Commit 74cdc83
KVM: x86: Make use of kvm_read_cr*_bits() when testing bits
Make use of the kvm_read_cr{0,4}_bits() helper functions when we only
want to know the state of certain bits instead of the whole register.
This not only makes the intent cleaner, it also avoids a potential
VMREAD in case the tested bits aren't guest owned.
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20230322013731.102955-5-minipli@grsecurity.net
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent e40bcf9 commit 74cdc83
2 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
| 543 | + | |
544 | 544 | | |
545 | | - | |
| 545 | + | |
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5517 | 5517 | | |
5518 | 5518 | | |
5519 | 5519 | | |
5520 | | - | |
| 5520 | + | |
5521 | 5521 | | |
5522 | 5522 | | |
5523 | 5523 | | |
| |||
7575 | 7575 | | |
7576 | 7576 | | |
7577 | 7577 | | |
7578 | | - | |
| 7578 | + | |
7579 | 7579 | | |
7580 | 7580 | | |
7581 | 7581 | | |
| |||
0 commit comments