From nobody Sun Dec 14 06:20:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1765566053; cv=none; d=zohomail.com; s=zohoarc; b=E7EKgOy+fhSmbYq+ZuRVRIt5iFKo9u4eudwk1WwV7U2FX7XrjcNX1yTjKeY2l95XhfyckTFmqWV/gFnFGxrFWGuMg7e0jSokJqhB9/FXRhiteE43l2nePIDD3TlwDjT7nDY5qGrVDB3XRs0Rx0fNN1w/09Ut7HmSc26NlG3Cne8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765566053; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mMX8hclgzHMMe8+a0wYX8Wx4IbGSejxjaqyDoIvWwPA=; b=aVhyC7zCGUFPyQspMTuagQ6Pz7nW3JPM5UgKmpOM/T0M1Ft387NM3z0027YKnwKIaChbGxZLdYtjgsNLlwyRjGoNxBx8fXtpDc4B/8/f33rznlgq9aeD1gNgiEEQcH4lUh3giXb/ZsK/tBHqq7KxfTMbcjPCtgjUZ1d6rSK8wcI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1765566053217962.8079710004184; Fri, 12 Dec 2025 11:00:53 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1185681.1507722 (Exim 4.92) (envelope-from ) id 1vU8NU-0002LO-Gq; Fri, 12 Dec 2025 19:00:32 +0000 Received: by outflank-mailman (output) from mailman id 1185681.1507722; Fri, 12 Dec 2025 19:00:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NU-0002KP-Cg; Fri, 12 Dec 2025 19:00:32 +0000 Received: by outflank-mailman (input) for mailman id 1185681; Fri, 12 Dec 2025 19:00:31 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NS-0001RM-Tc for xen-devel@lists.xenproject.org; Fri, 12 Dec 2025 19:00:30 +0000 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [2a00:1450:4864:20::32b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d0a28a71-d78c-11f0-9cce-f158ae23cfc8; Fri, 12 Dec 2025 20:00:24 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-47a80d4a065so11245315e9.2 for ; Fri, 12 Dec 2025 11:00:24 -0800 (PST) Received: from localhost.localdomain (host-92-26-102-188.as13285.net. [92.26.102.188]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f4af065sm16863975e9.6.2025.12.12.11.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Dec 2025 11:00:23 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d0a28a71-d78c-11f0-9cce-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1765566024; x=1766170824; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mMX8hclgzHMMe8+a0wYX8Wx4IbGSejxjaqyDoIvWwPA=; b=kaZ0ayhnpFJgL8Vaa6OAtDUaM/Yow9rOkofS+C9pZaC6ONQlL8sms5qSwqo12RXhM9 Sl06VfP/W9AvhYnXVqpCfwCP3cLkulA7hE9WnfDPsk9kK/taFp767mpd4NVRapXor0Nw lP0CzTMLsVoO93VWS3byFQGOKFE6PPDJHos9Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765566024; x=1766170824; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mMX8hclgzHMMe8+a0wYX8Wx4IbGSejxjaqyDoIvWwPA=; b=HOt2A+PnyXcwEz3LHvpVZwGSx8muG7uXArhBdLbxWMejypKeCMw0hFQTW3B3a8hNrZ QenrObA0mPxJ2xn48yDyY6bFB/XjtMW7qSC7Bj1SIwSfbxKmWePOoDoKgW+UJiclCsX9 nUt66ZC4MjZiG4SyugnPRH8jEbTr1C35QzGbuHYGFCJRDc2dQvR2NlgTZv1E6zjYbzC/ p/SNPWN0wk/QUzgEAkyxlZNG8k9JC7hIGz6L/Z6QPNfCwDMdIA2vl2qR/kUU9bmy7hNi pUC/AIRgyOl/5b/ugrV6RzakhOdCdLz5v9OW9x7hhACd02MkL036xl+/4mAdXX3ayHzR umug== X-Gm-Message-State: AOJu0YxcGnmN6l39pZHhUGBODRgCj6wqXEGBCqVPohuAnQUPm44BATo0 J5SAvvvSXDhmCE69P2ndTqQ3m4bxquckEPv48y43bdcLP7Q666LKTGhvAIl9uVRVp34fBjxboU+ msZn7 X-Gm-Gg: AY/fxX6XwD0vOaQ1miyb+FnY80SyhIwjtHX4RdFqxPNXMQeSP7VCOPg9U9dGOiGjrt5 bOdmMNRDdzjCRFz4CHaaQe67ypQNviuRidH2ZlOAjHaD7xYM3/Lq5UwrSzQf+GUVkx6YTxvp3co Uu0qE6iryYTAk7AiAd3qJD38uKVNNATUmqCnZIZaJawG08w1FDENCal7o3sIVTpTBmrgmvyePIn 2f68UPrRonJ6ZguBtcO6iQQ/I4eOSesXTN+rn7V2hm6kD0hHoNkkLUL9axLnMUZfqwy0cez0EUI pvXSVQimn8GniZALQ08euRwwzThaioWDrzqlbgz/gQK/fOXpcr08JZT3OM7zCWpE9kTDHZLN9bN U/6kEvo6oPhOTJIOyBdY7erEnMVqb2I+ult/u1a67R+hI4fDUPZwF9cmyZ5p5G2WmDzbAaiK1XC ouI9/jZSAWD8jze0LdYOGOvP793zU8WBTkC4NImDlAwZmrfhYMXw6QAGvFbuLuvg== X-Google-Smtp-Source: AGHT+IHFvn0wOVqXzITgjJLH/rXW3nvF60trf6a8xKufUBoAf80GilgiecqjjBzI8Ji1FcpYs0vvxw== X-Received: by 2002:a05:600c:34cd:b0:475:daba:d03c with SMTP id 5b1f17b1804b1-47a8f8c1d1amr32991535e9.13.1765566023636; Fri, 12 Dec 2025 11:00:23 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 1/5] x86/svm: Move asm/hvm/svm/svm.h up one directory Date: Fri, 12 Dec 2025 19:00:16 +0000 Message-Id: <20251212190020.2570076-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251212190020.2570076-1-andrew.cooper3@citrix.com> References: <20251212190020.2570076-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1765566054192158500 ... in preparation to remove the svm/ directory entirely. intr.c doesn't need to include svm.h at all. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/cpu-policy.c | 2 +- xen/arch/x86/domain.c | 2 +- xen/arch/x86/hvm/svm/asid.c | 2 +- xen/arch/x86/hvm/svm/emulate.c | 2 +- xen/arch/x86/hvm/svm/intr.c | 1 - xen/arch/x86/hvm/svm/nestedsvm.c | 2 +- xen/arch/x86/hvm/svm/svm.c | 2 +- xen/arch/x86/hvm/svm/vmcb.c | 2 +- xen/arch/x86/include/asm/hvm/{svm =3D> }/svm.h | 0 xen/arch/x86/spec_ctrl.c | 2 +- 10 files changed, 8 insertions(+), 9 deletions(-) rename xen/arch/x86/include/asm/hvm/{svm =3D> }/svm.h (100%) diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c index 0a7ef15f7210..372d11f2ff20 100644 --- a/xen/arch/x86/cpu-policy.c +++ b/xen/arch/x86/cpu-policy.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index b15120180993..7632d5e2d62d 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/xen/arch/x86/hvm/svm/asid.c b/xen/arch/x86/hvm/svm/asid.c index 0e115243a3af..53aa5d05125f 100644 --- a/xen/arch/x86/hvm/svm/asid.c +++ b/xen/arch/x86/hvm/svm/asid.c @@ -6,7 +6,7 @@ =20 #include #include -#include +#include =20 #include "svm.h" #include "vmcb.h" diff --git a/xen/arch/x86/hvm/svm/emulate.c b/xen/arch/x86/hvm/svm/emulate.c index d8aa45590885..be3a710fa53d 100644 --- a/xen/arch/x86/hvm/svm/emulate.c +++ b/xen/arch/x86/hvm/svm/emulate.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include =20 #include "svm.h" diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c index 931973a9fad4..702c071e8962 100644 --- a/xen/arch/x86/hvm/svm/intr.c +++ b/xen/arch/x86/hvm/svm/intr.c @@ -17,7 +17,6 @@ #include #include #include -#include #include /* for nestedhvm_vcpu_in_guestmode */ #include #include diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nested= svm.c index 63ed6c86b775..5718ca7f7f0f 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -6,7 +6,7 @@ */ =20 #include -#include +#include #include #include #include /* paging_mode_hap */ diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 15d45cbb57c5..86a030b02c27 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c index 7bde6e98ce03..463e527a7d98 100644 --- a/xen/arch/x86/hvm/svm/vmcb.c +++ b/xen/arch/x86/hvm/svm/vmcb.c @@ -15,7 +15,7 @@ #include =20 #include -#include +#include #include #include #include diff --git a/xen/arch/x86/include/asm/hvm/svm/svm.h b/xen/arch/x86/include/= asm/hvm/svm.h similarity index 100% rename from xen/arch/x86/include/asm/hvm/svm/svm.h rename to xen/arch/x86/include/asm/hvm/svm.h diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c index e71f62c60186..dd0413e1fc13 100644 --- a/xen/arch/x86/spec_ctrl.c +++ b/xen/arch/x86/spec_ctrl.c @@ -11,7 +11,7 @@ #include =20 #include -#include +#include #include #include #include --=20 2.39.5 From nobody Sun Dec 14 06:20:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1765566052; cv=none; d=zohomail.com; s=zohoarc; b=WCdCfzt7LgkT1pd0l/AAbXgO74NENn51wXuVk/LD5ORJCAcN/+2l0FMs51PAEVAFjbXBtuc/9G6cEkPmvneTLao/2KzCf+7foTVZdFXS7jH4KlG9esrsEtqZXz+kWIvW+OYMqoen/lzjiruLQKItoDbXKGVjgk3lJZRBedXLF2Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765566052; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4dLK03IrT6Fyyeaqxy4fKDrRO6QQiKG3aEO82LTQDBc=; b=Bv0Fm4M2vPuZ5Yl1Ve0g09eAKryPgxxyZOX4tIhHWCx//tQqaELdczKAkGrLKE9ZzwK7xNGMb2pS1sb3fEcsJzOZkByLQtOKh0qnzbwohmC2HuGqItljBXKJgFhtjT3410SX8bbXL1LcXRaruDztrnqMMJkobeLBsEDq4Zx6xnY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1765566052166357.92750334753543; Fri, 12 Dec 2025 11:00:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1185680.1507707 (Exim 4.92) (envelope-from ) id 1vU8NT-0001xE-8n; Fri, 12 Dec 2025 19:00:31 +0000 Received: by outflank-mailman (output) from mailman id 1185680.1507707; Fri, 12 Dec 2025 19:00:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NT-0001w0-1l; Fri, 12 Dec 2025 19:00:31 +0000 Received: by outflank-mailman (input) for mailman id 1185680; Fri, 12 Dec 2025 19:00:29 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NR-0001RM-TQ for xen-devel@lists.xenproject.org; Fri, 12 Dec 2025 19:00:29 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d10319c6-d78c-11f0-9cce-f158ae23cfc8; Fri, 12 Dec 2025 20:00:25 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4779a637712so11208865e9.1 for ; Fri, 12 Dec 2025 11:00:25 -0800 (PST) Received: from localhost.localdomain (host-92-26-102-188.as13285.net. [92.26.102.188]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f4af065sm16863975e9.6.2025.12.12.11.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Dec 2025 11:00:23 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d10319c6-d78c-11f0-9cce-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1765566024; x=1766170824; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4dLK03IrT6Fyyeaqxy4fKDrRO6QQiKG3aEO82LTQDBc=; b=D0DFeOHz+JHF3DSVjfwdtjAHxp43jPaDtEPIoZ3hM3QLFnKLlR1XlWQ/mmvEQPdUJl z2KWJGjHcGjXRJsvuMzjhjYW8QujwBFcA33KVvqrEUCGwvTtcKH2RDIKr5Jmk/ybBwFc IC2oepPvhDgl51/njtYsfKCj1+BjbEHvMysnQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765566024; x=1766170824; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4dLK03IrT6Fyyeaqxy4fKDrRO6QQiKG3aEO82LTQDBc=; b=fDzDeWnBWXZXdWNr9yPC5WrOjRNAaktsf8JO6XCFGRTjXzK8gBtIqoJmc945sKJ0/1 dp/esJM/gVa+L7PMofx1NvvFzMog/od1dgxdeZJyIQusQGPA+NL4T3mF6oA50PUazDTB ZVWNnYsryMchAxilY9T0811iY4Atuxxp9afw+zNRGk9ebHr43drqYRgIaut5+XW5zqW2 xHp+F0LHwMYTJgXYNkafnJvTkfn6ZyESh28qCmYx1VLsVt/6oxdJ/SoWzH1jE+yYt+qx Y4OxdZO/d2Q/zI0OjlytypK7edrfdZtF6EmHNQCHv+TVIEhojMTILmzynDSEKSLWzD/E 9BhA== X-Gm-Message-State: AOJu0YwQ9Es3a0Xaagw2VD+LPsCgVOJW7kevZ1kAPIogLuTF8ILAvBMc 2zFGvQRa3Lk7zv4M3riMdvAfVDkJ9CE4uI1ph6K39xOXLbhsbJwhT0XVLj3RGrRGty7EZwpMK0b d8Ah7 X-Gm-Gg: AY/fxX4ar+fMqZisuIeL5Ln7Hw5RpojRu7JTwLTqUsVHsFeNDVYbWKxvCTMQjpDax7x BDYBtqjrSuH58QVdNypGBVjTNSZuiE8THxAa6hai9ouAoIOCy3/ZiyyiguFSPDlnO40cPYmfFTl UDb6LG6C6QYs8WeOA44HWL+KGyq4Q+Kos4Mqn5iT6b4qCRZkQwTzdHpraE6D7g01zRyHSYhPwsA I5moabl0mjFjsxouoQ+sdTnobz5u5RGwidVlB54XyFxW8Fsmy2oPu5IhHFrbx5MpJkBsSXNQdas TJlop0LkDJP+uL5NDv4rFU+lIb10RFJz3SQ6x/8SDRnfeipR0cwQyuXS3u7aKqZKcTHhD2hMOJA Px4Q779SnJYdUiZ9WU5QCQccqpDefy0klfDjyDKyI5uT6juvtBDh6g2N33G0CZ4HwueRyslw3lb Ss56L2MK2tqASKdxLpLHh6eEV0ATtEw8LnCHL/B5b4Xi/gct6bYcHYCR8hg72cIQ== X-Google-Smtp-Source: AGHT+IFSu+4j4uKTL7ZzLVe4hYU2KGDe/v8kpe17wS59/wud3nTCjaYW2CY1kTFKgicub3chQXPY0Q== X-Received: by 2002:a05:600c:8b67:b0:471:14af:c715 with SMTP id 5b1f17b1804b1-47a8f8a6d83mr25900215e9.3.1765566024307; Fri, 12 Dec 2025 11:00:24 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 2/5] x86/svm: Move svm_intercept_msr() into svm.h Date: Fri, 12 Dec 2025 19:00:17 +0000 Message-Id: <20251212190020.2570076-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251212190020.2570076-1-andrew.cooper3@citrix.com> References: <20251212190020.2570076-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1765566054087158500 The single user of svm_intercept_msr() outside of the main svm logic is in vpmu_amd.c. Currently the declaration is picked up transitively through xen/sched.h, so include asm/hvm/svm.h explicitly. Sort the headers while doing so. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/cpu/vpmu_amd.c | 5 ++++- xen/arch/x86/include/asm/hvm/svm.h | 8 ++++++++ xen/arch/x86/include/asm/hvm/svm/vmcb.h | 8 -------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c index a6117dfebf2a..fa157d45dd01 100644 --- a/xen/arch/x86/cpu/vpmu_amd.c +++ b/xen/arch/x86/cpu/vpmu_amd.c @@ -13,10 +13,13 @@ #include #include #include + #include -#include #include +#include #include +#include + #include =20 #define MSR_F10H_EVNTSEL_GO_SHIFT 40 diff --git a/xen/arch/x86/include/asm/hvm/svm.h b/xen/arch/x86/include/asm/= hvm/svm.h index 4eeeb25da90c..a6d7e4aed3b1 100644 --- a/xen/arch/x86/include/asm/hvm/svm.h +++ b/xen/arch/x86/include/asm/hvm/svm.h @@ -57,4 +57,12 @@ static inline bool cpu_has_svm_feature(unsigned int feat) #define cpu_has_svm_sss cpu_has_svm_feature(SVM_FEATURE_SSS) #define cpu_has_svm_spec_ctrl cpu_has_svm_feature(SVM_FEATURE_SPEC_CTRL) =20 +#define MSR_INTERCEPT_NONE 0 +#define MSR_INTERCEPT_READ 1 +#define MSR_INTERCEPT_WRITE 2 +#define MSR_INTERCEPT_RW (MSR_INTERCEPT_WRITE | MSR_INTERCEPT_READ) +void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags); +#define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr)= , MSR_INTERCEPT_NONE) +#define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr),= MSR_INTERCEPT_RW) + #endif /* __ASM_X86_HVM_SVM_H__ */ diff --git a/xen/arch/x86/include/asm/hvm/svm/vmcb.h b/xen/arch/x86/include= /asm/hvm/svm/vmcb.h index 41bcc9f0d862..d1e200df564c 100644 --- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h +++ b/xen/arch/x86/include/asm/hvm/svm/vmcb.h @@ -42,14 +42,6 @@ struct svm_vcpu { uint64_t guest_sysenter_eip; }; =20 -#define MSR_INTERCEPT_NONE 0 -#define MSR_INTERCEPT_READ 1 -#define MSR_INTERCEPT_WRITE 2 -#define MSR_INTERCEPT_RW (MSR_INTERCEPT_WRITE | MSR_INTERCEPT_READ) -void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags); -#define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr)= , MSR_INTERCEPT_NONE) -#define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr),= MSR_INTERCEPT_RW) - #endif /* ASM_X86_HVM_SVM_VMCS_H__ */ =20 /* --=20 2.39.5 From nobody Sun Dec 14 06:20:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1765566057; cv=none; d=zohomail.com; s=zohoarc; b=IqmkdpLYwTnURXiaUS7ydm7BQE0zOPnLEHKRE3ljSU461Q8KKSdRE4HXB9mFL2hQB9X39+pkwvJNJAUouz9siVpLtRmyQPZQYaPEzcFxwc7m7zJmPpsJQ1/Dn+xgtTEGkScfs93LwI+BONx3I8wg0Hwx8op13deLHFzlybEN94Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765566057; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MVb9ekhD4Wc0C53D3BLiFybhruazQrTOGwycCd8VZjI=; b=Ezms/rTwx+nXq2cZEKuDE7CkIbqHW/bBXF/Gxv3LjTsCad+48ZODzrt/4XHTuCsFAS4QTDXkXHHccsUJqvLghzy7rlpHqm66BUPJoQ6eLMeGGkivEw3iyUb7avuoJNF8ejbuPh3H0lC/YcyORmpdkLrSxBsL0+B7ON+MsTMi2ks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1765566057223387.03183102859214; Fri, 12 Dec 2025 11:00:57 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1185677.1507681 (Exim 4.92) (envelope-from ) id 1vU8NQ-0001Sq-BM; Fri, 12 Dec 2025 19:00:28 +0000 Received: by outflank-mailman (output) from mailman id 1185677.1507681; Fri, 12 Dec 2025 19:00:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NQ-0001Sj-8b; Fri, 12 Dec 2025 19:00:28 +0000 Received: by outflank-mailman (input) for mailman id 1185677; Fri, 12 Dec 2025 19:00:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NO-0000Sh-MF for xen-devel@lists.xenproject.org; Fri, 12 Dec 2025 19:00:26 +0000 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [2a00:1450:4864:20::32e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d1647683-d78c-11f0-b15b-2bf370ae4941; Fri, 12 Dec 2025 20:00:25 +0100 (CET) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-47774d3536dso15142255e9.0 for ; Fri, 12 Dec 2025 11:00:25 -0800 (PST) Received: from localhost.localdomain (host-92-26-102-188.as13285.net. [92.26.102.188]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f4af065sm16863975e9.6.2025.12.12.11.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Dec 2025 11:00:24 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d1647683-d78c-11f0-b15b-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1765566025; x=1766170825; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MVb9ekhD4Wc0C53D3BLiFybhruazQrTOGwycCd8VZjI=; b=vQHkVPmuXe+07aEa+5KlAoVUhkUDDCVP9QmqrO39t6ykjUGMUgJpNl2gKGJST4eORv qRggq52lKiUmpCeNSMK97W2fGDiGVN+AEwwDHWu7gzRfBGlNGLA+B2/vg33DUjW1oHGm 6Jhucz3IJG3iTwVITkPEOwB6If46sACXv4gS0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765566025; x=1766170825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MVb9ekhD4Wc0C53D3BLiFybhruazQrTOGwycCd8VZjI=; b=GjuuRqA3hLQM3oKYs+8Ftls6piopu5XjAC2fYtIjAKdNIEUJcDYh2lwx2OJ5TwZsmo QCWoh5fews5bVvzT6rXNjYylCUsA2v6zDUKeTfYmEO7Qkh8nkBZBVHikWrZ+1LZhyW7u BWtFLed+UTYjl+o7HvUDWxQk/H8vWOjGMXcbYpjx/GMWUR9gqZ43GbOY+FTv/nnqHVaJ 5YNCEYPlVeZVRIPW3AClGylSRPjgq+vdXbO4vRcpxNYe4Tb5qmxfYND/RlHGdf00Bl5K D5BK2CnxTA53N18MGOlLVs1b9OCwF0a71AXtOUzJz2MO4z5CAOrqxtFbdkYibB74cVfY LPow== X-Gm-Message-State: AOJu0YwNEv6sBM4QOaLDVmPvyGj7q45LV/bVLPSYsEITg/98W/Lv1G3A R//YppDBLVnT2JUzkuVpfoxgCay5ItgUNqY3G3+t+OK3WO5VBlCeV7dYe/RlbSS5bp7RAnzss7k 4CZt1 X-Gm-Gg: AY/fxX6S0USIIPlnlvXR7YsGimjExTsQVNzPo4aVaqe2YKm/lf0HEfLBLLp776q1oEP OGHAMqg6Dtb1jYvc99bLTl53p+G9v6WnlHKLG3f0ghU12Daxr/bkIyIVXwu2G8EOT2rWiykQq/T me4vIvEsCznD2kFEuKPnwe53QH/oaabXfTl8S5y5/pQ2Y549XSXm59HxsD3uMGdE4iMqo5CMoVL 9mGLPnfeErNt83IKpTOlzo5SQuQthjWnafLJBZ2Vu3ODAD6s+Q3Edq3DdHYn5q8O3Qbsb0XPXDR u/fYzOcWUFSFA7fnkAeUheaGHr1ZA51H4fSblug3DAmKFLyAs7qUFTppGLo5AvHdTR3Q+I7+Nxf P4pACSCdeb6OpoHnx2/8Yd18CrIoDp+9jYJODBtm6ZFrjZdw/TAcXM0cN/jPuz8cZYRdUcPfPYp rSeS0PvWpPPzFU5eO76xBMn8JFcyQac/kAs11oAVanVNgfvhcODl9IQ32Gf5ek+g== X-Google-Smtp-Source: AGHT+IEI+vKlzk2aTjGDWjBJULU4xgcp9jDk3EiraNPCvv45g3F7X85rp1tka0ppu18c6q/8apu/QQ== X-Received: by 2002:a05:600c:4e45:b0:477:9d88:2da6 with SMTP id 5b1f17b1804b1-47a8faaf533mr26206265e9.0.1765566024938; Fri, 12 Dec 2025 11:00:24 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 3/5] x86/svm: Introduce svm-types.h Date: Fri, 12 Dec 2025 19:00:18 +0000 Message-Id: <20251212190020.2570076-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251212190020.2570076-1-andrew.cooper3@citrix.com> References: <20251212190020.2570076-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1765566057842158500 In order to reduce the header tangle around xen/sched.h, we need to split types away from other declarations. Introduce a new svm/svm-types.h to do this, including it from hvm/domain.h = and hvm/vcpu.h, and dropping all other inclusions of svm/vmcb.h and svm/nestedhvm.h No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/hvm/svm/emulate.c | 1 - xen/arch/x86/hvm/svm/nestedsvm.c | 1 - xen/arch/x86/hvm/svm/svm.c | 1 - xen/arch/x86/hvm/svm/vmcb.c | 1 - xen/arch/x86/include/asm/hvm/domain.h | 2 +- xen/arch/x86/include/asm/hvm/svm-types.h | 11 +++++++++++ xen/arch/x86/include/asm/hvm/vcpu.h | 3 +-- 7 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 xen/arch/x86/include/asm/hvm/svm-types.h diff --git a/xen/arch/x86/hvm/svm/emulate.c b/xen/arch/x86/hvm/svm/emulate.c index be3a710fa53d..1f5436c8ea5d 100644 --- a/xen/arch/x86/hvm/svm/emulate.c +++ b/xen/arch/x86/hvm/svm/emulate.c @@ -12,7 +12,6 @@ #include #include #include -#include =20 #include "svm.h" #include "vmcb.h" diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nested= svm.c index 5718ca7f7f0f..a63ec613465f 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -7,7 +7,6 @@ =20 #include #include -#include #include #include /* paging_mode_hap */ #include /* for local_event_delivery_(en|dis)able */ diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 86a030b02c27..1208999454d3 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c index 463e527a7d98..cbee10d0463d 100644 --- a/xen/arch/x86/hvm/svm/vmcb.c +++ b/xen/arch/x86/hvm/svm/vmcb.c @@ -16,7 +16,6 @@ =20 #include #include -#include #include #include #include diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/a= sm/hvm/domain.h index 83be2bd1c29c..be1a0d8c5b9f 100644 --- a/xen/arch/x86/include/asm/hvm/domain.h +++ b/xen/arch/x86/include/asm/hvm/domain.h @@ -15,7 +15,7 @@ =20 #include #include -#include +#include =20 #ifdef CONFIG_MEM_SHARING struct mem_sharing_domain diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/includ= e/asm/hvm/svm-types.h new file mode 100644 index 000000000000..1c26daa981a7 --- /dev/null +++ b/xen/arch/x86/include/asm/hvm/svm-types.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * SVM types needed to form struct domain/vcpu. + */ +#ifndef X86_SVM_TYPES_H +#define X86_SVM_TYPES_H + +#include +#include + +#endif /* X86_SVM_TYPES_H */ diff --git a/xen/arch/x86/include/asm/hvm/vcpu.h b/xen/arch/x86/include/asm= /hvm/vcpu.h index eae9ac53767b..836138a4a677 100644 --- a/xen/arch/x86/include/asm/hvm/vcpu.h +++ b/xen/arch/x86/include/asm/hvm/vcpu.h @@ -12,8 +12,7 @@ #include #include #include -#include -#include +#include #include #include =20 --=20 2.39.5 From nobody Sun Dec 14 06:20:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1765566061; cv=none; d=zohomail.com; s=zohoarc; b=Cjkr6UhmmKI4bOpZkRNdQB5JIPImuepSTBQscfWpuBJlq0UZ04M/SFbS15SVEhSUNbH93EcLXkEl1XcteEuUfEUlL509+GrGAg8NOY6FGmTlVhjwcDrmW3KBngjXr2pIk8mQACc9Inga89pyuEl6pMDQ1A/VwsU5dKb+53dxm20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765566061; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ps58niqN4uMF+QvTxFnqL3rpQIPJOM5Dbdsk2f6ndKM=; b=U2L/Pcf3Pd+Ow0fi0xdfntHyJ4AmnQuAC+g5zTefuGdnW0cbyy3vGipTWRLlxRYvWzJbVG/arP816ij5di/L/NkHSg6T3f1HBAWH5dkvCWdJl/IymXI7uuo9dXRV5Gr39KFUA/P4gFD6xXcvuiGFgF8jza/8W8NA3udAQO4tNjo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1765566061735475.4656055098162; Fri, 12 Dec 2025 11:01:01 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1185682.1507732 (Exim 4.92) (envelope-from ) id 1vU8NW-0002cl-0Y; Fri, 12 Dec 2025 19:00:34 +0000 Received: by outflank-mailman (output) from mailman id 1185682.1507732; Fri, 12 Dec 2025 19:00:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NV-0002cU-T7; Fri, 12 Dec 2025 19:00:33 +0000 Received: by outflank-mailman (input) for mailman id 1185682; Fri, 12 Dec 2025 19:00:31 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NT-0001RM-Tp for xen-devel@lists.xenproject.org; Fri, 12 Dec 2025 19:00:31 +0000 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [2a00:1450:4864:20::333]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d1c553f4-d78c-11f0-9cce-f158ae23cfc8; Fri, 12 Dec 2025 20:00:26 +0100 (CET) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-477aa218f20so10887735e9.0 for ; Fri, 12 Dec 2025 11:00:26 -0800 (PST) Received: from localhost.localdomain (host-92-26-102-188.as13285.net. [92.26.102.188]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f4af065sm16863975e9.6.2025.12.12.11.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Dec 2025 11:00:25 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d1c553f4-d78c-11f0-9cce-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1765566025; x=1766170825; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ps58niqN4uMF+QvTxFnqL3rpQIPJOM5Dbdsk2f6ndKM=; b=rQXKKXrnffc6Em9tBU9yy6CYBh7ISw/GtOIjhTsmK353I9psGFLgQ2UQNqlGlqxyNM Ejov3SUypcYXuxPFYA3tr9gi+FSp5BA3lEb0H2SVUCB2P7MRef7zFZYoaCnLSO12WrkD XtRJDwzCojFzlxhz8cdoSWcvh7ViNlvU7VPGo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765566025; x=1766170825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ps58niqN4uMF+QvTxFnqL3rpQIPJOM5Dbdsk2f6ndKM=; b=IM/yqLOmfYxhWfu7qgeG3s9zZ5fgqqdoNVYKQHZHKD8kEQbYVyD0Vu6ntNI6EjUE0h Y+qAIhDMK6VCjeeAUrHvkhNF9X+uE40ssRnYAGfR5uAfmCAeLCHixQKTu/Ks6tMhzC8Y oUZZOZzoeyHo1yr5oZnpX8e0hCeKkCLqt5I/hyrp/RZYreAIQtblz6pxsW/P9L4uFomK BB3x24ZrtyIoV3y7g4vFt9/W5+IyknaVMJpMy1latkmPljDwZ6ROfjF/90IwbNXIjWe7 FQUbDLpXrnFPyMFI52M4kBB0wi7VjycdtP0tTqX/AKOD8zIxz7zkwf+GfLTVZMuVINCg k/0Q== X-Gm-Message-State: AOJu0Yx0DLKMfddJkXJOrhQUsHJapgkyVJxi1zVRzAuiTEqVrMqeX3g0 UBidWjj2AiiePmLyDBp28/bYDUlkWGJWtqW1Qmh8AE4lrQwU1URwGvNYc0CLQAUiWsc7nrhC6JZ WnQaJ X-Gm-Gg: AY/fxX4EQgBWlrQ3Pwt80A3VCWoksBeBzXmWICHvsJchdZqcKa1FTTe/2s1qvMQpncn ydIgkyzGLCMx+xvVudmOGHimL2k5vK+k1l1RnwDshGH2dWYAc/9xRN4OxtzvxHdjf55pWctnECI h7y3JGpfd9kL3Y2TCIFKtwzvwIcPFimp2c9z6VwvOka1+bklwpP5dzhp4LrFlcG9XED9T0dTtud pktuWdbgWBEhiEO2pHXJqcTrtOxNhwJkQlNBFEJfTAOs0gECKagSVlAJ0q7Dz64EDvSy8U5ZsWZ TA4/+XI4Kxfv5JM4jhtNbpWELGsy3oAq2LZWzl1JiT6P/1BqqJyW0ehZ1TBfMPiTQeDoVE1cjaq eXz1Olcsx6CoVO0rLIpvmcFhwvXdVvqHyOEsP0pyxrX37eP4PdYCM6VYK6AHjSzlU1weIGrSUDJ Srojgc9uLIMQtecpJpFLfV46PXxqC/bLNIJl6rH9Y4O7XmYVngJQpaBJSrJHwIwh8z6F5rL86i X-Google-Smtp-Source: AGHT+IF2qe996kPERecRDoM8QDX/3zB5zvYJGrTiyLOU8tcL3/NKmQ859lEMGlquUYzV+H9OAcEtvA== X-Received: by 2002:a05:600c:3e1a:b0:477:afc5:fb02 with SMTP id 5b1f17b1804b1-47a8f9051c4mr34560195e9.21.1765566025573; Fri, 12 Dec 2025 11:00:25 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 4/5] x86/svm: Merge nestedsvm.h into svm-types.h Date: Fri, 12 Dec 2025 19:00:19 +0000 Message-Id: <20251212190020.2570076-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251212190020.2570076-1-andrew.cooper3@citrix.com> References: <20251212190020.2570076-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1765566063719158500 While doing so, move the ns_gif field to beside ns_hap_enabled to remove 7 padding bytes, and make some style fixes to comments/etc. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/include/asm/hvm/svm-types.h | 66 +++++++++++++++- xen/arch/x86/include/asm/hvm/svm/nestedsvm.h | 79 -------------------- 2 files changed, 65 insertions(+), 80 deletions(-) delete mode 100644 xen/arch/x86/include/asm/hvm/svm/nestedsvm.h diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/includ= e/asm/hvm/svm-types.h index 1c26daa981a7..637b94fa37da 100644 --- a/xen/arch/x86/include/asm/hvm/svm-types.h +++ b/xen/arch/x86/include/asm/hvm/svm-types.h @@ -5,7 +5,71 @@ #ifndef X86_SVM_TYPES_H #define X86_SVM_TYPES_H =20 +#include + #include -#include + +struct nestedsvm { + uint64_t ns_msr_hsavepa; /* MSR HSAVE_PA value */ + + /* + * l1 guest physical address of virtual vmcb used by prior VMRUN. Nee= ded + * for VMCB Cleanbit emulation. + */ + uint64_t ns_ovvmcb_pa; + + /* Cached real intercepts of the l2 guest */ + uint32_t ns_cr_intercepts; + uint32_t ns_dr_intercepts; + uint32_t ns_exception_intercepts; + uint32_t ns_general1_intercepts; + uint32_t ns_general2_intercepts; + + /* Cached real MSR permission bitmaps of the l2 guest */ + unsigned long *ns_cached_msrpm; + /* Merged MSR permission bitmap */ + unsigned long *ns_merged_msrpm; + + /* guest physical address of virtual io permission map */ + paddr_t ns_iomap_pa, ns_oiomap_pa; + /* Shadow io permission map */ + unsigned long *ns_iomap; + + /* + * Cached guest_cr[0] of l1 guest while l2 guest runs. Needed to han= dle + * FPU context switching. + */ + uint64_t ns_cr0; + + /* + * Cache guest cr3/host cr3 the guest sets up for the l2 guest. + * Used by Shadow-on-Shadow and Nested-on-Nested. + * ns_vmcb_guestcr3: in l2 guest physical address space and points to + * the l2 guest page table + * ns_vmcb_hostcr3: in l1 guest physical address space and points to + * the l1 guest nested page table + */ + uint64_t ns_vmcb_guestcr3, ns_vmcb_hostcr3; + uint32_t ns_asid; + + bool ns_gif; + bool ns_hap_enabled; + + /* Only meaningful when vmexit_pending flag is set */ + struct { + uint64_t exitcode; /* native exitcode to inject into l1 guest */ + uint64_t exitinfo1; /* additional information to the exitcode */ + uint64_t exitinfo2; /* additional information to the exitcode */ + } ns_vmexit; + + union { + uint32_t bytes; + struct { + uint32_t rflagsif:1; + uint32_t vintrmask:1; + uint32_t reserved:30; + } fields; + } ns_hostflags; +}; =20 #endif /* X86_SVM_TYPES_H */ diff --git a/xen/arch/x86/include/asm/hvm/svm/nestedsvm.h b/xen/arch/x86/in= clude/asm/hvm/svm/nestedsvm.h deleted file mode 100644 index 205989e80095..000000000000 --- a/xen/arch/x86/include/asm/hvm/svm/nestedsvm.h +++ /dev/null @@ -1,79 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * nestedsvm.h: Nested Virtualization - * Copyright (c) 2011, Advanced Micro Devices, Inc - * - */ -#ifndef __ASM_X86_HVM_SVM_NESTEDSVM_H__ -#define __ASM_X86_HVM_SVM_NESTEDSVM_H__ - -#include - -struct nestedsvm { - bool ns_gif; - uint64_t ns_msr_hsavepa; /* MSR HSAVE_PA value */ - - /* l1 guest physical address of virtual vmcb used by prior VMRUN. - * Needed for VMCB Cleanbit emulation. - */ - uint64_t ns_ovvmcb_pa; - - /* Cached real intercepts of the l2 guest */ - uint32_t ns_cr_intercepts; - uint32_t ns_dr_intercepts; - uint32_t ns_exception_intercepts; - uint32_t ns_general1_intercepts; - uint32_t ns_general2_intercepts; - - /* Cached real MSR permission bitmaps of the l2 guest */ - unsigned long *ns_cached_msrpm; - /* Merged MSR permission bitmap */ - unsigned long *ns_merged_msrpm; - - /* guest physical address of virtual io permission map */ - paddr_t ns_iomap_pa, ns_oiomap_pa; - /* Shadow io permission map */ - unsigned long *ns_iomap; - - uint64_t ns_cr0; /* Cached guest_cr[0] of l1 guest while l2 guest runs. - * Needed to handle FPU context switching */ - - /* Cache guest cr3/host cr3 the guest sets up for the l2 guest. - * Used by Shadow-on-Shadow and Nested-on-Nested. - * ns_vmcb_guestcr3: in l2 guest physical address space and points to - * the l2 guest page table - * ns_vmcb_hostcr3: in l1 guest physical address space and points to - * the l1 guest nested page table - */ - uint64_t ns_vmcb_guestcr3, ns_vmcb_hostcr3; - uint32_t ns_asid; - - bool ns_hap_enabled; - - /* Only meaningful when vmexit_pending flag is set */ - struct { - uint64_t exitcode; /* native exitcode to inject into l1 guest */ - uint64_t exitinfo1; /* additional information to the exitcode */ - uint64_t exitinfo2; /* additional information to the exitcode */ - } ns_vmexit; - union { - uint32_t bytes; - struct { - uint32_t rflagsif: 1; - uint32_t vintrmask: 1; - uint32_t reserved: 30; - } fields; - } ns_hostflags; -}; - -#endif /* ASM_X86_HVM_SVM_NESTEDSVM_H__ */ - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ --=20 2.39.5 From nobody Sun Dec 14 06:20:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1765566051; cv=none; d=zohomail.com; s=zohoarc; b=kkPT0HxoF1zBUmMF6JkscOdJWCAA3YWEOAORTxuTcgf4gXMbhHuta28HMXqQ+RjVoKUYQS4GVQnidhSLO1O9YC2LCAnPr6/4VLfRxLyK/xU5HXZB1LNiOe4tnvJtVRAcA6EYyWlbLX/zUu0feBEdyFgJOyUY4mzX4AzVYHSTs6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765566051; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3gL+Enjh91ePnBSDyCGD4ymXdSwQiUrx66mBkDlBghw=; b=ewE9+VJ03ZGOkjP48dDQJRp5X4MB/FPxuVz+0xPUYplUjRoXYhU9aZmfabniP6+hwLtvln7Axw+iiw5li8jd+Ec7BxEgKoHNpRffsTsTRODWnhRgQ0eaQNOmEAQHhFSzhYM3zi8AxM/801cvWBRVLz7QqI7nEJ0KeuQcCiUOeWA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1765566050973448.02658838845105; Fri, 12 Dec 2025 11:00:50 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1185678.1507692 (Exim 4.92) (envelope-from ) id 1vU8NR-0001gM-Nk; Fri, 12 Dec 2025 19:00:29 +0000 Received: by outflank-mailman (output) from mailman id 1185678.1507692; Fri, 12 Dec 2025 19:00:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NR-0001gF-K3; Fri, 12 Dec 2025 19:00:29 +0000 Received: by outflank-mailman (input) for mailman id 1185678; Fri, 12 Dec 2025 19:00:27 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vU8NP-0000Sh-U3 for xen-devel@lists.xenproject.org; Fri, 12 Dec 2025 19:00:27 +0000 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [2a00:1450:4864:20::32a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d226ec3b-d78c-11f0-b15b-2bf370ae4941; Fri, 12 Dec 2025 20:00:27 +0100 (CET) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4775ae5684fso7525235e9.1 for ; Fri, 12 Dec 2025 11:00:27 -0800 (PST) Received: from localhost.localdomain (host-92-26-102-188.as13285.net. [92.26.102.188]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f4af065sm16863975e9.6.2025.12.12.11.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Dec 2025 11:00:25 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d226ec3b-d78c-11f0-b15b-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1765566026; x=1766170826; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3gL+Enjh91ePnBSDyCGD4ymXdSwQiUrx66mBkDlBghw=; b=GAFgkIia8SGUHqHwjLo+MgDEwXal1n2rn4xQnVEP/wlD6MAG+lQMzpdqnwQkpSM4iO yAXbRf4NQDzbHAsVzTETCvf5Ce+Zu3OZ45TER36Wa4s6h7OMW9VsyzrCNzPkCjh+EVYO +NCJBwQ2a6CXhHxxaVQ6FftiRXMnqKOSEGDkg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765566026; x=1766170826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3gL+Enjh91ePnBSDyCGD4ymXdSwQiUrx66mBkDlBghw=; b=mwdwKQj+EEtvswWe7Zgq2oV5YaL08os/GuGmv2fBYo8AIj2T3vpu/ynrZvyvGpeeCM kTLjESoSk4CN7oehUv14jVXJfxpJHia1ftYDYJEWJYP1C1jk1mofAKPmNyJPfMwRNBdy JhHwNWm8x5om9jYDGNh94Tfm459cvC9ncFlvrtm4aMBfSBzIyHBAgbP8YM7feFpCuBp3 jXhnGjLfqc4CRUkc1U5SmM3Ih8LQkpsly+8BOAn27RPyjXBxP5MddhV8sT3uruxuGnRS 0m0HmrYZFPR0f5up7y3/wYujed10w9fa+dLaherUSYMQQd47i4wQy6hDOCSgZtTua5Hr /zVA== X-Gm-Message-State: AOJu0YxV73jFkpboNCfwC1fRiuCKaZKz6KKpxY94Rb94BULCxttP4YaJ yFxL5JWezLFGqPGZv89KJPw6ZiQ8o79/Py0hBQ/RiicpxZPGhgUYHmBNAvnEX1iK+rpURkRhXUN JoUKj X-Gm-Gg: AY/fxX4bunJgHR6GqwEhAm8wtmMgflRl5dCirhkwIk9+n8PGJUl52/z470kpecb44QQ d3iadd2qst3kBbSDCCrJcluiEqhHdOzskbpaF4waKMIT7SmpQ+7WzXGS+TOSM+bgb1aO/Rjk0yo yIDSU4O2z6fRCGy6JW3YvlY+LYxW2h3fSw82CBi5T3yR/uCeiMu4raaO5qAbccdX38qlrXGf4dW JOI4wtmHHIAAKGCMFJDT79ODPuoJqPIKpMi6sPvFi/yB4H4v9IKCtqSyEHvnAw6HoLVpSoIZ3fU xJ95dU5jYYMRLq3OoTX7IfYpSNYl/1h1zTJHwzdbkcPAuzRmqfU8lWg0GdgHP9cPSD4R1aCwetc Tp7cRl98pg3XNhgm2pe6BFkZvwNO91cARmtc1oBGWZLdZA0/4bluQRb621Rm+bWyAkKAcl7Rs3A KnM5pFQlGU+2A2HdEmif8HqSHeOwPKw+W7tnpM54yjZlRAcjHpzumiiQ4Rn3oOXw== X-Google-Smtp-Source: AGHT+IF2YyM3Nge3Hk1arDdyHtK4rfPZSN3vZVo2Suz25mW45G2SMbhU6hQaVB1ugtxKdC1Uludk7w== X-Received: by 2002:a05:600c:1992:b0:477:1ae1:fa5d with SMTP id 5b1f17b1804b1-47a8f9055camr31813165e9.20.1765566026207; Fri, 12 Dec 2025 11:00:26 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 5/5] x86/svm: Merge vmcb.h into svm-types.h Date: Fri, 12 Dec 2025 19:00:20 +0000 Message-Id: <20251212190020.2570076-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251212190020.2570076-1-andrew.cooper3@citrix.com> References: <20251212190020.2570076-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1765566054085158501 While doing so, make some style fixes to comments/etc. This removes the include/asm/hvm/svm/ subdirectory. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/include/asm/hvm/svm-types.h | 32 +++++++++++++- xen/arch/x86/include/asm/hvm/svm/vmcb.h | 55 ------------------------ 2 files changed, 31 insertions(+), 56 deletions(-) delete mode 100644 xen/arch/x86/include/asm/hvm/svm/vmcb.h diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/includ= e/asm/hvm/svm-types.h index 637b94fa37da..051b235d8f69 100644 --- a/xen/arch/x86/include/asm/hvm/svm-types.h +++ b/xen/arch/x86/include/asm/hvm/svm-types.h @@ -7,7 +7,37 @@ =20 #include =20 -#include +struct svm_domain { + union { + uint64_t raw[2]; + struct { + uint64_t length; + uint64_t status; + }; + } osvw; +}; + +struct svm_vcpu { + struct vmcb_struct *vmcb; + unsigned long *msrpm; + uint64_t vmcb_pa; + int launch_core; + + uint8_t vmcb_sync_state; /* enum vmcb_sync_state */ + + /* VMCB has a cached instruction from #PF/#NPF Decode Assist? */ + uint8_t cached_insn_len; /* Zero if no cached instruction. */ + + /* + * Upper four bytes are undefined in the VMCB, therefore we can't use = the + * fields in the VMCB. Write a 64bit value and then read a 64bit value= is + * fine unless there's a VMRUN/VMEXIT in between which clears the upper + * four bytes. + */ + uint64_t guest_sysenter_cs; + uint64_t guest_sysenter_esp; + uint64_t guest_sysenter_eip; +}; =20 struct nestedsvm { uint64_t ns_msr_hsavepa; /* MSR HSAVE_PA value */ diff --git a/xen/arch/x86/include/asm/hvm/svm/vmcb.h b/xen/arch/x86/include= /asm/hvm/svm/vmcb.h deleted file mode 100644 index d1e200df564c..000000000000 --- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h +++ /dev/null @@ -1,55 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * vmcb.h: VMCB related definitions - * Copyright (c) 2005-2007, Advanced Micro Devices, Inc - * Copyright (c) 2004, Intel Corporation. - * - */ -#ifndef __ASM_X86_HVM_SVM_VMCB_H__ -#define __ASM_X86_HVM_SVM_VMCB_H__ - -#include - -struct svm_domain { - /* OSVW MSRs */ - union { - uint64_t raw[2]; - struct { - uint64_t length; - uint64_t status; - }; - } osvw; -}; - -struct svm_vcpu { - struct vmcb_struct *vmcb; - u64 vmcb_pa; - unsigned long *msrpm; - int launch_core; - - uint8_t vmcb_sync_state; /* enum vmcb_sync_state */ - - /* VMCB has a cached instruction from #PF/#NPF Decode Assist? */ - uint8_t cached_insn_len; /* Zero if no cached instruction. */ - - /* Upper four bytes are undefined in the VMCB, therefore we can't - * use the fields in the VMCB. Write a 64bit value and then read a 64b= it - * value is fine unless there's a VMRUN/VMEXIT in between which clears - * the upper four bytes. - */ - uint64_t guest_sysenter_cs; - uint64_t guest_sysenter_esp; - uint64_t guest_sysenter_eip; -}; - -#endif /* ASM_X86_HVM_SVM_VMCS_H__ */ - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ --=20 2.39.5