linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nuno Das Neves <nunodasneves@linux.microsoft.com>
To: "Michael Kelley (LINUX)" <mikelley@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>
Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	Sunil Muthuswamy <sunilmut@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>,
	"dwmw2@infradead.org" <dwmw2@infradead.org>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"will@kernel.org" <will@kernel.org>
Subject: Re: [PATCH] iommu/hyper-v: Allow hyperv irq remapping without x2apic
Date: Tue, 15 Nov 2022 17:25:29 -0800	[thread overview]
Message-ID: <fd31c242-e510-cba3-4057-8040eab8f41f@linux.microsoft.com> (raw)
In-Reply-To: <BYAPR21MB1688FA95BE87E9D1B607B050D7059@BYAPR21MB1688.namprd21.prod.outlook.com>

On 11/14/2022 11:09 AM, Michael Kelley (LINUX) wrote:
> From: Wei Liu <wei.liu@kernel.org> Sent: Monday, November 14, 2022 5:59 AM
>>
>> On Fri, Nov 11, 2022 at 02:53:59PM -0800, Nuno Das Neves wrote:
>>> On 11/11/2022 9:58 AM, Michael Kelley (LINUX) wrote:
>>>> From: Wei Liu <wei.liu@kernel.org> Sent: Friday, November 11, 2022 9:27 AM
>> [...]
>>>
>>> I've tested this patch on these Azure SKUs:
>>> - Standard_D2S_v2 (intel xapic)
>>> - Standard_D4ds_v4 (intel xapic)
>>> - Standard_D4ds_v5 (intel x2apic)
>>> - Standard_D4ads_v5 (amd xapic)
>>>
>>> I've tested with linux Dom0 (nested hyperv root partition) and as a
>>> regular L1 guest.
>>>
>>
>> Okay. I think your tests are good.
>>
>> Michael, do you have any further concern?
>>
> 
> If ms_hyperv_msi_ext_dest_id() returns "true", then
> hyperv_prepare_irq_remapping() will still return -ENODEV and you
> won't get interrupt remapping because it isn't needed, at least not
> for guest VMs.  Is that what we want for the root partition?  Or does
> ms_hyperv_msi_ext_dest_id() only return true in a guest partition,
> and not in the root partition?  See commit d981059e13ff.
> 

I did some digging, and I *think* this function will always return "false"
in the root partition.

The cpuids (HYPERV_CPUID_VIRT_STACK_*) that determine the result of
ms_hyperv_msi_ext_dest_id() are implemented by the virtualization stack
in Azure, so for L1 guests it depends on that.

But, for nested root, the nested hypervisor controls which cpuids the
root partition sees, and VIRTUALIZATION_STACK_CPUID_INTERFACE is not in
that list.

I tested this too; if I boot the kernel with an L1 guest, I can see that
the HYPERV_CPUID_VIRT_STACK_INTERFACE contains the "VS#1" signature.
If I boot as L2 Root, the signature is not present.

I'm reasonably certain, but if I'm wrong we'll see the same breakage for
the same reason and we can fix it I guess.

  reply	other threads:[~2022-11-16  1:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 19:07 [PATCH] iommu/hyper-v: Allow hyperv irq remapping without x2apic Nuno Das Neves
2022-11-10 13:41 ` Stanislav Kinsburskii
2022-11-11 16:32 ` Wei Liu
2022-11-11 16:55   ` Michael Kelley (LINUX)
2022-11-11 17:27     ` Wei Liu
2022-11-11 17:58       ` Michael Kelley (LINUX)
2022-11-11 22:53         ` Nuno Das Neves
2022-11-14 13:59           ` Wei Liu
2022-11-14 19:09             ` Michael Kelley (LINUX)
2022-11-16  1:25               ` Nuno Das Neves [this message]
2022-11-16 18:49                 ` Michael Kelley (LINUX)

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=fd31c242-e510-cba3-4057-8040eab8f41f@linux.microsoft.com \
    --to=nunodasneves@linux.microsoft.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=decui@microsoft.com \
    --cc=dwmw2@infradead.org \
    --cc=haiyangz@microsoft.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=sunilmut@microsoft.com \
    --cc=wei.liu@kernel.org \
    --cc=will@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;
as well as URLs for NNTP newsgroup(s).