Re: [PATCH 47/54] KVM: x86/mmu: Add helpers to do full reserved SPTE checks w/ generic MMU

From: Paolo Bonzini
Date: Wed Jun 23 2021 - 16:13:30 EST


On 22/06/21 19:57, Sean Christopherson wrote:
+ /*
+ * Use a bitwise-OR instead of a logical-OR to aggregate the reserved
+ * bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc
+ * (this is used in hot paths).

Probably s/this is used in hot paths/this is extremely unlikely to be short-circuited as true/, since we are at it.

Paolo

+ */
+ return __is_bad_mt_xwr(rsvd_check, spte) |
+ __is_rsvd_bits_set(rsvd_check, spte, level);