From: Sean Christopherson <seanjc@google.com>
To: Yu Zhang <yu.c.zhang@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
kvm@vger.kernel.org, pbonzini@redhat.com, maz@kernel.org,
james.morse@arm.com, alexandru.elisei@arm.com,
suzuki.poulose@arm.com, oliver.upton@linux.dev,
catalin.marinas@arm.com, will@kernel.org, paul@xen.org
Subject: Re: [PATCH v2] KVM: MMU: Make the definition of 'INVALID_GPA' common.
Date: Thu, 15 Dec 2022 00:07:29 +0000 [thread overview]
Message-ID: <Y5plQVtUEWZfXShw@google.com> (raw)
In-Reply-To: <20221214154714.3qj4wt3u36zwp67q@linux.intel.com>
On Wed, Dec 14, 2022, Yu Zhang wrote:
> On Wed, Dec 14, 2022 at 11:10:54AM +0000, David Woodhouse wrote:
> > On Tue, 2022-12-13 at 17:04 +0800, Yu Zhang wrote:
> > > --- a/arch/x86/kvm/xen.c
> > > +++ b/arch/x86/kvm/xen.c
> > > @@ -41,7 +41,7 @@ static int kvm_xen_shared_info_init(struct kvm *kvm, gfn_t gfn)
> > > int ret = 0;
> > > int idx = srcu_read_lock(&kvm->srcu);
> > >
> > > - if (gfn == GPA_INVALID) {
> > > + if (gfn == INVALID_GPA) {
> > > kvm_gpc_deactivate(gpc);
> > > goto out;
> > > }
> > > @@ -659,7 +659,7 @@ int kvm_xen_hvm_get_attr(struct kvm *kvm, struct kvm_xen_hvm_attr *data)
> > > if (kvm->arch.xen.shinfo_cache.active)
> > > data->u.shared_info.gfn = gpa_to_gfn(kvm->arch.xen.shinfo_cache.gpa);
> > > else
> > > - data->u.shared_info.gfn = GPA_INVALID;
> > > + data->u.shared_info.gfn = INVALID_GPA;
> > > r = 0;
> > > break;
> >
> > Strictly, those are INVALID_GFN not INVALID_GPA but I have so far
> > managed to pretend not to notice...
> >
> > If we're bikeshedding the naming then I might have suggested
> > INVALID_PAGE but that already exists as an hpa_t type.
>
> Thanks, David. INVALID_GFN sounds more reasonable for me.
>
> But I am not sure if adding INVALID_GFN is necessary. Because for now
> only kvm_xen_shared_info_init() and kvm_xen_hvm_get_attr() use INVALID_GPA
> as a GFN.
>
> Any suggestion? Thanks!
It's not strictly necessary, but it's an easy change and I can't think of any
reason not to add INVALID_GFN.
prev parent reply other threads:[~2022-12-15 0:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 9:04 [PATCH v2] KVM: MMU: Make the definition of 'INVALID_GPA' common Yu Zhang
2022-12-14 10:24 ` Paul Durrant
2022-12-14 11:10 ` David Woodhouse
2022-12-14 15:47 ` Yu Zhang
2022-12-15 0:07 ` Sean Christopherson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5plQVtUEWZfXShw@google.com \
--to=seanjc@google.com \
--cc=alexandru.elisei@arm.com \
--cc=catalin.marinas@arm.com \
--cc=dwmw2@infradead.org \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yu.c.zhang@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox