From patchwork Wed Dec 18 15:59:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 851714 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp999482wrq; Wed, 18 Dec 2024 08:00:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9wqPjHJtoH9eE+5KSZaE+LMfor75AMmEY/XAFiBVhudEOJ0sW+Ao5LW7VuUw+3xv37E8p3w==@linaro.org X-Google-Smtp-Source: AGHT+IEurJOcg9+1rH/SmALT6NLi7ghEytq4nhGT6bY8XrgqMTviSNAL96ggDtfl31T0+qDOFyfW X-Received: by 2002:a05:6214:19ef:b0:6d8:8f81:e2ec with SMTP id 6a1803df08f44-6dcf4c4e219mr134017036d6.12.1734537625957; Wed, 18 Dec 2024 08:00:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734537625; cv=none; d=google.com; s=arc-20240605; b=DTdibQNrbwz8Tw/p/rQKlcN+9pyPGE9ENm5Jr9IdOjOK06gRciEeGgTgh56bx89mqJ oZZJ2N5eueUlQJFAk14slZOh8OBXsfprxUfi7Vatwren3Yx7CfIC2GdS/H6qfIvRizri Lrmy2/dgoGTMSqi6fNWX729Z/GFgMXtBYdWXqhENYcmGi5i7afPDGZZD8D1iro3320GN WSEdW8aQixVlRHUAPRVn4tluF+8u9WGIf+xCkQWYKsdJKlLKzRgeB8/N6fJH1Q5SMmEc jMxMArZ5kB0p3dP0Ur3iDa8oRibfZ0Qz+2OOBzf2wH8AnxEV7Qrx5y6s7MhwhiDuo2dp kefw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i1PtiwkJt/+DijNbqUoe227vdUj70+KPR5ybVcrTmE4=; fh=J6xwFb9r+wBglNFLu4Do3qnteWKPYOBmL246SEZoC6Q=; b=VbWc5As3q2dq8Yysbdso/14Ubd57RrAZrpf2WCD2364/q0SeZPFmRmDcDvHgiI2yN5 B23eqrNmUVi8A/tItxjVUbXl4qzsPrQEHMF3iH1bw2Dd2jy2kRls9RCygkZluMY9gkaQ 76JF4yGxGs8+Vy5tXsfrNITE+NN4mWroDzx15b9mub1+dzGlp61fCMmOsDQkiHNpTGvP sihmzYLtNEf5h36rIHtNZlBTopNBX02Hn5DfQQeTmFaBMFiBk9tOi0dowE3voo/piHON pmFSXXqMHiMwU5ImRqDsyWORN7rFSm3LQsdqPj4On72e+yAHAisV9QzNe1nwg3I1jNN6 Op+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EaHL89Sj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2ed0e3asi119940341cf.416.2024.12.18.08.00.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2024 08:00:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EaHL89Sj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNwSM-0006DO-Cf; Wed, 18 Dec 2024 10:59:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNwSL-0006DD-Mg for qemu-devel@nongnu.org; Wed, 18 Dec 2024 10:59:25 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNwSJ-0007rk-ME for qemu-devel@nongnu.org; Wed, 18 Dec 2024 10:59:25 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-436249df846so46468655e9.3 for ; Wed, 18 Dec 2024 07:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734537560; x=1735142360; darn=nongnu.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=i1PtiwkJt/+DijNbqUoe227vdUj70+KPR5ybVcrTmE4=; b=EaHL89Sjk0Ntujul6Q5s+BlRnBaZ25PomvHGy4XuFzYkYNtLK1rYcj67qu2WdgutYu EnzKY3j0YB4MLqNldIhlseasgpEBPjZ+JFcPHg5rnEsFPsBl3ZVCbP3ldTyNEaPe/Ezc UQ47sIT3wkIdZLbK9pmyjW244LTL2A7kQFIDvDK2BSEp7IBN9+ZlER0aqFtB8f952oru 64lv6FkLIUPZGC4fHCxc0A1WGKjdB74NoAIJJjcjNxFphVnkPu2x3tc3SOHpW5juEVXX F2g8BhiqxCGmBMCKozWADeMIa6pRBztsIUa3iWVssIhfEPanVTe3mOAvYl1vxNU0Uxhr 6pmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734537560; x=1735142360; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i1PtiwkJt/+DijNbqUoe227vdUj70+KPR5ybVcrTmE4=; b=A35WpXllJxazDmNLOc+wqqAxHNDm1+y3fnUKDC7pihqlQx000a7jn36yLM773Mhts1 aiNfcEgVIAbIoe19u8c5pvSYx2Pa6EXIBjR4LfnekQbAsRNxxwr0w7anIyOxqqWNnXvG JnMyXgzRiPivpeeg2TOyn1Ov8C9C7UwGBybrKIPRST5M1pzqydWEhhUjdVSy52lwa8ue 3EYGzvggD31E3BeFMYE4Y5mWIvTI5S0MbfuqlDbzmgojDWHhrIUlsKdUBlFAqWEVYsvs xWjovM7obKSBYGDk2MrhIngT8oEyDaDgQfbtedv4ODTjGaiXbQ2YyiRyhLQGEkV4ZycA vTsg== X-Gm-Message-State: AOJu0YzvdKdekkrVUddpA9wGtK9s8S0OtuxahK2fto1sEUpg1x5NTPo+ ClsNzxof2hS35OkZWytVemdH7+LwzjbxbrEvc5f2FAZzkc8d/WgWjlC2n782goQjsa/Vzk+oKPV i X-Gm-Gg: ASbGncs+T6XjNhmVtor9H4VCVAV5mQChYsen8UofcjdbXtce2f/nJrfI8JwsP30X5C+ OK+Y6COQABFFoAStrI5MJOsGKdeZpgMLpITLTMbSVrSIU88Y/ppAKy4jXh14ZOgNBH7G2W1UPc3 jpIWmsOSNLpNLNKzCpBhXeBzz5K8q6ykNqIf1SBVoDBqq+xzKOT0sGGZpi983CipqMnERtjMdKA DDvyqwopGhEG4a+w9Pq9eesrB6qBKcAHt9l8EYQMJ6j/wUSCTbzfL5S+WfGSPQm6bCQv7p4CNOe nr3L X-Received: by 2002:a05:600c:5103:b0:434:ff9d:a3a1 with SMTP id 5b1f17b1804b1-436553445f5mr32035875e9.2.1734537559916; Wed, 18 Dec 2024 07:59:19 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b01d17sm23876155e9.16.2024.12.18.07.59.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Dec 2024 07:59:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eric Farman , kvm@vger.kernel.org, Marcelo Tosatti , David Hildenbrand , Ilya Leoshkevich , Nicholas Piggin , Daniel Henrique Barboza , Richard Henderson , Thomas Huth , Paolo Bonzini , qemu-ppc@nongnu.org, Zhao Liu , qemu-s390x@nongnu.org, Yanan Wang , Christian Borntraeger , Eduardo Habkost , Marcel Apfelbaum , Harsh Prateek Bora , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , "Michael S. Tsirkin" , Halil Pasic Subject: [PATCH 1/2] system: Move 'exec/confidential-guest-support.h' to system/ Date: Wed, 18 Dec 2024 16:59:12 +0100 Message-ID: <20241218155913.72288-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241218155913.72288-1-philmd@linaro.org> References: <20241218155913.72288-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org "exec/confidential-guest-support.h" is specific to system emulation, so move it under the system/ namespace. Mechanical change doing: $ sed -i \ -e 's,exec/confidential-guest-support.h,sysemu/confidential-guest-support.h,' \ $(git grep -l exec/confidential-guest-support.h) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu --- include/{exec => system}/confidential-guest-support.h | 6 +++--- target/i386/confidential-guest.h | 2 +- target/i386/sev.h | 2 +- backends/confidential-guest-support.c | 2 +- hw/core/machine.c | 2 +- hw/ppc/pef.c | 2 +- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- system/vl.c | 2 +- target/s390x/kvm/pv.c | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) rename include/{exec => system}/confidential-guest-support.h (96%) diff --git a/include/exec/confidential-guest-support.h b/include/system/confidential-guest-support.h similarity index 96% rename from include/exec/confidential-guest-support.h rename to include/system/confidential-guest-support.h index 02dc4e518f0..b68c4bebbc1 100644 --- a/include/exec/confidential-guest-support.h +++ b/include/system/confidential-guest-support.h @@ -18,7 +18,9 @@ #ifndef QEMU_CONFIDENTIAL_GUEST_SUPPORT_H #define QEMU_CONFIDENTIAL_GUEST_SUPPORT_H -#ifndef CONFIG_USER_ONLY +#ifdef CONFIG_USER_ONLY +#error Cannot include system/confidential-guest-support.h from user emulation +#endif #include "qom/object.h" @@ -94,6 +96,4 @@ static inline int confidential_guest_kvm_reset(ConfidentialGuestSupport *cgs, return 0; } -#endif /* !CONFIG_USER_ONLY */ - #endif /* QEMU_CONFIDENTIAL_GUEST_SUPPORT_H */ diff --git a/target/i386/confidential-guest.h b/target/i386/confidential-guest.h index 7342d2843aa..0afb8317b58 100644 --- a/target/i386/confidential-guest.h +++ b/target/i386/confidential-guest.h @@ -14,7 +14,7 @@ #include "qom/object.h" -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" #define TYPE_X86_CONFIDENTIAL_GUEST "x86-confidential-guest" diff --git a/target/i386/sev.h b/target/i386/sev.h index 858005a119c..2664c0b1b6c 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -18,7 +18,7 @@ #include CONFIG_DEVICES /* CONFIG_SEV */ #endif -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" #define TYPE_SEV_COMMON "sev-common" #define TYPE_SEV_GUEST "sev-guest" diff --git a/backends/confidential-guest-support.c b/backends/confidential-guest-support.c index 052fde8db04..1cd9bed505d 100644 --- a/backends/confidential-guest-support.c +++ b/backends/confidential-guest-support.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" OBJECT_DEFINE_ABSTRACT_TYPE(ConfidentialGuestSupport, confidential_guest_support, diff --git a/hw/core/machine.c b/hw/core/machine.c index ba819fec0af..0e8af37194f 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -30,7 +30,7 @@ #include "hw/pci/pci_bridge.h" #include "hw/mem/nvdimm.h" #include "migration/global_state.h" -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-net.h" #include "hw/virtio/virtio-iommu.h" diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c index cffda44602e..8b2d726e008 100644 --- a/hw/ppc/pef.c +++ b/hw/ppc/pef.c @@ -14,7 +14,7 @@ #include "qom/object_interfaces.h" #include "system/kvm.h" #include "migration/blocker.h" -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" #define TYPE_PEF_GUEST "pef-guest" OBJECT_DECLARE_SIMPLE_TYPE(PefGuest, PEF_GUEST) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ad21018b5aa..623842f8064 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -75,7 +75,7 @@ #include "hw/virtio/vhost-scsi-common.h" #include "exec/ram_addr.h" -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" #include "hw/usb.h" #include "qemu/config-file.h" #include "qemu/error-report.h" diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index f4d64d64f94..b45d8963b36 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "exec/ram_addr.h" -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" #include "hw/boards.h" #include "hw/s390x/s390-virtio-hcall.h" #include "hw/s390x/sclp.h" diff --git a/system/vl.c b/system/vl.c index a271ecc1acf..4785b3ff09a 100644 --- a/system/vl.c +++ b/system/vl.c @@ -107,7 +107,7 @@ #include "qemu/plugin.h" #include "qemu/queue.h" #include "system/arch_init.h" -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" #include "ui/qemu-spice.h" #include "qapi/string-input-visitor.h" diff --git a/target/s390x/kvm/pv.c b/target/s390x/kvm/pv.c index e4b0d17a48a..69c1811e156 100644 --- a/target/s390x/kvm/pv.c +++ b/target/s390x/kvm/pv.c @@ -19,7 +19,7 @@ #include "system/kvm.h" #include "system/cpus.h" #include "qom/object_interfaces.h" -#include "exec/confidential-guest-support.h" +#include "system/confidential-guest-support.h" #include "hw/s390x/ipl.h" #include "hw/s390x/sclp.h" #include "target/s390x/kvm/kvm_s390x.h" From patchwork Wed Dec 18 15:59:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 851713 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp999463wrq; Wed, 18 Dec 2024 08:00:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXhaxuaQri9kf0NINItan02hmUTtB7Lws0r4V/Iw9nJ+rezuqfeoiwyUlBYhU91xZ9VgEWdqA==@linaro.org X-Google-Smtp-Source: AGHT+IHbqvcuNNXd2jH+K+PPecLP1J0h+QYfUQojXAzvYjC9eL89sgzr8fyqcIfe5/ffnix1qC5y X-Received: by 2002:a05:620a:470b:b0:7b6:e8d4:9b7d with SMTP id af79cd13be357-7b86375bc52mr577799485a.30.1734537624605; Wed, 18 Dec 2024 08:00:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734537624; cv=none; d=google.com; s=arc-20240605; b=JFoz30UBsIC+ODBaQ3RxE4haXIB3IPHKOhdR0DvOXS5F/l8akJP8LakVPrYQLUVARW 3Pmwmv4BT/u9UUkF2T1V+XoUCGl74WXAMeRwydc9J+u89hzbbrrEuSaA6c2njkekY87C u6UTQRyMhXYvrRfiVNQWMgh7SysD2v//AT+a5ZUAoCuDGw6osKhNAr7fny3zlEjm6uoG WwxwGifNxc6lvai+DcbpYc+Cd3N3IZU1J0GTTBOKVNDRHIGXgkieV+8A/A++/YcDPNt+ zrmClOzQ/dPzhCdQG8Xs4is06TRoR1mWYZ12+BLx6Lo0x33Tz9ItpqlNI4Rtfpw1+q28 vLvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HVrC/xB4J4W5X585RY4Zqal4Bi+Ph7neB+RzuTzMwMY=; fh=J6xwFb9r+wBglNFLu4Do3qnteWKPYOBmL246SEZoC6Q=; b=C2g66NH36gR2iPv1v0w7inVSIxIuhmk6Bmxx5umaX9X4od9hLENl6WXL3pbICNdvoa Rkhd9e3q7wTaW3BBdwdiRe1LgIjYm83LuQXzG+dOoZdmliOCmIuOaQlbcdYIZhgct1iP V4fYu8IhTZkwVJelyjtJtTPfFOUp7HiCvldNBtJ5//1QewMJuOjNxr4J24ivwfRMi5+O 8f2I3x3fgxGdeul9xKH/0p7M9r8jhrMJ+eAAobla792ePoy6uaDYub8B3hRwzjOrodmV /y7n6gVQ/EP3xLhrfLG7UhNbxdN6q1RptKYw+QezaKfPTEbmveMymZN1SCr5y5sh+yU4 rMnA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J6Sq7t1f; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b7048f398asi1335523185a.676.2024.12.18.08.00.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2024 08:00:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J6Sq7t1f; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNwSQ-0006Eo-Il; Wed, 18 Dec 2024 10:59:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNwSP-0006E4-5Q for qemu-devel@nongnu.org; Wed, 18 Dec 2024 10:59:29 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNwSN-0007t4-AP for qemu-devel@nongnu.org; Wed, 18 Dec 2024 10:59:28 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4361dc6322fso44790555e9.3 for ; Wed, 18 Dec 2024 07:59:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734537565; x=1735142365; darn=nongnu.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=HVrC/xB4J4W5X585RY4Zqal4Bi+Ph7neB+RzuTzMwMY=; b=J6Sq7t1fQoSlxAZ7SgPjiepzVQwPI4H3leMSsX/0tLr6Y1Lk8Aj4FRf4HOulyZQujw Rjk14SB2oUe8fnU+3gnnmie59wBJ0KhnRRWscXgJB23kUjQw7L9Ov9f2mhU3Iu3xlK9o xlt6eqAPwZ7kXVfN5iNcojedeKdCx5WNJlqrvUJCOteCidfTE75B3S1W0Bn8nuh3pXpC 5ODfgYpy64+M7Gft4QwVjagaEBUxBz2ggljxs/Ftzo6G6bQXOi/QWBqtuKa0Er5e4pWg 5JgtvHT7GYPQIIIv1c6tD9krKbvN0jkGKpsjAWIyh9MWjdwwJwCGCI7Bd0CHlpWv0ezq rNqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734537565; x=1735142365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HVrC/xB4J4W5X585RY4Zqal4Bi+Ph7neB+RzuTzMwMY=; b=JP4sNUao9Adgz6F0ezO5PZoLcCqFucq9HMo7pn7PvB/rs8+A02j9pFLNtboUlpQXto OfhCbU/uS+XUi1M5+AQM94BYR9tY1X2roF1mH+Ai6ZzAFqZ/H08PAu+gvVBAPlCvdgVD 2arkTY7TT/wuauZhRTmdJpQQZpj3KRpVldBRP5pITM6XzNiyBGNfFakpFhKkJ+AOyBRA t5ScRUtRHgehc+5li4l1OaCqhc2f3ufKecsgjKGHenI/vvajXvmFUr/QnP5rV1BmgW/1 brQSVH9deexCFc9vRCo5wz0qDaP0qQUzyjzRtXilS2RVtaqfWM/adWVPqiI4ofcTuXvj l4+g== X-Gm-Message-State: AOJu0Yz50qDco28uhddXB54xJm0ONr/Ieo/Egdr1Av1Og/cLxbfXQMFe g18CF1CUCNsBRBWzFPdlEU9GFqKAf4iQX62pHQus2Hq3/UEK7HAh7Mc/dDGvDbTEOV9wUK88Bfr 4 X-Gm-Gg: ASbGncukiZV4STRCUk41HJiTPRZBZx1FrEfCg8qqneRwawRl9Md8VmqQ8tbXGv3kr0i 1BRD8e/jT9XguKHMJoB6IT48tS5GIU+cJiErRJ3fSDmdyCD870IFdQVuSOpYqUa2fqcn/q7ahGh X/hxaCfqhzaJ7gDNRcV3zdVWIS1lcAWFJK/DJWkTCrX44ZLTxfBuE4vZyj6rseyGyNQ98kAJVR0 vl8lyiQSBmuKoGyhZqj+Wb0Lohod+VMl3iEJWXcyIrF8MRPuBQZyiFcY5kvCywWrEA4fpJhfYyA WUpl X-Received: by 2002:a05:600c:35cb:b0:434:ff9d:a370 with SMTP id 5b1f17b1804b1-436550b0fe8mr35114405e9.0.1734537565061; Wed, 18 Dec 2024 07:59:25 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b01b73sm24760955e9.14.2024.12.18.07.59.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Dec 2024 07:59:24 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eric Farman , kvm@vger.kernel.org, Marcelo Tosatti , David Hildenbrand , Ilya Leoshkevich , Nicholas Piggin , Daniel Henrique Barboza , Richard Henderson , Thomas Huth , Paolo Bonzini , qemu-ppc@nongnu.org, Zhao Liu , qemu-s390x@nongnu.org, Yanan Wang , Christian Borntraeger , Eduardo Habkost , Marcel Apfelbaum , Harsh Prateek Bora , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , "Michael S. Tsirkin" , Halil Pasic Subject: [PATCH 2/2] target/i386/sev: Reduce system specific declarations Date: Wed, 18 Dec 2024 16:59:13 +0100 Message-ID: <20241218155913.72288-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241218155913.72288-1-philmd@linaro.org> References: <20241218155913.72288-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org "system/confidential-guest-support.h" is not needed, remove it. Reorder #ifdef'ry to reduce declarations exposed on user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu --- target/i386/sev.h | 29 ++++++++++++++++------------- hw/i386/pc_sysfw.c | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/target/i386/sev.h b/target/i386/sev.h index 2664c0b1b6c..373669eaace 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -18,7 +18,17 @@ #include CONFIG_DEVICES /* CONFIG_SEV */ #endif -#include "system/confidential-guest-support.h" +#if !defined(CONFIG_SEV) || defined(CONFIG_USER_ONLY) +#define sev_enabled() 0 +#define sev_es_enabled() 0 +#define sev_snp_enabled() 0 +#else +bool sev_enabled(void); +bool sev_es_enabled(void); +bool sev_snp_enabled(void); +#endif + +#if !defined(CONFIG_USER_ONLY) #define TYPE_SEV_COMMON "sev-common" #define TYPE_SEV_GUEST "sev-guest" @@ -45,18 +55,6 @@ typedef struct SevKernelLoaderContext { size_t cmdline_size; } SevKernelLoaderContext; -#ifdef CONFIG_SEV -bool sev_enabled(void); -bool sev_es_enabled(void); -bool sev_snp_enabled(void); -#else -#define sev_enabled() 0 -#define sev_es_enabled() 0 -#define sev_snp_enabled() 0 -#endif - -uint32_t sev_get_cbit_position(void); -uint32_t sev_get_reduced_phys_bits(void); bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **errp); int sev_encrypt_flash(hwaddr gpa, uint8_t *ptr, uint64_t len, Error **errp); @@ -68,4 +66,9 @@ void sev_es_set_reset_vector(CPUState *cpu); void pc_system_parse_sev_metadata(uint8_t *flash_ptr, size_t flash_size); +#endif /* !CONFIG_USER_ONLY */ + +uint32_t sev_get_cbit_position(void); +uint32_t sev_get_reduced_phys_bits(void); + #endif diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index da7ed121292..1eeb58ab37f 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -36,7 +36,7 @@ #include "hw/qdev-properties.h" #include "hw/block/flash.h" #include "system/kvm.h" -#include "sev.h" +#include "target/i386/sev.h" #define FLASH_SECTOR_SIZE 4096