]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
xen: allow privcmd for HVM guests
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 22 Aug 2012 16:20:16 +0000 (17:20 +0100)
committerAnthony PERARD <anthony.perard@citrix.com>
Wed, 27 Feb 2013 12:05:39 +0000 (12:05 +0000)
This patch removes the "return -ENOSYS" for auto_translated_physmap
guests from privcmd_mmap, thus it allows ARM guests to issue privcmd
mmap calls. However privcmd mmap calls are still going to fail for HVM
and hybrid guests on x86 because the xen_remap_domain_mfn_range
implementation is currently PV only.

Changes in v2:

- better commit message;
- return -EINVAL from xen_remap_domain_mfn_range if
  auto_translated_physmap.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/xen/mmu.c
drivers/xen/privcmd.c

index 69f5857660ac7d04322f81ad8314bb7239dc68f3..e82514251773297df140aeca6543f1920958e040 100644 (file)
@@ -2335,6 +2335,9 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
        unsigned long range;
        int err = 0;
 
+       if (xen_feature(XENFEAT_auto_translated_physmap))
+               return -EINVAL;
+
        prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
 
        BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_RESERVED | VM_IO)) ==
index ccee0f16bcf8c10e994855a6efadff99b5b6bda1..85226cbeca245caf6c71943e58226456b254727f 100644 (file)
@@ -380,10 +380,6 @@ static struct vm_operations_struct privcmd_vm_ops = {
 
 static int privcmd_mmap(struct file *file, struct vm_area_struct *vma)
 {
-       /* Unsupported for auto-translate guests. */
-       if (xen_feature(XENFEAT_auto_translated_physmap))
-               return -ENOSYS;
-
        /* DONTCOPY is essential for Xen because copy_page_range doesn't know
         * how to recreate these mappings */
        vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY | VM_PFNMAP;