Commit 3d4e882
committed
KVM: SEV: Move init of SNP guest state into sev_init_vmcb()
Move the initialization of SNP guest state from svm_vcpu_reset() into
sev_init_vmcb() to reduce the number of paths that deal with INIT/RESET
for SEV+ vCPUs from 4+ to 1. Plumb in @init_event as necessary.
Opportunistically check for an SNP guest outside of
sev_snp_init_protected_guest_state() so that sev_init_vmcb() is consistent
with respect to checking for SEV-ES+ and SNP+ guests.
No functional change intended.
Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>
Link: https://lore.kernel.org/r/20250819234833.3080255-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 34bd82a commit 3d4e882
3 files changed
Lines changed: 13 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1975 | 1975 | | |
1976 | 1976 | | |
1977 | 1977 | | |
1978 | | - | |
| 1978 | + | |
1979 | 1979 | | |
1980 | 1980 | | |
1981 | 1981 | | |
| |||
3887 | 3887 | | |
3888 | 3888 | | |
3889 | 3889 | | |
3890 | | - | |
| 3890 | + | |
3891 | 3891 | | |
3892 | 3892 | | |
3893 | 3893 | | |
3894 | 3894 | | |
3895 | 3895 | | |
3896 | 3896 | | |
3897 | 3897 | | |
3898 | | - | |
3899 | | - | |
3900 | | - | |
3901 | 3898 | | |
3902 | 3899 | | |
3903 | 3900 | | |
| |||
4546 | 4543 | | |
4547 | 4544 | | |
4548 | 4545 | | |
4549 | | - | |
| 4546 | + | |
4550 | 4547 | | |
| 4548 | + | |
| 4549 | + | |
4551 | 4550 | | |
4552 | 4551 | | |
4553 | 4552 | | |
| |||
4557 | 4556 | | |
4558 | 4557 | | |
4559 | 4558 | | |
4560 | | - | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
4561 | 4563 | | |
4562 | 4564 | | |
4563 | 4565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1083 | 1083 | | |
1084 | 1084 | | |
1085 | 1085 | | |
1086 | | - | |
| 1086 | + | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | 1089 | | |
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | | - | |
| 1224 | + | |
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | | - | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
| 1259 | + | |
1263 | 1260 | | |
1264 | 1261 | | |
1265 | 1262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
829 | | - | |
| 829 | + | |
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
867 | | - | |
868 | 867 | | |
869 | 868 | | |
870 | 869 | | |
| |||
891 | 890 | | |
892 | 891 | | |
893 | 892 | | |
894 | | - | |
895 | 893 | | |
896 | 894 | | |
897 | 895 | | |
| |||
0 commit comments