Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp3732rdb; Mon, 15 Jan 2024 09:58:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzQuBWYD7P/4QdkQqutb+eEH3TgV2aS/zE8KmIYVUr0AwjOQMCnHN7/YQ0LQ50amex4VVt X-Received: by 2002:a05:622a:22a4:b0:429:74f4:5ace with SMTP id ay36-20020a05622a22a400b0042974f45acemr7631999qtb.66.1705341512157; Mon, 15 Jan 2024 09:58:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705341512; cv=none; d=google.com; s=arc-20160816; b=k6E/dTkD091f4+vHXw7E+C5ndS2r13i3luRVegvoXFtPpnJMm0ZMpGSiqt9kbuPDCR T6TnFR10coQR0zDDYlPBHaPPGAWDWf9CfoH4PbVvoCTv2eCboYHwAMJSWL7a102YC2TK MAMUaK/mJelMjo8EWlRZBsVpRs88ylBz0MRhxLAaFOiOWYk6EqvYSZOiRTFjM22R5dNR yQUoyplZgq3OpwgtHT3nuTe1JzoAWztlhuEAX8pKmGGGa+JoM7dRL5mXLHXyKktihuM2 Nj+yyP665qSWPWJOfxfyS/TcxYw/7kSMomoojAGpzpFz4P+Onv0+Kk/Ge1CUvSes5QA4 nPPw== 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=M/7pcXQalXHcMoHN9ldxUjvdafJ22HCKPBnrDAVw1HQ=; fh=Q90LcKQU9isaEX5E6EGA77zJrhNMo5wuUyqVhBPa5Uw=; b=FjieBH6LHg1LJFVbeldKYexOCHikdvr4Ps1RYUdiz1OZp2bxdT+gF0uT/IunrSpoaK 9FvEp87DJjdRF9tqIrGSwLZkXqK0VK8PT05tjxquH/eLRRSV7JebYgD38EK7lV1hPaF/ VzJ7Ne92vhcWyu6cvnr1wDvN4qoboC2nP/220tp5arg1kkmxqL7wP73/dAJudim+pguh eA8exQ2HvDhEkMuh+EYn1IbUhA4GwKhkuQM/dVsRYJe8T/cylZZY0Fp6Tp0DE0Y3qoZf KH052peAG84RWG3VSVJpadpH74/5hJD2+tQw468Qs6PXtIKQRlfaCLqL6sBNfvTVPHWe Y7jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=rl1OYcPB; spf=pass (google.com: domain of linux-kernel+bounces-26337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26337-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 ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o20-20020ac87c54000000b00429d5f68dffsi5308333qtv.324.2024.01.15.09.58.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 09:58:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=rl1OYcPB; spf=pass (google.com: domain of linux-kernel+bounces-26337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26337-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E7D661C21F39 for ; Mon, 15 Jan 2024 17:58:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AA2C18C35; Mon, 15 Jan 2024 17:57:54 +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="rl1OYcPB" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06BAC18C25; Mon, 15 Jan 2024 17:57:51 +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 D849B20C80BA; Mon, 15 Jan 2024 09:57:44 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D849B20C80BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1705341464; bh=M/7pcXQalXHcMoHN9ldxUjvdafJ22HCKPBnrDAVw1HQ=; h=From:To:Cc:Subject:Date:From; b=rl1OYcPBwsGLkD+Eq0xve8jCrB0U8W1ZjzLwEAnVDm5hW3UxPKKZ1Qin1249GLGKy qPxzV3n08+ba5UaeAXqN4D+7/fWoQzqNLU1PYVQvb9kh7XsCeoZrx/0dTFTG6a1qmO xqzxgip277E/ElAdmB7pM+KOVWQXk4PWMcP4zUs8= 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 v2] x86/hyperv: Allow 15-bit APIC IDs for VTL platforms Date: Mon, 15 Jan 2024 09:57:40 -0800 Message-Id: <1705341460-18394-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 safe, as Hyper-V does not employ any architectural MSIs at higher VTLs This unblocks startup of VTL2 environments with more than 256 CPUs. Signed-off-by: Saurabh Sengar --- [V2] - Modify commit message 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 96e6c51..cf1b78c 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"); @@ -38,6 +43,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) -- 1.8.3.1