* [PATCH] vmx: refine validity check for guest line address
@ 2016-08-18 7:49 Liang Li
2016-08-18 10:08 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Liang Li @ 2016-08-18 7:49 UTC (permalink / raw)
To: kvm; +Cc: x86, pbonzini, rkrcmar, tglx, mingo, hpa, Liang Li
The validity check for the guest line address is inefficient,
check the invalid value instead is more efficient.
Signed-off-by: Liang Li <liang.z.li@intel.com>
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a45d858..c32d5e8 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6103,7 +6103,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
gla_validity = (exit_qualification >> 7) & 0x3;
- if (gla_validity != 0x3 && gla_validity != 0x1 && gla_validity != 0) {
+ if (gla_validity == 0x2) {
printk(KERN_ERR "EPT: Handling EPT violation failed!\n");
printk(KERN_ERR "EPT: GPA: 0x%lx, GVA: 0x%lx\n",
(long unsigned int)vmcs_read64(GUEST_PHYSICAL_ADDRESS),
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] vmx: refine validity check for guest line address
2016-08-18 7:49 [PATCH] vmx: refine validity check for guest line address Liang Li
@ 2016-08-18 10:08 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2016-08-18 10:08 UTC (permalink / raw)
To: Liang Li, kvm; +Cc: x86, rkrcmar, tglx, mingo, hpa
On 18/08/2016 09:49, Liang Li wrote:
> The validity check for the guest line address is inefficient,
> check the invalid value instead is more efficient.
>
> Signed-off-by: Liang Li <liang.z.li@intel.com>
> ---
> arch/x86/kvm/vmx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index a45d858..c32d5e8 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -6103,7 +6103,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
> exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
>
> gla_validity = (exit_qualification >> 7) & 0x3;
> - if (gla_validity != 0x3 && gla_validity != 0x1 && gla_validity != 0) {
> + if (gla_validity == 0x2) {
> printk(KERN_ERR "EPT: Handling EPT violation failed!\n");
> printk(KERN_ERR "EPT: GPA: 0x%lx, GVA: 0x%lx\n",
> (long unsigned int)vmcs_read64(GUEST_PHYSICAL_ADDRESS),
>
Queued for 4.9, thanks.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-18 10:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-18 7:49 [PATCH] vmx: refine validity check for guest line address Liang Li
2016-08-18 10:08 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.