LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: "van der Linden, Frank" <fllinden@amazon.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"jgross@suse.com" <jgross@suse.com>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH 1/1] x86/xen: Reset VCPU0 info pointer after shared_info remap
Date: Mon, 7 May 2018 14:57:27 -0400 [thread overview]
Message-ID: <ab71bf69-5074-ca7d-ceb5-1b42b0a70457@oracle.com> (raw)
In-Reply-To: <B3C02FE4-651D-4A89-90BB-78E389764688@amazon.com>
On 05/07/2018 02:00 PM, van der Linden, Frank wrote:
> Hi Boris,
>
> Thanks for the feedback.
>
> On 5/7/18, 8:13 AM, "Boris Ostrovsky" <boris.ostrovsky@oracle.com> wrote:
>
> > diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c
> > index 6b424da1ce75..c78b3e8fb2e5 100644
> > --- a/arch/x86/xen/enlighten_hvm.c
> > +++ b/arch/x86/xen/enlighten_hvm.c
> > @@ -71,6 +71,19 @@ static void __init xen_hvm_init_mem_mapping(void)
> > {
> > early_memunmap(HYPERVISOR_shared_info, PAGE_SIZE);
> > HYPERVISOR_shared_info = __va(PFN_PHYS(shared_info_pfn));
> > +
> > + /*
> > + * The virtual address of the shared_info page has changed, so
> > + * the vcpu_info pointer for VCPU 0 is now stale.
>
> Is it "has changed" or "has changed if kaslr is on"?
>
> It's "has changed". See commit 4ca83dcf4e3bc0c98836dbb97553792ca7ea5429 . It's a way to make kaslr work, but it's done regardless of whether it's enabled or not.
I completely forgot about this one.
>
> > + *
> > + * The prepare_boot_cpu callback will re-initialize it via
> > + * xen_vcpu_setup, but we can't rely on that to be called for
> > + * old Xen versions (xen_have_vector_callback == 0).
> > + *
> > + * It is, in any case, bad to have a stale vcpu_info pointer
> > + * so reset it now.
> > + */
> > + xen_vcpu_info_reset(0);
>
>
> Why not xen_vcpu_setup(0)?
>
> Basically, I wanted to be minimally invasive. xen_vcpu_setup does a little more work (tries to do the VCPU placement hypercall), and will be called later in any case. So doing just the basic xen_vcpu_info_reset for VCPU 0 seems like the best way to do it; it just re-iterates what is done for VCPU 0 earlier in boot, which is also a vcpu_info_reset.
OK, fair enough. This should go to stable as well I think (4.12+),
copying them.
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
next prev parent reply other threads:[~2018-05-07 18:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 20:11 van der Linden, Frank
2018-05-07 15:15 ` Boris Ostrovsky
2018-05-07 18:00 ` van der Linden, Frank
2018-05-07 18:57 ` Boris Ostrovsky [this message]
2018-05-07 19:12 ` van der Linden, Frank
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=ab71bf69-5074-ca7d-ceb5-1b42b0a70457@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=fllinden@amazon.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
--subject='Re: [PATCH 1/1] x86/xen: Reset VCPU0 info pointer after shared_info remap' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).