[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d28de5c6-27ff-5ced-95dc-575325e71598@xen.org>
Date: Thu, 14 Sep 2023 11:38:12 +0200
From: Paul Durrant <xadimgnik@...il.com>
To: David Woodhouse <dwmw2@...radead.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Paul Durrant <pdurrant@...zon.com>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH 5/8] KVM: pfncache: allow a cache to be activated with a
fixed (userspace) HVA
On 14/09/2023 10:29, David Woodhouse wrote:
> On Thu, 2023-09-14 at 08:49 +0000, Paul Durrant wrote:
>>
>> int kvm_gpc_refresh(struct gfn_to_pfn_cache *gpc, unsigned long len)
>> {
>> - return __kvm_gpc_refresh(gpc, gpc->gpa, len);
>> + return __kvm_gpc_refresh(gpc, gpc->addr, len, gpc->addr_is_gpa);
>> }
>> EXPORT_SYMBOL_GPL(kvm_gpc_refresh);
>
> I think I have a slight preference for leaving kvm_gpc_refresh()
> working on a GPA unconditionally, thus calling __kvm_gpc_refresh() with
> the final argument set to true.
>
> Introduce another one-line wrapper kvm_gpc_refresh_hva() for the false
> case. And perhaps BUG_ON() calling the 'wrong' refresh function?
Hmm. That makes life harder for the code messing with the vcpu_info. I
would need to know which cache it was looking at, because it could be
the vcpu_info cache or shinfo cache, and if it's the shinfo cache it
would need to know how it was activated.
Paul
Powered by blists - more mailing lists