mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Tianyu Lan <ltykernel@gmail.com>
Cc: mhklinux@outlook.com, kys@microsoft.com, haiyangz@microsoft.com,
	wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com,
	tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index()
Date: Sun, 13 Sep 2026 15:36:05 -0700	[thread overview]
Message-ID: <20260913223605.GD2219269@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <CAMvTesAKMHYC36QViaUi_cw8-gSkBQyJtCd+Kt73HoDaLOkwUQ@mail.gmail.com>

On Wed, Sep 02, 2026 at 02:30:02PM +0800, Tianyu Lan wrote:
> On Wed, Sep 2, 2026 at 11:02 AM Michael Kelley <mhkelley58@gmail.com> wrote:
> >
> > hv_apicid_to_vp_index() currently uses the per-cpu hypercall input
> > and output pages. This function is called when running in VTL2 and
> > when running in an SEV-SNP CoCo VM with no paravisor. In the former
> > case, the output page is allocated, but in the latter case it is
> > not, so the hypervisor stores the output VP index in memory that has
> > not been allocated by the guest.
> >
> > Fix this by using the input page for both input and output. The
> > hypercall has very small input and output, so sharing the same
> > page for both is straightforward. An alternative fix is to
> > allocate the per-cpu output page when running in an SEV-SNP CoCo
> > guest, but this uses significantly more memory, particularly
> > with larger vCPUs counts.
> >
> > Fixes: 86c48271e0d6 ("x86/hyperv: Fix APIC ID and VP index confusion in hv_snp_boot_ap()")
> > Signed-off-by: Michael Kelley <mhklinux@outlook.com>
> > ---
> > I'm not aware that this bug is causing any real problems because
> > SEV-SNP CoCo VMs on Hyper-V are rarely, if ever, used without a
> > paravisor. But it was on my list of little clean-ups to do, and
> > a recent Sashiko analysis [1] flagged the issue. So the best thing
> > to do is just fix it.
> Reviewed-by: Tianyu Lan <tiala@microsoft.com>

Applied. Thanks.

      reply	other threads:[~2026-09-13 22:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  3:01 Michael Kelley
2026-09-02  6:30 ` Tianyu Lan
2026-09-13 22:36   ` Wei Liu [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=20260913223605.GD2219269@liuwe-devbox-debian-v2.local \
    --to=wei.liu@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=ltykernel@gmail.com \
    --cc=mhklinux@outlook.com \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®