On 10/01/20 17:04, Sean Christopherson wrote: > Ya, I don't love the code, but it was the least awful of the options I > tried, in that it's the most readable without being too obnoxious. > > > Similar to your suggestion, but it avoids evaluating __is_bad_mt_xwr() if > reserved bits are set, which is admittedly rare. > > return __is_rsvd_bits_set(&mmu->guest_rsvd_check, gpte, level) > #if PTTYPE == PTTYPE_EPT > || __is_bad_mt_xwr(&mmu->guest_rsvd_check, gpte) > #endif > ; > > Or macrofying the call to keep the call site clean, but IMO this obfuscates > things too much. > > return __is_rsvd_bits_set(&mmu->guest_rsvd_check, gpte, level) || > IS_BAD_MT_XWR(&mmu->guest_rsvd_check, gpte); I think what you posted is the best (David's comes second). Queued, thanks. Paolo