On 17/08/20 20:42, Sean Christopherson wrote:
> 
> Don't suppose you'd be in the mood to kill the bare 'unsigned'?
> 
>   WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

u32 is even better.

> Alternatively, what about capturing the result in a new variable (instead of
> defining the mask) to make the wrap suck less (or just overflow like the
> current code), e.g.:
> 
>         u32 access = error_code &
>                      (PFERR_WRITE_MASK | PFERR_FETCH_MASK | PFERR_USER_MASK);
> 
>         if (!(error_code & PFERR_PRESENT_MASK) ||
>             vcpu->arch.walk_mmu->gva_to_gpa(vcpu, gva, access, &fault) != 
> UNMAPPED_GVA) {

Sure, that's better.

Paolo

Reply via email to