Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp54605rdb; Fri, 5 Jan 2024 02:29:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMf4IVPAP969wOYR4qhffd2QSHgVSzKOYTqE/nDBDgafUZpXRey+4uwiz9wx/GRvQQ4irW X-Received: by 2002:a17:90a:1283:b0:28c:bd4a:ae4a with SMTP id g3-20020a17090a128300b0028cbd4aae4amr1782901pja.43.1704450584744; Fri, 05 Jan 2024 02:29:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704450584; cv=none; d=google.com; s=arc-20160816; b=aIbHrZRpnNJg95s0XEzoOl5wUpPULpq4sQrcWIzzkMlnTiqnag/8BNck4iRiQTxTQN +CXNsenn+jHFVkSwbzbCmxpXM9Qj7gIQa0j31KRW2V2VcNUHU6wOScjCKjSj6/xkhrb6 WvuSf2EKRnuurcHdhazPQnnf9lgcUmwQDPbmTAqFnQ0zwO7siA0lW1SIjLjEnpDSND+G nd+MoYjqGKwUPw83Yzqo3KCjlEFi/nXixCEZWrjGnbHtsGF7Br60/dAP0N/3aTGc6PRM E66j7fXDxwXSxefn3t73k5kJ3jUCJpEylza78NJ8xaj2aTyCwwjloRdP5U74fpIrI91X q5mw== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c62-20020a17090a494400b0028bd42e0ca5si577613pjh.176.2024.01.05.02.29.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 02:29:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17747-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CEB6E284778 for ; Fri, 5 Jan 2024 10:29:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28EF525101; Fri, 5 Jan 2024 10:29:39 +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 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: List-Subscribe: List-Unsubscribe: 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 --- 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