From: Boris Ostrovsky Date: Mon, 21 Dec 2015 12:38:53 +0000 (+0100) Subject: x86/mm: add information about faulted page's presence to npfec structure X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2035 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1a966b46a0b699190c1b634c7daee848e02cce37;p=xen.git x86/mm: add information about faulted page's presence to npfec structure This is provided explicitly in SVM and implicitly in VMX (when neither of the three EPT_EFFECTIVE_* bits is set). Signed-off-by: Boris Ostrovsky Reviewed-by: Jan Beulich Acked-by: Kevin Tian --- diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 0078100dd6..a66d854480 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1491,7 +1491,8 @@ static void svm_do_nested_pgfault(struct vcpu *v, struct npfec npfec = { .read_access = !(pfec & PFEC_insn_fetch), .write_access = !!(pfec & PFEC_write_access), - .insn_fetch = !!(pfec & PFEC_insn_fetch) + .insn_fetch = !!(pfec & PFEC_insn_fetch), + .present = !!(pfec & PFEC_page_present), }; /* These bits are mutually exclusive */ diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index bda94a9d4e..b918b8a903 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2738,7 +2738,10 @@ static void ept_handle_violation(unsigned long qualification, paddr_t gpa) .read_access = !!(qualification & EPT_READ_VIOLATION) || !!(qualification & EPT_WRITE_VIOLATION), .write_access = !!(qualification & EPT_WRITE_VIOLATION), - .insn_fetch = !!(qualification & EPT_EXEC_VIOLATION) + .insn_fetch = !!(qualification & EPT_EXEC_VIOLATION), + .present = !!(qualification & (EPT_EFFECTIVE_READ | + EPT_EFFECTIVE_WRITE | + EPT_EFFECTIVE_EXEC)) }; if ( tb_init_done ) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 5d4b64b6d0..a795dd6001 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -159,6 +159,7 @@ struct npfec { unsigned int read_access:1; unsigned int write_access:1; unsigned int insn_fetch:1; + unsigned int present:1; unsigned int gla_valid:1; unsigned int kind:2; /* npfec_kind_t */ };