Searched hist:"15 e6a7e5324cc04a67891fc369ea834bbb7e7b42" (Results 1 – 2 of 2) sorted by relevance
/linux/arch/x86/kvm/mmu/ |
H A D | spte.h | diff 15e6a7e5324cc04a67891fc369ea834bbb7e7b42 Sat Jan 23 01:30:03 CET 2021 Sean Christopherson <seanjc@google.com> KVM: x86/mmu: Use boolean returns for (S)PTE accessors
Return a 'bool' instead of an 'int' for various PTE accessors that are boolean in nature, e.g. is_shadow_present_pte(). Returning an int is goofy and potentially dangerous, e.g. if a flag being checked is moved into the upper 32 bits of a SPTE, then the compiler may silently squash the entire check since casting to an int is guaranteed to yield a return value of '0'.
Opportunistically refactor is_last_spte() so that it naturally returns a bool value instead of letting it implicitly cast 0/1 to false/true.
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210123003003.3137525-1-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
/linux/arch/x86/kvm/ |
H A D | mmu.h | diff 15e6a7e5324cc04a67891fc369ea834bbb7e7b42 Sat Jan 23 01:30:03 CET 2021 Sean Christopherson <seanjc@google.com> KVM: x86/mmu: Use boolean returns for (S)PTE accessors
Return a 'bool' instead of an 'int' for various PTE accessors that are boolean in nature, e.g. is_shadow_present_pte(). Returning an int is goofy and potentially dangerous, e.g. if a flag being checked is moved into the upper 32 bits of a SPTE, then the compiler may silently squash the entire check since casting to an int is guaranteed to yield a return value of '0'.
Opportunistically refactor is_last_spte() so that it naturally returns a bool value instead of letting it implicitly cast 0/1 to false/true.
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210123003003.3137525-1-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|