[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen: Use #defines instead of magic constants in vmx_vmcs_save()


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Tue, 5 Aug 2014 12:57:37 +0300
  • Cc: kevin.tian@xxxxxxxxx, keir@xxxxxxx, jun.nakajima@xxxxxxxxx, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, eddie.dong@xxxxxxxxx, jbeulich@xxxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Tue, 05 Aug 2014 09:58:12 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=Kr7smvK/58JT8rMdOE1ljuOfErSrxD+woEzADNvs0ToU4oQ042pTBDHFMfMB3XttuAuWtqUqEa7H7Xnk87dn/7VLIidK3uGBVS9XkyS8MuvnSKzIIUO2OMVo99xjUiUJ6TRwphy3Xkw9PJCslbj637RedQalskgwpymQT0oVGho0lnck4PfJjAKaUm/bGr75VVx4wUGClhnM0wJWXkG+Q6tCrx657ELiyb8uZlPqrJv7g6sAhQWsHR+uGH0RNSMTO8091QJUQprPM4gprVRbEnL4i5J4Qx+PlwctROi7dyZv2NoZfcvFwBiZpwaFvocPU22DZsMRl9/WgHVmRwjiEQ==; h=Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Now using a combination of INTR_INFO_VECTOR_MASK,
INTR_INFO_INTR_TYPE_MASK and MASK_EXTR() to replace the old
"(ev >> 8) & 7, ev & 0xff" magic constant code in vmx.c.

Signed-off-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 2caa04a..278a7a7 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -434,7 +434,8 @@ static void vmx_vmcs_save(struct vcpu *v, struct hvm_hw_cpu 
*c)
     c->error_code = 0;
     __vmread(VM_ENTRY_INTR_INFO, &ev);
     if ( (ev & INTR_INFO_VALID_MASK) &&
-         hvm_event_needs_reinjection((ev >> 8) & 7, ev & 0xff) )
+         hvm_event_needs_reinjection(MASK_EXTR(ev, INTR_INFO_INTR_TYPE_MASK),
+            ev & INTR_INFO_VECTOR_MASK) )
     {
         c->pending_event = ev;
         __vmread(VM_ENTRY_EXCEPTION_ERROR_CODE, &ev);
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.