From patchwork Mon Nov 13 15:21: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: 13454102 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 CA28DC4332F for ; Mon, 13 Nov 2023 15:21:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631691.985282 (Exim 4.92) (envelope-from ) id 1r2Ykg-0006Ha-9g; Mon, 13 Nov 2023 15:21:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631691.985282; Mon, 13 Nov 2023 15:21:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2Ykg-0006HR-6b; Mon, 13 Nov 2023 15:21:26 +0000 Received: by outflank-mailman (input) for mailman id 631691; Mon, 13 Nov 2023 15:21:24 +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 1r2Yke-0005il-Ty for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:21:24 +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 4e8d3b90-8238-11ee-98da-6d05b1d4d9a1; Mon, 13 Nov 2023 16:21:24 +0100 (CET) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9e62ab773f1so450000066b.0 for ; Mon, 13 Nov 2023 07:21:24 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id dx15-20020a170906a84f00b009adcb6c0f0esm4204593ejb.193.2023.11.13.07.21.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:21:23 -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: 4e8d3b90-8238-11ee-98da-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888884; x=1700493684; 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=R0n+efnCwqYZSgvX5xA6BN1n520F2bZNMKVl3gVhASA=; b=Fj6N6HceDCT5lmsTGLuL8jOKrWVDWDB/6msLjIH/8VMWntJ3ljGFdugMW/6Dop+kBm ReiY9Cn8iKzS4fK1Tq4TWBJ40HVwZuT/fuWtYyGPJwoebZqF5GDElNJ4nmV5Cgy4g+t9 6pyjXIzRMNLgq9Hy9Zuqv3VyjDFK4ao3mA8j5RwtU5oG3iKKGG97E/i41mRjRr2Spx5A pxai4ZqCar5KXY/6cOOvS1FV1miFPUnDYN7WRrqWpZpQCO5LSGh0DcFcDKODgZ2kukmw v+hyGavTZwFSMVzEqDWhimIAYnMV02mWts0k3VWK9gnjFYL/wNtvTwLZ+Z1NCOekjlGI drhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888884; x=1700493684; 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=R0n+efnCwqYZSgvX5xA6BN1n520F2bZNMKVl3gVhASA=; b=rx+ijbGuRI7Nvu9y4T/l/rkTHb+86SFz7SRKNp6sxCuss5dutHYBHmk79weOM7Sra6 qeIEZom8x6VJt8EUaNFRduhZDjgSkGI/FUIMizqfflQ9+Z5hW+mw7MZtxuHYl4koEHeD jX9FQPcj7YWOJfivwi0PjrPwB1LlE7k9eh/JoGIdlsqpmIjw4WQ+t0Nb3uscD/2s6zvQ OqIow2ur2HkJhnCj3QjC4IMwr2YixNiYA2oxVW2dGTNKOqTHItkZ63/zHMk2RIGASBkh LUgLp9EIaVWErbD60rThUbS6PWkGcrGDCO9v4pzcdd6eGLdqQrwzWAxwoc6eVC0vB+YT a17w== X-Gm-Message-State: AOJu0YyN4HF8svXnd3f2KrjLcCdUKwQC/0R1kVil2x6Up7CtXgKARLbI YYIoNhXMF5h5MnmWfydeehZ2Gw== X-Google-Smtp-Source: AGHT+IH6xxb8oSsdvX/Qxe7SX73ROr6di4a0tnTAF45WIy9EC8KmTSkElWDjJsGSvtz6GSstCFLdyw== X-Received: by 2002:a17:906:4c84:b0:9cb:5a8a:b19d with SMTP id q4-20020a1709064c8400b009cb5a8ab19dmr4350360eju.5.1699888883852; Mon, 13 Nov 2023 07:21:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH-for-9.0 01/10] sysemu/xen: Forbid using Xen headers in user emulation Date: Mon, 13 Nov 2023 16:21:04 +0100 Message-ID: <20231113152114.47916-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-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 Mon Nov 13 15:21: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: 13454104 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 04DD5C4332F for ; Mon, 13 Nov 2023 15:21:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631692.985292 (Exim 4.92) (envelope-from ) id 1r2Ykm-0006dG-H0; Mon, 13 Nov 2023 15:21:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631692.985292; Mon, 13 Nov 2023 15:21:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2Ykm-0006d3-E7; Mon, 13 Nov 2023 15:21:32 +0000 Received: by outflank-mailman (input) for mailman id 631692; Mon, 13 Nov 2023 15:21: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 1r2Ykl-0005il-4P for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:21:31 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 52380b4c-8238-11ee-98da-6d05b1d4d9a1; Mon, 13 Nov 2023 16:21:30 +0100 (CET) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9e8b36e36e0so176058966b.2 for ; Mon, 13 Nov 2023 07:21:30 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id o23-20020a17090611d700b009829d2e892csm4243243eja.15.2023.11.13.07.21.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:21:29 -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: 52380b4c-8238-11ee-98da-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888890; x=1700493690; 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=R3bxfGqI5yyGuHTvJ252KdxHxDRKsvIzu9uNKMF+2iI=; b=gXRsTDOSQEDG1gnNO7n66cyH16/iNbTSvrH3oXMTeKldkNLFpU3/pxDz+o2MorWn/y l2ZvGuOPTU6ThdQxurR9cVmvl0G2+q+KnxzNxK3/bSNfvXyETx9oHrjW/s5ia7wwyAba /n0ezaoVFwL4u872GV/dM974JBO2rJBsgPD1BIyo0s9mwOb7RlUo/7+eBo7PL05jqwTT A3Tyr5bPorHuRg/yvq4Y/dGx0EprtiI+pCBnSyu6Z2QBHxW4c/X4iCrJCxv46Bwa4efl 3GKmQrzui3VeirDAkDgIJu8cRJI+e9uU1uMRizLCTSHndJF1U0+9T3r20dY9+Qm2LRQ4 2Hbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888890; x=1700493690; 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=R3bxfGqI5yyGuHTvJ252KdxHxDRKsvIzu9uNKMF+2iI=; b=ofm+I98/PiYhAX4gEVfPDoCaCWKeu5zQlrf54OQo6RvNYQk1VthQi9abGkI3hhVFcb 7ttagzWXBE8d+nim7y9ds/nlWhA6QNp5XMKOeDpAtXV+Oh3ocYZn+ZOEwqBxuinoXXB3 e76Ufjtxz4PgjjBmS+sYxPjwdIKZkSwdXxpeIBUoWLmg7UaCaTaviah4yCNzj18AH2xr Xla4qPkOZ0efjxLNmqiyoAFq4kkx8HVBHB1SujTIb00BbtcECSeB9bFSp0t6JDRZAxpU 8bDPMNQB93sUM8Or2lNcX2A2yIdggkWx01451aLzIk9uPkNWfzg/y1SXfIShhUx+UP9k hEEw== X-Gm-Message-State: AOJu0Ywr+Q1XSbFrzzIZGGtDJBeHdnmg5f8Fg9CA2P+Eo8pYDBWWCTDO lN7SlRq2e9CNoDvkGUxc0aXpIA== X-Google-Smtp-Source: AGHT+IF709HFmNxhzIc8XnNuz+a2oAKUrEHD5dHSaR8itUuUqXulXss7tknv1cuy4PMkZKxP4RsDmw== X-Received: by 2002:a17:906:3049:b0:9bd:f155:eb54 with SMTP id d9-20020a170906304900b009bdf155eb54mr4125199ejd.6.1699888890200; Mon, 13 Nov 2023 07:21:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Peter Maydell , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PATCH-for-9.0 02/10] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix Date: Mon, 13 Nov 2023 16:21:05 +0100 Message-ID: <20231113152114.47916-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-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 --- 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 a5631529d0..28d790f4ce 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 f42621e674..ffa95e3c3d 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 565dc39c8f..1d8bd9aea7 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 Mon Nov 13 15:21: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: 13454105 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 9502BC4167D for ; Mon, 13 Nov 2023 15:21:55 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631693.985302 (Exim 4.92) (envelope-from ) id 1r2Yks-0007IZ-P9; Mon, 13 Nov 2023 15:21:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631693.985302; Mon, 13 Nov 2023 15:21: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 1r2Yks-0007IP-L9; Mon, 13 Nov 2023 15:21:38 +0000 Received: by outflank-mailman (input) for mailman id 631693; Mon, 13 Nov 2023 15:21:37 +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 1r2Ykr-0005il-HQ for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:21:37 +0000 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [2a00:1450:4864:20::531]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5604f5d6-8238-11ee-98da-6d05b1d4d9a1; Mon, 13 Nov 2023 16:21:36 +0100 (CET) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5437269a661so11297035a12.0 for ; Mon, 13 Nov 2023 07:21:36 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id 11-20020a50874b000000b0053e2a64b5f8sm3913912edv.14.2023.11.13.07.21.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:21:36 -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: 5604f5d6-8238-11ee-98da-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888896; x=1700493696; 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=dMhWA/NoPTBRWdKt+DCwjQph3Exp2cV0GiTpIObeWaI=; b=eC+tcMr8YPUPZXRcjewL9pLwKzuQKSvdAZDUX2wQEWBgy7L/fESwHtwxO1oKjWZQvH cADqCjTlRXvVOiAbWkfYUj5w55XFdEm8PXD6ZRLTb3prGoQczPfsuND5Tc+ZxYZl7QBQ 7CGVrxlBsjaqMYaFPhP7PAc5XWXOGYiquA7LTCygoREpDCzs29QSyfrGBvXHGQzhhQ36 7V2G1oKSNzSA7MZc4FZEwK7uMRyB21g3Fat+oSTSRjxqeEuqdTTL7dfDhVzkPwxs0XqD ivwa3hYoJce2932GnaLH7PCJ3kvPvK28q0ylok5zaZXC9dusGZZpgsVDxBN+EzqyBRt/ BTHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888896; x=1700493696; 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=dMhWA/NoPTBRWdKt+DCwjQph3Exp2cV0GiTpIObeWaI=; b=reC3TmliD2fjvW8Nloq7LScLYiDtq7wawlUPj6npXmkGTHuNI1R0pQgxWMlbg/Lv02 cNrmyrLmSt/dOu9ikHN1p0mP5nCbkoiCFipX9B3HgNaspLMHz0Ifmo6wZOfU/W9/Icsm CdxZieaVDEbpgmuPxGF1WPVtlXSKE29GE2rQ5ehqykIAJdILF6dKsaptHSZnrXLq1eCf 4Ihv1F6rq1suEsG43MnwijA/KyNztxxP1SW/N649qy6LCMfnP4+bZXYKFDqTEul8O7Xv dsBSUWAG0Ve4Kj0ax2yItzgn3k58yP1D3/Cuc0S+7UrtHv5S+lEcdcK84SksRkcIaiF+ AdqA== X-Gm-Message-State: AOJu0Yzd9Fhzb0YlzjQssBWpxKKR/3APVehU7MsCovqjul5BUbaQAZx+ 6JTxnTbf4QgrLrT23piSov/UnQ== X-Google-Smtp-Source: AGHT+IGc2vVbLMMmJTrJzN8L348x5fFie1XMuffaYHScqr/mEvB+nkKPvDnad4c+cU6PUAspz7oR2w== X-Received: by 2002:a05:6402:2553:b0:533:5d3d:7efe with SMTP id l19-20020a056402255300b005335d3d7efemr9304050edb.6.1699888896473; Mon, 13 Nov 2023 07:21:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Peter Maydell , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost Subject: [PATCH-for-9.0 03/10] hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h' Date: Mon, 13 Nov 2023 16:21:06 +0100 Message-ID: <20231113152114.47916-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-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 --- 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 4e9904f1a6..27e938d268 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 28d790f4ce..6a1d7719e9 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 ffa95e3c3d..f8a195270a 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 1d8bd9aea7..c028c1b541 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 ram_memory; From patchwork Mon Nov 13 15:21: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: 13454106 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 923C4C4332F for ; Mon, 13 Nov 2023 15:21:55 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631697.985311 (Exim 4.92) (envelope-from ) id 1r2Yl0-0007qt-1Y; Mon, 13 Nov 2023 15:21:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631697.985311; Mon, 13 Nov 2023 15:21:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2Ykz-0007qi-Ug; Mon, 13 Nov 2023 15:21:45 +0000 Received: by outflank-mailman (input) for mailman id 631697; Mon, 13 Nov 2023 15:21:44 +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 1r2Yky-0007fE-NM for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:21:44 +0000 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [2a00:1450:4864:20::62f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 59b59792-8238-11ee-9b0e-b553b5be7939; Mon, 13 Nov 2023 16:21:43 +0100 (CET) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9e2838bcb5eso672348266b.0 for ; Mon, 13 Nov 2023 07:21:43 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id d17-20020a17090648d100b009e6cedc8bf5sm4165051ejt.29.2023.11.13.07.21.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:21:42 -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: 59b59792-8238-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888902; x=1700493702; 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=YAZk+3Dse8rl86kxKUGHVuPZUfUpHgJaPljFBSi46HI=; b=Dm8Bg4/Mn5BSImYcP7u268GzoYOpZ1eZIVw/97Bznf6cFTLfTTXaRmeh8ZwQpYHhhx +G/hBe2xuvlD/bSQhEFdmG12qmj95r1uNzhDIw1cTBxmuXtZzlPPzY/TKKpaan3dZaDJ ImkcrfTyRFTFVKZCYSGnuRGj6qyDoJht2X0cWNPQIZ6dFCy949qHjIgL4O07VW0uN+aK TZtL+zKce2cCoHHybUi2KQoBpA8KHTudwpyxi7Wk/d3/+FfPv882VuVJ9Oc/ioAXTTt7 GRM8vIeew4iRaA6mpUqR2hZqCfTNHIjdOldhd1e9OM/XhXj59nfK+OKuoVoku9MGanQb bNNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888902; x=1700493702; 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=YAZk+3Dse8rl86kxKUGHVuPZUfUpHgJaPljFBSi46HI=; b=kewo1LXzFGtQ/9hOS/0nzbMyetZNLjY1XNSe1E2uCtsvnCirXvZixTS9+I1qlkSw5R hyMyW2H4xcwRxou4Z1mklVE7ADIqOYfbFQL9HjP8Ci4H5xof11eU//ZRCfyyVsJMetcl 25yKskKFAttFTtEpBEvYo730FNNxSlQHYeMoiJkfvRqI4+ik49RIRiYw2HXoVH1ISW4s UXBrvCPLY0d8jTw9xNINvAgUJlzmMJodtvcL84EsxeA0cHkaMN7xsZxk9SR1o282ji7d lZmcv1MBg+83Nsdf0YHYTJzUYKfyeBO4vJFqqPhPueTrvjPCOHxByZAWLwb/y5MCpdYI 4HkA== X-Gm-Message-State: AOJu0YwTmj2lU2OimpivH34hLp59vUUja2fCEhiEafOHHQU1RFu0gDJ9 hmQWHMjAsOE+MDWOHYf0XO9RSg== X-Google-Smtp-Source: AGHT+IGj6dXGN5MguahUCcbomoo2q2R5bpml51YnyeqNpSNRHHGNbaVXW8b4IH/nqJe1/joi6MIM1w== X-Received: by 2002:a17:906:84c:b0:9ae:6da8:1819 with SMTP id f12-20020a170906084c00b009ae6da81819mr4194118ejd.48.1699888902783; Mon, 13 Nov 2023 07:21:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Peter Maydell , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq() Date: Mon, 13 Nov 2023 16:21:07 +0100 Message-ID: <20231113152114.47916-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-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. In order to compile this file once for all targets, factor the target-specific code out of handle_ioreq() as a per-target handler called xen_arch_align_ioreq_data(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- Should we have a 'unsigned qemu_target_long_bits();' helper such qemu_target_page_foo() API and target_words_bigendian()? --- include/hw/xen/xen-hvm-common.h | 1 + hw/arm/xen_arm.c | 8 ++++++++ hw/i386/xen/xen-hvm.c | 8 ++++++++ hw/xen/xen-hvm-common.c | 5 +---- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-common.h index 27e938d268..734bfa3183 100644 --- a/include/hw/xen/xen-hvm-common.h +++ b/include/hw/xen/xen-hvm-common.h @@ -97,6 +97,7 @@ void xen_register_ioreq(XenIOState *state, unsigned int max_cpus, void cpu_ioreq_pio(ioreq_t *req); +void xen_arch_align_ioreq_data(ioreq_t *req); void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req); void xen_arch_set_memory(XenIOState *state, MemoryRegionSection *section, diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 6a1d7719e9..c646fd70d0 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -128,6 +128,14 @@ static void xen_init_ram(MachineState *machine) } } +void xen_arch_align_ioreq_data(ioreq_t *req) +{ + if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) + && (req->size < sizeof(target_ulong))) { + req->data &= ((target_ulong) 1 << (8 * req->size)) - 1; + } +} + void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req) { hw_error("Invalid ioreq type 0x%x\n", req->type); diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index f8a195270a..aff5c5b81d 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -699,6 +699,14 @@ void xen_arch_set_memory(XenIOState *state, MemoryRegionSection *section, } } +void xen_arch_align_ioreq_data(ioreq_t *req) +{ + if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) + && (req->size < sizeof(target_ulong))) { + req->data &= ((target_ulong) 1 << (8 * req->size)) - 1; + } +} + void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req) { switch (req->type) { diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index c028c1b541..03f9417e7e 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -426,10 +426,7 @@ 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; - } + xen_arch_align_ioreq_data(req); if (req->dir == IOREQ_WRITE) trace_handle_ioreq_write(req, req->type, req->df, req->data_is_ptr, From patchwork Mon Nov 13 15:21: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: 13454108 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 414E8C4167B for ; Mon, 13 Nov 2023 15:22:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631700.985322 (Exim 4.92) (envelope-from ) id 1r2Yl6-00009O-EX; Mon, 13 Nov 2023 15:21:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631700.985322; Mon, 13 Nov 2023 15:21:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2Yl6-00009H-BF; Mon, 13 Nov 2023 15:21:52 +0000 Received: by outflank-mailman (input) for mailman id 631700; Mon, 13 Nov 2023 15:21:50 +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 1r2Yl4-0007fE-Qi for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:21:50 +0000 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [2a00:1450:4864:20::533]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5d63363e-8238-11ee-9b0e-b553b5be7939; Mon, 13 Nov 2023 16:21:49 +0100 (CET) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-53e07db272cso7044339a12.3 for ; Mon, 13 Nov 2023 07:21:49 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id f19-20020a50a6d3000000b0054026e95beesm3942482edc.76.2023.11.13.07.21.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:21: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: 5d63363e-8238-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888909; x=1700493709; 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=hC1GyuSTm1pIOLAiq1jl6VtM1wTJGGJIerTVB/FTO70=; b=RhKDSAq4tdFZFblL2vgU5GyIc25BAMTcvtLAay9NlQ86waYqpEFM97KTw95y77ljf1 bJwamz84mo9R24Wo97Sha70o22VVLAgAm3RzDP/0HyIjUgNnGTAjAQyWo1EWr2+Q3wFd GuP0fNuOjpo8dvP30c2Ee2esBtRKK48hBkJj/3BTpEpP5Pn5ALH+XBpsF3D0W1kcceuQ u+2aBHNLa0oUWOJtqfTz5WZ6Bm9ZeU3B+IYV2YO+1jy2RgJHRuHoUKEx7/vjNibOXH6J 2q5NmF5s72b/cqlnYswZnkzlRXxWM2qMk1SbvgVIfFQO9ba8QLXHY5g2o30t2pHbSyUk 14pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888909; x=1700493709; 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=hC1GyuSTm1pIOLAiq1jl6VtM1wTJGGJIerTVB/FTO70=; b=mBjVAN92tnXev/5cnZMI+M+590rZS0K8jXAHnu2aM18lZNKnVN7mL8NEmpAZTJ/u+Y qVxFoNjUbGZZaepUptuXhSfBh5EPftxej1+mFDdCg0XkNtSZuthpl1ASYyoRa+lKCBuT w5+p6cN1x+XgjlkMk+qNB15kZ2a/Q69iM0BKh7NNsw+ccFOTp+hXL3sAPRGXfOvoji+j 9GFkVykhJH+r0iVr5L0a/fJxroYiUlU80/ebXbCzTNzBLk+zUGtFCYUPDrECOBSLcSvA 9UmPgBtUn3qA/DFa9vTMgXr1hU5uh1SSWnwZ7LIHMj5+E+jtQI0aMfmv5VNS/AAiVmqu D+yw== X-Gm-Message-State: AOJu0YzQPUzQJBniCIZnAeEvGCCO1Q96VFjpJBnof/OaUoyTHJvc4iQv hPorFKexCdRXTa+wt2bMDQfQtg== X-Google-Smtp-Source: AGHT+IGbtAixMPiQVaiouSIFTb1IQKmmFA1AcOCrzXhQQ2Afk2FYf+XnPnB9Zgf0YAtZ7aK4/lySbw== X-Received: by 2002:a50:ab12:0:b0:540:2ece:79 with SMTP id s18-20020a50ab12000000b005402ece0079mr5690457edc.10.1699888908890; Mon, 13 Nov 2023 07:21:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH-for-9.0 05/10] hw/xen: Use target-agnostic qemu_target_page_bits() Date: Mon, 13 Nov 2023 16:21:08 +0100 Message-ID: <20231113152114.47916-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-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 03f9417e7e..35b3b5407d 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -1,6 +1,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qapi/error.h" +#include "exec/target_page.h" #include "trace.h" #include "hw/pci/pci_host.h" @@ -13,6 +14,7 @@ MemoryRegion ram_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; @@ -31,11 +33,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 Mon Nov 13 15:21: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: 13454107 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 E671FC4332F for ; Mon, 13 Nov 2023 15:22:05 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631701.985332 (Exim 4.92) (envelope-from ) id 1r2YlC-0000fl-Oo; Mon, 13 Nov 2023 15:21:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631701.985332; Mon, 13 Nov 2023 15:21:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2YlC-0000fa-Lz; Mon, 13 Nov 2023 15:21:58 +0000 Received: by outflank-mailman (input) for mailman id 631701; Mon, 13 Nov 2023 15:21: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 1r2YlB-0007fE-1r for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:21:57 +0000 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [2a00:1450:4864:20::635]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 611d9c33-8238-11ee-9b0e-b553b5be7939; Mon, 13 Nov 2023 16:21:55 +0100 (CET) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9c2a0725825so698888066b.2 for ; Mon, 13 Nov 2023 07:21:55 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id e22-20020a1709062c1600b009de11cc12d2sm4197707ejh.55.2023.11.13.07.21.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:21: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: 611d9c33-8238-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888915; x=1700493715; 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=iaPh59FgiGsmC+pCYaCOTA7yQ1Mp2MwkOCCJHlQNKqo=; b=fMk5NYIlbQ/gxBSTh9zJcjf5COuMPlM+O2pnKN9ZYTtV+/IvWkLoOQ+ERyYiN8ZqQB bMqHbyz0W9+eFiOgmLQUifCMZBxz3aMfx62deCOS/5LdKf6ydcGhy5GQCr7dLBoO+VyH rwsOJ49ZoY/Qnq3N9bZwbhpqJZq2/dBNuTMgZKXtsgo09ZHYNFes0g3EgZQ7HszHgAea gZMWZ0i7tyLCsDvWRWBPM/0pXnZQ7/pZ3cJwKfEocyWQx2Kw1qdNIaXcimZQxKUOddFw DRE2FaEAmTeBONgOaQBQ3TYzrZPJqN7o3558J5LrsrlZsTFxkpjXEpEyBR4iBZC7wzqu eOKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888915; x=1700493715; 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=iaPh59FgiGsmC+pCYaCOTA7yQ1Mp2MwkOCCJHlQNKqo=; b=KB0prYqAtCmvYIPxjyw8W/3mNh9f7xtXVtr0XDrSalzeWYpx8J6cRnjRHaae5OfFbt ceAt8vv1GKRKNaWheZapkyhGj6njQgURe6TmuANfr4ytpE/g71vXMA8YJwaVh/gszcVM 9JC+4ue3V++PjJcG2Tk1VVNz6QGEENzSz4pTPk9Eb5D14qdsoGrjoHTIQoidfgpTsNr4 0N88Orb6W+6eNVgfoVDRcGi8AGFi0d8Wx6lq7uHXAS33Y89HvCVA+HShnHO1iS796Lq2 YGAkkVyA00Kq0ewlGgwVq419JigVZSLYaMA+vS0gsIxA31Z7clDKAkzpbztws6kizSLx 176A== X-Gm-Message-State: AOJu0YxPCMpL3aS9/B4HCrQjQHPYLBCcGp2fx/+L0bVCbExVBzHqLeGr Jl5g0vRDMd1VkBpFGh6VxbHY4w== X-Google-Smtp-Source: AGHT+IH3RjReylXfRQh/wsJfTu2jHnqkMqs+PQHcbPoh+QyiOeqF9Xb3+QdjFCNga0xDu80xIHTeww== X-Received: by 2002:a17:906:fb8b:b0:9e6:59d5:8228 with SMTP id lr11-20020a170906fb8b00b009e659d58228mr4946396ejb.27.1699888915206; Mon, 13 Nov 2023 07:21:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Peter Maydell , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PATCH-for-9.0 06/10] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources Date: Mon, 13 Nov 2023 16:21:09 +0100 Message-ID: <20231113152114.47916-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-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 --- 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 734bfa3183..ca941fd3eb 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 c646fd70d0..2c97d6adc8 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 aff5c5b81d..369d738b50 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 Mon Nov 13 15:21: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: 13454128 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 679DFC4167D for ; Mon, 13 Nov 2023 15:22:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631704.985342 (Exim 4.92) (envelope-from ) id 1r2YlJ-000194-2E; Mon, 13 Nov 2023 15:22:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631704.985342; Mon, 13 Nov 2023 15:22: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 1r2YlI-00018x-VU; Mon, 13 Nov 2023 15:22:04 +0000 Received: by outflank-mailman (input) for mailman id 631704; Mon, 13 Nov 2023 15:22:03 +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 1r2YlH-0007fE-K6 for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:22:03 +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 64c60e60-8238-11ee-9b0e-b553b5be7939; Mon, 13 Nov 2023 16:22:01 +0100 (CET) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9d216597f64so705796566b.3 for ; Mon, 13 Nov 2023 07:22:01 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id s10-20020a1709066c8a00b009dbe08bc793sm4269124ejr.18.2023.11.13.07.21.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:22: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: 64c60e60-8238-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888921; x=1700493721; 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=24ML07HsEvOYl+DuxzoZlUZnhAFy4fscEFWSzx7VWys=; b=lOzzkC5S6RQdYiPHj4aGiv8rW0Sjm3UITXtrK5KwSJCYfH/QOMm9hBuW28PtGMq3Cf O/GKUHh2Cx9tjoKNLMywry8TSYLn+EvsNuy9YSjWGR+mB0qLrteu+1koTH3+dDu4fCI3 8un4rKadAWt4PRBlJ2030v0RrvQ4q3zGq53bZooHxBOgcPSCnpvbcOzJWrk4mR86gdiN wfCz45kQXt2U9WXzN/8/aLZT4L2AQ9jtByV62lmzT2BsZEdwLdc8GAF5IkWv0/WbXdZ2 OCqbzfEOr0v39DUzmy7KktY/9X+H5832o+w9VUSlZ2PPiYBDQ1o7Rf6QLdhVAcOcl/fQ +1AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888921; x=1700493721; 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=24ML07HsEvOYl+DuxzoZlUZnhAFy4fscEFWSzx7VWys=; b=eTCKU1lxXmIBKR7JkzTvz3vtV/Sgc5IqhimqW+NQcdSWB/mAz5h91cVCvU5P46aUuY duEGUMcMEWbah5J+41UqV0vxcYLARyETmGF/aSnDHQYfWyo2kiIcHLAwJFzDJMc+wEtC kYpndQBKCgNqWm1bOPflVJCdeYbihRcDAvgPeDqQluXoXLqOkS/m2npwx0IHtf3D220W 2y69dFDE/XnjAoWIUasHYXTdVKWs8T8FjppUdeCBOaS6qAQFwJVCz92eNFdkz9nCH7tp ird0uCw0L9T+hTYev3jV75btFneSPBFoUwPQORp7GMp1E+cUTBTNyE67dqpRF1afyDyF VEdw== X-Gm-Message-State: AOJu0Yxm9N1hHSp2ld/2yC2gnZc/2JcGMH3lfoPtXqrkW5SwqsgLJP2C 0wfVI6IVxZVuqGRGiKX1h8nL/A== X-Google-Smtp-Source: AGHT+IH+PnzXWjrgKP+WWXsdazo2lewjVqkzA92vUb1Slw8L1D+s00HazVDZsJw73hj51Hyp7Aw3PQ== X-Received: by 2002:a17:906:5fc6:b0:9e6:5132:43e5 with SMTP id k6-20020a1709065fc600b009e6513243e5mr4860965ejv.16.1699888921215; Mon, 13 Nov 2023 07:22:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE Date: Mon, 13 Nov 2023 16:21:10 +0100 Message-ID: <20231113152114.47916-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-1-philmd@linaro.org> MIME-Version: 1.0 "sysemu/xen.h" defines CONFIG_XEN_IS_POSSIBLE as a target-agnostic version of CONFIG_XEN. 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 Mon Nov 13 15:21: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: 13454129 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 2DB33C4167B for ; Mon, 13 Nov 2023 15:25:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631718.985351 (Exim 4.92) (envelope-from ) id 1r2Yot-0004YJ-Hs; Mon, 13 Nov 2023 15:25:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631718.985351; Mon, 13 Nov 2023 15:25:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2Yot-0004YC-Ev; Mon, 13 Nov 2023 15:25:47 +0000 Received: by outflank-mailman (input) for mailman id 631718; Mon, 13 Nov 2023 15:25:46 +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 1r2YlM-0005il-6J for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:22:08 +0000 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [2a00:1450:4864:20::132]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 68683716-8238-11ee-98da-6d05b1d4d9a1; Mon, 13 Nov 2023 16:22:07 +0100 (CET) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50970c2115eso6303489e87.1 for ; Mon, 13 Nov 2023 07:22:07 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id a9-20020a17090640c900b009e5ce1acb01sm4126763ejk.103.2023.11.13.07.22.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:22:07 -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: 68683716-8238-11ee-98da-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888927; x=1700493727; 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=M3IanRET4oRDB/554uZaBMmk8ZcCL79rxTcGgU2jVuI=; b=ZTojBGG/LuJFgNd0mzP79FlXicHw+nRG3h6jnjxWZHHQ1gRhZU3dkRqTB+i/RBIgKJ Vx15YHRarcOMXwvTzH7KKKIhoGvXxJPN5Q9uJ7mGgQDKN32PGj+oNbTkpv8IoTNfoXCn bZNiWLNH35vF4xZeuR2BN5c2fhYYQQ7eTvgDd53foIHn7Z59l4ynOvK+jLw88FL1ri9h BXlvEsY9rCaiLovsdOgSnqsfheo5nVOzYXYCciKhw8jq2Jkj7vufiDb1G17rWJO5oLO8 6SMCfybjEivY1eXKTHHX/iRph643RocV81NeUVtMrDjxAFUBOrbSjZ4kqL7L9QGSU6IH C+Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888927; x=1700493727; 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=M3IanRET4oRDB/554uZaBMmk8ZcCL79rxTcGgU2jVuI=; b=Zk8sG/BYKMSMtvMQP44Vp7vyF25vdUOIYXf6y2BN/sLdkIiO3pcg8pYcUe9pxiz89O ciFdOHphiPsteAMw8VYbBAmY951pLrNqLDMCuxGE3NH9DXc2Lw/+qb6aZGrIbT1HlKN5 sjeKS/abfTtIJOcR1wkhUBEFy1zRfye9Qx4qEXlFBYKh/RNdHVfWDMBOhPDRG5AljJb7 2ID6/eIMt/z28bM8zsvEXdJIr2eF8DN7XEDPAU1p9Vn8PCNdVQnj0nSDgFofWNXeFu/m TarH/me/YyTCfxyqGnjdMW5bMuVLhW3MEy8uAg6KBg4LgPDnlXXtY96cpJms2JIbimGo PPBQ== X-Gm-Message-State: AOJu0YwrzOMQzcBsuwRD5r7MKW6LuweoXIXnKShSgwLHOa4yxluaT49y GrtKMJUBH+TxRMTZKp6yVE7QSw== X-Google-Smtp-Source: AGHT+IGrSDy3wD9q51MX9RzmoZqMhawPjp2jB+lPSAfi/Dv8LmkQCpZSU6Ww+isXzJecNCmpib4vPw== X-Received: by 2002:ac2:5e6f:0:b0:502:a4f4:ced9 with SMTP id a15-20020ac25e6f000000b00502a4f4ced9mr4406770lfr.62.1699888927362; Mon, 13 Nov 2023 07:22:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Peter Xu , David Hildenbrand Subject: [PATCH-for-9.0 08/10] system/physmem: Only include 'hw/xen/xen.h' when Xen is available Date: Mon, 13 Nov 2023 16:21:11 +0100 Message-ID: <20231113152114.47916-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-1-philmd@linaro.org> MIME-Version: 1.0 "hw/xen/xen.h" contains declarations for Xen hardware. There is no point including it when Xen is not available. When Xen is not available, we have enough with declarations of "sysemu/xen.h". Signed-off-by: Philippe Mathieu-Daudé --- system/physmem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/physmem.c b/system/physmem.c index fc2b0fee01..fa667437da 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -35,9 +35,9 @@ #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/boards.h" -#include "hw/xen/xen.h" #include "sysemu/kvm.h" #include "sysemu/tcg.h" +#include "sysemu/xen.h" #include "sysemu/qtest.h" #include "qemu/timer.h" #include "qemu/config-file.h" @@ -51,6 +51,9 @@ #include "sysemu/hostmem.h" #include "sysemu/hw_accel.h" #include "sysemu/xen-mapcache.h" +#ifdef CONFIG_XEN +#include "hw/xen/xen.h" +#endif #include "trace/trace-root.h" #ifdef CONFIG_FALLOCATE_PUNCH_HOLE From patchwork Mon Nov 13 15:21: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: 13454130 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 2DBE2C4332F for ; Mon, 13 Nov 2023 15:30:57 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631729.985371 (Exim 4.92) (envelope-from ) id 1r2Yti-00088L-En; Mon, 13 Nov 2023 15:30:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631729.985371; Mon, 13 Nov 2023 15:30:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2Yti-00088E-CC; Mon, 13 Nov 2023 15:30:46 +0000 Received: by outflank-mailman (input) for mailman id 631729; Mon, 13 Nov 2023 15:30:44 +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 1r2YlS-0005il-Oj for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:22:14 +0000 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [2a00:1450:4864:20::52c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6c2103a2-8238-11ee-98da-6d05b1d4d9a1; Mon, 13 Nov 2023 16:22:14 +0100 (CET) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-54394328f65so7044526a12.3 for ; Mon, 13 Nov 2023 07:22:14 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id lu16-20020a170906fad000b0098884f86e41sm4167855ejb.123.2023.11.13.07.22.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:22: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: 6c2103a2-8238-11ee-98da-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888933; x=1700493733; 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=M4sm9DG4Z80HufhtnK5i8zUn8uDgyk6yGboQ8Gp5Uh8=; b=Hx4/J/M5boRN9Gt+jVpVZh1c+Q5YfL3KxrUENgke6Q4ER6+tRewrPNTpOHkgorHTpz SBoLumDHlWMxYqN/X4QG7mvetq8HBD7qp4VsQ3axz9zMER0APrbhfjwBQ3QspuxiwZ4X aSX97eIQlM6lqV4yIijLMR2hmys7hi84Cwbm5RA3ossss9SdsmawhgxUuSzbZRWz0sTW LE098Bn6dV6+a0X4rEofEXb2HefWNnjQOMp1EWQB4qka+pG3bRYG/TxkatXx2ycFCYXH gNJjB9fBZa7kQgQZssgipNMoMt3mcHi2Brd4ukJhwFaXtj2reFdcTn8Ez7Qt2f1Dtrju MM1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888933; x=1700493733; 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=M4sm9DG4Z80HufhtnK5i8zUn8uDgyk6yGboQ8Gp5Uh8=; b=rSsxXf1N3LkgAp/YTZdkUkqMrwF9QRrqqsGZYFhhCQ90x92kwLGXAhpdk3Cx9SPrjW CFU2W7nvwGuEWlTbYS5kEgBPIrTFKXHarjrwdAf6+z8yT/TFdAPmFpnbKamwxN8zPFyZ jkEtJmvMybV36575Czj7wXC6cSwamPWdd8DpbVrxUv5GohRBtKxnsh2ZG3syLqLE8NqU L1vUO/lZqsDfeL/7u2tBkyLEqAm1DBYStEh7bkjqgY2tgLc1uN/YvUjkb9WU7Zx87hm1 dnjADkJHbF4+fy33yMiswzYxof1Lh96gia5knJAlvqAVoS5rO2R/BgwWfr/iry6jErM+ 3a9g== X-Gm-Message-State: AOJu0YxWCW8gtzlgmmuWUWwPfk1HhSkJZd/iWRn1KaxaECZ6ewXizBX5 sw6/GAuz+pJ6uYZjy8AmLoP7CA== X-Google-Smtp-Source: AGHT+IHGfNKy17vE6nE5Sw7Yg/bCgxdoxzzgRWsVuH1JW/c7ZnqbwtyNJGeirXmng2B4mnP0CKSxhg== X-Received: by 2002:a17:906:b092:b0:9de:2b93:cab9 with SMTP id x18-20020a170906b09200b009de2b93cab9mr5146163ejy.8.1699888933620; Mon, 13 Nov 2023 07:22:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PATCH-for-9.0 09/10] hw/xen: Extract 'xen_igd.h' from 'xen_pt.h' Date: Mon, 13 Nov 2023 16:21:12 +0100 Message-ID: <20231113152114.47916-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-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 --- What license for the new "hw/xen/xen_igd.h" header? --- hw/xen/xen_pt.h | 14 -------------- include/hw/xen/xen_igd.h | 23 +++++++++++++++++++++++ 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, 32 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 31bcfdf705..da5af67638 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -5,9 +5,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) @@ -52,12 +49,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, @@ -343,11 +334,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..52f1f8244c --- /dev/null +++ b/include/hw/xen/xen_igd.h @@ -0,0 +1,23 @@ +#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 Mon Nov 13 15:21: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: 13454131 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 CFB7BC4332F for ; Mon, 13 Nov 2023 15:35:10 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.631736.985381 (Exim 4.92) (envelope-from ) id 1r2Yxj-00017A-UO; Mon, 13 Nov 2023 15:34:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 631736.985381; Mon, 13 Nov 2023 15:34:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r2Yxj-000173-Rk; Mon, 13 Nov 2023 15:34:55 +0000 Received: by outflank-mailman (input) for mailman id 631736; Mon, 13 Nov 2023 15:34:54 +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 1r2YlZ-0005il-1J for xen-devel@lists.xenproject.org; Mon, 13 Nov 2023 15:22:21 +0000 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [2a00:1450:4864:20::535]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 70027308-8238-11ee-98da-6d05b1d4d9a1; Mon, 13 Nov 2023 16:22:20 +0100 (CET) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-54553e4888bso6893748a12.2 for ; Mon, 13 Nov 2023 07:22:20 -0800 (PST) Received: from m1x-phil.lan ([176.164.221.204]) by smtp.gmail.com with ESMTPSA id lw27-20020a170906bcdb00b009de11bcbbcasm4238875ejb.175.2023.11.13.07.22.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Nov 2023 07:22:19 -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: 70027308-8238-11ee-98da-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888940; x=1700493740; 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=z2PpOM4WQ+uf4xck1acJwuABeC89nz7da2f3K2pGLBg=; b=U+3ipKtyp5p1l6dXSqpdO3ts4CnflliP0KAIZGvl5PPnYbOytr4thmGtKNukPSbSNj VIW/fBcMZtqp0Sp7Qt3T4VPzQpkfUe6CWhT6eeTXMpQ7ifprmk+r6VTu/F2idGXT14GK UAc9J4exvtLeihc5qRhWQuGmnLAfDZzdw9mElDeJe+6JkAem+iY6swUdG/PJNvLJDhs7 W3EO4zcYyCkqmUOMIFwgKJfiwJsesrq4VBdSIidFgS+NXajDU9QE1Fi+BfVQDg2gb7yh RMziBfYP5ATrP6qgjP6YWDDaWCiqY+5TF66Brgz4IvXPfomHmhQlfuKqQ/O0vDX+UF2F f+mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699888940; x=1700493740; 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=z2PpOM4WQ+uf4xck1acJwuABeC89nz7da2f3K2pGLBg=; b=ro6iGkumsmcEsBHrhdcWaZ5sqX6zONMVYX6bCYXh76YYIecsmSgMw3t7N7KoQeOb3g 2NyHym5iv7pC81+TK/nbMJfFyxd7DFzZQo2KnAGfDXtoz+udfNv/wAwab5pUncVxnl5g ditIJncEWFDv8HCj8WNUoGZiq1fQtp/roLfmMd0m+iHbUY6UkeHDSRveZo8wgUkTsB3v ht+AJfKs2LQXh6WxTBtqRCefVlLprp8+zEhtK9D3YQXPh8PSRSQWMLtwoRrE6osMWOU6 DzhWjuBEWxtRlTAk0+7tp9HhV2TSEoGd9XvUY/don0vMyNZ6eNgCU960eq3Zf33VlzND gV6A== X-Gm-Message-State: AOJu0YzkpKiTuz/l7m7Ux/vPjV1nLm4/C3sJz0TFbnFRopuZ+NxhX9KP XkpyamjRmUaBXB2yZTO/HZ27oQ== X-Google-Smtp-Source: AGHT+IFN0oQYvnRoNATsOZJ25LMlTXynSPofCu2en/Z0LYSJQyfcBbtJzfmWQwHuJeMUC7biyDShHw== X-Received: by 2002:a17:906:f2c3:b0:9bd:a738:2bfe with SMTP id gz3-20020a170906f2c300b009bda7382bfemr5045867ejb.38.1699888940071; Mon, 13 Nov 2023 07:22:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , qemu-arm@nongnu.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Stefan Hajnoczi , Kevin Wolf , Hanna Reitz Subject: [PATCH-for-9.0 10/10] hw/xen: Have most of Xen files become target-agnostic Date: Mon, 13 Nov 2023 16:21:13 +0100 Message-ID: <20231113152114.47916-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113152114.47916-1-philmd@linaro.org> References: <20231113152114.47916-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. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse --- accel/xen/meson.build | 2 +- hw/block/dataplane/meson.build | 2 +- hw/xen/meson.build | 13 ++++--------- 3 files changed, 6 insertions(+), 11 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..29adfadd1c 100644 --- a/hw/xen/meson.build +++ b/hw/xen/meson.build @@ -9,15 +9,12 @@ system_ss.add(when: ['CONFIG_XEN_BUS'], if_true: files( system_ss.add(when: ['CONFIG_XEN', xen], if_true: files( 'xen-operations.c', + 'xen-hvm-common.c', + 'xen-mapcache.c', )) -xen_specific_ss = ss.source_set() -xen_specific_ss.add(files( - 'xen-mapcache.c', - 'xen-hvm-common.c', -)) if have_xen_pci_passthrough - xen_specific_ss.add(files( + system_ss.add(files( 'xen-host-pci-device.c', 'xen_pt.c', 'xen_pt_config_init.c', @@ -26,7 +23,5 @@ if have_xen_pci_passthrough 'xen_pt_msi.c', )) else - xen_specific_ss.add(files('xen_pt_stub.c')) + system_ss.add(files('xen_pt_stub.c')) endif - -specific_ss.add_all(when: ['CONFIG_XEN', xen], if_true: xen_specific_ss)