Re: [PATCH v3 10/13] KVM: x86: emulator/smm: use smram struct for 64 bit smram load/restore
From: Sean Christopherson
Date: Wed Aug 24 2022 - 18:34:41 EST
On Wed, Aug 03, 2022, Maxim Levitsky wrote:
> @@ -9909,57 +9906,51 @@ static void enter_smm_save_state_32(struct kvm_vcpu *vcpu, struct kvm_smram_stat
> }
>
> #ifdef CONFIG_X86_64
> -static void enter_smm_save_state_64(struct kvm_vcpu *vcpu, char *buf)
> +static void enter_smm_save_state_64(struct kvm_vcpu *vcpu, struct kvm_smram_state_64 *smram)
Please put these on different lines.
> struct desc_ptr dt;
> - struct kvm_segment seg;
> unsigned long val;
> int i;
>
> for (i = 0; i < 16; i++)
> - put_smstate(u64, buf, 0x7ff8 - i * 8, kvm_register_read_raw(vcpu, i));
> + smram->gprs[15 - i] = kvm_register_read_raw(vcpu, i);
Blech, why do I get the feeling that the original layout was designed so that
ucode could use PUSHAD? This look so weird...