[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <377a2e4f-91bf-4156-86e4-feaddf90113e@linux.intel.com>
Date: Wed, 18 Dec 2024 13:09:16 +0800
From: Binbin Wu <binbin.wu@...ux.intel.com>
To: Xiaoyao Li <xiaoyao.li@...el.com>
Cc: pbonzini@...hat.com, seanjc@...gle.com, kvm@...r.kernel.org,
rick.p.edgecombe@...el.com, kai.huang@...el.com, adrian.hunter@...el.com,
reinette.chatre@...el.com, tony.lindgren@...ux.intel.com,
isaku.yamahata@...el.com, yan.y.zhao@...el.com, chao.gao@...el.com,
michael.roth@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/7] KVM: TDX: Handle TDG.VP.VMCALL<MapGPA>
On 12/18/2024 9:38 AM, Binbin Wu wrote:
>
>
>
> On 12/16/2024 2:03 PM, Xiaoyao Li wrote:
>> On 12/16/2024 9:08 AM, Binbin Wu wrote:
>>>
>>>
>>>
>>> On 12/13/2024 5:32 PM, Xiaoyao Li wrote:
>>>> On 12/1/2024 11:53 AM, Binbin Wu wrote:
>>>>
>>> [...]
>>>>> +
>>>>> +static int tdx_map_gpa(struct kvm_vcpu *vcpu)
>>>>> +{
>>>>> + struct vcpu_tdx * tdx = to_tdx(vcpu);
>>>>> + u64 gpa = tdvmcall_a0_read(vcpu);
>>>>
>>>> We can use kvm_r12_read() directly, which is more intuitive. And we can drop the MACRO for a0/a1/a2/a3 accessors in patch 022.
>>> I am neutral about it.
>>>
>>
>> a0, a1, a2, a3, are the name convention for KVM's hypercall. It makes sense when serving as the parameters to __kvm_emulate_hypercall().
>>
>> However, now __kvm_emulate_hypercall() is made to a MACRO and we don't need the temp variable like a0 = kvm_xx_read().
>>
>> For TDVMCALL leafs other than normal KVM hypercalls, they are all TDX specific and defined in TDX GHCI spec, a0/a1/a2/a3 makes no sense for them.
> OK, make sense.
>
> Thanks!
>
>
I will leave it as it is for now.
There is an RFC proposal from Hunter about using descriptively named parameters
https://lore.kernel.org/all/fa817f29-e3ba-4c54-8600-e28cf6ab1953@intel.com/
It can wait until there is a final conclusion.
Powered by blists - more mailing lists