aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/mmu.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-06-17 09:22:52 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-07-27 02:13:26 -0400
commit5915100106b8f14a38053ad6c03a664d208aeaa2 (patch)
tree86117ec2860f0a1d1f16fd778ab2e53722871d33 /arch/x86/xen/mmu.c
parentc1c5413ad58cb73267d328e6020268aa2e50d8ca (diff)
x86: Call HVMOP_pagetable_dying on exit_mmap.
When a pagetable is about to be destroyed, we notify Xen so that the hypervisor can clear the related shadow pagetable. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r--arch/x86/xen/mmu.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 914f04695ce..84648c1bf13 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -58,6 +58,7 @@
58 58
59#include <xen/page.h> 59#include <xen/page.h>
60#include <xen/interface/xen.h> 60#include <xen/interface/xen.h>
61#include <xen/interface/hvm/hvm_op.h>
61#include <xen/interface/version.h> 62#include <xen/interface/version.h>
62#include <xen/hvc-console.h> 63#include <xen/hvc-console.h>
63 64
@@ -1941,6 +1942,38 @@ void __init xen_init_mmu_ops(void)
1941 pv_mmu_ops = xen_mmu_ops; 1942 pv_mmu_ops = xen_mmu_ops;
1942} 1943}
1943 1944
1945static void xen_hvm_exit_mmap(struct mm_struct *mm)
1946{
1947 struct xen_hvm_pagetable_dying a;
1948 int rc;
1949
1950 a.domid = DOMID_SELF;
1951 a.gpa = __pa(mm->pgd);
1952 rc = HYPERVISOR_hvm_op(HVMOP_pagetable_dying, &a);
1953 WARN_ON_ONCE(rc < 0);
1954}
1955
1956static int is_pagetable_dying_supported(void)
1957{
1958 struct xen_hvm_pagetable_dying a;
1959 int rc = 0;
1960
1961 a.domid = DOMID_SELF;
1962 a.gpa = 0x00;
1963 rc = HYPERVISOR_hvm_op(HVMOP_pagetable_dying, &a);
1964 if (rc < 0) {
1965 printk(KERN_DEBUG "HVMOP_pagetable_dying not supported\n");
1966 return 0;
1967 }
1968 return 1;
1969}
1970
1971void __init xen_hvm_init_mmu_ops(void)
1972{
1973 if (is_pagetable_dying_supported())
1974 pv_mmu_ops.exit_mmap = xen_hvm_exit_mmap;
1975}
1976
1944#ifdef CONFIG_XEN_DEBUG_FS 1977#ifdef CONFIG_XEN_DEBUG_FS
1945 1978
1946static struct dentry *d_mmu_debug; 1979static struct dentry *d_mmu_debug;