From patchwork Tue Nov 14 14:37:57 2023 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: 13455434 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 990B44174A for ; Tue, 14 Nov 2023 14:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FRG7FV+Z" Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22D3ED5E for ; Tue, 14 Nov 2023 06:38:29 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9c773ac9b15so803904466b.2 for ; Tue, 14 Nov 2023 06:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972707; x=1700577507; darn=vger.kernel.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=7bjOOh298/gVm20zFogtcW7Ag9vjCtjGY9z1KnDRo3U=; b=FRG7FV+ZTGvdXzNfcoLFDhRMPWSanfD+FO7abxOP+6zEV8QEhJqK79MdhIe4WcK9sM GsgnalzmC61NjTXaBXg2n/1+vjMbMHqFwunh0kr9k0fe+rzkBtc4OKoBecaTdUfJ0p5o hpAxVEtvGnsxPk6NDKILPwPv8Vc6jnshOcEiimoDhjTmwy8lxrVvCVQSn5MRQzNGCv0p FRlfxDmg5A9QdxGYMddgkOo9gK7qtO8rNwvsJ3eL0j4X1MuEoqcEzqv630Fj7ngNCja6 09lMCvuueVn29DY0cIQUDA7mKT269nGPz3zWcQr0xtRmpytRFfjtL6Dlp8oMD9m7Wh/a L77w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972707; x=1700577507; 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=7bjOOh298/gVm20zFogtcW7Ag9vjCtjGY9z1KnDRo3U=; b=w8bqbv6wcg/PS91gw/KmmgIHNF68EXfWtYOd2ALDiNcch6Tc4oxdxzO9SMlKYlrVLP v1RPIgnmVgf2ueIZkH2hhKc2TxhBQY1PWYuqalxY/LsapzKoepfELICreAek1mSk0z0p 8Z4inPnDR7vmRQPwgMGzKtdGjqYiGRN/8yFgCoU6pO0RxoIQVf9Xslzzc6OPvO+nhVtn aWZzAWZrtjJlb1ilqrpyl/28Y3OtUYjWVMZ9sG9vkllAeOEtDTGKY7Vzs9+f1N3NF5qK Mc2J1vX5HyYk0nVw0Jz1ODJOdl8qDpN2TZupPO4i3xdQoVnTS2zDoRuJkeFPZS0WnrPA PstQ== X-Gm-Message-State: AOJu0YyLR9ub33KB8amQzoApLB1FYx8tY8gwL6/ROcpvfRFn9z/mUacc UfrPL4ChWQ0gwU62Ld7s8FFmBA== X-Google-Smtp-Source: AGHT+IGmC/f0NBuJq3lX6zmQbmq53YN/p3zW7ekfEdUOO96zzY8Hw2NKquJgt5a7Y31IS7pqqhAiDQ== X-Received: by 2002:a17:906:e084:b0:9c6:64be:a3c9 with SMTP id gh4-20020a170906e08400b009c664bea3c9mr7562718ejb.39.1699972707580; Tue, 14 Nov 2023 06:38:27 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id v21-20020a1709064e9500b009df5d874ca7sm5636254eju.23.2023.11.14.06.38.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:38:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PATCH-for-9.0 v2 01/19] tests/avocado: Add 'guest:xen' tag to tests running Xen guest Date: Tue, 14 Nov 2023 15:37:57 +0100 Message-ID: <20231114143816.71079-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a tag to run all Xen-specific tests using: $ make check-avocado AVOCADO_TAGS='guest:xen' Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- tests/avocado/boot_xen.py | 3 +++ tests/avocado/kvm_xen_guest.py | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/avocado/boot_xen.py b/tests/avocado/boot_xen.py index fc2faeedb5..f7f35d4740 100644 --- a/tests/avocado/boot_xen.py +++ b/tests/avocado/boot_xen.py @@ -61,6 +61,9 @@ def launch_xen(self, xen_path): class BootXen(BootXenBase): + """ + :avocado: tags=guest:xen + """ def test_arm64_xen_411_and_dom0(self): """ diff --git a/tests/avocado/kvm_xen_guest.py b/tests/avocado/kvm_xen_guest.py index 5391283113..63607707d6 100644 --- a/tests/avocado/kvm_xen_guest.py +++ b/tests/avocado/kvm_xen_guest.py @@ -22,6 +22,7 @@ class KVMXenGuest(QemuSystemTest, LinuxSSHMixIn): :avocado: tags=arch:x86_64 :avocado: tags=machine:q35 :avocado: tags=accel:kvm + :avocado: tags=guest:xen :avocado: tags=kvm_xen_guest """ From patchwork Tue Nov 14 14:37:58 2023 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: 13455435 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4F5641749 for ; Tue, 14 Nov 2023 14:38:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wFWKca9Y" Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F59173C for ; Tue, 14 Nov 2023 06:38:35 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5409bc907edso8776941a12.0 for ; Tue, 14 Nov 2023 06:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972714; x=1700577514; darn=vger.kernel.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=r7OOTLwbh53U5+FgsPEU5EGeXSv4SaNpAAr4X/+o3UA=; b=wFWKca9YzdgRIktqGSmPdVOBQhv5b+AQgcbXZ/5TH3q8teOReqy7UwznHNG8eZIxfv 3aZs9sOiB31o9YQ9LXGD1Lhn8ZN5Ak0bs166xn1euYsm/DFNgOOLB4hEEjewcL1DDT4a Qn/rUiX86yWYRcJ6VpkKaL3gIVvFc9erfrorIlbKs3ndWcepHDFeGQLwoKDC9vo9AzEP WKvxE3MTx0cSmfyicl4D6GQurnMBbizNUHI2KTKB3YQByVHfAUVvLHfxQO1EhF57o+5U qAoolUHu8Plz7bccG+0fF4CKIde8SVC5XvSBB1MP+X4RF9Pt72JKm0TbL/CX7u47F2eX nQMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972714; x=1700577514; 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=r7OOTLwbh53U5+FgsPEU5EGeXSv4SaNpAAr4X/+o3UA=; b=m+CyDQQDejQfMXpAuCj8g926UEbmbdXI4jdy5HP9k3dYDMEkYnF8SC9HOAZfgIZmio sgcnXLamvvXGyh9Qbi8l5PVDCc3vMqPXwzlaZSqfBOBj2bk93tqsa5WANMgGqJMPJhob wXUCstCyT30Y+SlIMrOfvB1BcW0D0S3Yfisue9r+NWypu2CUhmZCQHo9AhTVLCIs6sIC frPTUCwbgaOqrMrutvxiIq7I2gIgTtobNgCPNDGGxCkkVg0HgUfnS/1kkXldZCrZHK2F bXNs4e+5hO9aIF6O8YURE/CgsmElAzBL67wrOy0Ds1AyHCZVIP9e5c4RyMsNXnanYu6m EfVA== X-Gm-Message-State: AOJu0YxUT42WkRVr5Upjp2DmtVSoGUyzG2WYtV85O62G62a5P2wFwt4t ZumdBAYVASZthkKiD/3SiryKfg== X-Google-Smtp-Source: AGHT+IELhzs9bxNKpuVpMav1CIPsLfztJ8ibvFnuauNtaNuW/pX7cLT4uf7lQThdsPSioUMrMZEBQA== X-Received: by 2002:a17:906:ca5b:b0:9be:30c2:b8ff with SMTP id jx27-20020a170906ca5b00b009be30c2b8ffmr7193715ejb.61.1699972713904; Tue, 14 Nov 2023 06:38:33 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id ha17-20020a170906a89100b009dd8473559dsm5543525ejb.110.2023.11.14.06.38.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:38:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 v2 02/19] sysemu/xen: Forbid using Xen headers in user emulation Date: Tue, 14 Nov 2023 15:37:58 +0100 Message-ID: <20231114143816.71079-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xen is a system specific accelerator, it makes no sense to include its headers in user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: David Woodhouse --- include/sysemu/xen.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h index bc13ad5692..a9f591f26d 100644 --- a/include/sysemu/xen.h +++ b/include/sysemu/xen.h @@ -10,6 +10,10 @@ #ifndef SYSEMU_XEN_H #define SYSEMU_XEN_H +#ifdef CONFIG_USER_ONLY +#error Cannot include sysemu/xen.h from user emulation +#endif + #include "exec/cpu-common.h" #ifdef NEED_CPU_H @@ -26,16 +30,13 @@ extern bool xen_allowed; #define xen_enabled() (xen_allowed) -#ifndef CONFIG_USER_ONLY void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length); void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, struct MemoryRegion *mr, Error **errp); -#endif #else /* !CONFIG_XEN_IS_POSSIBLE */ #define xen_enabled() 0 -#ifndef CONFIG_USER_ONLY static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) { /* nothing */ @@ -45,7 +46,6 @@ static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, { g_assert_not_reached(); } -#endif #endif /* CONFIG_XEN_IS_POSSIBLE */ From patchwork Tue Nov 14 14:37:59 2023 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: 13455436 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71A274174F for ; Tue, 14 Nov 2023 14:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Uv9VV2Zk" Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C43D4B for ; Tue, 14 Nov 2023 06:38:42 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-53e04b17132so8861668a12.0 for ; Tue, 14 Nov 2023 06:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972720; x=1700577520; darn=vger.kernel.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=kBdIXHGvx5/0R2xC8Q+GilhuZtCQOtnJ9hpGFyppJEE=; b=Uv9VV2Zkny1SjVtm6tIagaw90v/mpvSDVxWQD4QVt/v68BTJA10UT7BzbJ/9xZUbBy cV2OKjT8a5R3Wxh5TdnbfhnuG5n93R4erY8lCPP9QzEtDFp4yyoGtg/X6klsjKwavBPJ H+kfkGZCbgp9hrgDzbsnA9s8vuiy78pgIu8TYTrYVCfoVT101WLIj5rlgxl+QVrQVwRK p5LOY8EPEndCsBpqR2WxtnE1rLCNrbRwRNSOuWeuPNuZZf5ZB85mkH3ccj4lhy5It3I2 CTsV4sg/NsyQ5AIG+W2WHwhIl1Jfhv3/Ir72quH7aupwC0NcNwwZYh+Z8F2pQWxUP9tR BI2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972720; x=1700577520; 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=kBdIXHGvx5/0R2xC8Q+GilhuZtCQOtnJ9hpGFyppJEE=; b=Sf+o/bTC0Vj5l6MvoAMkO1Te4jFhNcwKAj6M8yE/Ba5wdeit7p1nsZ3I7OATtKgUjT A4Ytyv1bNWQjGP9sb5zFUvFe4mhuuVNBpUzwpLMw5Au9Rmu6ZY00a9lJx7qL70XsRDPL LlW528JKM0U5VutZI9w27NXpvmIufXrj/N3hG0CWEQqkGBgUUXSGCXz+6a6ZJx7lEY0n K5B+LtLqQNwWhpQByFosk+fpdyZKlK3Z+5hsDHgdpWBjOjssfOBfpqba1C27FzUGVbMP LmkQspjwF+RBbAg1i1E0c23qo1ZS77LcwTghKLrJQRbwPWLUmoeImEzlHvjGO2eA+wCo v9dA== X-Gm-Message-State: AOJu0Yxy734po7xUPfMBND98bArhRunJ9I1W+ELcYHe4X21WhTzcE6Gz OW31K9qyGawWBo2Ia11Dr7ni3g== X-Google-Smtp-Source: AGHT+IFii/vTCRNAFXoxhgp7tKdZ5NzaA4D0hMTO7kCC4hnZ5p3PauJ+Zda1OHH5OQndb4HCu48Kbw== X-Received: by 2002:a17:906:6b97:b0:9d2:e2f6:45b2 with SMTP id l23-20020a1709066b9700b009d2e2f645b2mr7411114ejr.71.1699972720502; Tue, 14 Nov 2023 06:38:40 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id j2-20020a170906094200b009ad7fc17b2asm5613097ejd.224.2023.11.14.06.38.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:38:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 v2 03/19] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE Date: Tue, 14 Nov 2023 15:37:59 +0100 Message-ID: <20231114143816.71079-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 "sysemu/xen.h" defines CONFIG_XEN_IS_POSSIBLE as a target-agnostic version of CONFIG_XEN accelerator. Use it in order to use "sysemu/xen-mapcache.h" in target-agnostic files. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- include/sysemu/xen-mapcache.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/sysemu/xen-mapcache.h b/include/sysemu/xen-mapcache.h index c8e7c2f6cf..10c2e3082a 100644 --- a/include/sysemu/xen-mapcache.h +++ b/include/sysemu/xen-mapcache.h @@ -10,10 +10,11 @@ #define XEN_MAPCACHE_H #include "exec/cpu-common.h" +#include "sysemu/xen.h" typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr phys_offset, ram_addr_t size); -#ifdef CONFIG_XEN +#ifdef CONFIG_XEN_IS_POSSIBLE void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque); From patchwork Tue Nov 14 14:38:00 2023 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: 13455437 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB95441748 for ; Tue, 14 Nov 2023 14:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oR+q2E2h" Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA72D198B for ; Tue, 14 Nov 2023 06:38:48 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-54366784377so8748477a12.3 for ; Tue, 14 Nov 2023 06:38:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972727; x=1700577527; darn=vger.kernel.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=UVR+oDiuZU+TW6PLxAmD0Xj/DK6BF5fQU92EHH5K3Z4=; b=oR+q2E2h+BVzvH9q0zzS5CpWKgcvy7Y1YBzVAeaTK/vkAeR6F+Y/QIiLwkuXi1C0fp 59HTK7+5h0cbgNzWy+6OXycxsZk9qfvsxUZvgOLqhfjrd8HzQHds2Q+siIhnDV+tGdFI 6Cv3Ij5sgGMwZZdEbl92+dvlc3zVOOAXq80PEiTwA5F7FRidmZj1WxEq1ZI3saO8XUE2 ydlgD9a9MUSCQhk4GRcLFhH76gtvqwguI1R1w3vIayxGvsnxX8xJpRAcoQ8beXMN6xLV c7iejFmvg1WVvL+3GMvdNQghQn8yCF4rHIGGoHYliL8p6wQR+2VAiPNyAGDdd15veSNv SVlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972727; x=1700577527; 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=UVR+oDiuZU+TW6PLxAmD0Xj/DK6BF5fQU92EHH5K3Z4=; b=uJKBvbsHNkkltKRHElzkQpZJk0mwUGew5U5NrRUp8zZS9gP1NIb/ZeGBP1pTrh02ae PhiBw5AYZ1RrCU4Isxzgd/FK/2KBGuumL5IaJj7LjyFCnSlulINNjflNNFLUekB1XOmy 7S2v5sGI9o8wwFHQgMXi1nRkV4802bqUde+6WCrvfJ4E4LcPEEiXyvrdVFnhVrBMXU8m Uma4QqXWob9YqPajPS5+5hZVr0py6l+AlVuVtQoXQ1iwqvLhsFENvOClyAGtnorm1MCL l7NVeG52lpLDsyuE5PHS04qEv8G0G3Tbeag7ko+NKNVJkcnAH7H4XPJVit4jGLzXZzfI N5zw== X-Gm-Message-State: AOJu0YynZFBw9gy9R+MRV2tyYM3x9nv1J/3Nuqbq5hdlFPSh6yzRw4rv wCFQbH0OM1kcAlZ5aOA5y07mlw== X-Google-Smtp-Source: AGHT+IFU6fMqnyRTdYcaSZcZeeOvXEQ5/pqyJPjwVu+SyaMG1cEZXv2HxBOf7hgBnVZ045SVB8RX8Q== X-Received: by 2002:aa7:c759:0:b0:543:5a91:a8b2 with SMTP id c25-20020aa7c759000000b005435a91a8b2mr7512514eds.19.1699972727421; Tue, 14 Nov 2023 06:38:47 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id m13-20020a50930d000000b0053e3d8f1d9fsm5267242eda.67.2023.11.14.06.38.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:38:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , David Hildenbrand Subject: [PATCH-for-9.0 v2 04/19] system/physmem: Do not include 'hw/xen/xen.h' but 'sysemu/xen.h' Date: Tue, 14 Nov 2023 15:38:00 +0100 Message-ID: <20231114143816.71079-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 physmem.c doesn't use any declaration from "hw/xen/xen.h", it only requires "sysemu/xen.h" and "system/xen-mapcache.h". Suggested-by: David Woodhouse Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Reviewed-by: David Hildenbrand --- system/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/physmem.c b/system/physmem.c index fc2b0fee01..04630711d2 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -35,7 +35,7 @@ #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/boards.h" -#include "hw/xen/xen.h" +#include "sysemu/xen.h" #include "sysemu/kvm.h" #include "sysemu/tcg.h" #include "sysemu/qtest.h" From patchwork Tue Nov 14 14:38:01 2023 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: 13455438 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D0F941743 for ; Tue, 14 Nov 2023 14:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gdZNic/G" Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A7BA1980 for ; Tue, 14 Nov 2023 06:38:55 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-9d2e7726d5bso856279766b.0 for ; Tue, 14 Nov 2023 06:38:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972734; x=1700577534; darn=vger.kernel.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=xuAolXSNCEGrTS5m5CRvskBDG9NQVZE3kWB97Se1m9g=; b=gdZNic/GvjcgDIlpoGbOXtXRJlRFeKOcLARDnSefMwfY8bF0OmVyl0WQx2zIjNp1ZC OvDuuYH4Ay5wvpHRHdT5fDsiXrHaplfJv3KMIyeWooQzJjNM6ywSqNdbyFX73dntwHJw 3GYNlO4W1Z/m/acFa/IQ9Tdn2Qq/yFN7tlDNG3f+Tmz4jSfO0LwJZNFj3pIt2y4u8cIH I4olfrdXCMOTPZ+tny8vlw1PCoA0bAbD0kjqD2mlRDPVVpMmGPcAlWiNZGyCi1GVaf7X Ft/ZsnzNrqCKxN962ce9GJoTkpV1buvULlNfMUrJrWzRITxQoqk3K7wWg95BjZ9W+9HE afHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972734; x=1700577534; 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=xuAolXSNCEGrTS5m5CRvskBDG9NQVZE3kWB97Se1m9g=; b=ctXlA9jg/Fmc96tvC0+VEWSzS+PvZpRj9Bp56LCHEJ5Ft4C+ZN1ff66v9X2WR6s/s7 IRxF9+GpHTEpNB/cmmZ6UD2iA8doApgnyjoAL90dyRN82pWIw8nkvj/dOZAEnxXewDwM arSV9vbUnVMo53XqEgCZmQp6H3ucXrKhNavdkTAfn6LvTb45lteOQuTwzyowbd+eBmis skaHkyxKwsaMzNU6ReGd6j0a3+PkKA3Hfil6qS/aoL4gl44Aj35zuZZB5hLUgy93U4c1 IgDrwkejgwsunl/VSeq/szAWBbFaNl3oLxN6FRDhG1VzYnnzZVDFq0YSBWMQWcA9Dg3C dSCw== X-Gm-Message-State: AOJu0YxD3v7lV7n3uIX64jgnTfBbjik7opmsW8j4MeIBVECTfInSCZta /mVAgWQ2ljnKiMTCjLuq1Ad4Hg== X-Google-Smtp-Source: AGHT+IEd2vTLeg2GpIsCyOKyOB5sACh8KieliOs//U/3JH0fTJ/5IoDfAGItJdrYHg+Wv8sdCg7VbA== X-Received: by 2002:a17:906:b78c:b0:9bf:f20:8772 with SMTP id dt12-20020a170906b78c00b009bf0f208772mr7590866ejb.26.1699972733904; Tue, 14 Nov 2023 06:38:53 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id un1-20020a170907cb8100b009a9fbeb15f5sm5549367ejc.46.2023.11.14.06.38.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:38:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH-for-9.0 v2 05/19] hw/display: Restrict xen_register_framebuffer() call to Xen Date: Tue, 14 Nov 2023 15:38:01 +0100 Message-ID: <20231114143816.71079-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Only call xen_register_framebuffer() when Xen is enabled. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anthony PERARD --- hw/display/vga.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index 37557c3442..f9cf3d6f77 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "sysemu/reset.h" +#include "sysemu/xen.h" #include "qapi/error.h" #include "hw/core/cpu.h" #include "hw/display/vga.h" @@ -2223,7 +2224,9 @@ bool vga_common_init(VGACommonState *s, Object *obj, Error **errp) return false; } vmstate_register_ram(&s->vram, s->global_vmstate ? NULL : DEVICE(obj)); - xen_register_framebuffer(&s->vram); + if (xen_enabled()) { + xen_register_framebuffer(&s->vram); + } s->vram_ptr = memory_region_get_ram_ptr(&s->vram); s->get_bpp = vga_get_bpp; s->get_offsets = vga_get_offsets; From patchwork Tue Nov 14 14:38:02 2023 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: 13455439 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C59EE41746 for ; Tue, 14 Nov 2023 14:39:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WR7pGy3/" Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C6F01FD9 for ; Tue, 14 Nov 2023 06:39:02 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-545ed16b137so8049511a12.1 for ; Tue, 14 Nov 2023 06:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972740; x=1700577540; darn=vger.kernel.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=A2i2PCnBLcbag3MdE1ImS65uDPosS8yIjq0X323T5yY=; b=WR7pGy3/lEwF9HSN3ataHNSjGbe67kB8HorCDX5kKmnNJKHtcPygLQ1H8e98v1fhqD P4CJSsDZD7p4MDJrkchbHYOtpWZifbcD8yvwHy1mYvNijXzjsUV8mq4zPMclIIKDYKa4 nM3pFB2MqVF75+hStQQgABNJQiEYO1qLSsgzONgr/hzOdFDs6caP1c/5lRzj+RNcQxAJ hYgLKqVU4+hpXhzoUOm1T0L1zYz7b950600EtQxxGJSsjSjOCdlrw9Kt1kk7Nn679S4N n4Lmj+viB6u2OPP3GChiA4FqCTucZkV3qfkwT8F1X6APEQJ92/CLigCoZSuV+BZYVjws UkrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972740; x=1700577540; 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=A2i2PCnBLcbag3MdE1ImS65uDPosS8yIjq0X323T5yY=; b=P/CDCuUEZpMFLH7Lee3ayTL8vKnwr638mWrk1JFuk3WmZilnW1czxxorXF/2BnAzbb TLwj/Jwmtz26wtUg0dcIj9tdV4yu4riiz9Q5SIOBTXYqI9Nc8mesIVMQ+SRgivwQH7G2 I4UHkOa2ITiOfgmVgeLbbaOoQk8LoshiXBa7iY4rkbwuVmLh3owKVuBdJPPk1Ud+9aTh kasRQ0x28+VJp3wV7HbYU95d1xZLT2WCshDDMC7UMx6+rUluxj45OvJtnbo2CjtQ5rjR sp4xmcN6mN3r1u/Q1TJJqWoGoJ/KNWKC55Tah6OCQqttSAN70pUF3lEpFyiaOkehGqPx hiOA== X-Gm-Message-State: AOJu0YzCIohbresofaf9+5KAIaSU2uF/Wd+hn/rDdVA+lrXROMfybrED qmovfv3rjd9ebE8TViX1+eqHXA== X-Google-Smtp-Source: AGHT+IHSJfSbRj04/mwMI7ongNHq1l4+SKd+JSAzh7MEswy3END/JCbC/d/lhlupvrq+nM36Jvq7cA== X-Received: by 2002:a50:fb14:0:b0:53d:eca8:8775 with SMTP id d20-20020a50fb14000000b0053deca88775mr7423669edq.26.1699972740609; Tue, 14 Nov 2023 06:39:00 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id b21-20020aa7d495000000b0054353639161sm5133902edr.89.2023.11.14.06.38.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH-for-9.0 v2 06/19] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen Date: Tue, 14 Nov 2023 15:38:02 +0100 Message-ID: <20231114143816.71079-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Similarly to the restriction in hw/pci/msix.c (see commit e1e4bf2252 "msix: fix msix_vector_masked"), restrict the xen_is_pirq_msi() call in msi_is_masked() to Xen. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- hw/pci/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/msi.c b/hw/pci/msi.c index 041b0bdbec..8104ac1d91 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -23,6 +23,7 @@ #include "hw/xen/xen.h" #include "qemu/range.h" #include "qapi/error.h" +#include "sysemu/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -308,7 +309,7 @@ bool msi_is_masked(const PCIDevice *dev, unsigned int vector) } data = pci_get_word(dev->config + msi_data_off(dev, msi64bit)); - if (xen_is_pirq_msi(data)) { + if (xen_enabled() && xen_is_pirq_msi(data)) { return false; } From patchwork Tue Nov 14 14:38:03 2023 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: 13455440 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A72DB4174A for ; Tue, 14 Nov 2023 14:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kkz1o2z2" Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8151A173B for ; Tue, 14 Nov 2023 06:39:08 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9d2e7726d5bso856318166b.0 for ; Tue, 14 Nov 2023 06:39:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972747; x=1700577547; darn=vger.kernel.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=oo2mmHUNt8cswMDm2G2tk7NYG50Leech1RMDbe0XTgw=; b=kkz1o2z2Itu6yTNcz2cpsDUKbOT1Oal2bSvG7/AoCCAxyUdTVoPrLs56ysvardQxgZ ILTV1GLLpNI4jwCcQuzwhbd7fTEqfzHX9OGBSxA0z3UQRLXqEDbIfqoxHjF9N7mNP4xh npKNFUedNQNTfJjA5SWFxYA2KTu3aqeAkqtsNnUy0qg3H94JJiTfBGU8lBoB6Xlu6tFI PZNMeWe3Kbkx7gKJ5bGEyNGBFwPAig8zNsh6FJmcrer4xqQJsJv3XUFtmzufQxuWXHXX tLm8oeT1yPGn9x+DBixfBLESLk5lO/S+vCgw9wJCcKXiWBhNOTIUEIpUD0a82Q0KE2Lq 7Yxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972747; x=1700577547; 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=oo2mmHUNt8cswMDm2G2tk7NYG50Leech1RMDbe0XTgw=; b=Mx0wJ1AlDTpFYHF2MZbSRTbnZsQKDDaqoO8dGofKOgDVaJa5pWM6R1NdmaBcCbIv15 ovtVq8NEjZ3DxYrI3VK1vuve8FjbFHP4kspQj/bVk3XVMv903e0BUj2p776ugqG+Suq0 OpvAF22382xuQ3afe1Fqpnn3Wm6nfdYg4f27EWa81bU9vj1imL1f1T0v/4kbGqufO0Zd 9oDaTqobxdPSEEFAVg+O0spLhkXLtNEfIprL4fd13BwIJ05vMlr3UzjGfSEXBvpGqB6J ii5Pqoz1xoFlw/N4B2Dn/hCNXUVnBwljQfE3TcGUlNn5Q5JET8p0ofENRMXdU/o0JMC8 Cu7w== X-Gm-Message-State: AOJu0YwoAWh9REP+9AuEZAvYa7ZmFKeKZhLRWa8zp7ywWmfYKvm6htcC D7OapTlyRf01PnzFaZZxpWijIg== X-Google-Smtp-Source: AGHT+IFJHEre72B5jboKAaroDeSDmy2A+msHyepV3IUCtazYitevtMIyD1yfonucyI3qP3HjOGn0kg== X-Received: by 2002:a17:906:45a:b0:9c7:56ee:b6e5 with SMTP id e26-20020a170906045a00b009c756eeb6e5mr6778901eja.40.1699972747032; Tue, 14 Nov 2023 06:39:07 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id m13-20020a170906234d00b00997e00e78e6sm5591697eja.112.2023.11.14.06.39.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 v2 07/19] hw/xen: Remove unnecessary xen_hvm_inject_msi() stub Date: Tue, 14 Nov 2023 15:38:03 +0100 Message-ID: <20231114143816.71079-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since commit 04b0de0ee8 ("xen: factor out common functions") xen_hvm_inject_msi() stub is not required. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- stubs/xen-hw-stub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stubs/xen-hw-stub.c b/stubs/xen-hw-stub.c index 7d7ffe83a9..6cf0e9a4c1 100644 --- a/stubs/xen-hw-stub.c +++ b/stubs/xen-hw-stub.c @@ -24,10 +24,6 @@ int xen_set_pci_link_route(uint8_t link, uint8_t irq) return -1; } -void xen_hvm_inject_msi(uint64_t addr, uint32_t data) -{ -} - int xen_is_pirq_msi(uint32_t msi_data) { return 0; From patchwork Tue Nov 14 14:38:04 2023 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: 13455441 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39D7D41235 for ; Tue, 14 Nov 2023 14:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GsDWmE5M" Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B23A8D6E for ; Tue, 14 Nov 2023 06:39:15 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9becde9ea7bso1375256066b.0 for ; Tue, 14 Nov 2023 06:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972754; x=1700577554; darn=vger.kernel.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=MhpN1sNxh5OOZ/KSUE3Y0jUPmEpPW/hS+3a5vlda+P4=; b=GsDWmE5Mag4wtJBIR1S2l9OJevfGpRVhzKLwM/rkQWHQ1jjeA2nhyi50HAG905BxLo zBCL/1PV4I0U38K2czP95ECg2Hzf92OZ/67kamKKxHkKkKbMVqDhbWNZsm8zypiJsU6d gIQlKHsXLrjVsvb7Gy6JMCxFoLnYI2+Sn+AiG2UJd6nA84xv5rgyXqUkNu789hM4xGll yji0BDevkdX0dK9hHm2QORAbnZlkp9QOuO8dlwRr6F53KspfN56OdZBLO83PsD5j38lV z6LFY6tw3EX8Lda7NhND0v6GyT43ScwYNLU0Dpxpn9qPX5aNP5NXkEX3/OuSZ0js7/bp anug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972754; x=1700577554; 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=MhpN1sNxh5OOZ/KSUE3Y0jUPmEpPW/hS+3a5vlda+P4=; b=OerZZ8sZ/leuPCZ5zUZGqVAjLECTBJaK/Yxkpe0QTCUp6nB4B584sDaQvbNFZ7oyYZ zn1Ks1XyGi3orpp79gc4LsIZFtEnsAo3k077JPthynJ/zF1OVO7WYzOsXMSPhhZ1dtlO MEZ+BRyQk4XhNBcys3AEex82XcDbDCdy08eI7r/zPp127wpNYM4sj9FrQ+gL/O3GD7Ci lJkbPs5PT28B0ELwI5gUA9lULLcUc34QlbsFoxiBQ5Hs+XvcPCsA7EV7Fe+Lr30N8Jlt 0SDfyS/FMrXJs/VfIGX54nIg5UohGc65m8ClKd7z7bu7zIWBLd/ZYwUH+7kihgLNYaQL ewAg== X-Gm-Message-State: AOJu0YyTgzXe5DGUxA4NwOdXbo01bibK9q05NRrvoSgKiSV4fTy09PDb 9/jPhkPZpaYkNsM2qUgnpz+hng== X-Google-Smtp-Source: AGHT+IEBPsAFKv3TcvW/4lHrf4Ji7dOfSz7fvZ7L1HUiABJvwud/gdEB/1UIkKrwYaMtMuFVPwAlYw== X-Received: by 2002:a17:906:bf45:b0:9e5:1db7:3199 with SMTP id ps5-20020a170906bf4500b009e51db73199mr3052455ejb.4.1699972753957; Tue, 14 Nov 2023 06:39:13 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id g4-20020a1709064e4400b009e609088c09sm5584953ejw.1.2023.11.14.06.39.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 v2 08/19] hw/xen: Remove unused Xen stubs Date: Tue, 14 Nov 2023 15:38:04 +0100 Message-ID: <20231114143816.71079-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 All these stubs are protected by a 'if (xen_enabled())' check. Signed-off-by: Philippe Mathieu-Daudé --- stubs/xen-hw-stub.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/stubs/xen-hw-stub.c b/stubs/xen-hw-stub.c index 6cf0e9a4c1..53c6a6f2a0 100644 --- a/stubs/xen-hw-stub.c +++ b/stubs/xen-hw-stub.c @@ -8,36 +8,12 @@ #include "qemu/osdep.h" #include "hw/xen/xen.h" -#include "hw/xen/xen-x86.h" - -int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) -{ - return -1; -} - -void xen_intx_set_irq(void *opaque, int irq_num, int level) -{ -} - -int xen_set_pci_link_route(uint8_t link, uint8_t irq) -{ - return -1; -} int xen_is_pirq_msi(uint32_t msi_data) { return 0; } -qemu_irq *xen_interrupt_controller_init(void) -{ - return NULL; -} - void xen_register_framebuffer(MemoryRegion *mr) { } - -void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion **ram_memory) -{ -} From patchwork Tue Nov 14 14:38:05 2023 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: 13455442 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7187841748 for ; Tue, 14 Nov 2023 14:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="I4Ulp5/v" Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37812114 for ; Tue, 14 Nov 2023 06:39:22 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9becde9ea7bso1375282166b.0 for ; Tue, 14 Nov 2023 06:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972760; x=1700577560; darn=vger.kernel.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=UNMQSJ9n3HwpNaurQlo3tUtiIa6U/WmLwhKlbRCATs0=; b=I4Ulp5/vp5DjC68RrjwLH64SvFRq1P/P6ylDBXfmgUwn4bWpt2Hxc7fdQD1TuLIAC5 8gPvJr9tIwWvDrigjTkr+Ixh+gWSjQiWFFXrtaIKqV5WI9bFHiINvFFL7zOHvUEe5Ml0 sIgp4OplAnmgC9Rp7WxmfSDn6kUUqDPhR1MmUx/XGGrmz0ClNiDLcTCVHV0EOaMfoDjq xPjceqqyMR8LnCWvTJpi07fLt9cq9OFUgiU3JPwqPxUNAjVwUKsnK3G5QxT6v6xp53ZU lrBbGaVHFH+5pHi9Esbr/unabxe/s29TltyCsrvY4lEdTsWy7FQ/4ajhFkgawTfMxcUp WUnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972760; x=1700577560; 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=UNMQSJ9n3HwpNaurQlo3tUtiIa6U/WmLwhKlbRCATs0=; b=VMG+i6HnLEfeYZTzM1Wz3W19grCv3WUMY3Zf8CqsHdt2jZi3VItg4U14y+DoUrZ8pi dLCHBqBCQp3kctb5776ppV+loYzQWyxPtMS1JApHBxgkOjypJWfZTZ5Iu3+HVJA6ixYL DNEIO88+9aSLXvCfM2ELZseYZpllKIhD5yVIV2LsOJDkBLnl/Zog7FQ7jccdaqB818WB 6SaiSj1EQ776dPieYKD9YEdtwOfW0HqZa9YFeyIyP8FaO2EihtTQ0d0mxS7SEzuKpIV2 xizBZw6D1L1VPdugP/OV7J9enzRTR06W6ZxvIEuP7SrFPyOHWBrC6UgDELAfkosfwnsa IdCA== X-Gm-Message-State: AOJu0Yx6YS/PpbuWSwUkk5UvZvg4UmtcvHVAkW+aIWrw7aTG4vWlJAsu DuAsrRr2PswoB8a4e0vki6hrow== X-Google-Smtp-Source: AGHT+IEprkHMikBtwTk6Pc2HglM2aACFqynKnIxKilr0MgI5mWMBku8mpMF5XwofVv89mcZ1ndbJxA== X-Received: by 2002:a17:906:d7b2:b0:9ef:b466:abe0 with SMTP id pk18-20020a170906d7b200b009efb466abe0mr1430110ejb.8.1699972760684; Tue, 14 Nov 2023 06:39:20 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id rp13-20020a170906d96d00b009ddb919e0aasm5622830ejb.138.2023.11.14.06.39.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz Subject: [RFC PATCH-for-9.0 v2 09/19] hw/block/xen_blkif: Align structs with QEMU_ALIGNED() instead of #pragma Date: Tue, 14 Nov 2023 15:38:05 +0100 Message-ID: <20231114143816.71079-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Except imported source files, QEMU code base uses the QEMU_ALIGNED() macro to align its structures. Signed-off-by: Philippe Mathieu-Daudé --- hw/block/xen_blkif.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h index 99733529c1..c1d154d502 100644 --- a/hw/block/xen_blkif.h +++ b/hw/block/xen_blkif.h @@ -18,7 +18,6 @@ struct blkif_common_response { }; /* i386 protocol version */ -#pragma pack(push, 4) struct blkif_x86_32_request { uint8_t operation; /* BLKIF_OP_??? */ uint8_t nr_segments; /* number of segments */ @@ -26,7 +25,7 @@ struct blkif_x86_32_request { uint64_t id; /* private guest value, echoed in resp */ blkif_sector_t sector_number; /* start sector idx on disk (r/w only) */ struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; -}; +} QEMU_ALIGNED(4); struct blkif_x86_32_request_discard { uint8_t operation; /* BLKIF_OP_DISCARD */ uint8_t flag; /* nr_segments in request struct */ @@ -34,15 +33,14 @@ struct blkif_x86_32_request_discard { uint64_t id; /* private guest value, echoed in resp */ blkif_sector_t sector_number; /* start sector idx on disk (r/w only) */ uint64_t nr_sectors; /* # of contiguous sectors to discard */ -}; +} QEMU_ALIGNED(4); struct blkif_x86_32_response { uint64_t id; /* copied from request */ uint8_t operation; /* copied from request */ int16_t status; /* BLKIF_RSP_??? */ -}; +} QEMU_ALIGNED(4); typedef struct blkif_x86_32_request blkif_x86_32_request_t; typedef struct blkif_x86_32_response blkif_x86_32_response_t; -#pragma pack(pop) /* x86_64 protocol version */ struct blkif_x86_64_request { From patchwork Tue Nov 14 14:38:06 2023 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: 13455443 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 158894123C for ; Tue, 14 Nov 2023 14:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="c1Yh6aSh" Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 907201B5 for ; Tue, 14 Nov 2023 06:39:29 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-507a98517f3so7531577e87.0 for ; Tue, 14 Nov 2023 06:39:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972768; x=1700577568; darn=vger.kernel.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=BqgJC9hPHkcXARLwNhCfo2KLP+5VvJiIzbHQjbp4PnI=; b=c1Yh6aShjZoPuVGLu7HGWvocpI8dpq3/aYgkpPmU+Gk+Wr3fdra3WTuXAJH9VlQ4RB LCeLf3HyT1Wiyyod6TRxvYWhtLWAMeJVWqu8pszmqhlrzoa9xNjOe0IL7gpUY0kWjUXa PhtcIfk3Mj+R8fXmTqmgXYyPo+CWm3pxfjJc1DuVG4AWzsqqKYfRgFUKkl49rE2ZHJqN fOhcf06MKYadaqyobc8hILriqOQ7BRZisQSWeoMhxjOAp7HpvUBKkzTPAJR7DAEJU13J o9C6a0AN7gvsjoxxtpBuMsS9HELMWBA0A9Oaf3QZWRm/sgdbDJ9QonnqOC5toh1tqBh3 HakQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972768; x=1700577568; 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=BqgJC9hPHkcXARLwNhCfo2KLP+5VvJiIzbHQjbp4PnI=; b=uQN8fgmhRgSX20Z+IY/Zj2i8W8EgjazrelQEBMA4ivlUpiyc191YVxYjLbcDZEiFnQ qnlnfEwwvoVuAjnI3+K3lablx+3YOxT2FRYwDuMSQC6fcAZ61mN9D2ljOFfZf4RJVMvl KQXYgr04K54x42dWTSy4mUV4ZQwtiwr2SIQx9PmM+xPqK3kHrHcI3Yzc39TQHC/sNuMI oHF3Aw43cGJu5eGj0bg1lDcoBnL7amqyZMYqhksD8Z7cMEuPe5tpMSgNkxIZi/qS+0jn 3HkjheciEfUMk5tG3JOFtOOVmEzbjWQV4uR6fSZIgD55s/eD1dx8xCSTWECZlh07XpQq COug== X-Gm-Message-State: AOJu0YyxFLIqNneVQNWaaoNwK02jT6TxpFOtwF/S1/PTo2+EOT1iLf/g O0xxb0/x2iFvnJb0PWzoznwTlg== X-Google-Smtp-Source: AGHT+IG5cdmuSMLF1QQ3nk9d4MKQ+Rf9u6gyzBn2OUTA0N6PdU8Lc7kj9gwB2wtfxvTcro7nwctRJA== X-Received: by 2002:a05:6512:3d90:b0:507:9a49:2d3d with SMTP id k16-20020a0565123d9000b005079a492d3dmr7641727lfv.31.1699972767814; Tue, 14 Nov 2023 06:39:27 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id c19-20020a50f613000000b00542d3e470f9sm5256915edn.10.2023.11.14.06.39.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH-for-9.0 v2 10/19] hw/xen: Rename 'ram_memory' global variable as 'xen_memory' Date: Tue, 14 Nov 2023 15:38:06 +0100 Message-ID: <20231114143816.71079-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To avoid a potential global variable shadow in hw/i386/pc_piix.c::pc_init1(), rename Xen's "ram_memory" as "xen_memory". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- include/hw/xen/xen-hvm-common.h | 2 +- hw/arm/xen_arm.c | 6 +++--- hw/i386/xen/xen-hvm.c | 10 +++++----- hw/xen/xen-hvm-common.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-common.h index 4e9904f1a6..d3fa5ed29b 100644 --- a/include/hw/xen/xen-hvm-common.h +++ b/include/hw/xen/xen-hvm-common.h @@ -16,7 +16,7 @@ #include "qemu/error-report.h" #include -extern MemoryRegion ram_memory; +extern MemoryRegion xen_memory; extern MemoryListener xen_io_listener; extern DeviceListener xen_device_listener; diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index a5631529d0..8a185da193 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -111,17 +111,17 @@ static void xen_init_ram(MachineState *machine) block_len = GUEST_RAM1_BASE + ram_size[1]; } - memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len, + memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len, &error_fatal); - memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &ram_memory, + memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory, GUEST_RAM0_BASE, ram_size[0]); memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo); DPRINTF("Initialized region xen.ram.lo: base 0x%llx size 0x%lx\n", GUEST_RAM0_BASE, ram_size[0]); if (ram_size[1] > 0) { - memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &ram_memory, + memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory, GUEST_RAM1_BASE, ram_size[1]); memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi); DPRINTF("Initialized region xen.ram.hi: base 0x%llx size 0x%lx\n", diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index f42621e674..1ae943370b 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -149,12 +149,12 @@ static void xen_ram_init(PCMachineState *pcms, */ block_len = (4 * GiB) + x86ms->above_4g_mem_size; } - memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len, + memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len, &error_fatal); - *ram_memory_p = &ram_memory; + *ram_memory_p = &xen_memory; memory_region_init_alias(&ram_640k, NULL, "xen.ram.640k", - &ram_memory, 0, 0xa0000); + &xen_memory, 0, 0xa0000); memory_region_add_subregion(sysmem, 0, &ram_640k); /* Skip of the VGA IO memory space, it will be registered later by the VGA * emulated device. @@ -163,12 +163,12 @@ static void xen_ram_init(PCMachineState *pcms, * the Options ROM, so it is registered here as RAM. */ memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", - &ram_memory, 0xc0000, + &xen_memory, 0xc0000, x86ms->below_4g_mem_size - 0xc0000); memory_region_add_subregion(sysmem, 0xc0000, &ram_lo); if (x86ms->above_4g_mem_size > 0) { memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", - &ram_memory, 0x100000000ULL, + &xen_memory, 0x100000000ULL, x86ms->above_4g_mem_size); memory_region_add_subregion(sysmem, 0x100000000ULL, &ram_hi); } diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 565dc39c8f..cf4053c9f2 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -9,7 +9,7 @@ #include "hw/boards.h" #include "hw/xen/arch_hvm.h" -MemoryRegion ram_memory; +MemoryRegion xen_memory; void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, Error **errp) @@ -26,7 +26,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, return; } - if (mr == &ram_memory) { + if (mr == &xen_memory) { return; } @@ -53,7 +53,7 @@ static void xen_set_memory(struct MemoryListener *listener, { XenIOState *state = container_of(listener, XenIOState, memory_listener); - if (section->mr == &ram_memory) { + if (section->mr == &xen_memory) { return; } else { if (add) { From patchwork Tue Nov 14 14:38:07 2023 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: 13455444 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5BFC41750 for ; Tue, 14 Nov 2023 14:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xHU+YqVU" Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CA38185 for ; Tue, 14 Nov 2023 06:39:36 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9d0b4dfd60dso855575766b.1 for ; Tue, 14 Nov 2023 06:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972774; x=1700577574; darn=vger.kernel.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=6XE67RaqwP19rEjPR9cmWaIkbDnma1jGWKj3qDcuG2M=; b=xHU+YqVU95cmfV0IASuDjHDx6kTp201HyOYJsSF0au9qdZpRfolyHYwaZvplv9b4J7 cX+4gZUv1zzWH0Cz+hyWQEBy6IarMLIcpKz5BdaAUm6ORR88MDMynQRWwkDdQYOlCwqA pt60KaLDMM4KZ5bOWJDGzRFPT8umZRyvJ9O46xJ24hH3Lp8wBvVqAlwT9OOLteNp0oGW WkUBfC/PMzdHf1pZJgbjsRfF5vdfXCQkZVDK10Ly6gl3isrXfUNkQ8WYS4M8MuRGJHvP tCOE9ZF184ayuB7b+gv/YfRRo8mFnCrygGxhMNqh5OpWrO/IQ/b4xAsO/M12XEN5qhAx 5mRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972774; x=1700577574; 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=6XE67RaqwP19rEjPR9cmWaIkbDnma1jGWKj3qDcuG2M=; b=LL6QgYLsPYnEBScT9qGjEB9DWYUvOuhC5pLCxn/aJz1Q5eMkl1/peHMkbALEKMHZEy qSpvL4hNYS0M2W7UHP8Z0BPlsBqEKajWWaZvSbSAIExXZYDNGOGbqTmRM+RtapKUjmMM mGIkuG5alCRIH66uhXBxtW2H6D0bBki6xG4i3eUqI/8+jkD19wGtcnL26X1EXFEq/AN1 bk7X+szVg60WpWMrIr5vxFK/+BwSELbRMwjwcANAOU/9YLyyAH9GMqMr5PhdO7qEmW+y MtGeQZoJflRmHg1c4D3Do5DNdBgdwJNhrsdoaQXLSPhpJ2IkKc16odLfr99+UrGY6DWT pwVQ== X-Gm-Message-State: AOJu0Yx3nFQAHJ8CyP/gqdL0xWAIEFV6qtEWuKjbi5K5PlebDGddhDIj vksN4Z1XCo2bYEPoH+55uZT4sQ== X-Google-Smtp-Source: AGHT+IH5uADtxqVb0gu9wkOPtm794L9VQ3NjNtPGCuhDFtQMH4f3XXf2p8ohPfBbgEKWHzCsn1iRrg== X-Received: by 2002:a17:906:899:b0:9df:e457:cef6 with SMTP id n25-20020a170906089900b009dfe457cef6mr5737290eje.77.1699972774671; Tue, 14 Nov 2023 06:39:34 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id qx25-20020a170906fcd900b0098e34446464sm5684531ejb.25.2023.11.14.06.39.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , "Michael S. Tsirkin" , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH-for-9.0 v2 11/19] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix Date: Tue, 14 Nov 2023 15:38:07 +0100 Message-ID: <20231114143816.71079-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use a common 'xen_arch_' prefix for architecture-specific functions. Rename xen_arch_set_memory() and xen_arch_handle_ioreq(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Reviewed-by: Richard Henderson Acked-by: Anthony PERARD --- include/hw/arm/xen_arch_hvm.h | 4 ++-- include/hw/i386/xen_arch_hvm.h | 4 ++-- hw/arm/xen_arm.c | 4 ++-- hw/i386/xen/xen-hvm.c | 6 +++--- hw/xen/xen-hvm-common.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/hw/arm/xen_arch_hvm.h b/include/hw/arm/xen_arch_hvm.h index 8fd645e723..6a974f2020 100644 --- a/include/hw/arm/xen_arch_hvm.h +++ b/include/hw/arm/xen_arch_hvm.h @@ -2,8 +2,8 @@ #define HW_XEN_ARCH_ARM_HVM_H #include -void arch_handle_ioreq(XenIOState *state, ioreq_t *req); -void arch_xen_set_memory(XenIOState *state, +void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req); +void xen_arch_set_memory(XenIOState *state, MemoryRegionSection *section, bool add); #endif diff --git a/include/hw/i386/xen_arch_hvm.h b/include/hw/i386/xen_arch_hvm.h index 1000f8f543..2822304955 100644 --- a/include/hw/i386/xen_arch_hvm.h +++ b/include/hw/i386/xen_arch_hvm.h @@ -4,8 +4,8 @@ #include #include "hw/xen/xen-hvm-common.h" -void arch_handle_ioreq(XenIOState *state, ioreq_t *req); -void arch_xen_set_memory(XenIOState *state, +void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req); +void xen_arch_set_memory(XenIOState *state, MemoryRegionSection *section, bool add); #endif diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 8a185da193..bf19407879 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -129,14 +129,14 @@ static void xen_init_ram(MachineState *machine) } } -void arch_handle_ioreq(XenIOState *state, ioreq_t *req) +void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req) { hw_error("Invalid ioreq type 0x%x\n", req->type); return; } -void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, +void xen_arch_set_memory(XenIOState *state, MemoryRegionSection *section, bool add) { } diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 1ae943370b..5150984e46 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -659,8 +659,8 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp) } } -void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, - bool add) +void xen_arch_set_memory(XenIOState *state, MemoryRegionSection *section, + bool add) { hwaddr start_addr = section->offset_within_address_space; ram_addr_t size = int128_get64(section->size); @@ -700,7 +700,7 @@ void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, } } -void arch_handle_ioreq(XenIOState *state, ioreq_t *req) +void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req) { switch (req->type) { case IOREQ_TYPE_VMWARE_PORT: diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index cf4053c9f2..cf6ed11f70 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -65,7 +65,7 @@ static void xen_set_memory(struct MemoryListener *listener, } } - arch_xen_set_memory(state, section, add); + xen_arch_set_memory(state, section, add); } void xen_region_add(MemoryListener *listener, @@ -452,7 +452,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req) cpu_ioreq_config(state, req); break; default: - arch_handle_ioreq(state, req); + xen_arch_handle_ioreq(state, req); } if (req->dir == IOREQ_READ) { trace_handle_ioreq_read(req, req->type, req->df, req->data_is_ptr, From patchwork Tue Nov 14 14:38:08 2023 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: 13455445 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B5F041753 for ; Tue, 14 Nov 2023 14:39:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xM02bfnw" Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76F521B9 for ; Tue, 14 Nov 2023 06:39:43 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5440f25dcc7so8731460a12.0 for ; Tue, 14 Nov 2023 06:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972782; x=1700577582; darn=vger.kernel.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=jzmBSObK1PNYaVxHm2kQdQrWhNegSVRCuy1/LpCCkxs=; b=xM02bfnwTVc9M44TeBHymVpy4I/dItFSYS/ukKo/c8srP7MyLDTsf5s8louuwVe3PR FAkh1Gk0p/xDBIWEMUguX4b8cqcmNFbABUH6wnxaqqaVvYl6Nkrg2ljfIx0hXUtsw9LV qGZG0HTJl7lvMYfYDBFOEoAU9/7OCvj0jPonLyhbvbFe09iDl0GGqh4reKZtZG3B6QJ/ FrsU4J7dXjcFZrBFl/YjCH56Kuts2XHl4rYesMNZgqLER2cAhfNoiKwVfsgUP2OrDsKM 37USgl3yVSrMkiLbtFH3uGpd8Tqw4XMInys0zzPupD1qprafzrVmqP/N75ipr8gGBR7r NGBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972782; x=1700577582; 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=jzmBSObK1PNYaVxHm2kQdQrWhNegSVRCuy1/LpCCkxs=; b=IO1Zj6UlTatbztwtaFuJpSk2UeEqDbYSc8y0RX5PC7XGBulP7o1u9pJAGyDGKLfm3G YKXJ0K/xwAP1rI0CUDd0QmN/XF0vNlcqY1+i7Ez20KDpMVNC//TLzux5cM2tTStkH8mS UlK6fBtsjqeIur3Ku7wCMaXG7TYqN+cQFMoM84gn5DgJyfN2l3PC3O5+twgQXtYuWlDF BNI1IFBGYA29tZJzrb5BVczp8YdQqH83dG6Q2Z75QbysOmAG6whuuMAA694ZKKh6n1u7 cm04pdWZlIak+Fgr82jFuWQ28It71535nhWLe1effH4Q8iE34S3o57gvEZ0vmCOZzIkM ijrA== X-Gm-Message-State: AOJu0Yyr2s9Yj0mub84dcFe1gTHCxhKyjIcHvJETpJlCumhzTvQnKJnh u09dPcZmpJb8MVPNPHxsRyLbLg== X-Google-Smtp-Source: AGHT+IExeFq34FYS8TGI99eGSAGJR2PT8yf3hsSWiq8DkOxV7jzDuNfy8kK0Izfgi0PzWhH+ZoIHKg== X-Received: by 2002:aa7:d050:0:b0:540:3286:d2e8 with SMTP id n16-20020aa7d050000000b005403286d2e8mr7060069edo.18.1699972781909; Tue, 14 Nov 2023 06:39:41 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id k25-20020aa7c059000000b0053dd8898f75sm5155063edo.81.2023.11.14.06.39.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH-for-9.0 v2 12/19] hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h' Date: Tue, 14 Nov 2023 15:38:08 +0100 Message-ID: <20231114143816.71079-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We don't need a target-specific header for common target-specific prototypes. Declare xen_arch_handle_ioreq() and xen_arch_set_memory() in "hw/xen/xen-hvm-common.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Reviewed-by: Richard Henderson Acked-by: Anthony PERARD --- include/hw/arm/xen_arch_hvm.h | 9 --------- include/hw/i386/xen_arch_hvm.h | 11 ----------- include/hw/xen/arch_hvm.h | 5 ----- include/hw/xen/xen-hvm-common.h | 6 ++++++ hw/arm/xen_arm.c | 1 - hw/i386/xen/xen-hvm.c | 1 - hw/xen/xen-hvm-common.c | 1 - 7 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 include/hw/arm/xen_arch_hvm.h delete mode 100644 include/hw/i386/xen_arch_hvm.h delete mode 100644 include/hw/xen/arch_hvm.h diff --git a/include/hw/arm/xen_arch_hvm.h b/include/hw/arm/xen_arch_hvm.h deleted file mode 100644 index 6a974f2020..0000000000 --- a/include/hw/arm/xen_arch_hvm.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef HW_XEN_ARCH_ARM_HVM_H -#define HW_XEN_ARCH_ARM_HVM_H - -#include -void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req); -void xen_arch_set_memory(XenIOState *state, - MemoryRegionSection *section, - bool add); -#endif diff --git a/include/hw/i386/xen_arch_hvm.h b/include/hw/i386/xen_arch_hvm.h deleted file mode 100644 index 2822304955..0000000000 --- a/include/hw/i386/xen_arch_hvm.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef HW_XEN_ARCH_I386_HVM_H -#define HW_XEN_ARCH_I386_HVM_H - -#include -#include "hw/xen/xen-hvm-common.h" - -void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req); -void xen_arch_set_memory(XenIOState *state, - MemoryRegionSection *section, - bool add); -#endif diff --git a/include/hw/xen/arch_hvm.h b/include/hw/xen/arch_hvm.h deleted file mode 100644 index c7c515220d..0000000000 --- a/include/hw/xen/arch_hvm.h +++ /dev/null @@ -1,5 +0,0 @@ -#if defined(TARGET_I386) || defined(TARGET_X86_64) -#include "hw/i386/xen_arch_hvm.h" -#elif defined(TARGET_ARM) || defined(TARGET_ARM_64) -#include "hw/arm/xen_arch_hvm.h" -#endif diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-common.h index d3fa5ed29b..8934033eaa 100644 --- a/include/hw/xen/xen-hvm-common.h +++ b/include/hw/xen/xen-hvm-common.h @@ -96,4 +96,10 @@ void xen_register_ioreq(XenIOState *state, unsigned int max_cpus, const MemoryListener *xen_memory_listener); void cpu_ioreq_pio(ioreq_t *req); + +void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req); +void xen_arch_set_memory(XenIOState *state, + MemoryRegionSection *section, + bool add); + #endif /* HW_XEN_HVM_COMMON_H */ diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index bf19407879..6b0e396502 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -33,7 +33,6 @@ #include "sysemu/sysemu.h" #include "hw/xen/xen-hvm-common.h" #include "sysemu/tpm.h" -#include "hw/xen/arch_hvm.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh") OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 5150984e46..0fbe720c8f 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -21,7 +21,6 @@ #include "qemu/range.h" #include "hw/xen/xen-hvm-common.h" -#include "hw/xen/arch_hvm.h" #include static MemoryRegion ram_640k, ram_lo, ram_hi; diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index cf6ed11f70..bb3cfb200c 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -7,7 +7,6 @@ #include "hw/xen/xen-hvm-common.h" #include "hw/xen/xen-bus.h" #include "hw/boards.h" -#include "hw/xen/arch_hvm.h" MemoryRegion xen_memory; From patchwork Tue Nov 14 14:38:09 2023 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: 13455446 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73F6141750 for ; Tue, 14 Nov 2023 14:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="o3Npxwaz" Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A773D5C for ; Tue, 14 Nov 2023 06:39:50 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-507cee17b00so7592768e87.2 for ; Tue, 14 Nov 2023 06:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972788; x=1700577588; darn=vger.kernel.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=x5X2FluBMHtEHwLVURbcbmArZUeMN34wqMB+9uG3SGg=; b=o3Npxwaz9s6hA78UQ/Qd8X+pBDW/IodaRz6FH7xFXGkVqEQ3S0d1cVY3ziEgOAQuR4 ZHpXu+GQ1eZ8dKlD9yaS8tSaTpIZq3Rnm2HhkYOUosA3mOYk6gQN5GOBK5VHEHaeUR9f HDsBxctU3zVj67QDKkJ69C6ZE0d/Q5h65Zqm3mjVgk62ZmMQQFCakioM96W3uIoD7+vJ oBBF8liBPkwjtIASsIBMonsP7jcn7hFY/qqUTspzD07Q0f3Y4yDwdRPGzrIgGLZE2Ujk 8uTbJOW+0agwHi/XbERwjeYKIerUG71YSmvKgbIXL95KEAG/ENWEp02cxx3bHc/xf22q zNzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972788; x=1700577588; 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=x5X2FluBMHtEHwLVURbcbmArZUeMN34wqMB+9uG3SGg=; b=jEYglzb/DlS9+omwWFHyUkC1BexdF8/TxbEyXsaoaqxIJLQDZQeVCh6RjCvw2KHGWq MN6q7dHFHfkNtmhyALqztCzCatVoNshGUX6KHJMdr7pzOrZTYJrmqH+TX8JYxRIfYrSR K2FrQEAQ1ixHv+1knyQZq2K6QTQLNu834smufHD8/EmB+lgriDlzF4AcA/w24rwgr4Ll pNZ2tRHRcsgyWoTkQKxvXP5h9goVPyokVyTviU4zKLCMrl/xf/4f69sAM2XgpTvmFZac aPXSU2mN/EJReQTbCmRQDD4UOHf/UyJzPOR6yJcwjHh920y6obYPlKadvLJNxvyRc3Jb V8+w== X-Gm-Message-State: AOJu0Yyu7QLLiuHHlqUtgzbbItXzynvMIKjaWF5eHeRvDJyeMg9Rmq4n 0nFTSaq6QXutKMJpThEPRL6yoA== X-Google-Smtp-Source: AGHT+IEJ1DzMQPrVK6vmcQ1s/BHFe+ZR138ty+E3IEfmXhpEvhlt8hMy3AYRKnboRNNE1Pe2RYsE2w== X-Received: by 2002:a05:6512:b14:b0:509:8e3d:7cb0 with SMTP id w20-20020a0565120b1400b005098e3d7cb0mr9400030lfu.41.1699972788532; Tue, 14 Nov 2023 06:39:48 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id l18-20020a50d6d2000000b00542db304680sm5268842edj.63.2023.11.14.06.39.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-9.0 v2 13/19] hw/xen: Remove use of 'target_ulong' in handle_ioreq() Date: Tue, 14 Nov 2023 15:38:09 +0100 Message-ID: <20231114143816.71079-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Per commit f17068c1c7 ("xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common"), handle_ioreq() is expected to be target-agnostic. However it uses 'target_ulong', which is a target specific definition. Per xen/include/public/hvm/ioreq.h header: struct ioreq { uint64_t addr; /* physical address */ uint64_t data; /* data (or paddr of data) */ uint32_t count; /* for rep prefixes */ uint32_t size; /* size in bytes */ uint32_t vp_eport; /* evtchn for notifications to/from device model */ uint16_t _pad0; uint8_t state:4; uint8_t data_is_ptr:1; /* if 1, data above is the guest paddr * of the real data to use. */ uint8_t dir:1; /* 1=read, 0=write */ uint8_t df:1; uint8_t _pad1:1; uint8_t type; /* I/O type */ }; typedef struct ioreq ioreq_t; If 'data' is not a pointer, it is a u64. - In PIO / VMWARE_PORT modes, only 32-bit are used. - In MMIO COPY mode, memory is accessed by chunks of 64-bit - In PCI_CONFIG mode, access is u8 or u16 or u32. - None of TIMEOFFSET / INVALIDATE use 'req'. - Fallback is only used in x86 for VMWARE_PORT. Masking the upper bits of 'data' to keep 'req->size' low bits is irrelevant of the target word size. Remove the word size check and always extract the relevant bits. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anthony PERARD --- hw/xen/xen-hvm-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index bb3cfb200c..fb81bd8fbc 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -1,5 +1,6 @@ #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/bitops.h" #include "qapi/error.h" #include "trace.h" @@ -426,9 +427,8 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req) trace_handle_ioreq(req, req->type, req->dir, req->df, req->data_is_ptr, req->addr, req->data, req->count, req->size); - if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) && - (req->size < sizeof (target_ulong))) { - req->data &= ((target_ulong) 1 << (8 * req->size)) - 1; + if (!req->data_is_ptr && (req->dir == IOREQ_WRITE)) { + req->data = extract64(req->data, 0, BITS_PER_BYTE * req->size); } if (req->dir == IOREQ_WRITE) From patchwork Tue Nov 14 14:38:10 2023 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: 13455447 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE0754174E for ; Tue, 14 Nov 2023 14:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lWtMoWwY" Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BDC310D for ; Tue, 14 Nov 2023 06:39:56 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9df8d0c2505so1150163666b.0 for ; Tue, 14 Nov 2023 06:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972795; x=1700577595; darn=vger.kernel.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=R1LXi3GoLl/gkTzQsgGS9qqbGm09JIagG9772ckn2qA=; b=lWtMoWwYSJXjwoJOFHq05ry/Y8EgDgwVTS4YeTppe+cZZ+1KOORfUr5Z9luc0iFgKc KEzOv2AxoYuKvnF6QDexCePDqE6Kyhm70RzHt+HGHlNqfr0ToORDqayLWJZhyz6BXVzr EWTaZFQgSlDMBeyZZvduqpSqHxZIETF9+khxkoE+X4CrTKoM+ecgm3xoGElNiBpqcCee hydEWfTjfH/chcoFnf1NBi6pLDcJIJl8P0jX82ldMy0nioqnVPx/YlDUe5kdc+k2bnM1 Dn+vDjsHfRL0S9kAuyBAPvCcPtqyGOgXUK68h4+w8r5EOcEOKofkNTNnnBCzGxaQ+RwO gioQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972795; x=1700577595; 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=R1LXi3GoLl/gkTzQsgGS9qqbGm09JIagG9772ckn2qA=; b=kSZq7NXo6nwGdbuCC4FT3OQXMZRdT+OdRcOd8bl83qpyvz0iFlLY5mnehc22D/sBb9 RWKbIy5rp2OF/xo+muv5fI0n1Hjbj6xjEZxlJcECyMYQGKpJmlGxJNQJBacXtFVFeK5D fIjmDM5zR/w+mJ7FATCoTSXAl0NyM7yjacvs42mqHZHHiBRKteUqoVVPy2yOvXgxA5E/ kT0bmkokFGLUVFAR9H10QWkIVUHEr+tUoU5LuVJvLyfZKvP4Zuc56ZQAKuyQk7nd2n8I vJ+pawy1zfroRKVFeYvHP6o/r+pnLPyS6PnPb7byeybYMBd78puLd2NyYFTl5TuQKc3O e4UQ== X-Gm-Message-State: AOJu0Yz7O1UXhNjsUWSFNC968kfZ+t20BofJcUW+urtMdVWfIVdh8Bk1 6Q5pi4cISUIv0m/LzTUnj4wptg== X-Google-Smtp-Source: AGHT+IFO0v0Kbx5mK0/IVC1YCc6AdDt4TudkiuPrPaddeZvjZPoy7Sp5UUV1A0HKtR5wjcSegxv9ZQ== X-Received: by 2002:a17:906:e51:b0:9ba:b5:cba6 with SMTP id q17-20020a1709060e5100b009ba00b5cba6mr2289558eji.14.1699972795126; Tue, 14 Nov 2023 06:39:55 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id e10-20020a170906080a00b009a193a5acffsm5624675ejd.121.2023.11.14.06.39.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 v2 14/19] hw/xen: Use target-agnostic qemu_target_page_bits() Date: Tue, 14 Nov 2023 15:38:10 +0100 Message-ID: <20231114143816.71079-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of the target-specific TARGET_PAGE_BITS definition, use qemu_target_page_bits() which is target agnostic. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: David Woodhouse --- hw/xen/xen-hvm-common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index fb81bd8fbc..73fa2c414d 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -2,6 +2,7 @@ #include "qemu/units.h" #include "qemu/bitops.h" #include "qapi/error.h" +#include "exec/target_page.h" #include "trace.h" #include "hw/pci/pci_host.h" @@ -14,6 +15,7 @@ MemoryRegion xen_memory; void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, Error **errp) { + unsigned target_page_bits = qemu_target_page_bits(); unsigned long nr_pfn; xen_pfn_t *pfn_list; int i; @@ -32,11 +34,11 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, trace_xen_ram_alloc(ram_addr, size); - nr_pfn = size >> TARGET_PAGE_BITS; + nr_pfn = size >> target_page_bits; pfn_list = g_new(xen_pfn_t, nr_pfn); for (i = 0; i < nr_pfn; i++) { - pfn_list[i] = (ram_addr >> TARGET_PAGE_BITS) + i; + pfn_list[i] = (ram_addr >> target_page_bits) + i; } if (xc_domain_populate_physmap_exact(xen_xc, xen_domid, nr_pfn, 0, 0, pfn_list)) { From patchwork Tue Nov 14 14:38:11 2023 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: 13455448 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3B4A4174F for ; Tue, 14 Nov 2023 14:40:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KnhyAbya" Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81323D50 for ; Tue, 14 Nov 2023 06:40:03 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-53d8320f0easo8830043a12.3 for ; Tue, 14 Nov 2023 06:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972802; x=1700577602; darn=vger.kernel.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=vfmEPJkfg9xcA7W0yB07+uhlzLrR51RZZmvLOIuALj0=; b=KnhyAbyagKPjTnwE6rGubFAZz4qz4fyt8LDRu1PknKppD26ApLIW/KsWajMWT9YEOE wuaO72FVSzQvWkHga/jIDT4B7EdNzdxj3iI1HC4sMgg8beAewtavRGAixAjl79V6PClf /XzTo8o0ULEM/tHHKS5kQba5wSlW8YX8knbX4i2VUO44Vote8LAxgy/TbFuk4PgN0v47 KIX2QGCciWe8tsekGCsvq8wOQkk127kv8qyCFeHlUlTblthr2WAQpLXNWtX0mXwZ8c2t hdixWAsPeaAfHNiQ0KTd4ykwwdvIJAHvQ3xKPaLiHjHqxBxDKrISblINgFIkFlp9W/Ra i+xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972802; x=1700577602; 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=vfmEPJkfg9xcA7W0yB07+uhlzLrR51RZZmvLOIuALj0=; b=coydYU4lTDAEzGqfX90fYx8qpKHdO6aaZro8n0t0rpRei+4E6TRDlagW3SRg3pB1G7 U/U1rFKEwXLciiLCOk08ZgCkvphhnx30aVOKM/EOZjLS6C9PcOEvAngjMTfuxFt1Xg3f EwgRwzb/hut+G8sNtatu20Raht63yX3igJJYIr52OdhTw7E8chh5YtFfRnop6M1HfLTa qHQiutpQtuhW5v4Hz3NKFZndqF59VdA/oxA8V2ss87Lg1jv/gAGp0QtC+kOdXSex6I0T K7r2fkzV3DYWcpgpRXbtHpUkCMKJWCCeMVKp1tBA665iR8wPg0ULsDCTzA51n57hXOIp gMkA== X-Gm-Message-State: AOJu0Ywfbe/mV7IyTcdFo2JnURvPv67OTfUZFgztVWEVXhMAK8hXoDWj IaD6tWTLDNON99a8XIRkDm1vhw== X-Google-Smtp-Source: AGHT+IFr1fCG0rC/823Fjj2RnGPLFEJJu5Vypm0crh2s8xGJ38WYt9mRvWNiRlcZ2yw4Up2Qw1V1LQ== X-Received: by 2002:aa7:d704:0:b0:53d:e0cf:cb95 with SMTP id t4-20020aa7d704000000b0053de0cfcb95mr7775616edq.21.1699972802002; Tue, 14 Nov 2023 06:40:02 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id r30-20020a50aade000000b005434e3d8e7bsm5309632edc.1.2023.11.14.06.39.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:40:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH-for-9.0 v2 15/19] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources Date: Tue, 14 Nov 2023 15:38:11 +0100 Message-ID: <20231114143816.71079-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We rarely need to include "cpu.h" in headers. Including it 'taint' headers to be target-specific. Here only the i386/arm implementations requires "cpu.h", so include it there and remove from the "hw/xen/xen-hvm-common.h" *common* header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: David Woodhouse Acked-by: Anthony PERARD --- include/hw/xen/xen-hvm-common.h | 1 - hw/arm/xen_arm.c | 1 + hw/i386/xen/xen-hvm.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-common.h index 8934033eaa..83ed16f425 100644 --- a/include/hw/xen/xen-hvm-common.h +++ b/include/hw/xen/xen-hvm-common.h @@ -4,7 +4,6 @@ #include "qemu/osdep.h" #include "qemu/units.h" -#include "cpu.h" #include "hw/pci/pci.h" #include "hw/hw.h" #include "hw/xen/xen_native.h" diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 6b0e396502..b478d74ea0 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -33,6 +33,7 @@ #include "sysemu/sysemu.h" #include "hw/xen/xen-hvm-common.h" #include "sysemu/tpm.h" +#include "cpu.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh") OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 0fbe720c8f..f1c30d1384 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -22,6 +22,7 @@ #include "hw/xen/xen-hvm-common.h" #include +#include "cpu.h" static MemoryRegion ram_640k, ram_lo, ram_hi; static MemoryRegion *framebuffer; From patchwork Tue Nov 14 14:38:12 2023 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: 13455449 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DCB04174E for ; Tue, 14 Nov 2023 14:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="K7b1OCsa" Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DE561BE for ; Tue, 14 Nov 2023 06:40:10 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9be02fcf268so853489766b.3 for ; Tue, 14 Nov 2023 06:40:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972808; x=1700577608; darn=vger.kernel.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=CAcrCtDRFE27SgAEHRwd23jK5KSLpjZ+znXdyGAiZas=; b=K7b1OCsaQXPdOfk3pYBZtqd1sPvaWvF0D8VS8CHocI1GYIeBo4Vwdxvwd3rYoD3+Yq 4pbW7ttPnwDogpK++YjagpiNSNHXi3gbjktM8KT1vYYJMfqou2UPypWs/JtJZoxRUB/O aZahISvvg7h3loIpUwhSddZr1g6bP4EiT/K9mvWPidVeL4T5hFlyAgrRBFxpYRDyD9UT tn139J2mn39C9i2qLhZzeIP5c09QGGYgmixddtPNoBpjhNExaYZyL5kW4oKHieCbQyms mykM56l6P8Fl1GhUTHs4gzVftfK00bzYugamWebS2+dzwLlqufkNlHKoOsBrpiaCtiB5 sZUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972808; x=1700577608; 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=CAcrCtDRFE27SgAEHRwd23jK5KSLpjZ+znXdyGAiZas=; b=gugQSZv6794xpibtaYUarj25cQQ9A9DKOuuOPZ4Urv09oRVSvex7TUeNYT8rJG4XGn SyGCSjttRUKk86yESeDfp5Nw6gRYQcN6EOs9lyWlAKMnX4TwRGjNw7ahASZ17jCZvnJf yN0DJKOUxwyJe/DYyfVmViJk2Z6WA6uqPsHquxIICmVwf/vBYAPtAGZr9ixUrrNIr1gJ IQH+bsMWo7+QedtdaKmpWPfYMNdRCJwdTXJp+kqbIKDT/Ei9yO6LwiKJj8VdOSPL/Acr RnaWvdvYQid6x6/LeYRdyMebPt0dUZGlMAoYWAj3yNvgYjypz5yG10V2P9XhsePsFC88 o16g== X-Gm-Message-State: AOJu0YxFkkMMu/QUHtjjxalRNjtFSQo8PHvxin2gRwxFGWBNXWOogo3X f64C1NqsUURnA2hwuN9P+2NXyA== X-Google-Smtp-Source: AGHT+IFRbdN3aM58BgezwVky3EFK69MoaorjbUe4txfqvi/Mr07fntHT95KnMqBlE8Dz9TGy0ZX5tw== X-Received: by 2002:a17:907:9848:b0:9dd:5adc:b1d2 with SMTP id jj8-20020a170907984800b009dd5adcb1d2mr6678484ejc.38.1699972808614; Tue, 14 Nov 2023 06:40:08 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id y10-20020a1709064b0a00b009dd7bc622fbsm5606206eju.113.2023.11.14.06.40.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:40:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 v2 16/19] hw/xen/xen_pt: Add missing license Date: Tue, 14 Nov 2023 15:38:12 +0100 Message-ID: <20231114143816.71079-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit eaab4d60d3 ("Introduce Xen PCI Passthrough, qdevice") introduced both xen_pt.[ch], but only added the license to xen_pt.c. Use the same license for xen_pt.h. Suggested-by: David Woodhouse Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Acked-by: Anthony PERARD --- hw/xen/xen_pt.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index 31bcfdf705..d3180bb134 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2007, Neocleus Corporation. + * Copyright (c) 2007, Intel Corporation. + * + * SPDX-License-Identifier: GPL-2.0-only + * + * Alex Novik + * Allen Kay + * Guy Zana + */ #ifndef XEN_PT_H #define XEN_PT_H From patchwork Tue Nov 14 14:38:13 2023 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: 13455450 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96EFF3FE58 for ; Tue, 14 Nov 2023 14:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KKKRjadX" Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED4B7D43 for ; Tue, 14 Nov 2023 06:40:16 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-9be02fcf268so853517566b.3 for ; Tue, 14 Nov 2023 06:40:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972815; x=1700577615; darn=vger.kernel.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=cJTBhe5AIq+piFF54yNuiwKWHopSqD7by2+9eio+MdU=; b=KKKRjadX7rmKAwAlmZNnj3gXC9ig0yHMVqECVPJ00G+J0LfO5HYHZEP+vnGcyboePF EAm2iCH0WBzW4A1CVYOq/X5ZbhaN9NPOSSfiB3yf0m6EXjiHXKY6XBAgnAT3sfKvMxJn bA0wxsrpg4XF246SiROMI/mH/R9Ib67Sb1fTvWrWocJMxnFyKzTYroqVrtUpBSa9O4vQ a2mAtN91m/s/huzgxaR89pZcr6Kx//4cdD4CBchZ/N3fwJakKVbuZPKz9Qy6Ct+XvK/C RRIIVcxKIurbHgLhFJ71rfbt8ly57x37nBIFK0mBpBdRC70tc5/JxdxvexaXAelfNbir Cy1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972815; x=1700577615; 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=cJTBhe5AIq+piFF54yNuiwKWHopSqD7by2+9eio+MdU=; b=SDt2nuTjTiCiDFxvJQYtFYyBXakZXgV33Km0cXFXSeLVC9WOwMazZXV/fTt68MXmqU LT3KGCs0M5Q2vB+oB/yAcNqJfx4Uiyc6YwoYjztVok7+0Fz8CoSTiVdKJ8BOzNtWp2VF Fphk+tRjya4r6V5R7I257yqkdxrGtOklDu8D+JlSUj9g83CLyuCbTJFMxaZY9VzJNAzu E1PslibwGTawVrBzfMov1ldRj8V9QLerZEN7U2rL1i2gvJUTMWL1vUTd9N1tkyYmV2nj XKFJNLeqcngS8gi6sj1OHt3RC8ze74deB6Blr+5YW1vECHPujTsrPwbJu5GJncizqPP3 N/fQ== X-Gm-Message-State: AOJu0Yxjh3qvxVrbuKwfxyJjwvhbYZtvamrk7wHNoJCjSHWT/R/dmdrV bcCMQoKf3W6YM67MUmNuHv8XBA== X-Google-Smtp-Source: AGHT+IE8dPcoX4Dac2Uu05H6YcGwd8wvx56/VSesXpaOIpMKV8Ekj9QVQKSryNOPBDH4ia71GkoHQw== X-Received: by 2002:a17:906:6a1f:b0:9b2:df16:851d with SMTP id qw31-20020a1709066a1f00b009b2df16851dmr9925246ejc.57.1699972815506; Tue, 14 Nov 2023 06:40:15 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id le5-20020a170907170500b00988f168811bsm5631076ejc.135.2023.11.14.06.40.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:40:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH-for-9.0 v2 17/19] hw/xen: Extract 'xen_igd.h' from 'xen_pt.h' Date: Tue, 14 Nov 2023 15:38:13 +0100 Message-ID: <20231114143816.71079-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 "hw/xen/xen_pt.h" requires "hw/xen/xen_native.h" which is target specific. It also declares IGD methods, which are not target specific. Target-agnostic code can use IGD methods. To allow that, extract these methos into a new "hw/xen/xen_igd.h" header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- hw/xen/xen_pt.h | 14 -------------- include/hw/xen/xen_igd.h | 33 +++++++++++++++++++++++++++++++++ accel/xen/xen-all.c | 1 + hw/i386/pc_piix.c | 1 + hw/xen/xen_pt.c | 3 ++- hw/xen/xen_pt_config_init.c | 3 ++- hw/xen/xen_pt_graphics.c | 3 ++- hw/xen/xen_pt_stub.c | 2 +- 8 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 include/hw/xen/xen_igd.h diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index d3180bb134..095a0f0365 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -15,9 +15,6 @@ #include "xen-host-pci-device.h" #include "qom/object.h" -bool xen_igd_gfx_pt_enabled(void); -void xen_igd_gfx_pt_set(bool value, Error **errp); - void xen_pt_log(const PCIDevice *d, const char *f, ...) G_GNUC_PRINTF(2, 3); #define XEN_PT_ERR(d, _f, _a...) xen_pt_log(d, "%s: Error: "_f, __func__, ##_a) @@ -62,12 +59,6 @@ typedef struct XenPTDeviceClass { XenPTQdevRealize pci_qdev_realize; } XenPTDeviceClass; -uint32_t igd_read_opregion(XenPCIPassthroughState *s); -void xen_igd_reserve_slot(PCIBus *pci_bus); -void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val); -void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s, - XenHostPCIDevice *dev); - /* function type for config reg */ typedef int (*xen_pt_conf_reg_init) (XenPCIPassthroughState *, XenPTRegInfo *, uint32_t real_offset, @@ -353,11 +344,6 @@ static inline bool xen_pt_has_msix_mapping(XenPCIPassthroughState *s, int bar) void *pci_assign_dev_load_option_rom(PCIDevice *dev, int *size, unsigned int domain, unsigned int bus, unsigned int slot, unsigned int function); -static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev) -{ - return (xen_igd_gfx_pt_enabled() - && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA)); -} int xen_pt_register_vga_regions(XenHostPCIDevice *dev); int xen_pt_unregister_vga_regions(XenHostPCIDevice *dev); void xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev, diff --git a/include/hw/xen/xen_igd.h b/include/hw/xen/xen_igd.h new file mode 100644 index 0000000000..7ffca06c10 --- /dev/null +++ b/include/hw/xen/xen_igd.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2007, Neocleus Corporation. + * Copyright (c) 2007, Intel Corporation. + * + * SPDX-License-Identifier: GPL-2.0-only + * + * Alex Novik + * Allen Kay + * Guy Zana + */ +#ifndef XEN_IGD_H +#define XEN_IGD_H + +#include "hw/xen/xen-host-pci-device.h" + +typedef struct XenPCIPassthroughState XenPCIPassthroughState; + +bool xen_igd_gfx_pt_enabled(void); +void xen_igd_gfx_pt_set(bool value, Error **errp); + +uint32_t igd_read_opregion(XenPCIPassthroughState *s); +void xen_igd_reserve_slot(PCIBus *pci_bus); +void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val); +void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s, + XenHostPCIDevice *dev); + +static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev) +{ + return (xen_igd_gfx_pt_enabled() + && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA)); +} + +#endif diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 5ff0cb8bd9..0bdefce537 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -15,6 +15,7 @@ #include "hw/xen/xen_native.h" #include "hw/xen/xen-legacy-backend.h" #include "hw/xen/xen_pt.h" +#include "hw/xen/xen_igd.h" #include "chardev/char.h" #include "qemu/accel.h" #include "sysemu/cpus.h" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index eace854335..a607dcb56c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -56,6 +56,7 @@ #ifdef CONFIG_XEN #include #include "hw/xen/xen_pt.h" +#include "hw/xen/xen_igd.h" #endif #include "hw/xen/xen-x86.h" #include "hw/xen/xen.h" diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 36e6f93c37..a8edabdabc 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -59,7 +59,8 @@ #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" -#include "xen_pt.h" +#include "hw/xen/xen_pt.h" +#include "hw/xen/xen_igd.h" #include "hw/xen/xen.h" #include "hw/xen/xen-legacy-backend.h" #include "qemu/range.h" diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index 2b8680b112..ba4cd78238 100644 --- a/hw/xen/xen_pt_config_init.c +++ b/hw/xen/xen_pt_config_init.c @@ -15,7 +15,8 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/timer.h" -#include "xen_pt.h" +#include "hw/xen/xen_pt.h" +#include "hw/xen/xen_igd.h" #include "hw/xen/xen-legacy-backend.h" #define XEN_PT_MERGE_VALUE(value, data, val_mask) \ diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c index 0aed3bb6fd..6c2e3f4840 100644 --- a/hw/xen/xen_pt_graphics.c +++ b/hw/xen/xen_pt_graphics.c @@ -3,7 +3,8 @@ */ #include "qemu/osdep.h" #include "qapi/error.h" -#include "xen_pt.h" +#include "hw/xen/xen_pt.h" +#include "hw/xen/xen_igd.h" #include "xen-host-pci-device.h" static unsigned long igd_guest_opregion; diff --git a/hw/xen/xen_pt_stub.c b/hw/xen/xen_pt_stub.c index 5c108446a8..72feebeb20 100644 --- a/hw/xen/xen_pt_stub.c +++ b/hw/xen/xen_pt_stub.c @@ -6,7 +6,7 @@ */ #include "qemu/osdep.h" -#include "hw/xen/xen_pt.h" +#include "hw/xen/xen_igd.h" #include "qapi/error.h" bool xen_igd_gfx_pt_enabled(void) From patchwork Tue Nov 14 14:38:14 2023 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: 13455451 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14C8D4123E for ; Tue, 14 Nov 2023 14:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KMgbMoZ7" Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 454E810D for ; Tue, 14 Nov 2023 06:40:23 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5431614d90eso8857989a12.1 for ; Tue, 14 Nov 2023 06:40:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972822; x=1700577622; darn=vger.kernel.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=xWc7O88tTfL+IROUfXsM+NSd2X7VWDO4aCdpc797HXc=; b=KMgbMoZ7+JL2XT3qjscUa+Cv6MyGK7c3BCTWVYdHhXaKgVI1fJDW39IaCxava1edtB R8hRyEXFu8nqErrdwrSYF9yK6brF4wCBxQrT9gdEK/34iS+oMDmojmG852H1ZyoN5j2U d6m7n//7IIfbRRCh9K2S35eVTcsCwH1b85mQ4U9wWoqKvrGCAOHSWamXzaytfReoIF3t /sr3oBoCCVl90OzM9trKzczs6kqABWA17Me/WNAES/u/Rv+l56XpHphg94uxyI3LbCNw sndNBoGI9pT2gbBkxIa4lGXGCWrkxQFX1DC+4mjldz7dQ/XbKLf+Iyl9PrkIfCW1GUHN uK5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972822; x=1700577622; 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=xWc7O88tTfL+IROUfXsM+NSd2X7VWDO4aCdpc797HXc=; b=mEGnMbjXhtt9tbjNvNYG6HIe2Ko1xTpWtJ1CZRt1f9uP5WTUiPZHAePZgT/vYnNSTy WM1oxec3qxElLcP63QIv6ABIKsz8b2ZexhLI7kf/Ag6nynZJFOInCBkYusEvcBH4Doc9 j7y9dGLWTH9ryb61fkYDKMk62+LHqpXVxneLAo8Tq8Hze0mxtz1BOPHvE0iPy2nW+wQ2 A+b7X6wo1KFWVsmQButGUKuCzDYi2Pn6miSdtxgFrGx1gNZUH09Pa2wiHRO1sOGQivhU p4CnfU68ohBw5FdaXJGMnl/Kx2NMQMKvMsDfgaUesxoU0VjrYwyKelX8yhbOEVwhiH9z IsCQ== X-Gm-Message-State: AOJu0Yw8SSBDtv7h1NHql1omIgxTSFnji4I4so2K/AMUpA2INYjnS7Bt i/M0yv5+K3hkwUScLfdCR+X+Tw== X-Google-Smtp-Source: AGHT+IHNrn5T4boQ0NzVhZdNm2rxcLbpt1HdZaO6IACtyCbzFgVV5y7RIxXgNNvQBcNbwz/XH0TntA== X-Received: by 2002:a05:6402:518e:b0:543:5c2f:e0e6 with SMTP id q14-20020a056402518e00b005435c2fe0e6mr7401790edd.17.1699972821905; Tue, 14 Nov 2023 06:40:21 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id e29-20020a50d4dd000000b0052e1783ab25sm5343752edj.70.2023.11.14.06.40.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:40:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH-for-9.0 v2 18/19] hw/i386/xen: Compile 'xen-hvm.c' with Xen CPPFLAGS Date: Tue, 14 Nov 2023 15:38:14 +0100 Message-ID: <20231114143816.71079-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 xen-hvm.c calls xc_set_hvm_param() from , so better compile it with Xen CPPFLAGS. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- hw/i386/xen/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build index 3dc4c4f106..3f0df8bc07 100644 --- a/hw/i386/xen/meson.build +++ b/hw/i386/xen/meson.build @@ -1,8 +1,10 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files( - 'xen-hvm.c', 'xen_apic.c', 'xen_pvdevice.c', )) +i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files( + 'xen-hvm.c', +)) i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files( 'xen_platform.c', From patchwork Tue Nov 14 14:38:15 2023 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: 13455452 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 063DA41747 for ; Tue, 14 Nov 2023 14:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="E1PUaRm1" Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761B2185 for ; Tue, 14 Nov 2023 06:40:30 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9d216597f64so867250466b.3 for ; Tue, 14 Nov 2023 06:40:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972829; x=1700577629; darn=vger.kernel.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=85224ACu16xcahxMJd73na2pr08geUP2BaqK8DQk41g=; b=E1PUaRm1NYxy59keC1dubEsXuF91chxN3q/2e3QtP7K0e5DIuXmyWeZ0WDTMwa+4z1 oA8SKd6r20VqeRqr09rExjqsR38forvBdtXa5CKMA275WEMwSbfPEZ/z6RmmoUpGlCPC 9IoeSwSD1gCmn9VXNLoPFPquj/P7Qwvtx9XfcaDi3P61SGeSOthWjUeftHdhpteUzJJB 6kONfCaQCTqoKCq3uYWXHUjbUTh/n3TW+2HTDOAmXfhtk9OEWRVeQVXyRJztAhG0Nr5Z QHaOOci38fUrnAU9sAMfhwDX6l+ikStAUMd2Acj+oAJwojCqbC+dtSo9Zfw+mVHHEQ8+ Mhpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972829; x=1700577629; 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=85224ACu16xcahxMJd73na2pr08geUP2BaqK8DQk41g=; b=mh/BNJfP4cdacLvz1s0UBdr/b11WWOeB5hMI96YQ1qTtgFE8g5NT8/XLqWSpQF0o4n GM/B1EDGJ94YBFMsuCfQTSlErC1VK+kIcOXWrrm80J2Q/Yai3pPDks10IlV2kDRdXUDw tIzqBPexYfmQoGpnbzA/BcMkak73Acvy0WBfTD0x4VMzCHRVThUt1Kaz+NDdEcTJTB6C QcLy3MUpUSTxQy68ymLIMwXiuIp+Whx20fj6chcYizshwaPYqRWojET1sC6sCe3OxT17 WouMXQ8CM8DEucHkSxBZSsuXTHkOgGEUS+vFKwp/kMa84I4X0enlcwKnPd0vegxYFBKu uUsg== X-Gm-Message-State: AOJu0YwZ7lkNqLK+bmP+39AkjIURNYmBpyH3wetuKUPGKZiPZp1Ljbwm RR9SXgO7J7HErzLsYVDw0pbxwg== X-Google-Smtp-Source: AGHT+IE4fe4f8bleIo+ydEdJnHpXElyEFzfSvfuN7IjKmK4sPC2Xb+6oIBNsyuQ4jtW9IDSYhgY52Q== X-Received: by 2002:a17:907:969f:b0:9eb:af0e:39da with SMTP id hd31-20020a170907969f00b009ebaf0e39damr3096379ejc.46.1699972828864; Tue, 14 Nov 2023 06:40:28 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id t25-20020a1709066bd900b0099c53c4407dsm5561943ejs.78.2023.11.14.06.40.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:40:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Kevin Wolf , Hanna Reitz Subject: [PATCH-for-9.0 v2 19/19] hw/xen: Have most of Xen files become target-agnostic Date: Tue, 14 Nov 2023 15:38:15 +0100 Message-ID: <20231114143816.71079-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Previous commits re-organized the target-specific bits from Xen files. We can now build the common files once instead of per-target. Only 4 files call libxen API (thus its CPPFLAGS): - xen-hvm-common.c, - xen_pt.c, xen_pt_graphics.c, xen_pt_msi.c Signed-off-by: Philippe Mathieu-Daudé --- Reworked since v1 so dropping David's R-b tag. --- accel/xen/meson.build | 2 +- hw/block/dataplane/meson.build | 2 +- hw/xen/meson.build | 21 ++++++++++----------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/accel/xen/meson.build b/accel/xen/meson.build index 002bdb03c6..455ad5d6be 100644 --- a/accel/xen/meson.build +++ b/accel/xen/meson.build @@ -1 +1 @@ -specific_ss.add(when: 'CONFIG_XEN', if_true: files('xen-all.c')) +system_ss.add(when: 'CONFIG_XEN', if_true: files('xen-all.c')) diff --git a/hw/block/dataplane/meson.build b/hw/block/dataplane/meson.build index 025b3b061b..4d8bcb0bb9 100644 --- a/hw/block/dataplane/meson.build +++ b/hw/block/dataplane/meson.build @@ -1,2 +1,2 @@ system_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c')) -specific_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c')) +system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c')) diff --git a/hw/xen/meson.build b/hw/xen/meson.build index d887fa9ba4..403cab49cf 100644 --- a/hw/xen/meson.build +++ b/hw/xen/meson.build @@ -7,26 +7,25 @@ system_ss.add(when: ['CONFIG_XEN_BUS'], if_true: files( 'xen_pvdev.c', )) -system_ss.add(when: ['CONFIG_XEN', xen], if_true: files( +system_ss.add(when: ['CONFIG_XEN'], if_true: files( 'xen-operations.c', -)) - -xen_specific_ss = ss.source_set() -xen_specific_ss.add(files( 'xen-mapcache.c', +)) +system_ss.add(when: ['CONFIG_XEN', xen], if_true: files( 'xen-hvm-common.c', )) + if have_xen_pci_passthrough - xen_specific_ss.add(files( + system_ss.add(when: ['CONFIG_XEN'], if_true: files( 'xen-host-pci-device.c', - 'xen_pt.c', 'xen_pt_config_init.c', - 'xen_pt_graphics.c', 'xen_pt_load_rom.c', + )) + system_ss.add(when: ['CONFIG_XEN', xen], if_true: files( + 'xen_pt.c', + 'xen_pt_graphics.c', 'xen_pt_msi.c', )) else - xen_specific_ss.add(files('xen_pt_stub.c')) + system_ss.add(when: ['CONFIG_XEN'], if_true: files('xen_pt_stub.c')) endif - -specific_ss.add_all(when: ['CONFIG_XEN', xen], if_true: xen_specific_ss)