Commit ef99001
KVM: x86: Untag addresses for LAM emulation where applicable
Stub in vmx_get_untagged_addr() and wire up calls from the emulator (via
get_untagged_addr()) and "direct" calls from various VM-Exit handlers in
VMX where LAM untagging is supposed to be applied. Defer implementing
the guts of vmx_get_untagged_addr() to future patches purely to make the
changes easier to consume.
LAM is active only for 64-bit linear addresses and several types of
accesses are exempted.
- Cases need to untag address (handled in get_vmx_mem_address())
Operand(s) of VMX instructions and INVPCID.
Operand(s) of SGX ENCLS.
- Cases LAM doesn't apply to (no change needed)
Operand of INVLPG.
Linear address in INVPCID descriptor.
Linear address in INVVPID descriptor.
BASEADDR specified in SECS of ECREATE.
Note:
- LAM doesn't apply to write to control registers or MSRs
- LAM masking is applied before walking page tables, i.e. the faulting
linear address in CR2 doesn't contain the metadata.
- The guest linear address saved in VMCS doesn't contain metadata.
Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Chao Gao <chao.gao@intel.com>
Tested-by: Xuelian Guo <xuelian.guo@intel.com>
Link: https://lore.kernel.org/r/20230913124227.12574-10-binbin.wu@linux.intel.com
[sean: massage changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 7a747b6 commit ef99001
5 files changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4980 | 4980 | | |
4981 | 4981 | | |
4982 | 4982 | | |
| 4983 | + | |
4983 | 4984 | | |
4984 | 4985 | | |
4985 | 4986 | | |
| |||
5797 | 5798 | | |
5798 | 5799 | | |
5799 | 5800 | | |
| 5801 | + | |
| 5802 | + | |
| 5803 | + | |
| 5804 | + | |
5800 | 5805 | | |
5801 | 5806 | | |
5802 | 5807 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8206 | 8206 | | |
8207 | 8207 | | |
8208 | 8208 | | |
| 8209 | + | |
| 8210 | + | |
| 8211 | + | |
| 8212 | + | |
| 8213 | + | |
8209 | 8214 | | |
8210 | 8215 | | |
8211 | 8216 | | |
| |||
8346 | 8351 | | |
8347 | 8352 | | |
8348 | 8353 | | |
| 8354 | + | |
| 8355 | + | |
8349 | 8356 | | |
8350 | 8357 | | |
8351 | 8358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
423 | 425 | | |
424 | 426 | | |
425 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13545 | 13545 | | |
13546 | 13546 | | |
13547 | 13547 | | |
| 13548 | + | |
| 13549 | + | |
| 13550 | + | |
| 13551 | + | |
13548 | 13552 | | |
13549 | 13553 | | |
13550 | 13554 | | |
| |||
0 commit comments