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: 13455421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF5FAC4332F for ; Tue, 14 Nov 2023 14:38:47 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632618.986870 (Exim 4.92) (envelope-from ) id 1r2uYh-0003xP-PC; Tue, 14 Nov 2023 14:38:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632618.986870; Tue, 14 Nov 2023 14:38:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uYh-0003wm-M0; Tue, 14 Nov 2023 14:38:31 +0000 Received: by outflank-mailman (input) for mailman id 632618; Tue, 14 Nov 2023 14:38:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uYg-0003vI-HC for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:38:30 +0000 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [2a00:1450:4864:20::632]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7a023afb-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:38:29 +0100 (CET) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9c773ac9b15so803904566b.2 for ; Tue, 14 Nov 2023 06:38:29 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7a023afb-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972707; x=1700577507; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7bjOOh298/gVm20zFogtcW7Ag9vjCtjGY9z1KnDRo3U=; b=DWY+OgqUa47v2r77qSjATEmqaZvwmpnPR63A0wPSgvWtgZem89riY6bcbhiBkaP6Ug vvGtQeHzkwM8AyyusI9CohijXN58HmuMHiLlJjSiTwmZIrsN7+XDn3mnForFEX44Kc+R mD6o5JaLPuKZHPKf2cIBKIEgLvWm1QXWSofZrFfnxXgm5FVJzoHrjrwqFKFY4xRlr10J ThGsVM3+f1g+Iu+6uTH0AhTLvoUqynNqxMiSBmZNDvKruhAgyY44+C3edkczx8xy/2pU M6HhJ9vYXRumjiAiduX8Pv50R4+RBe/3KwWJj/yLL0tS7rNgiiwV9I0c6JWOhsc0zv4f m+eg== 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=dnh37ygBpdzGKp1cavwUW7aQ4pQ9PLivWLMkxZCpIblNegmLZlVgv1As6Fk2ayTund 5gseu4B6oWsi9KcMB2n8xbEbDHhHZq/0TVIY/nQdN+gzm8wjlTyBtX3oLfJ8JHHwUpHT 8NMlQvpNmUOYGw1knrZm1zzx+dOhM4JtAlEd9dFsc7UH1CHcxCsi6HrEsIcnjm162i98 vhH1kRJ+eTt0jaz0E0oRrMWnW7Vc3Z4V0U3k2d/vNDWKrwdg9oAUg48WoWhTJfD8WB9v T3PR8sHqqvjl4AhxLEYq5/YRxPWHswovPThgZAKQkjtx/6PY5mvjiXEKtYlCilQ+HozG aj/g== X-Gm-Message-State: AOJu0YzX46EYNS3Z27SrrOdd3Zx/6L4pnppEsMRanRU6ABZV7WtgDE93 FUK0uFr0uI/jLL3kChC5UHHTSA== 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) 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> 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: 13455424 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 052C0C072A2 for ; Tue, 14 Nov 2023 14:38:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632619.986880 (Exim 4.92) (envelope-from ) id 1r2uYm-0004J6-7Y; Tue, 14 Nov 2023 14:38:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632619.986880; Tue, 14 Nov 2023 14:38:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uYm-0004Ix-3r; Tue, 14 Nov 2023 14:38:36 +0000 Received: by outflank-mailman (input) for mailman id 632619; Tue, 14 Nov 2023 14:38:35 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uYk-0003vI-V7 for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:38:34 +0000 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [2a00:1450:4864:20::530]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7d282fe8-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:38:34 +0100 (CET) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-545ed16b137so8048513a12.1 for ; Tue, 14 Nov 2023 06:38: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 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7d282fe8-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972714; x=1700577514; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r7OOTLwbh53U5+FgsPEU5EGeXSv4SaNpAAr4X/+o3UA=; b=Zx4iGlb/hwXpGeAFtoNCjTotHy//WhwBt/kIXlOjCEwXomxHfYFqAkVx21n62olVfJ x/WyOlFu+GasSC/OyfaDXo9q+69t0FEBd8wdR89Clet5dnY4lHyH4xsDUm75V5Z2nAbR jTVERu5OAesS3UMkgDkQzkeGwj05q2jKNuT8qA0s7OWlqRfvZRRKcJO7Gd2rrpHjVBFA MHlFz/Cvuzw3JLUMdMxPyWlWkiJwaaCRVoBLN5uWnbMopnI/vTNmwCKBDjbig6BHreNt GgEsoXf56ayZlT18o7u0qDJabAVhYkWFWg3GxvyZX7zW+jK/naJvbjTb7XPANmFJ5MBE TpNg== 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=Z3zNDq5r0oGHcU7EwBzvBbvA/vXoFCJixVeYmyUjKVyB2nNI/KI+iZF9b5amD7L+ZI PBEe59Zfw6uZCbq1xDLou65jnPCJhwPbLYW6ZjpaPw0/D1678K6EMa9xBcaJSLV2lJFH OX1AovNvxLnZe/I2h1PuNyt11UcUaZJzCZgHROkuAhF6uEJokS72TYZFao38Ol6CNQ7J IfeV4wo7BzRBQvpyKcjkV+wK4jeCNH6lTCmhIH6CE6jmychkYrW16z8sGF1mOLO8NrqU bu38qNajR7/rKICk9eRbMcYm3I9sFmoXlZvmWXDAwPYWVwizxpUVL4h0WoZmEdFPpnUD u5sw== X-Gm-Message-State: AOJu0Ywy4GwWFrG/5cNonjqdAYLe3EqcZgxCegcfOh059aC5uBpC4Kze jESJD5iv0O6EnqSbCZhpmMUlLQ== 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) 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> 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: 13455423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72467C4332F for ; Tue, 14 Nov 2023 14:38:52 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632620.986890 (Exim 4.92) (envelope-from ) id 1r2uYs-0004gO-FC; Tue, 14 Nov 2023 14:38:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632620.986890; Tue, 14 Nov 2023 14:38:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uYs-0004gF-Cc; Tue, 14 Nov 2023 14:38:42 +0000 Received: by outflank-mailman (input) for mailman id 632620; Tue, 14 Nov 2023 14:38:41 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uYr-0003vI-CM for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:38:41 +0000 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [2a00:1450:4864:20::633]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 80fed492-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:38:40 +0100 (CET) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9ae2cc4d17eso851790866b.1 for ; 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 80fed492-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972720; x=1700577520; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kBdIXHGvx5/0R2xC8Q+GilhuZtCQOtnJ9hpGFyppJEE=; b=VfrsxR0BlBurVaHJ2Y5Iwqs2Y84fBd/VZRQCgMebzbhGTkhHdXqBTtqt17aXU1E8Cg ruN/+VH+iKd6Zqs/y+UWyz7zvR8PciuJ/MZeFoJ4Usa6NQ0cXaV7Cbl3XwTFuWj1nzV/ FaRZ20NXSeMJ3xBZsg7zqa3Ze9D2B3QFpT/41BKwsnimQldIlmfpZih1MqqUB/L+bmE4 mxrBS2D9OTH+XxLN9IaqcWZVOYVAQBAJ/CqD2Tw3jBku5AHs5iWAI42xb152MrZYMgyL EB1TaSuEGHjMebeAL/1RB7G/z5phTYqe8xku/KpVYFXORyIpZbjHonOxUwo7Z5Bq8fqP IxjQ== 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=COPJUGP2sxffgimmf8e2ETn2SE7L4ExawWGIDlUvl4GvM5JlOYZpVDZv6rLYLvTWiR +/iQ8uUK+SlxUGpYU6ujardlgHktLwxPL16RM4ROzNE2wO3mTmyoqMm17ye8nr2ft/DN oQG1zpEKrnTJ4/ks8OouyO+VTWNuCCyvuL/5XWCiSkNky5xNlIuYCSjh3nWHIlC25yXf 10k0N9/t7QdaF8ZEIO/MWkAP+EvEBpLt1EDy8JjgDD5TV108mVIJoCb4cVXA7sDytoyy 1EVe6BgmhvRdMmnW2My1MUCZM7STXGzHcKvh93JvtuuvnrTdEKB4XhgQayf/apJkdS6J 4Pog== X-Gm-Message-State: AOJu0YxM3pVYm6bDmf/wkZZtOficNnftunrlUsTp4f151fGjT4G2yhnn lYA799pfD4nUslhTrw44I+1+zJfmbTJIkPgIHis= 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) 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> 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: 13455425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 27FC4C4332F for ; Tue, 14 Nov 2023 14:39:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632621.986900 (Exim 4.92) (envelope-from ) id 1r2uZ0-0005Bb-Nb; Tue, 14 Nov 2023 14:38:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632621.986900; Tue, 14 Nov 2023 14:38:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZ0-0005BU-Kw; Tue, 14 Nov 2023 14:38:50 +0000 Received: by outflank-mailman (input) for mailman id 632621; Tue, 14 Nov 2023 14:38:49 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uYz-0003b0-Bc for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:38:49 +0000 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [2a00:1450:4864:20::52c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 851d30b8-82fb-11ee-9b0e-b553b5be7939; Tue, 14 Nov 2023 15:38:47 +0100 (CET) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-54366784377so8748483a12.3 for ; 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 851d30b8-82fb-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972727; x=1700577527; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UVR+oDiuZU+TW6PLxAmD0Xj/DK6BF5fQU92EHH5K3Z4=; b=JE5EwRB/NhM31ug+MxKMHIzTxC5afV3rXEOALsjJ9aDYIFqFZ8mX6ibjk9oDRsCY8b gOxG+ji2bFpghHfXY2sS3X+lz9AEffdKP8AGtFlOexHkIMKIHdO+Nf5qAk8TqxHaGtq/ KTCqXFYu4ujoIObgGqTKV/7R7kEhBYFDkNte6Dcl/MAOUODDdowBFntbQ6fzwBWaxCwn KCLSL/vL5Qp7pT9u9yEZV5S6BHdYmcDTF1J9V1xqoDRboA8Pf0UG2bW7CR4++C5jHBGN ulVpfLGY7Xgcqn2uHdk6Trpyat3KLY10wWbpg84fQC3XmM6IAbcBNOwOLRTjr3kApapG /4HA== 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=AhWJdys5O74ZASeRsLvkuH9Do4Xari7PalLFE9/gjs4l2wdkafkKm3QX8rW0nDXkj1 VejP8j3a+ldMAo4A0JQ5mak+HU4xT0TVD62ahuG+re4KClIL+vFIzwjFkJCJ5spXJNia Ly9pxt0CyblU2babIPfvI235lBH1zrFgMdvSAO3JB3Vo12gkrkAadG0qBMg+yCovgGai UjWAN49hiDjy+xSsykFZ4EYm4W1+6nZVXOpKchxmrv3xvtdhZlVjpVgDBp77F0kgpMSr GNQOk+mEtI3uKeyktngp9AeZeSo3wfzcebpynE25SKRcInnbmTWIhB1v0QPV8VsKjk6q PkgQ== X-Gm-Message-State: AOJu0Yy7upXiiGTgGxJV92WpIP26GfVZ1cauYDwu9hjog8z1icb1fwPT PenQxTlIeQeDNgZl1iyKe9lruA== 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) 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> 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: 13455426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 814D0C4332F for ; Tue, 14 Nov 2023 14:39:06 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632626.986910 (Exim 4.92) (envelope-from ) id 1r2uZ7-0005lM-0W; Tue, 14 Nov 2023 14:38:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632626.986910; Tue, 14 Nov 2023 14:38:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZ6-0005lD-Sk; Tue, 14 Nov 2023 14:38:56 +0000 Received: by outflank-mailman (input) for mailman id 632626; Tue, 14 Nov 2023 14:38:55 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZ5-0003b0-Nw for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:38:55 +0000 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [2a00:1450:4864:20::62d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 88f8dab4-82fb-11ee-9b0e-b553b5be7939; Tue, 14 Nov 2023 15:38:54 +0100 (CET) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9e62f903e88so626118966b.2 for ; Tue, 14 Nov 2023 06:38:54 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 88f8dab4-82fb-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972734; x=1700577534; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xuAolXSNCEGrTS5m5CRvskBDG9NQVZE3kWB97Se1m9g=; b=w4RLHd/ijPrKLNVSNxRHMbaAfxOJM/N1TSReAZ2xX0crDtikUdzVWFiK0rkyDT/slj bHqcj/NXQq5qIcT6ai0VgC+PKna+11TDdbw0SiQZT9pv4nbH4aBRu80tIyggUUEgPadN kDbNcWEgedZbcrpSpSTk/zXeu43J6Is9eU+lKr3gHHesF+9LTRaC80Ucv8ddG0Zy7ZR7 JATatIW+/eSIW9bHyakIHWnMOxT6pfY/upD0FWa2gTqeNOcvwJ72Ufe+kqSUxlkkzVGN +t3wydsFMyV2t+2ktd6wEsGjTBoOJvF3BjuLBvdxkWYZiBwgpt/AQ7nUCcFBy5DHlsEv oA5w== 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=Hf1uEcuZ9avlEosxuaMc89WhqUuKgu26LbLZP943FHUkoEnjl5MCUrJ+JHu9xRLzeL tX4ayyyyQl+zX79g4IphIkQozZdg6fJxG6NyZRd0FFXe1EbRx0ngQMxVzmPVDbgo9eN0 7FFGdjn1UlBUb0uoMvYA/ZMWkdOxnTRkaKs7TVR8zdtTwNlvd6LKOyJP91Drjik3rUU0 DrUr11Ul7/Fe1BRaLSJRQ59rQ6cnd7flFZgO8ssTby7o0nStLkJWIEM2NGtQ5t5UjOlm NO+QGU2Nf8kQB/Khp/M4RcRZCFzpG7IXAZETHo4ifmABlmJ4TH9edyUZxiphZcZ2hY+I s4OQ== X-Gm-Message-State: AOJu0YzV73iin+4VGYwluF/pVtFaqMIPbB49cwBqNPtH9VF1MR0pHdSP uZh8MSF7EjzjHNpQfGVjcqeOxw== 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) 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> 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: 13455427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57B9EC4332F for ; Tue, 14 Nov 2023 14:39:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632628.986920 (Exim 4.92) (envelope-from ) id 1r2uZD-0006IU-8k; Tue, 14 Nov 2023 14:39:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632628.986920; Tue, 14 Nov 2023 14:39:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZD-0006IN-4o; Tue, 14 Nov 2023 14:39:03 +0000 Received: by outflank-mailman (input) for mailman id 632628; Tue, 14 Nov 2023 14:39:01 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZB-0003vI-Lk for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:01 +0000 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [2a00:1450:4864:20::52e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8cf80e29-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:39:01 +0100 (CET) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-545ed16b137so8049513a12.1 for ; Tue, 14 Nov 2023 06:39:01 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8cf80e29-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972740; x=1700577540; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A2i2PCnBLcbag3MdE1ImS65uDPosS8yIjq0X323T5yY=; b=mblXSRE7gCbEaWFRO/HpuNY+P90f7PHjKSwivujayJT3HaDfjT8vZQLryHZg/mXZBE Sj8CFJMLN07oyma6l+JNFRL7agBSofS2rSCIMErvWBShpoFffJEgf1i+x/rabf+7PZgJ W9gD1IsziW6tw9rJZo+a1UPpiT+7RaOVlolMu36rls9cjmPJAKuEHM/JmfiptCpl0NU8 TODLOuSf2q+AtT8ruqy7V/Ikymczt7v6XK79YTs4sa8879Bwa5Dx1pyIfoye+Rwh31vo f6h20pOe715O5OiijLK3hYmGIq3kb4ro7KWg64W2comZ/xaNwLl9AVfWBrmA+rtJHJal ZJHg== 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=Yjpuhsw44sJKJsPjskufMSv/Cs7EA5dNz/MHG6r1aZvUKVyK+8GFiok096kN1RC0XR 7kTYHanzjF6GNMdky5EpRKx8XNfw7dSbADkbcWJvoav/eEPK2m/2tR5i7UpwnvbSFtJ+ JBHO2LZpCfaLl8p+uJ1LBfUG6Lypbd7nRHLUUMu8D1YJ+caLeTbWQ3ROcNiCF4M2Knsp 6h36U7Xn9RAQIhN76/fPrBXk4s5PQuNAYAVpoMP7aVKPQkUbH2HWX1MNHSPe/UZQ/JKA IodK+VkthTbZ11GueXCNGisu/arj/mUiFpLbw3uM/rGOydq8tUo17Mi/crhEzJ0lvqao eR2A== X-Gm-Message-State: AOJu0Yw5sN7t3Fd0xVVJb9g2v1o3gAP0U22+T9IU/EXFbUuVRnobHzBH BirodqWG/piyDyPMMUYKqiDG4g== 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) 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> 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: 13455428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 369F7C4332F for ; Tue, 14 Nov 2023 14:39:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632630.986931 (Exim 4.92) (envelope-from ) id 1r2uZI-0006sp-Hc; Tue, 14 Nov 2023 14:39:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632630.986931; Tue, 14 Nov 2023 14:39:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZI-0006sg-Cf; Tue, 14 Nov 2023 14:39:08 +0000 Received: by outflank-mailman (input) for mailman id 632630; Tue, 14 Nov 2023 14:39:07 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZH-0003vI-Tx for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:07 +0000 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [2a00:1450:4864:20::62c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 90c855e0-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:39:07 +0100 (CET) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9be02fcf268so853298966b.3 for ; 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 90c855e0-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972747; x=1700577547; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oo2mmHUNt8cswMDm2G2tk7NYG50Leech1RMDbe0XTgw=; b=Td4zfwmkadSPU7BSZTFwxsCCl7P0/YW8ohw9JWZuMq4t7an6bV8TMFuKu97GS3GAEj A0xpc0IkkUkdQCrAta9Ataq5aB+EKlN34S+M5gFzGuuUiFa8Q0fOLExZ26qVh7cQ5OVZ eiXGtu8iXnAaPZp64vH1gy9w9IEytb7MOLcrCYfre6IOaIlcOU0cJM5egtfHukHe7DJB 1zXW4IrR8QpgkKlUQuA+vsF7d2i4QP89sOFvm0PpTNOYB671d03vX+xZotuFeSE0Oy/J sIQrqX8oMJ/163e52mrgQRPeEm/FUcZrLfS6ddkv6zfdEdftRnEHwoFJciezLKVlMYp/ MVIg== 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=E4/xyKHl5lRfrsv0L1ZFbGG+7OPHgXlyktIl7/jIO2R/B/SgqT7ai3s2SXMSZlGu7+ z+xHVI/1TdWzio075uq4h6rp0AtePmjlVMm5cA6GtMd8lOVz0hCpWRAC7DJh7damMhmC h9yYMAJdygoQyIN2kMjixw5/aBDsf/Eryq2UDKeVJ3+EK1nswUGH5u6ntC8rvwAZZPBu fYD0O8Zjo9GXoHR2KFfxnK3VY8u1DIxwsI9d6LpHWGQ9M7Uu6TZhoiwtSIKPMtGqgpEN nbqHHG7aToy1W6Bzncn2yQl2iiLaT2q7bAsAhs7x7T7OEX5VynTBW9s0xuoSKvIb3gWs DkTA== X-Gm-Message-State: AOJu0YxNmOrTPSWGM1VAfCPxCs8df/+hDPEc3kyUOpz7JAgxfzEFd1qB UkX6suONe1+S7D82AFCURB3nfw56sl1EdFwg90o= 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) 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> 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: 13455429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E87C6C4167B for ; Tue, 14 Nov 2023 14:39:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632631.986940 (Exim 4.92) (envelope-from ) id 1r2uZQ-0007V6-Uh; Tue, 14 Nov 2023 14:39:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632631.986940; Tue, 14 Nov 2023 14:39:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZQ-0007Ux-Pw; Tue, 14 Nov 2023 14:39:16 +0000 Received: by outflank-mailman (input) for mailman id 632631; Tue, 14 Nov 2023 14:39:16 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZP-0003b0-Ul for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:15 +0000 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [2a00:1450:4864:20::634]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 95048d94-82fb-11ee-9b0e-b553b5be7939; Tue, 14 Nov 2023 15:39:14 +0100 (CET) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-9c603e2354fso1146147566b.1 for ; Tue, 14 Nov 2023 06:39:14 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 95048d94-82fb-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972754; x=1700577554; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MhpN1sNxh5OOZ/KSUE3Y0jUPmEpPW/hS+3a5vlda+P4=; b=UdmQCgEDvbr7P35GPus8m2g3dRyrWQv8o42DbW7NIGomAr5QARmoZ8nsiLFD0GgtAL ac9i7YEDJVSQC66E/9erxEypAHYwOJdQoTH3bIXE7BNvufqNpg0PAmZNJe2O+7W2drBF hQng+brBxqbpH7amXu4Sa6118OKXQhIMmh3r8qRnB231R/JoXJOl6TXE2fHNqnHsWSSt 8zb9GnhCsT+cbt0w0y7gnpDOZNzQPP8WQUSkrDKvIxA4yIPkx7jmSgjrl9PTSOOvOve1 XgWKkfNzBB8YOZqzM9kMkdkjhqDOsgXc4YdYOf5JWCPvTk7+oqLb96TMkMhUWFTjpX4w BHIA== 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=u8GoUiP6SRR0HwWDDeV795xLCuA3fcFJWR0z5g6b2YHWXEIg6OiAf1LdTqcWzFtSyD 3mzPqNOhzYg0mEjUZMMs4bYcy0KiRgjvcs5xbwjGlibxUCc1NJVohMYR4SqdVWEj6erK Wis2KGbAS78Xi3XcCdrpvYJUr1RKqN8mz1Ek5XT7v+VhG7XiXxBU8CjFeiOI10A0jOoj jlm6hxgfKAMPXo1jJTuBq9I5sXz7YJv29Vloksdl2sx0/gm2I2sasoZkuAtJbP9D4zKN xvZ068KPpUWiR7/lGsID1sHKkMpVS5XYmSfENVRduiK3mZY1A9vVs0pOBvZeV7KQq3+W W/Mw== X-Gm-Message-State: AOJu0YwHKsnrdqnh95odb3y3Ij7j43PPqkgg5SQ/QgecekwM2C5bD1z2 f9uM7kXiuZcqvanYFQeIZaSMxg== 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) 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> 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: 13455430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E8AFC4332F for ; Tue, 14 Nov 2023 14:39:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632634.986949 (Exim 4.92) (envelope-from ) id 1r2uZY-00083W-5q; Tue, 14 Nov 2023 14:39:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632634.986949; Tue, 14 Nov 2023 14:39:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZY-00083N-2j; Tue, 14 Nov 2023 14:39:24 +0000 Received: by outflank-mailman (input) for mailman id 632634; Tue, 14 Nov 2023 14:39:22 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZW-0003b0-MB for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:22 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 98fc5ac9-82fb-11ee-9b0e-b553b5be7939; Tue, 14 Nov 2023 15:39:21 +0100 (CET) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9c603e2354fso1146179066b.1 for ; Tue, 14 Nov 2023 06:39: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 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 98fc5ac9-82fb-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972760; x=1700577560; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UNMQSJ9n3HwpNaurQlo3tUtiIa6U/WmLwhKlbRCATs0=; b=Dx7VXhFxIiIngIEJ1XutLBKC7QnBtzYF6jW7YwITSKt2Hm5oMM51qflx7tS+jWs5Vl Yv7hZg6OxIhD7gUVsBF5gYYIjUIOcf9XVYEqfLRkiHIVqzQ8XomlnS3SnClcxyT2hSie 8OdB1QJJp65YwdQiIzhh7y6vU2Iod2yiRSGohseEz1F+FmKdhh179peR6qFTLGThrfaP v2uoq9Cs7UQn4cHJELwA7ZKQnnjLWwQqGK4NIj6OW9+8X7j4I9G9637SO4g3tNlVIVH7 zIiHbfH+Ah9GIl43JG21vkEaAo6keMsZW8yJ2LiXINyoJlARwHcu+KttrCgde8dbmnzn 6PFg== 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=KtBEoy9XQq+r+reRFS31Mt3Wo2iz22EqatiN8IJdTXQ5wqX4Yc544kvMLgtbt19fbU mTvVpN0ZV7k8E3edhdiOjJA6sqzu0WymrCvJ4DhAdzQZ8db32JoMXBcjfyc504huUEaS hERH5ivor4yrBwMmi6hogYhP/R865M4UCQ5FRFOZy/xPjUP+qiQrJ+A0ZHLl4LlWN7VV /gjyXGedOT7PzEgIp1MzRjacnA48ERShJ3L6P7NVAsfhhVEG+FyUjJeZpfSEVQoQldMi +HHmeZGVG7POo8OGcL6S6dG7KxWprgh73nY3dUDj0EIGWW4vL8+iFkzI1nsPXTJGnK2I webg== X-Gm-Message-State: AOJu0YxQAuRgOUJ1AVKz2wbfdcEmiUQBe7YjLLulGiVyEOdPowjT6bgK L4Qq2qHVt3vNpQzsU57cWqH7rg== 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) 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> 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: 13455431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86144C4332F for ; Tue, 14 Nov 2023 14:39:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632635.986960 (Exim 4.92) (envelope-from ) id 1r2uZf-0000Gd-FG; Tue, 14 Nov 2023 14:39:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632635.986960; Tue, 14 Nov 2023 14:39:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZf-0000GQ-Bp; Tue, 14 Nov 2023 14:39:31 +0000 Received: by outflank-mailman (input) for mailman id 632635; Tue, 14 Nov 2023 14:39:29 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZd-0003b0-SU for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:29 +0000 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [2a00:1450:4864:20::135]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9d514783-82fb-11ee-9b0e-b553b5be7939; Tue, 14 Nov 2023 15:39:28 +0100 (CET) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5079f6efd64so7528209e87.2 for ; Tue, 14 Nov 2023 06:39: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 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9d514783-82fb-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972768; x=1700577568; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BqgJC9hPHkcXARLwNhCfo2KLP+5VvJiIzbHQjbp4PnI=; b=kJo1Dnt6JNNKZhQRbJrpxtjvMkTqUharHh3D2wkz2xJD22djc1tbc0DI7HM7h7i7lq GlMV8uameAKCJe7+SBjLUqdCrt4r0lUnwgLurqsiWYThm0y5Bz8jWOzH7urKxLWi870N m5z0mKOq8fkjc5/Wo9vXyeVi4umGpTQYdU0xHimfV/enGZuKM4GSYwzr2IMlqDDa+ReY Sa7KkknJg7iIF8eC2NVdTDweHYf53foOY9/o17w+EJV8KxrohWPySyA8kTEz/YwHyadh lf8fqivyjsFWSYGqY6iuCwByNEWWYb0RXifCk7yLLqPIJOMjreWte/p+OkmL1QzTFAAj xGiw== 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=GDzTCUZslX+XplcLFzJEwmjuhEVhi453DfPpuZz4IEP6VYu92dFGlbBNC3KAp52g4W Wi8yzbvZn/o+KqJ4jQ4JEdzI5a4Xm6oFFvHN22FOqLW38oIRJlAJPAyIZksXWtmd0PLu dQW3hAgB4eHm3SeZSDkRa/Qcvo2JEI6UIGyrD6m+baYCY7+Ls3fPX5DbGS6/IaMKey7A E66F0MeUmjbKDjDhiaPPI5u9pee8YNQAx0zMJzqtGmE0uGY+vT4lwnhLHLkDKWYLab6E 7eWe19yVfW59QsElM+Twg2Awwoa17rnx07fdu9PLW9vnYCJJ9wF5TJwKOH/C1qcn9KbI +ZgQ== X-Gm-Message-State: AOJu0YwWPj/oy1tWeCDvcnUDJg8dz5pb6MAgSncL8+7BXd3i0O7hZvWj tnJ5QETsKjUpnfDp2tSm1zsBvA== 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) 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> 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: 13455480 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 496EAC4332F for ; Tue, 14 Nov 2023 14:57:38 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632700.987065 (Exim 4.92) (envelope-from ) id 1r2ur2-0005ZK-J3; Tue, 14 Nov 2023 14:57:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632700.987065; Tue, 14 Nov 2023 14:57:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2ur2-0005ZD-GS; Tue, 14 Nov 2023 14:57:28 +0000 Received: by outflank-mailman (input) for mailman id 632700; Tue, 14 Nov 2023 14:57:27 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZj-0003vI-KH for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:35 +0000 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [2a00:1450:4864:20::631]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a14f0691-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:39:35 +0100 (CET) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9e62f903e88so626245966b.2 for ; Tue, 14 Nov 2023 06:39:35 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a14f0691-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972774; x=1700577574; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6XE67RaqwP19rEjPR9cmWaIkbDnma1jGWKj3qDcuG2M=; b=mTgzg8QvkuEOQmWGDbWfFM99zCtTos5bqLur+mU30kjpvW/qlPjBQR7Rgr09srNbUk PwbBQPEfPM60xCFKZVef3k0VIZbiuNr0ldKiimv1mypqUhn6G0OFTfRyWV4WjErQslZ9 2LR4QR4m+kpifWwyKXAMrwwqVFfJOFQ8pobxXRf/q557ZXtc8FxcJxMYMwQ9ulJrua7X FEm2Z9KybKxGcEVkmbKhKdu5fQZZRPiAwU+nPTwhIX9ZFAGn/Lp+UkatMKcL5eQOsMqP BlRvMprG4VqItpGpEN8i66CxWUqRX23hs2D7z1y4NbhQwLuIR6fc3NZgaLJh/db27PEw +HDQ== 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=er+AU0P6NRXjm8WbD59f7tLKEjm8DGsxjB/N9KrKpRw5LlhHWF547cDjLiZc5p/t2+ oPPCBokpoGxRNSut4+aY8yd4AgPo3LSDZ54BG1HpqGJH6ibgNtpjfpqaHC4+G7EiCEOR fZCcZGpBIBkZa/Sgt0G8pdr0fY5f0wmiTWWBRvFPUZTpxBXtDyGjZefI9wQOz4QsbQ+u 1GBUQr74iIr8ZxfsFkP/3oMP7soJoy16nsmJ6oODgIojUHGsNHijpqmpdDcVa32iS8IS eXtORxHZ0QVzNKLQW6thStMKtnO+uFiXKsM6geP80nIympISF0Evpx5E1UwwJkjMFHt7 5iZw== X-Gm-Message-State: AOJu0YxlORaBh4gouBFoMKcDml5jlO8zh47vbeJ9xpqafQTu+lSYc0vk XSab1ljvT267OSamTaLU0XOMnw== 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) 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> 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: 13455475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AA62C4332F for ; Tue, 14 Nov 2023 14:55:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632683.987035 (Exim 4.92) (envelope-from ) id 1r2uom-0002Ts-KB; Tue, 14 Nov 2023 14:55:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632683.987035; Tue, 14 Nov 2023 14:55:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uom-0002Tl-Hj; Tue, 14 Nov 2023 14:55:08 +0000 Received: by outflank-mailman (input) for mailman id 632683; Tue, 14 Nov 2023 14:55:06 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZq-0003vI-V1 for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:42 +0000 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [2a00:1450:4864:20::536]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a5a6b369-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:39:42 +0100 (CET) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5440f25dcc7so8731461a12.0 for ; Tue, 14 Nov 2023 06:39:42 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a5a6b369-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972782; x=1700577582; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jzmBSObK1PNYaVxHm2kQdQrWhNegSVRCuy1/LpCCkxs=; b=dMUVEZ74P91kfdtH+WZ7AuubPPGNE1Zes1A1b1D2dDu+79B7gpXxso5sL+ouFshZqr cz/29RhpNYitWHFAtQoPLkZIjmvYcP4vCRSkyi6Aj8Dtda0krhDZSCxK440j3SFqioQP hMu5R769lBO989KzQYwDAObXkgPOtwu0DCynhYCWmOfTS4k/KgnCndaAo4WKArDuoAIC miciZx1N+QcpCSf4LqarXPIp8VwcrKc+394yGw1teyerS2VGEZyw8p+dzygU1aS4q+qZ EnuJ53kI5Bb6ompVlD0zFL5swg3DxlJC2PqQFxZNXAzptUcownmSJX7MbvC1jSq207U0 X9XQ== 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=R4f+T434RcG/f7w2bak8bjdO728gPtwlDd1LcCwtYU5xnvbCKtlwjaHvFJjlFDq9yl a84Olbh3mH9eDhDZ3n7Tb2byn/oHMouLhzo3IcBDePpgL6Jz9BGqYAHrWKuBefpsEBny M372m6iHRZbRjDo1PfXwovAHw7J7EGQuVMk4APpnNo17bx12T9VCtULfK2xc1aU0W+bE 9Z74M8eSunC00PnxOn3G7fMWwUr9jsoLMrDliHXo+6seS+QkzC3N04q1rdIEEyIcwcUX S6d3yAowBfEMLOqFYKd7gjiYGyuSB6Y7DaL5L4cSPrsJgLHOJR1R3c5k3JNZEKiMXAt7 /3Xg== X-Gm-Message-State: AOJu0YztXYF3VjOXJ0hVrhTqsAqpR/HsfkDifCftAWtLhfYdS5Yobalj LOJVsI0gqv/Y//5dk0MuAwphJA== 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) 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> 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: 13455461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4C634C4332F for ; Tue, 14 Nov 2023 14:47:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632655.986989 (Exim 4.92) (envelope-from ) id 1r2uh1-0005oB-Pm; Tue, 14 Nov 2023 14:47:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632655.986989; Tue, 14 Nov 2023 14:47:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uh1-0005o4-NI; Tue, 14 Nov 2023 14:47:07 +0000 Received: by outflank-mailman (input) for mailman id 632655; Tue, 14 Nov 2023 14:47:06 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uZx-0003vI-FR for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:49 +0000 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [2a00:1450:4864:20::12c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a98a2ede-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:39:48 +0100 (CET) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-507bd19eac8so7632269e87.0 for ; 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a98a2ede-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972788; x=1700577588; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x5X2FluBMHtEHwLVURbcbmArZUeMN34wqMB+9uG3SGg=; b=qqIB2ixtDwnE8Ljp1CRMJKiVKwfUu7C8qkWkxML06u2pAP5DLTuNbZgtCLaPOVCJnX 9DxmxhykGfwE2znel8+OABw7XM+4NnvBOIZ+2GM8L4/o74RM6/y+3D2uGUAJ78MZ6YMe hmbXc0dIdBG8AS2Uqktus5uIZJPTjiHxcyia0DaritmtY+nC9aWqaX282oDvX7vEX7bc HHqIid1cH0P4ufCLraSVJkMPdWjOj5MeVPl0yCO+Jqq2oqv/kX5Di0UbC/pgT6Joc+T1 kTzpda+pWUuyhm2l8QmJFc23TKKkMiD+diXNrrqzgNqK8LdIF6dUPhiyYcStssol2IZ3 /Tlw== 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=Uvbb8g9LiZSi5bjI4mLa3zoHzJSmkUiMiGEbF7mzPpilo22GAf8Q9UxvvOgsDwRyqc NO2EQe1oTz7vMSCdAzODUou7n5f81/MGljhdmE0r5krCwjmtZz/SWbQhNPoWri6jI72G 8ynbEifGH6PPdTIB11GuFb9Bs2PHDKAz+pxoXxOG6zA2CvKHyJ47by1mxNARQmiUFh/v XZsO8e0vIfyZdzX0LvIBA/Vo5EHAkNiWwpl6UxxGamMx7Rt6DIfIAFFzIX0Xff1wYTzt GXkoaCjcyJ9288P63Vm2iW1SVp+qfaD4s/LRvhJmV2ZBJ/1Zrt5g3KbgN/Z+L5BNJ/Mk XWhw== X-Gm-Message-State: AOJu0YzG+VMPXM9euQjl+KDXeyn41iyRN5r01zDWM+IAoH5G+7tVaiEG csQjZoBpcWQdNkMbzIg24KwV1Q== 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) 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> 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: 13455432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3369C4167D for ; Tue, 14 Nov 2023 14:40:05 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632636.986969 (Exim 4.92) (envelope-from ) id 1r2ua5-0001R0-NW; Tue, 14 Nov 2023 14:39:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632636.986969; Tue, 14 Nov 2023 14:39:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2ua5-0001Qs-Kt; Tue, 14 Nov 2023 14:39:57 +0000 Received: by outflank-mailman (input) for mailman id 632636; Tue, 14 Nov 2023 14:39:57 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2ua5-0003b0-0x for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:39:57 +0000 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [2a00:1450:4864:20::62e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ad790427-82fb-11ee-9b0e-b553b5be7939; Tue, 14 Nov 2023 15:39:55 +0100 (CET) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9c603e2354fso1146304166b.1 for ; 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ad790427-82fb-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972795; x=1700577595; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R1LXi3GoLl/gkTzQsgGS9qqbGm09JIagG9772ckn2qA=; b=hxCvAE7FVqwDYhNRfCjNL5US0jkCbIkJR6IfJDC5oSRDty0wvBiA81FZb62xERhseS 0qen4Ig9tJTBPbDuPaMN4UoMTFPGWxDZWjHOi2Im1sBLAIx2DuT1sLApeADfz3AbiIj8 3ymYjWaoIrMMq1iTCxgt6BIHGIBAP7En05xpy9/Odv3qROiUBCUHxXyVB7+Olu+w4MAh tVFQVbuCOrisyjxPPwUTPKI7HnrGIzDV7xU1WCeSsrbLtB1iYXYpjjgbFBWk36z2v+uo PWPANlX7AdmQd3fmoZ45GBTC5yxeEwWyK/SBpFcnFMmzBdg3MMo4sOK6MAl7iVcnG4XU qgsw== 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=bMjX6IgV7vi0+p4E0Y1zCFBV8GZGxQhFfmZYp2JpwVyaGiPo6tkLF+KPSBEikEKNjX Ux4ZXAlE1X1anZdpygHIfAFp52Dm1YzYHs72rfp9OTFbXCT29inX8EgS5vkLEbN1hiGs bfPG1zBDallaiHlUUE+iN43Z+ZwNBgriIN23kZ6/rarl7GgAPszvfdI2R/XCzhmPPuyt rZPREkbqfPUV/DRD4m96MVIWbG7QVl/6mtISFdEsCCFAJXTNe7Aj2sAGyb1cDaau13PL t+ua9JN3CmmMsngsix9oF3XZyYrmlSwH14cw1J02D2Ppo3OmgbWRQSR8KBn4uLzN9+Ym 0g5Q== X-Gm-Message-State: AOJu0YyFn5j1PeL7YKUaT/gBxOnjsN8EClOiK9sneBhDSos60ABZxUHE HJfmA1TFaXsV6qiRcqJp2fm+kw== 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) 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> 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: 13455481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABF59C4332F for ; Tue, 14 Nov 2023 15:00:15 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632713.987086 (Exim 4.92) (envelope-from ) id 1r2uta-0000Cw-72; Tue, 14 Nov 2023 15:00:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632713.987086; Tue, 14 Nov 2023 15:00:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uta-0000Cj-4F; Tue, 14 Nov 2023 15:00:06 +0000 Received: by outflank-mailman (input) for mailman id 632713; Tue, 14 Nov 2023 15:00:05 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uaB-0003b0-V7 for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:40:03 +0000 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [2a00:1450:4864:20::530]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b19ac7f7-82fb-11ee-9b0e-b553b5be7939; Tue, 14 Nov 2023 15:40:02 +0100 (CET) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-53e751aeb3cso8834434a12.2 for ; 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b19ac7f7-82fb-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972802; x=1700577602; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vfmEPJkfg9xcA7W0yB07+uhlzLrR51RZZmvLOIuALj0=; b=sexywZSuZ5OpVpMwaZq+bkmen11MGw6bGNxc5lCGhet+f85tIukUUW8aO/2Kkc4x0h 5dCeXThmpBG5hfCevx+QctQZLRB7LWXlO0x3pKdAlUN0kF4O/DA3TjZTpOEeVx4XjNwA vCXqw0Wu5SudpThf98wEjQSzb22/WHpIHoImh7OK5ClKI59UgVfvS6+IcR0hvUr/Zz51 qz5ZdMeNtU7lFc+8Xhm1ZeyAz7PNhRYEDf+trN799nDHWqP4HoCD/rW+8Uyz+x00Afk7 V83aEnRt8/+bLzk7XELS6waFJL1FO7ScCTaytOAjt3UdLFimdyXnhmS7SG21NGMaw5TS fgXw== 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=xEn511E5/Hbk15iCfarn3jdqWpmITcxbnM5r855SULBRpP7QV2AAbzFoTN9jA8IbFU ulub9o6v4fEbpGJYT9yxUyYU85FT0GOILMl+Nfu0PUNZMvYUX+ba6s7IEk44fmirZfz6 LHxNWGoRSZZW7lkh780wUEv8TGU22dnd+EktqG3xuBcg0YCcjmbRhnlIL5GWcBQXb+tN BgtcCZDR6boIlYArRQyVSFCCUDLQPwKPuiCVLhmvT3OFnDmn/Q8tSZgOSMAaH8JQvGm2 GE98CPSwUcIbYsYeoARpSND7mHeDUBJHBo0sdzAjU7doYzidXNTP3BrQNOecHaQZoQ0l +amA== X-Gm-Message-State: AOJu0YzjHoeDj+fouJfzqPTC63nxEiKOuNSLixK7FFXwA29h8U9CUqy0 4yNksCDxuDVTjLbp4D7sPLlsLg== 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) 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> 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: 13455477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF01FC4332F for ; Tue, 14 Nov 2023 14:56:46 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632697.987056 (Exim 4.92) (envelope-from ) id 1r2uqE-0004Tu-Ag; Tue, 14 Nov 2023 14:56:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632697.987056; Tue, 14 Nov 2023 14:56:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uqE-0004Tn-7c; Tue, 14 Nov 2023 14:56:38 +0000 Received: by outflank-mailman (input) for mailman id 632697; Tue, 14 Nov 2023 14:56:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uaI-0003b0-Gl for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:40:10 +0000 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [2a00:1450:4864:20::62c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b58ac18b-82fb-11ee-9b0e-b553b5be7939; Tue, 14 Nov 2023 15:40:09 +0100 (CET) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9d2e7726d5bso856523766b.0 for ; Tue, 14 Nov 2023 06:40:09 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b58ac18b-82fb-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972808; x=1700577608; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CAcrCtDRFE27SgAEHRwd23jK5KSLpjZ+znXdyGAiZas=; b=TFC8KGRi8SIsVI/CJymk087sb+4rTj/4Nrfn+7QKf4+LMREqrfj1cjE96SgWsq7+c2 tk9BH5oEdnuVfWJWFoPe2TTQz0v4Gt9Y6b7coNgBzsE5DgZaMsS2PBEeKt13/a8Ije5M rX6D+ptjmJBteV2w8iicbQ2DO8DMVLf2Px5dOCOBSOwKbuXsgTy4qjPhBTIP3qu6V58y gsiDn+wlRY8/VlB4avWYO7FCixRp/Z9HvH48d/wPN/h+yanJuNybgQU76mLoLMb/yWcu Hl403+GS3cqEhoWCN9nwwSCJym42kcyC3QuIzJAvOq7G3o/46Tc8t2joXp9zWGDFwwZf eZWg== 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=BOy3v7+7PTmyAl732iSU3KVmuDZkNAhveUl+NpIlhIFRchFRH2PzFAWcnkT9Jvxk9V qmsrhE9/tIwBIRJ3G2QNTO2nmdB6BGEgvahjLz0cTAwrEMEpowGhhRhiuxDUl/2r4nnK +8XSz52sMHdLnSVvnofyxqQo5BJtz5SW+iu9DT0LjfZyh3llDM+BGpwsT2d0X9D50n4K iXWKxoFRf7T2MhYM3Uf3KeIwLU8vqYzFZaqT5gMqLdS3BhG1Fh7+QuJStiWLi0aBFpUc agHKP6DAQMyI4vzXeMta+WLG3wCALSEjL0MRlv969KER+MXCeMSdsTwuWPv5SYxgkTM9 pn5g== X-Gm-Message-State: AOJu0Yx17B+dDe5VHSJwSnyRuCeAm6Xk2lJG2m4x/Srx9XJAOmdQh/Rw gwC/tDxdLzw8jMJvuzRKSfTL7A== 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) 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> 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: 13455476 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D13BC4332F for ; Tue, 14 Nov 2023 14:56:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632693.987046 (Exim 4.92) (envelope-from ) id 1r2uph-0003Vm-VY; Tue, 14 Nov 2023 14:56:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632693.987046; Tue, 14 Nov 2023 14:56:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uph-0003Vf-RS; Tue, 14 Nov 2023 14:56:05 +0000 Received: by outflank-mailman (input) for mailman id 632693; Tue, 14 Nov 2023 14:56:03 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uaO-0003vI-Id for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:40:16 +0000 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [2a00:1450:4864:20::62b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b9a20dbc-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:40:15 +0100 (CET) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9d0b4dfd60dso855708766b.1 for ; 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b9a20dbc-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972815; x=1700577615; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cJTBhe5AIq+piFF54yNuiwKWHopSqD7by2+9eio+MdU=; b=s3YqYle69AuGuZZktfwL85Hlz8R2eFClsv4c7v6JzfgsiGDQ1qQ/R9ch41BszS3Wrw C57bZK6V8urpUWL0j6xqoJI/Tb+jcGjwnfvHWj0zOLHrOQxsKrQKUwG0AW17QVxzjlLR EoMmaVMJa4ll13qxbbUXtqk5/eWQSWP3fxkX/0Tt/hn2LrYcAErTeUFyWeR0jC8DkgbT ciSWskNgm9aOKjxO07iYq9mgXoxPNYeWjqW3R5/maqBw3yom6eoNmjac6vJ400DDm+uH wy9T9wTwAILwerha+Y+EJ+JnpZn8wQlCqr49yar+FmzwGtPAGexmL4ywL+T07HZ/f+A1 lw1w== 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=Uh8bHahNUM63TTNjpe2p5TbfAUTyc0T5cIoPNFtzl+E+slC9S4IQE6ihTIVaMCGR8k c5Rn/ycxnhjW0ZrWsPLK9Glx7z1ksvJsirz+zVowAAkql92hf0apraNfBikZOmxMKH+0 HZAUozV1Lu6utZhhGW89dPoPLSuvQZyWkwzmiAocL1V5g40zrKdA5kyu202IZL/o96r7 N282yTBh4zr07+n87pXSd7CZwedqkK+QkMFgt0zXkkeEIxU41ebHqG/dckjotRKnB0hY Pz95EAFMrSm6ciR4JS2enoTrZxKlnn9/YG72OyVfSxXvU7Q/aM2707NtCBdTyu4811Ai xHXg== X-Gm-Message-State: AOJu0YzzHq/CLBADElAkEbyQVH20i1x6OrLpR41xC8z2Aba3H1d7nmtZ PGD7Jt28ez+Qv8hVXNA6Tj3e6A== 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) 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> 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: 13455467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D49F8C4167B for ; Tue, 14 Nov 2023 14:48:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632658.987000 (Exim 4.92) (envelope-from ) id 1r2ui3-0006X2-4P; Tue, 14 Nov 2023 14:48:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632658.987000; Tue, 14 Nov 2023 14:48:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2ui3-0006Wv-1M; Tue, 14 Nov 2023 14:48:11 +0000 Received: by outflank-mailman (input) for mailman id 632658; Tue, 14 Nov 2023 14:48:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uaU-0003vI-LZ for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:40:22 +0000 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [2a00:1450:4864:20::529]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bd63bcd8-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:40:22 +0100 (CET) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-53e04b17132so8865323a12.0 for ; Tue, 14 Nov 2023 06:40:22 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bd63bcd8-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972822; x=1700577622; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xWc7O88tTfL+IROUfXsM+NSd2X7VWDO4aCdpc797HXc=; b=B2w1KnhFgmoFbUuLJV0Y9OjkgLXehu40+UFLinv4nNzXhki1Rzu4xRiQ0dA2WLrqo9 H3cYkQE09bKlMYMwjt7xFHW3CkGHh7pJRbjCIUk5r0qJurzWvL8Dow75sFHGoZ63qO7d hL27YHYVlEe75dkuFOBQX6Qbyd0N9l12GFfQhT5sgcKYjpV8UWxmy1KAz0OR7w6xgu1K H25EWeLCpglMoj4RsNSRgLZ5QGZ4VsZT0nIrYTqu3iXFxhZ8CRnYp31YbhiQFnmFxCRR ocQfxfmY26Nkn95m/wgxCaVvpb0GNAZSZZomFIkYxELOi41d7LERU4Ssqs2oyNLr9ltR E+bA== 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=N6fCDiaBfpRZItF30ril9NYb3yLooC8QH23ip5vp9/gMamTB3HsY59dURH8zMd3ON3 /RDiOMdsnvK4cq8kqBW2SAopsuY7UKCdFgAA1vJN3NtxSp4v7nDAHhmPTcY5WSRN6f/W boneHAIDuNR5rdTsIJzio3UzSyW51XdBWfW3aoLOk6YreqmjUG/pkqaNqzhXnwlLiWmh FCkzmk/MPN5VfYgRo7pIMA6xYM7jYtW3UxTCJYJ/10VK0QJogxF53ojAVTfFO8MeGT6a E1MkSUbZTDxMQdbNbp1Qv8JFE1bGJBWQNqwCU15a5i5VmS7xMW3UZ5rs1DLvT1X5irmW wJBQ== X-Gm-Message-State: AOJu0Yy0ZP65stN5fNrs8nVL41y+0Bk3QQN4KF5UsaPwECcKmXDYJqO4 UadNR5iavyuBsnsZpiEy8L2Pvg== 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) 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> 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: 13455482 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F31E8C4332F for ; Tue, 14 Nov 2023 15:00:39 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.632720.987126 (Exim 4.92) (envelope-from ) id 1r2uu1-0001rJ-C0; Tue, 14 Nov 2023 15:00:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 632720.987126; Tue, 14 Nov 2023 15:00:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uu1-0001r9-96; Tue, 14 Nov 2023 15:00:33 +0000 Received: by outflank-mailman (input) for mailman id 632720; Tue, 14 Nov 2023 15:00:31 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2uab-0003vI-Ux for xen-devel@lists.xenproject.org; Tue, 14 Nov 2023 14:40:29 +0000 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [2a00:1450:4864:20::62c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c1ac0474-82fb-11ee-98db-6d05b1d4d9a1; Tue, 14 Nov 2023 15:40:29 +0100 (CET) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9d216597f64so867250266b.3 for ; Tue, 14 Nov 2023 06:40:29 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c1ac0474-82fb-11ee-98db-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972829; x=1700577629; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=85224ACu16xcahxMJd73na2pr08geUP2BaqK8DQk41g=; b=CqFxKExZx2zVxBU4nAvTQG416qy1C7DnCz3i8i8kEqrLzu7cT4cSmCqjObTW7uWiz5 e13jIqbr3o6yr4uCxkVL9/sEp1s2hM3Tsq+fhyTM+mw5KEEnr5+/OmcEV8VBY+X1R7Gq xG3C5+nTBvZ4k/R5EmPvb0cU8FvvSQwZBlLIRqyjuUy3s6DR9oJBHNXpjKKLzHpRQcbM 1P2aUoksphLNkPw7OF4/teBTk5HcG/rL2z4cnzkRmSsR5E7DY9W8odtjEPyIx/aAfmha EEROBZf31Wm0V06rS8Hixal1NrU1XtI5+CHWMGIEqShLK+SzUFpcdIpVuskOGIDAfCee EiwA== 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=dUWjDUFRpYAM9Ynrta3pdMuwJskTFDIoPJvjFaruVlslsfSpMh9t/F2D71RvlUG7y9 ZoIy7qbGfCXcVX/GBw0mCehePCWqaoojByZ9MIIUTpIl8h9yKYPoZF6ojgmDVasaEbd2 Flbu/Xac70Baa9KrhDn5zhzLAs9Hb2+iZuSnjdbuGNfa9sGZsUBMoGC2F4O+AOSnUeA2 U3o5IwGtsVAhph9ByxvK9L9yp/teDR/2nt5Jvfiya7Dl3hj6RbNTqmmWwXzNKJ/Ze+tV EMW2CUkNXjVrXMGRqbFsXWuEELcf2R6Du9vKyNvVGXIEaZoYDGR0lYxeSGETUaC0FDlP 1d3Q== X-Gm-Message-State: AOJu0YxqfOxHWb2w1Z2nOPIH6HNZp5xKW2iNrDzjR5GKZsr8BKcrU6SD qzlO3oIw7wPHXI0N3zfigUn2+w== 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) 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> 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)