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

Re: [Xen-devel] [PATCH 1/4] x86/HVM: replace plain number in hvm_combine_hw_exceptions()



>>> On 22.01.15 at 15:12, <andrew.cooper3@xxxxxxxxxx> 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


_______________________________________________
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®.