Commit 8b59d02
KVM: VMX: Emulate read and write to CET MSRs
Add emulation interface for CET MSR access. The emulation code is split
into common part and vendor specific part. The former does common checks
for MSRs, e.g., accessibility, data validity etc., then passes operation
to either XSAVE-managed MSRs via the helpers or CET VMCS fields.
SSP can only be read via RDSSP. Writing even requires destructive and
potentially faulting operations such as SAVEPREVSSP/RSTORSSP or
SETSSBSY/CLRSSBSY. Let the host use a pseudo-MSR that is just a wrapper
for the GUEST_SSP field of the VMCS.
Suggested-by: Sean Christopherson <[email protected]>
Signed-off-by: Yang Weijiang <[email protected]>
Tested-by: Mathias Krause <[email protected]>
Tested-by: John Allen <[email protected]>
Tested-by: Rick Edgecombe <[email protected]>
Signed-off-by: Chao Gao <[email protected]>
[sean: drop call to kvm_set_xstate_msr() for S_CET, consolidate code]
Reviewed-by: Binbin Wu <[email protected]>
Reviewed-by: Xiaoyao Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>1 parent 9d6812d commit 8b59d02
3 files changed
Lines changed: 103 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2093 | 2093 | | |
2094 | 2094 | | |
2095 | 2095 | | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
2096 | 2105 | | |
2097 | 2106 | | |
2098 | 2107 | | |
| |||
2411 | 2420 | | |
2412 | 2421 | | |
2413 | 2422 | | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
2414 | 2432 | | |
2415 | 2433 | | |
2416 | 2434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1890 | 1890 | | |
1891 | 1891 | | |
1892 | 1892 | | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
1893 | 1931 | | |
1894 | 1932 | | |
1895 | 1933 | | |
| |||
1934 | 1972 | | |
1935 | 1973 | | |
1936 | 1974 | | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
1937 | 1989 | | |
1938 | 1990 | | |
1939 | 1991 | | |
| |||
3865 | 3917 | | |
3866 | 3918 | | |
3867 | 3919 | | |
3868 | | - | |
| 3920 | + | |
3869 | 3921 | | |
3870 | 3922 | | |
3871 | 3923 | | |
3872 | 3924 | | |
3873 | | - | |
| 3925 | + | |
3874 | 3926 | | |
3875 | 3927 | | |
3876 | 3928 | | |
| |||
4256 | 4308 | | |
4257 | 4309 | | |
4258 | 4310 | | |
| 4311 | + | |
| 4312 | + | |
| 4313 | + | |
| 4314 | + | |
4259 | 4315 | | |
4260 | 4316 | | |
4261 | 4317 | | |
| |||
4605 | 4661 | | |
4606 | 4662 | | |
4607 | 4663 | | |
| 4664 | + | |
| 4665 | + | |
| 4666 | + | |
| 4667 | + | |
4608 | 4668 | | |
4609 | 4669 | | |
4610 | 4670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
713 | 736 | | |
0 commit comments