Message ID | 1704450566-26576-1-git-send-email-ssengar@linux.microsoft.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-17747-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6135018dyb; Fri, 5 Jan 2024 02:29:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEebHt4c2XaApvFPQmVEm51ra7fct4O9uGnSGTyZEQvP0HLxuGuWKcaBAIwUSWMYtl/Ttnk X-Received: by 2002:a05:620a:2806:b0:781:5811:f902 with SMTP id f6-20020a05620a280600b007815811f902mr2019071qkp.144.1704450591026; Fri, 05 Jan 2024 02:29:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704450591; cv=none; d=google.com; s=arc-20160816; b=XMoy3JTTrv09Wt8PDQSNkyIkN8/7u5sTV4XEcN/Sl49bLfUwrZUieDPvbqmXxyaf/1 ZixL6tR2zhzbB6W1g9dGknDyA3bpqzLoEIfvgpBCSWCCI2e1BHyHuev6bhUxLZ6BvSk2 MONEvTWgj9Uegg+4ESXS75n8VDuO6EROxm4k0HREZGlgsIldVELvauP43Tm2U3K/iNlJ KL+EDtK5E3MjqJolcDMK7Q7dYTMbsd3k1vIx2oiMUwWEfsDV3/WjWa1QZZmVyGhldC6q xn/gVchxJzt+MmlEQteqqg4g36yPJpz0+mD33f995TKByPVFXOe+LINOjemTTRvJCvgz kzPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=ovwReRwgxvp0zRcHfp5lvTMwMqQKQ9zFOKT4nznwl9o=; fh=Q90LcKQU9isaEX5E6EGA77zJrhNMo5wuUyqVhBPa5Uw=; b=r7UxdhFVwbUEv40rOXphV/zj93AKztaXL7RFJkm7LgLjp3OkFJvKvnyRECx6a91qe1 NJjPXfu5pDUSEjHfa9LmBEkfienkwOI1M/4dECex1N8f9IxOUyQdHImNiqwFJ78D/tCO jbSCOcbJ7vciKiPzIzY5mjRM9N8uASQc4Il7zL/hkO00rOHlXEwtK3hi0/dn/VpaL2ku 4u7CgPOEoFbVmmHMZvLV/bwWH4m4eUvcUy1sHDFF7phrO/cSp/EoZWWOcqxrJgfltPBy P7Ur2HT6nQoU/s/CZDfPkzLA1lYneCpUnccylBui/y6HxLRBrEkYBEu5urE5Fz+kAvEC wKQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=SDAQLXkn; spf=pass (google.com: domain of linux-kernel+bounces-17747-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17747-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l2-20020a05620a28c200b0078155486896si1451298qkp.644.2024.01.05.02.29.50 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 02:29:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17747-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=SDAQLXkn; spf=pass (google.com: domain of linux-kernel+bounces-17747-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17747-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CF3401C22F3E for <ouuuleilei@gmail.com>; Fri, 5 Jan 2024 10:29:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0482628DAF; Fri, 5 Jan 2024 10:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="SDAQLXkn" X-Original-To: linux-kernel@vger.kernel.org Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28D96250E7; Fri, 5 Jan 2024 10:29:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 8E4F120B3CC1; Fri, 5 Jan 2024 02:29:36 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8E4F120B3CC1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1704450576; bh=ovwReRwgxvp0zRcHfp5lvTMwMqQKQ9zFOKT4nznwl9o=; h=From:To:Cc:Subject:Date:From; b=SDAQLXknt9VcjaxANAxYyvW559RuOTuhEYKcM2kcX2xYjuOJ9C3LuOmaWegH9Ucyl bWyn0rlu7xxzL6ad+PvgSchTpWb2t3aN1o2aLhDaV/PDularhnhC8r3e2bLsxQlcnJ YmQmQUHtalVCZ97FrsJuydD/vEZdLvNR1kws5esI= From: Saurabh Sengar <ssengar@linux.microsoft.com> To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, 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 Cc: ssengar@microsoft.com Subject: [PATCH] x86/hyperv: Allow 15-bit APIC IDs for VTL platforms Date: Fri, 5 Jan 2024 02:29:26 -0800 Message-Id: <1704450566-26576-1-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787245982866924006 X-GMAIL-MSGID: 1787245982866924006 |
Series |
x86/hyperv: Allow 15-bit APIC IDs for VTL platforms
|
|
Commit Message
Saurabh Singh Sengar
Jan. 5, 2024, 10:29 a.m. UTC
The current method for signaling the compatibility of a Hyper-V host
with MSIs featuring 15-bit APIC IDs relies on a synthetic cpuid leaf.
However, for higher VTLs, this leaf is not reported, due to the absence
of an IO-APIC.
As an alternative, assume that when running at a high VTL, the host
supports 15-bit APIC IDs. This assumption is now deemed safe, as no
architectural MSIs are employed at higher VTLs.
This unblocks startup of VTL2 environments with more than 256 CPUs.
Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
---
arch/x86/hyperv/hv_vtl.c | 7 +++++++
1 file changed, 7 insertions(+)
Comments
From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Friday, January 5, 2024 2:29 AM > > The current method for signaling the compatibility of a Hyper-V host > with MSIs featuring 15-bit APIC IDs relies on a synthetic cpuid leaf. > However, for higher VTLs, this leaf is not reported, due to the absence > of an IO-APIC. > > As an alternative, assume that when running at a high VTL, the host > supports 15-bit APIC IDs. This assumption is now deemed safe, as no > architectural MSIs are employed at higher VTLs. I'm trying to fully understand this last sentence. It has the words "now" and "deemed" as qualifiers. Can you say anything more about why "now" (implying it wasn't safe at some point in the past)? And what are the implications of "deemed"? Or are both just wordiness, and it would be just as good to say "This assumption is safe, as Hyper-V does not employ any architectural MSIs at higher VTLs." ? The code LGTM. Michael > > This unblocks startup of VTL2 environments with more than 256 CPUs. > > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> > --- > arch/x86/hyperv/hv_vtl.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c > index 539c7b5cfa2b..1c225362f88e 100644 > --- a/arch/x86/hyperv/hv_vtl.c > +++ b/arch/x86/hyperv/hv_vtl.c > @@ -16,6 +16,11 @@ > extern struct boot_params boot_params; > static struct real_mode_header hv_vtl_real_mode_header; > > +static bool __init hv_vtl_msi_ext_dest_id(void) > +{ > + return true; > +} > + > void __init hv_vtl_init_platform(void) > { > pr_info("Linux runs in Hyper-V Virtual Trust Level\n"); > @@ -39,6 +44,8 @@ void __init hv_vtl_init_platform(void) > x86_platform.legacy.warm_reset = 0; > x86_platform.legacy.reserve_bios_regions = 0; > x86_platform.legacy.devices.pnpbios = 0; > + > + x86_init.hyper.msi_ext_dest_id = hv_vtl_msi_ext_dest_id; > } > > static inline u64 hv_vtl_system_desc_base(struct ldttss_desc *desc) > -- > 2.25.1 >
On Wed, Jan 10, 2024 at 05:10:47AM +0000, Michael Kelley wrote: > From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Friday, January 5, 2024 2:29 AM > > > > The current method for signaling the compatibility of a Hyper-V host > > with MSIs featuring 15-bit APIC IDs relies on a synthetic cpuid leaf. > > However, for higher VTLs, this leaf is not reported, due to the absence > > of an IO-APIC. > > > > As an alternative, assume that when running at a high VTL, the host > > supports 15-bit APIC IDs. This assumption is now deemed safe, as no > > architectural MSIs are employed at higher VTLs. > > I'm trying to fully understand this last sentence. It has the words > "now" and "deemed" as qualifiers. Can you say anything more about > why "now" (implying it wasn't safe at some point in the past)? > And what are the implications of "deemed"? Or are both just > wordiness, and it would be just as good to say "This assumption is safe, > as Hyper-V does not employ any architectural MSIs at higher VTLs." ? > > The code LGTM. Thank you for your review. Your phrasing appears better to me. I will revise the commit message as per your suggestions and submit V2. - Saurabh > > Michael > > > > > This unblocks startup of VTL2 environments with more than 256 CPUs. > > > > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> > > --- > > arch/x86/hyperv/hv_vtl.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c > > index 539c7b5cfa2b..1c225362f88e 100644 > > --- a/arch/x86/hyperv/hv_vtl.c > > +++ b/arch/x86/hyperv/hv_vtl.c > > @@ -16,6 +16,11 @@ > > extern struct boot_params boot_params; > > static struct real_mode_header hv_vtl_real_mode_header; > > > > +static bool __init hv_vtl_msi_ext_dest_id(void) > > +{ > > + return true; > > +} > > + > > void __init hv_vtl_init_platform(void) > > { > > pr_info("Linux runs in Hyper-V Virtual Trust Level\n"); > > @@ -39,6 +44,8 @@ void __init hv_vtl_init_platform(void) > > x86_platform.legacy.warm_reset = 0; > > x86_platform.legacy.reserve_bios_regions = 0; > > x86_platform.legacy.devices.pnpbios = 0; > > + > > + x86_init.hyper.msi_ext_dest_id = hv_vtl_msi_ext_dest_id; > > } > > > > static inline u64 hv_vtl_system_desc_base(struct ldttss_desc *desc) > > -- > > 2.25.1 > > >
diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c index 539c7b5cfa2b..1c225362f88e 100644 --- a/arch/x86/hyperv/hv_vtl.c +++ b/arch/x86/hyperv/hv_vtl.c @@ -16,6 +16,11 @@ extern struct boot_params boot_params; static struct real_mode_header hv_vtl_real_mode_header; +static bool __init hv_vtl_msi_ext_dest_id(void) +{ + return true; +} + void __init hv_vtl_init_platform(void) { pr_info("Linux runs in Hyper-V Virtual Trust Level\n"); @@ -39,6 +44,8 @@ void __init hv_vtl_init_platform(void) x86_platform.legacy.warm_reset = 0; x86_platform.legacy.reserve_bios_regions = 0; x86_platform.legacy.devices.pnpbios = 0; + + x86_init.hyper.msi_ext_dest_id = hv_vtl_msi_ext_dest_id; } static inline u64 hv_vtl_system_desc_base(struct ldttss_desc *desc)