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

Re: [RFC PATCH v3 1/3] vmx: Rewrite vpid_sync_vcpu_gva



Le 31/07/2025 à 17:54, Jan Beulich a écrit :
> On 26.06.2025 16:01, Teddy Astie wrote:
>> Rewrite this function such as it doesn't rely on goto, also change the
>> type of "type" to match the __invvpid function call.
>
> While this type change is probably okay (and benign to code generation), ...
>
>> --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
>> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
>> @@ -287,10 +287,10 @@ extern uint8_t posted_intr_vector;
>>   #define cpu_has_vmx_vpid_invvpid_single_context_retaining_global    \
>>       (vmx_caps.vpid & VMX_VPID_INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL)
>>
>> -#define INVVPID_INDIVIDUAL_ADDR                 0
>> -#define INVVPID_SINGLE_CONTEXT                  1
>> -#define INVVPID_ALL_CONTEXT                     2
>> -#define INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 3
>> +#define INVVPID_INDIVIDUAL_ADDR                 0UL
>> +#define INVVPID_SINGLE_CONTEXT                  1UL
>> +#define INVVPID_ALL_CONTEXT                     2UL
>> +#define INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 3UL
>
> ... I don't follow the need for these extra adjustments. Preferably with
> them dropped

With the type change from int to unsigned long to match __invvpid()
parameter, IIUC MISRA rule 7.2 requires that integer literals that are
used for unsigned must have the proper suffix.

> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> Jan
>

Teddy


Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech





 


Rackspace

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