From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 1/4] x86/HVM: replace plain number in hvm_combine_hw_exceptions() Date: Thu, 22 Jan 2015 14:36:43 +0000 Message-ID: <54C1190B0200007800058350@mail.emea.novell.com> References: <54C10EE1020000780005827E@mail.emea.novell.com> <54C10FCD0200007800058291@mail.emea.novell.com> <54C1055C.4030604@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YEIsG-0008Jj-Kf for xen-devel@lists.xenproject.org; Thu, 22 Jan 2015 14:36:45 +0000 In-Reply-To: <54C1055C.4030604@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 22.01.15 at 15:12, wrote: > On 22/01/15 13:57, Jan Beulich wrote: >> --- a/xen/arch/x86/hvm/hvm.c >> +++ b/xen/arch/x86/hvm/hvm.c >> @@ -205,6 +205,16 @@ int hvm_event_needs_reinjection(uint8_t >> */ >> uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2) >> { >> + const unsigned int contributory_exceptions = >> + (1 << TRAP_divide_error) | >> + (1 << TRAP_invalid_tss) | >> + (1 << TRAP_no_segment) | >> + (1 << TRAP_stack_error) | >> + (1 << TRAP_gp_fault); >> + const unsigned int page_faults = >> + (1 << TRAP_page_fault) | >> + (1 << TRAP_virtualisation); > > static as an extra hint? > > I frankly hope that any decent compiler would turn these into > instruction immediate data. I think the static could actually misguide the compiler to in fact allocate storage. I did verify with gcc 4.9.2 that the compiler does translate the above to literal numbers. Jan