From: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> > Sent: 10 January 2020 16:05 ... > 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: return __is_rsvd_bits_set(&mmu->guest_rsvd_check, gpte, level) || (PTTYPE == PTTYPE_EPT && __is_bad_mt_xwr(&mmu->guest_rsvd_check, gpte)); Relying in the compiler to optimise it away. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)