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: 743455 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1677362wrw; Mon, 13 Nov 2023 07:22:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0g37UWPqX5OkMR/AgXOwMWtZWvMbMacCzlNGrBD3AtVWYDsqcuHOIDzpkcpiYyhR4iqW1 X-Received: by 2002:ad4:4a04:0:b0:671:92a4:6a52 with SMTP id m4-20020ad44a04000000b0067192a46a52mr5609561qvz.12.1699888957142; Mon, 13 Nov 2023 07:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699888957; cv=none; d=google.com; s=arc-20160816; b=vIVId8dha7a6Zyc0hUkrpNGTRFA5DrwAvUr+nE+xIgcMYfwMZBkYkHNUiaa5B53vIE c4qAk0jslFIiVU6oGh0ZBUu3YemJcwQMXKph78o/wqh01hc5E+mbSZzIROcNJtG+cPXU 8fo479ihV7obSPX8hQWD2c/cWseeb49oJ6p3FFWtklyWRwxOl/r+cJ4LVryYOwSqpNQc 3zyAJBIjWWr4Fc5jSga1FT0CYxiiKq0QZpcWsm/JNIxbAK80u3kWUCcEggniBI/4BHUC urj0KS9LsxyuZJMnkbS+J2dHCSYUnYjhfUJSjJQhYlqFErJvOWzdUkJsc+KWXOSaVgcd i5kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hC1GyuSTm1pIOLAiq1jl6VtM1wTJGGJIerTVB/FTO70=; fh=E0jvqUTVnbyPitMGLtsCjS/srUbMS2WTNKk9XEDC2rY=; b=ccVHu9FMAfaCMDVFcfnJfd443sjJvxU4qipERv2mROBVPzk4L7zC3juIJHecC89Pqw beGP5TwjHUf8sDjJ4A0kdCLgDR0xucaH2itmUZTFG2qPoMBP0vaiLEZUHcUm1GJYLWuY 4eG6LI9hbTZwXpijSd/Zrkl2v+5p0NFtidlZJ4MTn8jo0hHmWKbzrHbWW6z4eNMUaBWQ n7FSvtS7pRnpD7ssq4Xh9oGR+qFIljKWoGwc7krt+RESpHw/CSHkC/ur7l7XvV8e5X58 /JJ4Le7RRa6K04KHfkhFSqbABNq8aKI+I+gxJTP2RTHqc0g742ViImGWV67H2MntUNbR kJQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ONNMMf5S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u10-20020a0cec8a000000b0065b0fc01a9dsi4964886qvo.385.2023.11.13.07.22.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 07:22:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ONNMMf5S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2Yl9-0001rQ-1M; Mon, 13 Nov 2023 10:21:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2Yl6-0001pf-R6 for qemu-devel@nongnu.org; Mon, 13 Nov 2023 10:21:53 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2Yl5-0003Gi-8U for qemu-devel@nongnu.org; Mon, 13 Nov 2023 10:21:52 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-53e08b60febso7030538a12.1 for ; Mon, 13 Nov 2023 07:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888909; x=1700493709; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hC1GyuSTm1pIOLAiq1jl6VtM1wTJGGJIerTVB/FTO70=; b=ONNMMf5ShKOTAZfEB0QNL8A4KLsvbk34jIt6rmPSjIm1fYSMX1S+tCLT0zGbTZcviE OJyLqNoj5eEz7ACTykRKJEXO3hQCR1uXTEvZbMPx31TUfYRXlpqWhX9JgiWUunjGmKYp zQmLSQufzXMH0MiJexx2hTGidpkVXOjfuhShf0Tdugp5tEJyCvELN/Ns2zzt9BuCmWNv BTzG/1Lsn77/9WTtHUO55kXQ0xq3GBWXTiPg2PzXXMbPagtSYhmb8aPC/aEEJQJY3aPU G98J7MFlLMb9AvgJ98Oe1XDvmaTACxhDlVs+JeT7A4LkNOZokw0KeLfR74L4zfLTyhHx S8xw== 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=m44vI0BTH+U2tRPwADUrf8BIZzmAHNV2dUqzXrns28r8uuDVmLLhwhGqGwCyLpkqHr wytRzVhfhzzZ5qtBHyGW3wL978DI5iEBaguj5hyrhgFmS2lnlCHJ6ZozOTdWp0TBjCSn Sg/t1KTi/uz22xcpk5/TNS7mq5RQ2+s0jhM9MMgjVJNks6ynSQrt9d9FR3dHTTuBvHbG 9tW5ALjiDHd2cPuNaXytWuMKNKvAHvRJ1qrSOeLX0XoHXHMdiR8UkxSnRM47U1D7Ljd8 q2yEcHXMYjsI6ryVtsJVScp22tRv+CAtT5zVVIOtSrY7b1sFl6SeuZAoJAmLsSM8TKH5 TfpQ== X-Gm-Message-State: AOJu0YzhjfkKyWmmFjLh81iC1fYR3PDnnctmn/3aHK/vlh4kwff/9nqZ +58Y8cx/ltz3nU7cXJ4BaExfEg== 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) 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) 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 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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: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: 743458 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1677619wrw; Mon, 13 Nov 2023 07:23:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAO62dOR/M3qbgKyzXOMbylR3x3lP1l1LKxR6kVDkMyr3G53ehIuoEE0E1zWbn7l8eeXM4 X-Received: by 2002:a05:6214:4002:b0:671:1d0:d758 with SMTP id kd2-20020a056214400200b0067101d0d758mr8069310qvb.17.1699888985046; Mon, 13 Nov 2023 07:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699888985; cv=none; d=google.com; s=arc-20160816; b=jcKqkmVgoblJZjSb5RSYS2rVVcx2D/b4BON8rT1X2lkx11xPgGwZvv70L9zK/IlTLN sFA0V2ZLUeS/HWc6IMcnZj48SEtElNUQNaJfw2Dzmm8uWN2YUblKXHx7D0z2syEiRhla aBkh/yuHoUShADU5D6jeWIfqEKeTYuRGOhXYGETm3uc4To24nd4b9HulNPDWe1ipEDDj M2Egz0RnfYa9KyU46Z5DdUrIWr6RuWOYdIII3cKhd5G2Y8jabaoP1ImNzcmjKtMui8hd v92mHpGjWLEmMq3sOxyE/AQRPNjwOxmEauYq7HbFL72vPk7blG20Kd4xz7c3xqMJXEYE s7vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M3IanRET4oRDB/554uZaBMmk8ZcCL79rxTcGgU2jVuI=; fh=GiBYw8tXOCcndxW9R737jZrIBncGjjApaby5duidRsc=; b=TY9f/jKY+E0ZG5hkjxUNrx9AtX6jd2Qz+Qp2FdlIOQxxjwD8diP6DgwptSWqKO+XVz MCWugP6MipeRSaJjR6DMqaQZTYHJNaP5qIkX0mYM6zLFpEKh7GMJ2iJtf4ffuOmy6df+ DWTRAl8NbUT69zk1VOwc2QdDL9tu8Hf0KPJWsaREcDV/akCDQ3TUJUTpscYp9IKJ/BUw VDnDyGjGKX4wC6oiatnZ9MxqNhhZtkNvR+AR/0xjuWcPZKA7x6RPkniln92Bdai+b3Nw znO+2xGazjRrjorb5DfmYiXk1dRy+cYaS8ZqZusY7YL+klpKiU/EIc27hSzvZ7sX8J1b MYWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zmg2Z92S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b9-20020a056214002900b0066d121fdf87si4762930qvr.206.2023.11.13.07.23.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 07:23:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zmg2Z92S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2Ylb-0002Rv-QG; Mon, 13 Nov 2023 10:22:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2YlZ-0002G9-LY for qemu-devel@nongnu.org; Mon, 13 Nov 2023 10:22:21 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2YlN-0003Kl-4n for qemu-devel@nongnu.org; Mon, 13 Nov 2023 10:22:21 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-5094cb3a036so6294104e87.2 for ; Mon, 13 Nov 2023 07:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888927; x=1700493727; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M3IanRET4oRDB/554uZaBMmk8ZcCL79rxTcGgU2jVuI=; b=Zmg2Z92S+ZAynF5iomHSrDgJJtlXQgUrtUCYMJ0vjXah747IeUFFrnG+m80K6MmTTB GDMmNOj3C+pY/A3RGXvVjzMnqRjdPN099Ast/TTi/arPfr5ChcBEHGOoz+LaR2U5tWPy nQoGRlBsStg0xmpz5WlMN9zzxJ1YoAhTGOiZWq7wCMs0yd3cic+ztoDBzWUXIQYZiuHy EDktE/j0TJ4veZ81zjr0bR5XbJZG6vt1+RQtQ4daf7ujYb9/jah9OZoA+/hVurT89QVT 65Vnb8axpOZ4e3GDZy2aWCl8bnvAwXHDo8ZxxaSVUMFDQhAtKOBA2YgfwqfCsqFCNruu cPOA== 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=iJNZwnf0+giQTCm0HmkpkG7nohQir6fT9TVxKzNSNPFmEd9aUwMFBjhBY+A2MBvttv jXO1mhGJzcJCml7aaOR/Pb+e5BVRYh1spqQbiQPDwsK6ZW4zDRbZc5z5KzfuGyKsp3sN BsxzipEH2nsWGxHqV2lddG7zp+AdRjaPcT7WXJesKpyX3ewdhMkJXp9hl01bbmhH2mGR lAi5PHtV3xeZrIW/hqfmgqNNyWTwLN723KMgMVbEbDAP+IF9yfuQNJz/RHtxy28yUuMq EQCBAd/dxItQ2GGHewk6fX6vY276WGh0ssu+YChy4qhkBhQI8yMjGCzylNS/LlRGi9Zu 0KqQ== X-Gm-Message-State: AOJu0YzjAOCGLfWsV9ujqCBVVOza2p2HcT3Z0YRHMPg5GIFNR41ibWw2 aBX7RPp7+PRVG03FmrEYFI1kVA== 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) 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) 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 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org "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: 743457 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1677381wrw; Mon, 13 Nov 2023 07:22:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEG4s37wcxiDNDDO6Tw8n8EekzLahxT4WsA3JxFJHbMs+4UYWafsXv+LNGq8BD48W9atbH/ X-Received: by 2002:ac8:584f:0:b0:418:af7:e00a with SMTP id h15-20020ac8584f000000b004180af7e00amr7946198qth.21.1699888958231; Mon, 13 Nov 2023 07:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699888958; cv=none; d=google.com; s=arc-20160816; b=hX/+dGPXyRoUhdCs1NeWB4J/PifCBUiPhWbvZfVfg0IHQhxhRbei5s3U4UF5On/cPW 1OQK01UhgmCUBGVyBYkVglRweJTGbKjaKhZdiWge6pkKrgRQLC/Q6gCnP6uonO9QXOYJ jYXMoWFBdIezzRA73OUxR2mEL5fdAQZ+b5ttcA8BA0Kdf6v0qb95tSza76AD7G+yjX6O 3rvbCRTrZlw/Zn3mi6auvgqiBaKhj0+HjVcKAUtFGQoIqV+wmIgORAhOomWQv1iV3Nj9 KrNw9GQWs8OEgykRewDFqidllNHNJjVOIcxZmUdXPvqa946cjrxTxT1QAUWrqLz6mt/I Ih8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M4sm9DG4Z80HufhtnK5i8zUn8uDgyk6yGboQ8Gp5Uh8=; fh=sE7jrO7zRXEzTqLmd65HFEQBfnNVeSpKQq5mRfNQIAQ=; b=NQxHAtOVhN6Iezf2BbUUbJD+9qbpKsVkyMQH0vefsk1+to9jwm/W6l8KftedA/cHTt Ga/3mJixfQ/sQDHKD895P806ss1auQBsmjh63skX4BQ5APr4ppZwTLRDdQm3QOW/cc/8 Bp279pnOL0YVPg4dxozW1JfUXNvWKyw9gDGC0COBMKPh6AwTJ7YdjAg8Cw3YOs224Cg8 N1BOzJdlNIF1JtuY/wY7prLSQxNEfJY1uEqhSzTYqL9HG+x075bE9INWrKKCRJSxxP/e 6q53Qs0dLsVPOdNHnrCR7lM7kTpsSKwEYaB5zy3xfnBDUJQxvb3HeX4JlQMBPphm1w+q 3QCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a2qOrCoc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id cd11-20020a05622a418b00b00421c58ef9bcsi3789019qtb.7.2023.11.13.07.22.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 07:22:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a2qOrCoc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2YlX-0002Dz-1K; Mon, 13 Nov 2023 10:22:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2YlU-0002Bp-Q2 for qemu-devel@nongnu.org; Mon, 13 Nov 2023 10:22:17 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2YlS-0003LP-R5 for qemu-devel@nongnu.org; Mon, 13 Nov 2023 10:22:16 -0500 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9d10972e63eso671118466b.2 for ; Mon, 13 Nov 2023 07:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888933; x=1700493733; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M4sm9DG4Z80HufhtnK5i8zUn8uDgyk6yGboQ8Gp5Uh8=; b=a2qOrCocF+Ys/l8EWrSFo9qsiI80FxUak9Fr960d4YC+1w0jPxE6FK6BilcPlLDpZU eiBGJ9m2uOZTQur8k3MKncwzIJu42SPHV2tZi6m8WkdEFPlFptUflwCGiQVC/8DOdj2O kZME+QYINKoChleCQEr2PGgmrNGOVLc2jPUD1VHFwTABHq2357EoZZfdrCkHaLge3+I6 UDcH3AaAMezLJyGC6FIBAfQrZnWIBH1OPasEbb/TJaZTnoIVanlGRM8j1OrlR3jh4mnr Pbee64znqzd3JBjmwTRAGylABKYwKwxdORixaZgtr1FfqcINBljuiBs8LvvjgS8+sa4G wcpg== 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=O0VG4bt/mRNlwVnKNZeA1iqTr/Vz0Cj1fG5I633p+vxZLAEeRbQuFv735OnkH37NuB l9ySjSAijOwRYJTSKUi8VfFb/gP+dnVDZ1bnWKbchuKfCdXSezYZhNTG1pfVYKa5zCDx OhrGbkwQuJFTkDJa8CyBldJvSjpWRl3jsrQgM/GnkUfsVpGQ5KPisqRqBk+LU68acRuc bU3evW3k+pIjKO+NZrusS85viCtUlgTpx49QEC0AY1q4268Qtn7F2b1jtbw1HuCKMjeV Y+u/CL9Z+OC12P2doE9RnZmZkAHNSXKn2+5436oHpW855pQCL2+U8chODJ9k6f1LZa6Y 6+lQ== X-Gm-Message-State: AOJu0YzVC67cXCrCh7Kf5VA+7PpGXcUvtybwu9NbIhkR2juXGKKraVES uhMNFubK1fIsOZW2WbtfpH1btA== 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) 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) 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 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org "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: 743456 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1677380wrw; Mon, 13 Nov 2023 07:22:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNTyBpcQT3fyittsDhSI1YiVJ5hngpfipIcS1B9DUBYJOjHzP6t764EvLlCIex9EFqhDt8 X-Received: by 2002:a05:6122:2022:b0:49d:c1f5:d491 with SMTP id l34-20020a056122202200b0049dc1f5d491mr6852168vkd.15.1699888958171; Mon, 13 Nov 2023 07:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699888958; cv=none; d=google.com; s=arc-20160816; b=dwR5NhACZHbnyxuv6OT7zcFyVpx357z8IMQE4hSQJvKgX+mu7G5N4zhOZt3BVil2Rx a8JW6bVlaFkTKU84MI+T16RfVngNLDwSOLNJJ6DJr0182El03DNXMh+UIXhML8ZRGvyS N1Lb+IwMqQL6BzHTrrSOb7MjIkkOH9YRl9jpc1bmYqa67jerZ081uxEzIcrpBQW+dUi1 wJJnAJw8HRzk/GmLEz0iA1lQ34vjIqUtttsDF4LZfckxqbIi5UZyVXI+dTDZJMhSOKCC XcMm9VZtSOoZ280pmtWzodHVHlxLTStlpTzGjBtlxvTYjqU0UVjBOzDSqnpWjnh5xxQN Kq8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z2PpOM4WQ+uf4xck1acJwuABeC89nz7da2f3K2pGLBg=; fh=5R7Ays+lXy3R6eYmiUDvJwvlg9KwyY0eR9TFqtpjY3w=; b=zEtdD6rt1UyKY6dnFy03HBD+ZGRQEg5HGjvVOuciirIMvKr2vv88tP9/pCDsVZjJj0 6xcbD9IJqUWM5l56KX+N8iz1RAZzdCh0pujLzv77+Xm+dCbxKt1319qO6rBSXLF4JyDl bsoB2gdxvQYUMSvcwZtTrfPdIhd5oVXpnskSJndE5mqJcsBQH5Yq35PgbB3EK5DBzkWU QPfy/6WwSnTSbibuONWLOrMm9mxbXXw/8zHXaZIm4bAj55imBXl0QKXGiQE6TKRHP6x6 w2XMPg6jIfO+/BGT+w7ORYhHgpQc6nmuHm6vcN6oE7M1ve99dbdIaL72DY0pjdyZfE/X qhlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zZx560CP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dg9-20020a056214084900b0064cd41b2cf3si4788509qvb.25.2023.11.13.07.22.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 07:22:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zZx560CP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2Yld-0002Zl-L1; Mon, 13 Nov 2023 10:22:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2Ylb-0002Pc-95 for qemu-devel@nongnu.org; Mon, 13 Nov 2023 10:22:23 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2YlZ-0003M6-DC for qemu-devel@nongnu.org; Mon, 13 Nov 2023 10:22:22 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-54366784377so7100264a12.3 for ; Mon, 13 Nov 2023 07:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699888940; x=1700493740; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z2PpOM4WQ+uf4xck1acJwuABeC89nz7da2f3K2pGLBg=; b=zZx560CPsEtb9gZnwa4WxxXrwQE9eZnw0afxDwhIYX7hb4Bnifd1rKltMUIfd2iIAo L+CGC+nMOUOxlszSVNoD8+V/HKBiJZrl+rUIQ8GNalDSDDCkmkuUSDPlLquKPytLwYvM kRzWLIeMquYgUIP/jByLi0p6YwAiG4Ewc5U2zw8EKOyllDGX5IlL3JvYLmG0KRX+Dmcc Yp/own6p0kHe5xSz3aH13IWvCZIcG0/xi0d5htTO8La3o+Djms9r1uKDbwoEpDQuElGz woDUgO4q1Jea0XTg80byqFFiu+1oa0nUf7vaC9JEoxCtxmLjxIHMiY6jWmBHXlReADEA Y/XQ== 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=DWWV318demEH1wZ9nz55dD2ZoL2ZSZhcnmhP6GBPnpnlKe5pwK6xQPiWTK9gk+Rn+z dLrq/yxBYYnXlmLjPbQSpqfP+M+J6v5nbLp1Na4P1h3Qsbs2r1a47IsLJWh+834n+dUM 0pKkonKJuYfABxGzjqei5Qug5zD68QlU4MJ346R6m/WGstOnwghLX8rOO1FgzIs5mBPA a1mRDTzlyXHH9tBY0xcCHxde/ogUJpkrzIOmuhN46Y9rrhrTbXkL1o4xn/wgzvjcNd5g a8yD5WhNux785+0xrKBOvboiS++EuJtPjv6Hqd83gCG62T1PegRLiehmtSfMM+kk9wd8 x5lQ== X-Gm-Message-State: AOJu0YxE1kj9LkkfExzGVHPl7VK9LZ8vjfKpJ63fsp2La8ArHJYzfkbi f3p58pjGmj4hoMSQWMz2bmTIaA== 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) 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) 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 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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)