[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c09a99e8-913f-4a86-ba0b-c64d5cdcfb2e@amd.com>
Date: Tue, 3 Dec 2024 13:46:36 -0800
From: "Melody (Huibo) Wang" <huibo.wang@....com>
To: Sean Christopherson <seanjc@...gle.com>
CC: LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>, "Paolo
Bonzini" <pbonzini@...hat.com>, Tom Lendacky <thomas.lendacky@....com>, KVM
<kvm@...r.kernel.org>, Pavan Kumar Paluri <papaluri@....com>
Subject: Re: [PATCH v2] KVM: SVM: Convert plain error code numbers to defines
Hi Sean,
On 12/2/2024 4:11 PM, Sean Christopherson wrote:
>
> E.g. something like this? Definitely feel free to suggest better names.
>
> static inline void svm_vmgexit_set_return_code(struct vcpu_svm *svm,
> u64 response, u64 data)
> {
> ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, response);
> ghcb_set_sw_exit_info_2(svm->sev_es.ghcb, data);
> }
>
If I make this function more generic where the exit info is set for both KVM and the guest, then maybe I can write something like this:
void ghcb_set_exit_info(struct ghcb *ghcb,
u64 info1, u64 info2)
{
ghcb_set_sw_exit_info_1(ghcb, info1);
ghcb_set_sw_exit_info_2(ghcb, info2);
}
This way we can address every possible case that sets the exit info - not only KVM.
And I am not sure about the wrappers for each specific case because we will have too many, too specific small functions, but if you want them I can add them.
Thanks,
Melody
Powered by blists - more mailing lists