diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-08-22 12:20:16 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-08-23 10:18:20 -0400 |
commit | 1a1d43318aeb74d679372c0b65029957be274529 (patch) | |
tree | ab4743e3094ca5239e27448fd11f6dad2bbda6ed | |
parent | bd3f79b71de0410352ab506496a467fcb0620912 (diff) |
xen: allow privcmd for HVM guests
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>
-rw-r--r-- | arch/x86/xen/mmu.c | 3 | ||||
-rw-r--r-- | drivers/xen/privcmd.c | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 3a73785631ce..885a22354a96 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -2310,6 +2310,9 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | |||
2310 | unsigned long range; | 2310 | unsigned long range; |
2311 | int err = 0; | 2311 | int err = 0; |
2312 | 2312 | ||
2313 | if (xen_feature(XENFEAT_auto_translated_physmap)) | ||
2314 | return -EINVAL; | ||
2315 | |||
2313 | prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP); | 2316 | prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP); |
2314 | 2317 | ||
2315 | BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_RESERVED | VM_IO)) == | 2318 | BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_RESERVED | VM_IO)) == |
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index ccee0f16bcf8..85226cbeca24 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c | |||
@@ -380,10 +380,6 @@ static struct vm_operations_struct privcmd_vm_ops = { | |||
380 | 380 | ||
381 | static int privcmd_mmap(struct file *file, struct vm_area_struct *vma) | 381 | static int privcmd_mmap(struct file *file, struct vm_area_struct *vma) |
382 | { | 382 | { |
383 | /* Unsupported for auto-translate guests. */ | ||
384 | if (xen_feature(XENFEAT_auto_translated_physmap)) | ||
385 | return -ENOSYS; | ||
386 | |||
387 | /* DONTCOPY is essential for Xen because copy_page_range doesn't know | 383 | /* DONTCOPY is essential for Xen because copy_page_range doesn't know |
388 | * how to recreate these mappings */ | 384 | * how to recreate these mappings */ |
389 | vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY | VM_PFNMAP; | 385 | vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY | VM_PFNMAP; |