From patchwork Sat Mar 9 19:21:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910070 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=fvCZl1qz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY2T0qH1z1yXB for ; Sun, 10 Mar 2024 06:27:13 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2H3-00008J-Ve; Sat, 09 Mar 2024 14:22:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rj2H2-00007j-It for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:24 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2H0-0002Qy-S1 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:24 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a45ba1f8e89so379340266b.1 for ; Sat, 09 Mar 2024 11:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012141; x=1710616941; 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=AJ+tmUmaxk1VpVXptMjtzEM2Kqe3+MxYTD28YtS2upg=; b=fvCZl1qzhpAzWfi5gSdtuZaioWkP82AO+e2X1JVsKWcbp5Syc3VSbo3NtQzv6XkRFM CG0K4Mv5xVwR4kePOt+oBVAzUfjPFk/Qx52DdJNGEQUaMLbMHW7e349pVTJjlb1O1q0+ eDYpMmn1rdh40T/e1o9CilmGi+80uV47xGcdDrw7bw8EC6/quSvWZBFncK4OY7SGdvYi wjmHtsfV/ZYbXlp2rhHk+5Tnqjb1hLnEb3iONv4GMMQLuc/D5IZCreRA60kJ5Q4Eunc8 VqxWkhRQ4COQP6qB6CgPO8iRybNyv/3a5JJKASycc/5n2UY5FSWDIvy4nzWhW+BdArx9 QPyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012141; x=1710616941; 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=AJ+tmUmaxk1VpVXptMjtzEM2Kqe3+MxYTD28YtS2upg=; b=VPGzGKEdk5DNONNQxqI8D6udDbAWKXIP5Puf6JUTbkfduRPA9Xdk+2dT9voh8G5oqr //NuVersSzFjpf4P0UCppMxPLyXzZREK5NYj7GvP0GF7+7REMVkKqDfknAnCWPoBRcdq N/dn9lNt9g/q985mC/bCuSaScXA/MdaHah2lj+tcx0g/yn5tu8kt/qsRyBFBNH+RhCza yLazHWufzyYADUIHe4UHTE9zh+XH/I/KyCWMVWKRaL/f3i1ACXSi41kSOYbJCcA+ikov SR2SHTCpEekyypT9mIkK/Ku6S8tXddNx4bvjogofr+Atc0j8U326fhnXpnopSg5pHNNA uLyg== X-Gm-Message-State: AOJu0YzPIJKsXVYIMORdnJ67dddswVB/brJdlFjbu0Wng2l3SWngugi3 Q9htli5FZUyv9aW2kTkNXdUWDYsGv9zoLsUF92swRLmW1KpQc+wHcKQvcPs9/Xg= X-Google-Smtp-Source: AGHT+IE66itJxflVZocCe80286+eXvG5IMQn5qkdouVWUYXYnbCypWRxLwZmJyuxo1eR2ZHoySbZqg== X-Received: by 2002:a17:907:a4c1:b0:a46:172c:e9cf with SMTP id vq1-20020a170907a4c100b00a46172ce9cfmr223212ejc.61.1710012141400; Sat, 09 Mar 2024 11:22:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id qk2-20020a170906d9c200b00a3fb9f1f10csm1162016ejb.161.2024.03.09.11.22.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 01/43] hw/i386: Rename kvmvapic.c -> vapic.c Date: Sat, 9 Mar 2024 20:21:28 +0100 Message-ID: <20240309192213.23420-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org vAPIC isn't KVM specific, so having its name prefixed 'kvm' is misleading. Rename it simply 'vapic'. Rename the single function prefixed 'kvm'. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230905145159.7898-1-philmd@linaro.org> --- hw/i386/{kvmvapic.c => vapic.c} | 5 ++--- hw/i386/meson.build | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) rename hw/i386/{kvmvapic.c => vapic.c} (99%) diff --git a/hw/i386/kvmvapic.c b/hw/i386/vapic.c similarity index 99% rename from hw/i386/kvmvapic.c rename to hw/i386/vapic.c index 61a65ef2ab..f5b1db7e5f 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/vapic.c @@ -747,8 +747,7 @@ static void do_vapic_enable(CPUState *cs, run_on_cpu_data data) s->state = VAPIC_ACTIVE; } -static void kvmvapic_vm_state_change(void *opaque, bool running, - RunState state) +static void vapic_vm_state_change(void *opaque, bool running, RunState state) { MachineState *ms = MACHINE(qdev_get_machine()); VAPICROMState *s = opaque; @@ -793,7 +792,7 @@ static int vapic_post_load(void *opaque, int version_id) if (!s->vmsentry) { s->vmsentry = - qemu_add_vm_change_state_handler(kvmvapic_vm_state_change, s); + qemu_add_vm_change_state_handler(vapic_vm_state_change, s); } return 0; } diff --git a/hw/i386/meson.build b/hw/i386/meson.build index b9c1ca39cb..d8b70ef3e9 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -1,7 +1,7 @@ i386_ss = ss.source_set() i386_ss.add(files( 'fw_cfg.c', - 'kvmvapic.c', + 'vapic.c', 'e820_memory_layout.c', 'multiboot.c', 'x86.c', From patchwork Sat Mar 9 19:21:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=y9EJGYm5; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY4y3VtBz1yX6 for ; Sun, 10 Mar 2024 06:29:22 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2HA-0000AZ-AK; Sat, 09 Mar 2024 14:22:32 -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 1rj2H8-00009f-Kn for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:30 -0500 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2H6-0002S1-UD for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:30 -0500 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-513298d6859so3003832e87.3 for ; Sat, 09 Mar 2024 11:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012147; x=1710616947; 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=9v68VdV/ZTxTWOB82N2ZE0IksCha8mce59bQC7Dz3io=; b=y9EJGYm5tiwU7GvILWKfd+GRYVi0A0oTnRfXE26Mgv9cV3HJXpAKsg9vPuA2c18aYk YW9drXOHrP20ue/Vs7Yd6RWs0GOgAo79zy+HfTJpP6Qav29a6YsundROXXvP9VFzhJNG WoZl4BvgspQ0l4JP+ArxuJ6Fww7nJy7vBkUIGBqESHfqnCenX4sfiJfFe9HtzeaTV6Bs g/iYPNA7tixh+y2qjejPYXGmdIyYKwUHIlKoxYmAZDnUWuR5yj/6VAh+qwlWnh7Pjgx6 DPO+qtmgCf3tiw/VYfWi88eay5P2kvfD/btzeIBoX4YoB9r9LGIU3yQ3NLl738/JIiX+ vdPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012147; x=1710616947; 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=9v68VdV/ZTxTWOB82N2ZE0IksCha8mce59bQC7Dz3io=; b=WK9rH189H67A8FCLrnXnx9fmhTLdXcB7VQmHycfDMuNK/RM9RN9HgxXvwSvwbhnt/6 dzFI5cvw1SBNc6aA8DtJ3x6rzEaMe1uIUM71MmPEFnzXK0Ve3qgxMe8UNpGiwbZ99t1A nAFvrpUraLrqtl+CPPooqtClPFRJsC4egXGy7UuZgsCGl86glWYqFVS53vfzIqKhIM4x a3v1GfQgjfgY9UwyWaArFWnwKC4hYv2hOM5m9ztF2MdIxqHMHe9UlQnksFi4b7UAfNic PEkqTu/pAgH2t8lYY7a1hSzz9+1Qw0vX81Jh38MFFSm4lynJwRn/RpU2qwdD6zeqsSnT 7mHQ== X-Gm-Message-State: AOJu0YwFBaRiF3jd/a/wUWaTYMPfLhFtIxuRNYWMrkQdIeGSB16rH9F5 FaCbLsnm/+eZAD+/XPtZosequghfVUpkEcUD8LeArcgZr1aFkCcz2r1oYFN5AOs= X-Google-Smtp-Source: AGHT+IEPUeAq3OvXQ6d5BNC7LVFINL5jOukf6dFmDeF5FkUQjdJ+zjK8mwm9i8o+ivn3j1gVM1bH4g== X-Received: by 2002:ac2:43d2:0:b0:513:486a:57af with SMTP id u18-20020ac243d2000000b00513486a57afmr1542144lfl.7.1710012147310; Sat, 09 Mar 2024 11:22:27 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id h27-20020a170906399b00b00a3ce60b003asm1185569eje.176.2024.03.09.11.22.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , David Woodhouse , Stefano Stabellini , Anthony Perard , Paul Durrant , xen-devel@lists.xenproject.org Subject: [PULL 02/43] sysemu/xen: Forbid using Xen headers in user emulation Date: Sat, 9 Mar 2024 20:21:29 +0100 Message-ID: <20240309192213.23420-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=philmd@linaro.org; helo=mail-lf1-x135.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Message-Id: <20231114143816.71079-3-philmd@linaro.org> --- 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 Sat Mar 9 19:21:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=mfsMsTYk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXxs5CSkz1yX8 for ; Sun, 10 Mar 2024 06:23:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2HF-0000Bk-F0; Sat, 09 Mar 2024 14:22:37 -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 1rj2HE-0000B8-4l for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:36 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2HC-0002Sd-LV for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:35 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a450bedffdfso408582566b.3 for ; Sat, 09 Mar 2024 11:22:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012153; x=1710616953; 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=hXABjAaMhxHgVCCn4BlGHy0+qqoq0gDIyiPdTnOnZyc=; b=mfsMsTYkDCpgjf2QMCF2eoAcYTW4ZyH08BAH20vmzKCLBsafDfXyM29j4rw9LIXOIp Qg4s6KzOEXV6AwBmGF9ZrB2sfT0kPXUVt0KBKkuJLVjvimqXOjnQmACaqfAcIzX8UoHb PKNFiK9jVQNKdkHJt9qow0RjOX382GViTFkKUH1nFZLImaTLiGC27cLjZ+R/uVGfQEV6 Bc1ZsC2wZeENotgdiXhULYMVlPp4rtrHjJ5VFBI4gEMrP04nlAmaVk7B15pGBoNNQmB7 sy9TexOj/3dLAqhM6YMHgx8/dWaVs5Vt6iVsEcNkD5AKgsLCbR+Qc8HzOoI+AOgT4t9C zfgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012153; x=1710616953; 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=hXABjAaMhxHgVCCn4BlGHy0+qqoq0gDIyiPdTnOnZyc=; b=kwUjxOvN7xRwXjvNsHD4gXbxmazaUiW4UE6M5dJy53D0iG6zJBmE5tu4jrHphbbApA l3R0XSDruc4zSoHnnphMqwze+xFxCHazuOn3f32xakwQOosw4lq/27ATLNxaiLZFmmgs EdyL4+BabUqx+dTQgi0DyZ8McI8lqiRxlGahHORG9MAvYc68PV41gKfLHAqT9+0o+//G Px7I9FgsqaY6ytm3SeT2M5fpgtvjq5hsJ5VkcQTicxOEXCBo/5Fkc8knnxreKF/rWHoZ tCWbY/Yc4YF/CNXcsUe2Ulx0HGK00rJ1a8TgXGeznV0FHzlKj4d5YdDC1EA8Qz91/fGS 9jYw== X-Gm-Message-State: AOJu0Yz2MGF0gunkDx+mW0uordJXkvHXSc3zaLB5UpuKWYWxHsSY3FrW 5hQNj0Qf8iJE9MBQH0lPNiOZ8dWRwkDHSvYqQqqvGALXCvzj8buoGI+5Wv82ymk= X-Google-Smtp-Source: AGHT+IG1/vyvQGvmM09S/M6+IuzayHPuZieilQc2Rg23/rY/x2WN2KV9nhRWH7snP7zUoE6gG7SZXw== X-Received: by 2002:a17:906:4f02:b0:a44:446b:e99e with SMTP id t2-20020a1709064f0200b00a44446be99emr1256763eju.31.1710012153357; Sat, 09 Mar 2024 11:22:33 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id sd21-20020a170906ce3500b00a45f3524ac3sm1161512ejb.118.2024.03.09.11.22.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , Stefano Stabellini , Anthony Perard , Paul Durrant , xen-devel@lists.xenproject.org Subject: [PULL 03/43] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE Date: Sat, 9 Mar 2024 20:21:30 +0100 Message-ID: <20240309192213.23420-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=philmd@linaro.org; helo=mail-ej1-x62a.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org "sysemu/xen.h" defines CONFIG_XEN_IS_POSSIBLE as a target-agnostic version of CONFIG_XEN accelerator. Use it in order to use "sysemu/xen-mapcache.h" in target-agnostic files. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Message-Id: <20231114143816.71079-4-philmd@linaro.org> --- 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 Sat Mar 9 19:21:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910119 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=LrTYXNRc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY7P217Nz1yWx for ; Sun, 10 Mar 2024 06:31:29 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2HL-0000Gd-IK; Sat, 09 Mar 2024 14:22:43 -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 1rj2HJ-0000Fb-Uq for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:41 -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 1rj2HI-0002TK-FR for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:41 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5683576ea18so1629480a12.3 for ; Sat, 09 Mar 2024 11:22:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012159; x=1710616959; 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=tC/kiuQFLzAJIELEDb51aw3s24kLy7eDbWP5W63QeD8=; b=LrTYXNRcvDKTSH6APYZi8ttX7KMHjSzNikukosk3P6FDhMnOvmM1U5zpMalSoQCA73 2S8pjOgjs52wILRm1dWrE8ntnCoy+gwqYmaHRUUH8DazlALIz9luec7mumfH3hj5gGWg gQQsMcJYkQ+pFlKOZ3JOQVckH0pvlSMK58EykPCJ/kt5xykZ/OIBX07g1MZm9ooidBBm z9axii3WqIrSjIwsOUwDv8YPtkbB9eJaRGcwdAayNoB8hYryX7BPUYoA22+PYxp6PeCk QwsemhQAwirijWLOB5fFkktJiD8PMGBl7IsiGAkDfHvOVvKJka7g+rcts5KyCViMFFnB vNXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012159; x=1710616959; 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=tC/kiuQFLzAJIELEDb51aw3s24kLy7eDbWP5W63QeD8=; b=kFf1o8Rbh4Wf+MRStBlYWQp55dHQiqAa2/o0v3/HAHNmH1J5AemQHB4bGdGC0xR5WX Kctx9VrFIYskI2GdoXp1VOCHALFj2oTyJC6JHXzJxtLfGHCjTZKBtBEz99iH7nC8/gG/ ulEWLwcBejPcC0vlQRaj34iV1f6jjUJpS2dlbVJWSRMT9pRlrdoNcOZH62Ft7ENkqn9Q +c2nSdB1BzuMWC1uy+DxeJfCNcMqV9eMUCVTkUaLMqyVXF5Ltn7kMRdxNtxw3wvy05aU jTYW9mgBvgd9QSyFb3OPjD0tR4guLd6lAgAoENB7vF1QtLPoPHOxi8LKuk8F7qcC6yMD dlyw== X-Gm-Message-State: AOJu0Yy3tQMeCAX/W19tvVXQsfoqcqV9a40VjMVD+XhAJRExyvcUYXMV H2PAycKC1z9gTeaQG0+WRrbrHNYymdo3hJlfDGjfoRxfifl6i2iUkuzaWWZAtcd+5o1zlGZloC6 7 X-Google-Smtp-Source: AGHT+IHu7iErUaQhb/iOqdqNUztKh6+iIcuL2bT4JOaVPS9pbXCOM/MCUyWhBzpVIGeMmuHeD9ew8g== X-Received: by 2002:a50:8717:0:b0:568:1b9f:d6b3 with SMTP id i23-20020a508717000000b005681b9fd6b3mr1590136edb.40.1710012159128; Sat, 09 Mar 2024 11:22:39 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id a3-20020a50e703000000b005661badcccesm1148488edn.87.2024.03.09.11.22.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , David Hildenbrand , Paolo Bonzini , Peter Xu Subject: [PULL 04/43] system/physmem: Do not include 'hw/xen/xen.h' but 'sysemu/xen.h' Date: Sat, 9 Mar 2024 20:21:31 +0100 Message-ID: <20240309192213.23420-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org physmem.c doesn't use any declaration from "hw/xen/xen.h", it only requires "sysemu/xen.h" and "system/xen-mapcache.h". Suggested-by: David Woodhouse Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Reviewed-by: David Hildenbrand Message-Id: <20231114143816.71079-5-philmd@linaro.org> --- system/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/physmem.c b/system/physmem.c index 3adda08ebf..6e9ed97597 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -35,7 +35,7 @@ #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/boards.h" -#include "hw/xen/xen.h" +#include "sysemu/xen.h" #include "sysemu/kvm.h" #include "sysemu/tcg.h" #include "sysemu/qtest.h" From patchwork Sat Mar 9 19:21:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=uDPoWynI; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXyv1YMQz1yX8 for ; Sun, 10 Mar 2024 06:24:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2HS-0000Il-So; Sat, 09 Mar 2024 14:22:50 -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 1rj2HQ-0000Hq-5n for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:48 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2HO-0002UJ-Bj for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:47 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a2f22bfb4e6so475957866b.0 for ; Sat, 09 Mar 2024 11:22:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012165; x=1710616965; 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=dvPLYlBQAWmf1NvUY3LgRzjhJOxAzzfQLYDmKAk6+Eg=; b=uDPoWynIu2dvzNt3Ckd9UUX7TWwWMjKS5raMiqoWEz+PbBQJhFDo7WwtXUI6CdYlt8 gZ39MX/Yvedvd8FgIbGYtlt7KxB8Z0uV7I1pph3F4mv1Tx3lNwZmgO7NLSG0L5l9y6dj 6x+VMRCRdD3Ew7kx9Zll3o3qS2qtalPXpu5kD8e10HuGg/tgdPpYLIyTdDEKdEi4DBIg nB50eprbzaaIQp5tpddjTOpJxveydBA0zsJqstwSbfMq2SONQ0HZN+/7c6FyWNlWy50P mNqfmIFp+hOzPSEuqdPPPUy/qZ8aqmZ/B2WUhEmO65Z+vZxduzgjS9NWoKhLxSTgaYoy WONA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012165; x=1710616965; 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=dvPLYlBQAWmf1NvUY3LgRzjhJOxAzzfQLYDmKAk6+Eg=; b=sMlpoUjE/SsgD598Htco7i4pk22/fbWy4wjLqil3KW4vVs8XGh7g3b+90oaWIEYaPy mb3SUgKYaVVEWv5GLFdFB2M/JUcVZhPw+96v99EMW7W93V1UxsMGgv/HxngpEmzF6Vc3 BxWM9wjAKujaUyYl7Z28OMTQoJFxLpV1JzHoZNH7gOroay/n8u1mXt/Ew76CLNLHoYCb gNEuzjNpUuYiy99fbZUvc1c/N6Tb3lIMVP6M28PUCDrGdsC4vZoo70sotW8JnVz3MoXm 0o7tAq/dvq5Js2tirgxXL/GT0VJCaLtnrMJdmshqIkkQBhNsZ1depKSqrTdV7eSqxREW 4hdA== X-Gm-Message-State: AOJu0YyYDmgZmpJDy3acJi37j+kNRn6OqYcaxrZyZOVSdy4tHNqTzIEG sXLPt+/+TdkHLvhLhh/y4MKXIOVx6VgOTThnOED+z0VBmpLwZMIpspaw/0Oqt8U= X-Google-Smtp-Source: AGHT+IGN8k3Sm6baTXPm79wHAuc6ayShgYcEDLvukc8XhwEnOb6ThROAcunL2w6kbhV8Y4RYVCKWXg== X-Received: by 2002:a17:906:c2d2:b0:a43:f22e:57a6 with SMTP id ch18-20020a170906c2d200b00a43f22e57a6mr1137454ejb.67.1710012164856; Sat, 09 Mar 2024 11:22:44 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id o23-20020a1709062e9700b00a44cf710cc3sm1170300eji.182.2024.03.09.11.22.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 05/43] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen Date: Sat, 9 Mar 2024 20:21:32 +0100 Message-ID: <20240309192213.23420-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Similarly to the restriction in hw/pci/msix.c (see commit e1e4bf2252 "msix: fix msix_vector_masked"), restrict the xen_is_pirq_msi() call in msi_is_masked() to Xen. No functional change intended. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Message-Id: <20231114143816.71079-7-philmd@linaro.org> --- hw/pci/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/msi.c b/hw/pci/msi.c index 041b0bdbec..8104ac1d91 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -23,6 +23,7 @@ #include "hw/xen/xen.h" #include "qemu/range.h" #include "qapi/error.h" +#include "sysemu/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -308,7 +309,7 @@ bool msi_is_masked(const PCIDevice *dev, unsigned int vector) } data = pci_get_word(dev->config + msi_data_off(dev, msi64bit)); - if (xen_is_pirq_msi(data)) { + if (xen_enabled() && xen_is_pirq_msi(data)) { return false; } From patchwork Sat Mar 9 19:21:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910044 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=CqXWBu1F; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXyk4jlMz1yX8 for ; Sun, 10 Mar 2024 06:23:58 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2HZ-0000Kb-I5; Sat, 09 Mar 2024 14:22:57 -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 1rj2HY-0000K4-5t for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:56 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2HW-0002VA-6Y for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:22:55 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5683089d4bbso1940958a12.2 for ; Sat, 09 Mar 2024 11:22:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012171; x=1710616971; 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=cFjMT6zDVz6FC8tPUCQ4kyyMrqKZ8chKsrslRHOyQyw=; b=CqXWBu1FQrLQrx2FmDdLdS/BGLFDvUZKB+rVoGQmVFwQSM90i1GsAC8swYDoNG2P5V G5fvHMbj5xk/pl4pEJYjA4RA6mZAa3R5uPHtRmnZ6I0lUK6ReqHtAvzIItNbGcJDpG9/ xGQJVYMzDXEfB4cnsOW3ixx6Kphoz5jkh3fcqzxbcrzhzy9S3Q9iwO40Vd7rC8g7CcHS Vct4I2T/0psb1fk2hU7+yb0ZdTRF5Pd0/JCZlymvYVjAy39WFD37Yr2kpbrfhfJeE2gN MefBLQCB4Fm3dAuqCSe789RMLETLxxrcf9BkBGFmnjmMC0Pd0pGPXyLrBmOaVFdLPz0s 34BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012171; x=1710616971; 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=cFjMT6zDVz6FC8tPUCQ4kyyMrqKZ8chKsrslRHOyQyw=; b=eKFWIyPncBuw5XvQfAFBRWVV+1Mxs0YFufz2FTYtSHZokYVjEcJPiXqqtOC+2UvLGI eAK4/ccoA3wZGjdH7G2CeFDgJGFNhXGlaZwPxl31PbkH1Hqo2RnN571LsBUl/c+Ch1dU eha/twPLqZ53mSF4VjPKKXQvSKp1OVPDcLpaHM4PfvBq4Tszrm4MwET1q/CMODFrrPYt 4qHcYpWQvD/ftoz10sJRW1JYyak/cgqhxOSf6oM+eRbcZxG/Ozppo6HdYMiCZxx7bkzh oicUimxnfJnHIUHu4guhvGXcYiYHXlMfk626aehsuiQfL4tyqMoBynpW0x/57a9xCy0X AP6w== X-Gm-Message-State: AOJu0YzqXg6dMtN+HyFnKIxhYiubgbx/ur0Rp6QKchU0K7Kz3gnhod2E oVZCYSfy+9MMg/QZVSQAFa4yKIf0brpftyp0Hpl9rtUiOozjfv94RBvJzOUUt8g= X-Google-Smtp-Source: AGHT+IEOGwIBYdP/mzwuHWgPMjU0SlF6nHZcYJJa0Wt9irOScU0CVSd5Ssk82Pi/m/B9Cv/46kpyew== X-Received: by 2002:a50:934a:0:b0:568:1882:651f with SMTP id n10-20020a50934a000000b005681882651fmr1774495eda.25.1710012170814; Sat, 09 Mar 2024 11:22:50 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id y18-20020a056402359200b005648d0eebdbsm1141497edc.96.2024.03.09.11.22.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , Stefano Stabellini , Anthony Perard , Paul Durrant , Paolo Bonzini , xen-devel@lists.xenproject.org Subject: [PULL 06/43] hw/xen: Remove unnecessary xen_hvm_inject_msi() stub Date: Sat, 9 Mar 2024 20:21:33 +0100 Message-ID: <20240309192213.23420-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since commit 04b0de0ee8 ("xen: factor out common functions") xen_hvm_inject_msi() stub is not required. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Message-Id: <20231114143816.71079-8-philmd@linaro.org> --- stubs/xen-hw-stub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stubs/xen-hw-stub.c b/stubs/xen-hw-stub.c index 7d7ffe83a9..6cf0e9a4c1 100644 --- a/stubs/xen-hw-stub.c +++ b/stubs/xen-hw-stub.c @@ -24,10 +24,6 @@ int xen_set_pci_link_route(uint8_t link, uint8_t irq) return -1; } -void xen_hvm_inject_msi(uint64_t addr, uint32_t data) -{ -} - int xen_is_pirq_msi(uint32_t msi_data) { return 0; From patchwork Sat Mar 9 19:21:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910109 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=OjAj8Pwz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY7305VWz1yXB for ; Sun, 10 Mar 2024 06:31:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Hh-0000Oh-85; Sat, 09 Mar 2024 14:23:05 -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 1rj2Hd-0000MK-Fv for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:01 -0500 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ha-0002Vz-PO for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:01 -0500 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-513a08f2263so374126e87.3 for ; Sat, 09 Mar 2024 11:22:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012177; x=1710616977; 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=5TjXBOuAt82J0vCEpvih+prFEkSXa24TTOPlq290ir4=; b=OjAj8Pwz4f1q0Jr2TzRM5ltUQ/HXBFfezx+ybYHhDjY8mGBVfDWwxvw4wNoO//34Rv pAmE3IoLc8ws+H+54e208JAWYuc13IRwEZxcl8irEL8uU6/MOzgjX2zQU2XmX6C0oDEY wVbQwEfrIaJDAnvWQGuhQbCi8tzu6JO9KtUVCCCXnEHh7hMRo96lQdyD6eapZ+stdLp6 7yQeoSqa2xmVYVH5UjClrMUY00x3qPRV1nKEjp/b75+DI3fAGIJZ8E+pt4Qbed61Oxub Uf9NlGZ2U+mh4Y49H0erUGDZp0dM4kFv9khBn4T1qYqCduil0W946gdcqKnP8vHCWxEr d5RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012177; x=1710616977; 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=5TjXBOuAt82J0vCEpvih+prFEkSXa24TTOPlq290ir4=; b=NZjIAAWJiVUHWrsu7KryB5iiCq8fdz1UWk2gvtXIX3PPvChHH6YvInfvZqw1vnz2ig Sq1+FLFOILU4F2E2FIToqGGQZzEM72Shu2XNZ7z/nFAUj/sEC1hnr8DrPHnqoxny3cxN nxzh5CnOa1JN3qTGcIuZKtlsd5kg8Al2mUu7qItwUqdoLOUlFbFSDfnONKRjuyEHq2AJ 1koH9EL31C0ihuORRVvO7TBEWZ0sOM7HISxt4145eGWTCtKnUAlp7d4MT7h9oMtp4KdQ K+abnzpFQiydUA9L66vvQw2OM/n+PYYM7XWbdBLfPw5ytjXIOeTeU6aSjUd00ZJnzS6u PyPQ== X-Gm-Message-State: AOJu0Yx2NydoFzkOP1krxzdNCLf1c0J4n9bodECQi+dSA70wsTjcMdUn fQYb1xfBeAFpZDJTyAF1H3GTfDG74ojB2sO4BuU5E6vkZXhKFl/MEBFXH8KE+/c= X-Google-Smtp-Source: AGHT+IFu3iF5YfsPHFl4QgKzLThNg0KEglVlBZvKN0xPMmy0J9g6tryab3kSYkTuJAqwUaCGcPfaPg== X-Received: by 2002:a19:ae17:0:b0:512:d6b6:dc44 with SMTP id f23-20020a19ae17000000b00512d6b6dc44mr1371505lfc.66.1710012177076; Sat, 09 Mar 2024 11:22:57 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id 24-20020a508e58000000b00566f92f1facsm1220206edx.36.2024.03.09.11.22.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , Peter Maydell , Stefano Stabellini , Anthony Perard , Paul Durrant , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , xen-devel@lists.xenproject.org Subject: [PULL 07/43] hw/xen: Rename 'ram_memory' global variable as 'xen_memory' Date: Sat, 9 Mar 2024 20:21:34 +0100 Message-ID: <20240309192213.23420-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org To avoid a potential global variable shadow in hw/i386/pc_piix.c::pc_init1(), rename Xen's "ram_memory" as "xen_memory". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Message-Id: <20231114143816.71079-11-philmd@linaro.org> --- include/hw/xen/xen-hvm-common.h | 2 +- hw/arm/xen_arm.c | 6 +++--- hw/i386/xen/xen-hvm.c | 10 +++++----- hw/xen/xen-hvm-common.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-common.h index 4b1d728f35..65a51aac2e 100644 --- a/include/hw/xen/xen-hvm-common.h +++ b/include/hw/xen/xen-hvm-common.h @@ -15,7 +15,7 @@ #include "qemu/error-report.h" #include -extern MemoryRegion ram_memory; +extern MemoryRegion xen_memory; extern MemoryListener xen_io_listener; extern DeviceListener xen_device_listener; diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 32776d94df..15fa7dfa84 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -114,14 +114,14 @@ static void xen_init_ram(MachineState *machine) block_len = GUEST_RAM1_BASE + ram_size[1]; } - memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len, + memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len, &error_fatal); - memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &ram_memory, + memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory, GUEST_RAM0_BASE, ram_size[0]); memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo); if (ram_size[1] > 0) { - memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &ram_memory, + memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory, GUEST_RAM1_BASE, ram_size[1]); memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi); } diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index f42621e674..1ae943370b 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -149,12 +149,12 @@ static void xen_ram_init(PCMachineState *pcms, */ block_len = (4 * GiB) + x86ms->above_4g_mem_size; } - memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len, + memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len, &error_fatal); - *ram_memory_p = &ram_memory; + *ram_memory_p = &xen_memory; memory_region_init_alias(&ram_640k, NULL, "xen.ram.640k", - &ram_memory, 0, 0xa0000); + &xen_memory, 0, 0xa0000); memory_region_add_subregion(sysmem, 0, &ram_640k); /* Skip of the VGA IO memory space, it will be registered later by the VGA * emulated device. @@ -163,12 +163,12 @@ static void xen_ram_init(PCMachineState *pcms, * the Options ROM, so it is registered here as RAM. */ memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", - &ram_memory, 0xc0000, + &xen_memory, 0xc0000, x86ms->below_4g_mem_size - 0xc0000); memory_region_add_subregion(sysmem, 0xc0000, &ram_lo); if (x86ms->above_4g_mem_size > 0) { memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", - &ram_memory, 0x100000000ULL, + &xen_memory, 0x100000000ULL, x86ms->above_4g_mem_size); memory_region_add_subregion(sysmem, 0x100000000ULL, &ram_hi); } diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index baa1adb9f2..dc69cada57 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -9,7 +9,7 @@ #include "hw/boards.h" #include "hw/xen/arch_hvm.h" -MemoryRegion ram_memory; +MemoryRegion xen_memory; void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, Error **errp) @@ -26,7 +26,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, return; } - if (mr == &ram_memory) { + if (mr == &xen_memory) { return; } @@ -53,7 +53,7 @@ static void xen_set_memory(struct MemoryListener *listener, { XenIOState *state = container_of(listener, XenIOState, memory_listener); - if (section->mr == &ram_memory) { + if (section->mr == &xen_memory) { return; } else { if (add) { From patchwork Sat Mar 9 19:21:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=nYCXrbHd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY0Y3t1Rz1yX6 for ; Sun, 10 Mar 2024 06:25:33 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Hw-0000cT-3H; Sat, 09 Mar 2024 14:23:20 -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 1rj2Hq-0000Zl-NS for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:14 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Hj-0002WY-S0 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:12 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a458b6d9cfeso248270266b.2 for ; Sat, 09 Mar 2024 11:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012183; x=1710616983; 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=Q44dwAJ9zWJURYp9hh0U7wvOFqEH1mwy4JxGXOeg8jA=; b=nYCXrbHderVfjS+29AGgiifMHf6NUDFw/yLJ4BwXKnabQJx+9ODwdyWCaeUtGirb1/ 81w5za2WauxJilpN9XU8+i1AIq8Ce9ZWlbfkip0kbYRQsUZO6dCILPsxb0TEc5Y+Cr0Z bdbArpHMzIIblJtD4BVCkOo+o1YWi4q8dy+ggsA4M22hGKeaqDz5sUp9o+sJKsq3uXUq nv66aYylPxLfdEd4PGjcgtTADtvDWV2odV/XpCbnfGKa0l0YGnO/L6LNQzwrMrb1+iuI IVqqhBTr9DT1wjuzxG/hQGuSQx/7U7l4mP1h2sRUKNfbZtwbteKRqhOPPxJndurGFREx lnqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012183; x=1710616983; 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=Q44dwAJ9zWJURYp9hh0U7wvOFqEH1mwy4JxGXOeg8jA=; b=deH/pL5/2BsxpDG3jjnlu1qf3y81OjYulV7oYZfi1pWWfB4Y1AwB4VxdclIiKD4+pe ZnoH8aYltkXAnMR5OyJKGRHsb9lkK3oD1RAu+XRmWGupyOZVe5SfYfsSawGHp47AkgzU EA9ZnCWn0bs4+8N23T1t4vjA1+hX29SiZ3ca1uwDeBXgSb99g2hkURkXoXcNsUv1zuq3 T2CZ470yfjoHAQ6CORNLhvC5ahajuWp5+LDPfaXmWreKI1p69YfIsPfyvMvDuvNOU1Pf 5C25J0apCy/BfrJs29APZPmCTIWV6j+ZpRjz2gD8E526qCIJvR2YSwmRHUSaXieOph6v DNkQ== X-Gm-Message-State: AOJu0YyYws+H9LAQuQOVIv0U3CQRQ9m+OgYo/J31mQCXteycPGR+GsVZ 4nqNZ6rduluzgQhRdpi3cyh2z92lOed2bGwieQTwpZl1zQc9y+Mw5IsiOmFWBfk= X-Google-Smtp-Source: AGHT+IHOQkfTUB7DFZUnzFt5SN8xXU0FWBVOfPyoMZQqgOTUu5nO+XttuLhInRopNUGb3cs1S/BhDQ== X-Received: by 2002:a17:907:7898:b0:a45:119e:3dec with SMTP id ku24-20020a170907789800b00a45119e3decmr1327777ejc.73.1710012183067; Sat, 09 Mar 2024 11:23:03 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id x19-20020a1709064bd300b00a44e2f3024bsm1172780ejv.68.2024.03.09.11.23.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , David Woodhouse , Stefano Stabellini , Anthony Perard , Paul Durrant , xen-devel@lists.xenproject.org Subject: [PULL 08/43] hw/xen: Use target-agnostic qemu_target_page_bits() Date: Sat, 9 Mar 2024 20:21:35 +0100 Message-ID: <20240309192213.23420-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.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 Message-Id: <20231114143816.71079-15-philmd@linaro.org> --- 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 dc69cada57..1627da7398 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" @@ -14,6 +15,7 @@ MemoryRegion xen_memory; void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, Error **errp) { + unsigned target_page_bits = qemu_target_page_bits(); unsigned long nr_pfn; xen_pfn_t *pfn_list; int i; @@ -32,11 +34,11 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, trace_xen_ram_alloc(ram_addr, size); - nr_pfn = size >> TARGET_PAGE_BITS; + nr_pfn = size >> target_page_bits; pfn_list = g_new(xen_pfn_t, nr_pfn); for (i = 0; i < nr_pfn; i++) { - pfn_list[i] = (ram_addr >> TARGET_PAGE_BITS) + i; + pfn_list[i] = (ram_addr >> target_page_bits) + i; } if (xc_domain_populate_physmap_exact(xen_xc, xen_domid, nr_pfn, 0, 0, pfn_list)) { From patchwork Sat Mar 9 19:21:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910079 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=qD2laXfc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY382vDsz1yX6 for ; Sun, 10 Mar 2024 06:27:48 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Hx-0000du-MA; Sat, 09 Mar 2024 14:23:21 -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 1rj2Hq-0000a5-Tq for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:16 -0500 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Hm-0002YT-PZ for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:14 -0500 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2d3b93e992aso21968861fa.1 for ; Sat, 09 Mar 2024 11:23:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012189; x=1710616989; 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=9jsjeEWjsUkRHeCpOh+pko9UBxzZs1OaWzN0fIY08/s=; b=qD2laXfc0kbIGJy8+oNlHK2xm6IqvihqX4SHN+Uvtsw8Rw4xBcTI2H/edOX/ZtgCxW +TL3JtMP/tOFwGHSn3gGzRzTqWx1WMPk9BG0HRUIs2CvKZ0OoosuhyAwn8qswI4xmGha 9LHD3lAQFIJxZKJ6H1KU5rCwDnpMfaybNE3kb/H1udSbB14gMsQ2FcjeHxBk/ErivQD2 0XbsHPpmbN5NL3ySvkHbbyfsi4uqrSGv7KKkevx+krlatDuelUd/RSHjrvhbBvIF5Mfc S4knwHxmZnLne3WZaHpBI4l0CtZ/3tbfwmg+HgLpp2ZzJcW//aZSapzqAQy0dbgQ+nAx IDTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012189; x=1710616989; 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=9jsjeEWjsUkRHeCpOh+pko9UBxzZs1OaWzN0fIY08/s=; b=j02VTRma/j2CBByFAeHbq2HawojKlkycZXj6i3ltisL7peGIQ+mekJyycBUoQyOnZx V9jrLPv3HKIpFgzv7diEituhjvOCHT1sRoEm0LNQ5nLC9O64RrlScfB7NMfrQfjZII2K 86sZ8Xi0Hb9j1ad39VjKrppsHlIGk8O6RjNqZSVMR2ElynhOegwOMjHGlAPdh15Fmx14 ASaXAbfo1kNvx56ZxOOTCuFlNOQXMoJLjaSASdB0UXXEiOeLgD51nKoc27P2n4nM2rCQ XNyErbDBvj7/j+egKr6/TdfQEM1knscNTJh2eLUljG0m85vj7cJ0jU1u1VH/7TC81toY tu1w== X-Gm-Message-State: AOJu0Yx57bI5fc4jJd+ugFuvfZnvh9MSRaVb1zDi2R0Bx4+G629mtcMN KpxcXjxW9SEm/ZtSoB0E7Xvh4y+3O8kzoU3YtP81B/0wYglznS4+Oh0BUBQIozE= X-Google-Smtp-Source: AGHT+IHVJYQKMJoF6M5h+nBzkB9MQSOKRczhtHaq4vuFR2+EzQeH6DE9+nIiaOsLgRl8gEGAHG9UzQ== X-Received: by 2002:a05:651c:61f:b0:2d4:22b6:e6a4 with SMTP id k31-20020a05651c061f00b002d422b6e6a4mr1215415lje.30.1710012188800; Sat, 09 Mar 2024 11:23:08 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id fg3-20020a056402548300b005656bbb5b3fsm1153256edb.63.2024.03.09.11.23.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , Stefano Stabellini , Anthony Perard , Paul Durrant , xen-devel@lists.xenproject.org Subject: [PULL 09/43] hw/xen/xen_pt: Add missing license Date: Sat, 9 Mar 2024 20:21:36 +0100 Message-ID: <20240309192213.23420-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=philmd@linaro.org; helo=mail-lj1-x22c.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Commit eaab4d60d3 ("Introduce Xen PCI Passthrough, qdevice") introduced both xen_pt.[ch], but only added the license to xen_pt.c. Use the same license for xen_pt.h. Suggested-by: David Woodhouse Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Message-Id: <20231114143816.71079-17-philmd@linaro.org> --- hw/xen/xen_pt.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index 31bcfdf705..d3180bb134 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2007, Neocleus Corporation. + * Copyright (c) 2007, Intel Corporation. + * + * SPDX-License-Identifier: GPL-2.0-only + * + * Alex Novik + * Allen Kay + * Guy Zana + */ #ifndef XEN_PT_H #define XEN_PT_H From patchwork Sat Mar 9 19:21:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ddOS7a6t; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY583WDGz1yX6 for ; Sun, 10 Mar 2024 06:29:32 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Hy-0000f8-E5; Sat, 09 Mar 2024 14:23:22 -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 1rj2Hw-0000cX-Ae for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:20 -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 1rj2Ht-0002Zc-01 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:18 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-512e4f4e463so4455866e87.1 for ; Sat, 09 Mar 2024 11:23:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012195; x=1710616995; 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=0dapH6sMmnV9ZamVJJtysMb9yL4xw8w3bAoh22EL4Vo=; b=ddOS7a6ty3VgghRuGIE/wuDnv0ji3b9KuY/1XeDmr49TYdstEcOxOsDGHYqbqW3iXh nlRFbiXbPscgUnprMiIo89XsSdS9+QcQvxG08iXv44MzcyVcu9RpQdGL87XZz5dTmfXj phPTo+UoV7jivVm+SWqtdqpU4a/nGeW+23LdjBVrxFZBS3UvH1kcQJhqu1de5fI4LFpn yAOynPmiDl8+C3VG9SKZJ7GGp9OjKlpF+8pnMF8ujRmJIZuwXCRtH6bmtPJnwaAVDkCG c/kxGsKOrDKdh7TH6naZxFDQnyYuqnn6BZYLw8lzOgcccphbqwt4HNSmLKRyCgRtxoZw DK/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012195; x=1710616995; 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=0dapH6sMmnV9ZamVJJtysMb9yL4xw8w3bAoh22EL4Vo=; b=o6PL40mqvPw5noy/tpRcM3JGmynGiAi4g1OrdcDLg6BRhltk2YgLVXhtCj66jV+Hdz Ue+NjkMUCT5zK8Vg4D+KlHXwwfBQE1q8OXLJfczOm5CwAoiZ6QY06M3RYjG8BfFmHDeG DldCx+jFPHqmQBhPtMQ1jnYZLqragzugvsCX8rUl1bw30ClDZ+6WnPPtX6kjY+d5zcn9 AY9ipWCHHcu7Gv96IAOeBOEijjTPzStPAlhd2htoINosHEiY+VnosBA2GvmKtaT/eyaR TKtx4gHHDKz9e/RYri4rl+Xu0bP59+h10uWveGPTtqW4oXFG1EOCY0BEVCu0poOROJKE B8Pg== X-Gm-Message-State: AOJu0YwUhAIG3ZFPzNoeXK3MnNxShBW2L+qw9rQFhg5wcU6I1tZIxu9n j2JZIJfy+dougJ752KPr/DpWmexUyzY5bzHCwLCf9ZIDar+FhhqYylgzzyhC3tk= X-Google-Smtp-Source: AGHT+IFZ9Fs+PsF2jnfTNVld6iD1aF/yC/++Clb+ISz5eMReGA6KlLI+TlLWLbqJFmWdTAeuAL2cvw== X-Received: by 2002:a19:f709:0:b0:513:54c6:9f68 with SMTP id z9-20020a19f709000000b0051354c69f68mr1301272lfe.18.1710012195436; Sat, 09 Mar 2024 11:23:15 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id p16-20020a17090653d000b00a45464679b1sm1162257ejo.127.2024.03.09.11.23.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , Stefano Stabellini , Anthony Perard , Paul Durrant , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , xen-devel@lists.xenproject.org Subject: [PULL 10/43] hw/xen: Extract 'xen_igd.h' from 'xen_pt.h' Date: Sat, 9 Mar 2024 20:21:37 +0100 Message-ID: <20240309192213.23420-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-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, 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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.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 Message-Id: <20231114143816.71079-18-philmd@linaro.org> --- hw/xen/xen_pt.h | 14 -------------- include/hw/xen/xen_igd.h | 33 +++++++++++++++++++++++++++++++++ accel/xen/xen-all.c | 1 + hw/i386/pc_piix.c | 1 + hw/xen/xen_pt.c | 3 ++- hw/xen/xen_pt_config_init.c | 3 ++- hw/xen/xen_pt_graphics.c | 3 ++- hw/xen/xen_pt_stub.c | 2 +- 8 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 include/hw/xen/xen_igd.h diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index d3180bb134..095a0f0365 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -15,9 +15,6 @@ #include "xen-host-pci-device.h" #include "qom/object.h" -bool xen_igd_gfx_pt_enabled(void); -void xen_igd_gfx_pt_set(bool value, Error **errp); - void xen_pt_log(const PCIDevice *d, const char *f, ...) G_GNUC_PRINTF(2, 3); #define XEN_PT_ERR(d, _f, _a...) xen_pt_log(d, "%s: Error: "_f, __func__, ##_a) @@ -62,12 +59,6 @@ typedef struct XenPTDeviceClass { XenPTQdevRealize pci_qdev_realize; } XenPTDeviceClass; -uint32_t igd_read_opregion(XenPCIPassthroughState *s); -void xen_igd_reserve_slot(PCIBus *pci_bus); -void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val); -void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s, - XenHostPCIDevice *dev); - /* function type for config reg */ typedef int (*xen_pt_conf_reg_init) (XenPCIPassthroughState *, XenPTRegInfo *, uint32_t real_offset, @@ -353,11 +344,6 @@ static inline bool xen_pt_has_msix_mapping(XenPCIPassthroughState *s, int bar) void *pci_assign_dev_load_option_rom(PCIDevice *dev, int *size, unsigned int domain, unsigned int bus, unsigned int slot, unsigned int function); -static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev) -{ - return (xen_igd_gfx_pt_enabled() - && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA)); -} int xen_pt_register_vga_regions(XenHostPCIDevice *dev); int xen_pt_unregister_vga_regions(XenHostPCIDevice *dev); void xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev, diff --git a/include/hw/xen/xen_igd.h b/include/hw/xen/xen_igd.h new file mode 100644 index 0000000000..7ffca06c10 --- /dev/null +++ b/include/hw/xen/xen_igd.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2007, Neocleus Corporation. + * Copyright (c) 2007, Intel Corporation. + * + * SPDX-License-Identifier: GPL-2.0-only + * + * Alex Novik + * Allen Kay + * Guy Zana + */ +#ifndef XEN_IGD_H +#define XEN_IGD_H + +#include "hw/xen/xen-host-pci-device.h" + +typedef struct XenPCIPassthroughState XenPCIPassthroughState; + +bool xen_igd_gfx_pt_enabled(void); +void xen_igd_gfx_pt_set(bool value, Error **errp); + +uint32_t igd_read_opregion(XenPCIPassthroughState *s); +void xen_igd_reserve_slot(PCIBus *pci_bus); +void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val); +void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s, + XenHostPCIDevice *dev); + +static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev) +{ + return (xen_igd_gfx_pt_enabled() + && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA)); +} + +#endif diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 5ff0cb8bd9..0bdefce537 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -15,6 +15,7 @@ #include "hw/xen/xen_native.h" #include "hw/xen/xen-legacy-backend.h" #include "hw/xen/xen_pt.h" +#include "hw/xen/xen_igd.h" #include "chardev/char.h" #include "qemu/accel.h" #include "sysemu/cpus.h" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ce6aad758d..e123458bbc 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -55,6 +55,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 Sat Mar 9 19:21:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=uZcIsl1r; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY3V1HYZz1yX6 for ; Sun, 10 Mar 2024 06:28:06 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2I2-0000jE-Es; Sat, 09 Mar 2024 14:23:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rj2I0-0000gq-JK for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:24 -0500 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Hz-0002aT-2G for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:24 -0500 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-56838e00367so1122107a12.0 for ; Sat, 09 Mar 2024 11:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012202; x=1710617002; 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=A3YPWAKLFpXy74v59/y9ZVQ7mfzqWdCePg5o0rXQJdU=; b=uZcIsl1r4tAg3Mgcng1cPmj08G+ID/2Ui1lNuGzmdKBAf3ALX45pAO25aamLHzIXAE YH5rYaBbW4Mv33yiM+kSVRdwCiaoKMig+DGmrswWOAknup6EgZBHxSeDnEUUkr50ovro KQru4+CFjGWfW4/Racgq2EaP4tuCBqzVD0dvKT4l/uJMsd1XaOpdILd9p0i1Q7bQr+9Q /F5tXjjzy/f0MUfo4zQi3w5itJQPpE0e57NPzUzu1uFnHWCS+pesefSpnsag4ISd2VOH DEY91iKfRytemyNqiUnn/akCzK7GTDWtozH2xKmpRNHMn8MMvQIbIxHMo2ZyCrO4drXt 2UQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012202; x=1710617002; 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=A3YPWAKLFpXy74v59/y9ZVQ7mfzqWdCePg5o0rXQJdU=; b=VMM71oYhga5k22Dtp7DkEVSbc++Ac4PLZFhkRSn1olXmqwbD5g6WtVoWOtyTa3n7Bj RmK0yk6XOQiTWql7Ezx2EppjBQMpjNdaTcmW2MWz2X6g02k0rdGg5rAf3QWAVnC/4lfN 2izMPk4DG+1PA7W0PdXPN4n+McZkeR+MZ/OpqzonnL4oCnJiN/K1f5mhVEhDTaN+RLCT I+je16p3D0GxPrdXuZdHWpRJRgO3ogZkIDmS0x/kCC2UzwwVOQKbjA0wNmWFXG5hF3e3 5tm/vtxVERiKi2C10NTLG2u2xGkoIKA8Z8nwlzg5mJRyyLKiYU9P1I6O4TOmXK8AOmvu 7Wyw== X-Gm-Message-State: AOJu0YwSntAdGWzdL1WoXKC0UIZXblRpvTBQz05ZIXNvvUsO9haIfuKb 0X05cCQ1UUQZwkjU+NPn4YOL4/S05VJKv0yvRYJ31EIOQ2UsVVDkJVdyOqSuDsU= X-Google-Smtp-Source: AGHT+IESzjyaLuyggJlbtw/UU7wtPA1UXBAfVV9w8oQeEuaTMGyVqGqT6YAp9h+VrsWLnSESfaBeNA== X-Received: by 2002:a17:906:b110:b0:a45:c9fb:86d7 with SMTP id u16-20020a170906b11000b00a45c9fb86d7mr1387127ejy.54.1710012201803; Sat, 09 Mar 2024 11:23:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id g21-20020a170906595500b00a45a96a9c37sm1182786ejr.65.2024.03.09.11.23.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , Stefano Stabellini , Anthony Perard , Paul Durrant , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , xen-devel@lists.xenproject.org Subject: [PULL 11/43] hw/i386/xen: Compile 'xen-hvm.c' with Xen CPPFLAGS Date: Sat, 9 Mar 2024 20:21:38 +0100 Message-ID: <20240309192213.23420-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=philmd@linaro.org; helo=mail-ed1-x52c.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org xen-hvm.c calls xc_set_hvm_param() from , so better compile it with Xen CPPFLAGS. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Message-Id: <20231114143816.71079-19-philmd@linaro.org> --- hw/i386/xen/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build index 3dc4c4f106..3f0df8bc07 100644 --- a/hw/i386/xen/meson.build +++ b/hw/i386/xen/meson.build @@ -1,8 +1,10 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files( - 'xen-hvm.c', 'xen_apic.c', 'xen_pvdevice.c', )) +i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files( + 'xen-hvm.c', +)) i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files( 'xen_platform.c', From patchwork Sat Mar 9 19:21:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910047 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=VWo6lxN8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXyv3R9Lz23hc for ; Sun, 10 Mar 2024 06:24:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2IB-0000uv-Mm; Sat, 09 Mar 2024 14:23:37 -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 1rj2I7-0000li-M6 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:33 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2I5-0002bZ-7i for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:31 -0500 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5658082d2c4so4071478a12.1 for ; Sat, 09 Mar 2024 11:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012208; x=1710617008; 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=yLHD9GT6b5p3TJG9MYP2E7Mrw1kvuaLUPhHVHq70H4k=; b=VWo6lxN8yLys8ueQbO7F1V6Bgnp4UmrW/FJ0ZVFxeWgvRGre5Ao6i6Yh7J1FIxGfSl +kg8zqjiL2gDeSUZlsLTOfEr+x/MD/1UG551bdcqauSMyVWOdCCDXcnYy8oiK1ZiLXhr DUCIxsB2f1QJAIYqYXS/49Y1/DhxXWQWNV5z2XwcuHgg5YcH2LfzELWmmJM+d6c9cQiM NcrTbDjRVePdpLJ9lq+VrO8R20+sUgUIEiC4/UdgoQq8qO/nTmvPbZS6zxIfzcknNV6D A59rlmlpJDzJY4OZ9yAbi6EcvFMYQRYanGzuWfQCdPZOyRuOA1x58wG/pcoRtGAobv+X KsLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012208; x=1710617008; 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=yLHD9GT6b5p3TJG9MYP2E7Mrw1kvuaLUPhHVHq70H4k=; b=a+b8XfBaisnE/PfIgTtVM5IAk5Vbz0hMtv3ZMxfZXw0Y/xBOaFa4loT5r36SXMWhaW GD3gottYxEsMLQkqaKBA6TS4ww8ufrPVyY/P3tTMrk3SFtJyEOmd2Y5V2sMPeV0QEkYK ArKV4JUUhsx92MpI4eekL4gT8Dp/e3eq+XWbt4joh2oBXjcS5Fhf04894MBNaYa6AZST 9VvvZNuAPeaGfSRhGGyEF+P0F2ikCk/99XjKVeKyhok7on7EniMdc+VZp8p5NsRQVN6y j5L5QCQ4aJF9XGiGb8lm9ujDIiJpUccPOenKcUCQEf0ZcyFNJkwONrqAO4WC0vwPt2pk rbwg== X-Gm-Message-State: AOJu0YzhisYJBEmptDC/HFLRvciMzBNz2Q1NoOAJWBgSP5hMVBW/prtt CPNTT35AdgFEs36UDWzLBF+lppFdFjooPg2rIJ245j0PQ4pZGZ6UHr5CbqKINv8= X-Google-Smtp-Source: AGHT+IElag8KDyPQHd/yd7cCq1cSr3wdf4BCFyMPlhbecbflegKHRhCxKpfa2+2S5Xx9q4YSEt6pXw== X-Received: by 2002:a50:9fc9:0:b0:568:1b94:fb88 with SMTP id c67-20020a509fc9000000b005681b94fb88mr1660926edf.23.1710012208009; Sat, 09 Mar 2024 11:23:28 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id d18-20020a50fb12000000b0056486eaa669sm1182154edq.50.2024.03.09.11.23.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Manos Pitsidianakis , Stefano Stabellini , Anthony Perard , Paul Durrant , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , xen-devel@lists.xenproject.org Subject: [PULL 12/43] hw/xen/hvm: Inline TARGET_PAGE_ALIGN() macro Date: Sat, 9 Mar 2024 20:21:39 +0100 Message-ID: <20240309192213.23420-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=philmd@linaro.org; helo=mail-ed1-x529.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use TARGET_PAGE_SIZE to calculate TARGET_PAGE_ALIGN. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Message-Id: <20231114163123.74888-2-philmd@linaro.org> --- hw/i386/xen/xen-hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 1ae943370b..8235782ef7 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -678,7 +678,7 @@ void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, trace_xen_client_set_memory(start_addr, size, log_dirty); start_addr &= TARGET_PAGE_MASK; - size = TARGET_PAGE_ALIGN(size); + size = ROUND_UP(size, TARGET_PAGE_SIZE); if (add) { if (!memory_region_is_rom(section->mr)) { From patchwork Sat Mar 9 19:21:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=L5R6+j2a; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXzH3svXz1yX8 for ; Sun, 10 Mar 2024 06:24:27 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2IN-000190-CW; Sat, 09 Mar 2024 14:23:48 -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 1rj2ID-0000vG-1y for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:37 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2IB-0002cN-Aj for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:36 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a458b6d9cfeso248298466b.2 for ; Sat, 09 Mar 2024 11:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012214; x=1710617014; 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=GjJ9Xc35+gwGwrFshf70kAsb/Zk8w4JUpjKATwEq64Y=; b=L5R6+j2a/IN8VA7V2/BT3iQfI3WeCRPgY0MP5GD1MRLbYjYztLxujw0k0VuElZqDUV T8MLjoK54m+R8Mq2zUvvnL86hpdd/IITBUAv7A66mZAlo466nKLV6QmZRR91OIgAHtls jnK3aT8sZSEwiIRJGTzrX7TFKN9eEnrqDHmSBrTk5ywRG1S2+GRbPQI6G4BXruiLDc6c 6PHJE0IH8R71vQu7P6IqtYPCVKPk0vZo64wjUDzsu1TvVwtMyJRJLWvg0nOD880Oz6fG HdBwysaFcZXSvR5oiTUVFc+DzDDKkCUZB5/aOHUhQzfAEvHY9RVYnUUHqp6blsqaoA7v ztbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012214; x=1710617014; 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=GjJ9Xc35+gwGwrFshf70kAsb/Zk8w4JUpjKATwEq64Y=; b=QEHlL68FHmAIGyGfZNUiWjINao+4DrcgM8cHhCS8ndeptZANZGdtgZ50PKWmBnLMXk lLZKYcZQpf6nlXW0ki14jepGe00ftKoBMmzik8SNn4OjcUwuB5xvWwEUeXFXOO9vk3zX avvmA308k9nb6KPoEBtA5CDV991survy6Ssq+BBmqjgVwK4jZKhHAQY+/Jqu5stktYrv Qxk7QXv75AP+z25/UOxMMlksnp5P5ANPud/9GxhierhapWrOkB5V4rVfwgMZmMu1X8we 5RTucI09O1U7JxrIUlbAxyoWf1/74vIYV0DQn4srM3sF+hODR9faSHIVlsFkZR4lXF6s EcXw== X-Gm-Message-State: AOJu0YwKsE3ut8HKU9+KY2382DQ17BlPV0n6pOB/efyeKjiM3SERbyYU FsJ9YuGxSR+bON8O+fFoKmXH66aUVLBIiQw4x/lagrpSy2qk78t7pWYH1b3gtBI= X-Google-Smtp-Source: AGHT+IFUzNU4pC8ZaO+fIzpjlcMgyQZHUIXDLCwBTxfANDlJj9gCS9ZbhsgrrNnhXeKdaH05pNglXQ== X-Received: by 2002:a17:907:d389:b0:a45:92c4:7892 with SMTP id vh9-20020a170907d38900b00a4592c47892mr1630790ejc.56.1710012214113; Sat, 09 Mar 2024 11:23:34 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id l20-20020a170906a41400b00a46163be639sm251749ejz.12.2024.03.09.11.23.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Manos Pitsidianakis , Stefano Stabellini , Anthony Perard , Paul Durrant , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , xen-devel@lists.xenproject.org Subject: [PULL 13/43] hw/xen/hvm: Propagate page_mask to a pair of functions Date: Sat, 9 Mar 2024 20:21:40 +0100 Message-ID: <20240309192213.23420-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org We are going to replace TARGET_PAGE_MASK by a runtime variable. In order to reduce code duplication, propagate TARGET_PAGE_MASK to get_physmapping() and xen_phys_offset_to_gaddr(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Message-Id: <20231114163123.74888-3-philmd@linaro.org> --- hw/i386/xen/xen-hvm.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 8235782ef7..844b11ae08 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -174,11 +174,12 @@ static void xen_ram_init(PCMachineState *pcms, } } -static XenPhysmap *get_physmapping(hwaddr start_addr, ram_addr_t size) +static XenPhysmap *get_physmapping(hwaddr start_addr, ram_addr_t size, + int page_mask) { XenPhysmap *physmap = NULL; - start_addr &= TARGET_PAGE_MASK; + start_addr &= page_mask; QLIST_FOREACH(physmap, &xen_physmap, list) { if (range_covers_byte(physmap->start_addr, physmap->size, start_addr)) { @@ -188,9 +189,10 @@ static XenPhysmap *get_physmapping(hwaddr start_addr, ram_addr_t size) return NULL; } -static hwaddr xen_phys_offset_to_gaddr(hwaddr phys_offset, ram_addr_t size) +static hwaddr xen_phys_offset_to_gaddr(hwaddr phys_offset, ram_addr_t size, + int page_mask) { - hwaddr addr = phys_offset & TARGET_PAGE_MASK; + hwaddr addr = phys_offset & page_mask; XenPhysmap *physmap = NULL; QLIST_FOREACH(physmap, &xen_physmap, list) { @@ -252,7 +254,7 @@ static int xen_add_to_physmap(XenIOState *state, hwaddr phys_offset = memory_region_get_ram_addr(mr); const char *mr_name; - if (get_physmapping(start_addr, size)) { + if (get_physmapping(start_addr, size, TARGET_PAGE_MASK)) { return 0; } if (size <= 0) { @@ -325,7 +327,7 @@ static int xen_remove_from_physmap(XenIOState *state, XenPhysmap *physmap = NULL; hwaddr phys_offset = 0; - physmap = get_physmapping(start_addr, size); + physmap = get_physmapping(start_addr, size, TARGET_PAGE_MASK); if (physmap == NULL) { return -1; } @@ -373,7 +375,7 @@ static void xen_sync_dirty_bitmap(XenIOState *state, int rc, i, j; const XenPhysmap *physmap = NULL; - physmap = get_physmapping(start_addr, size); + physmap = get_physmapping(start_addr, size, TARGET_PAGE_MASK); if (physmap == NULL) { /* not handled */ return; @@ -633,7 +635,7 @@ void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) int rc; ram_addr_t start_pfn, nb_pages; - start = xen_phys_offset_to_gaddr(start, length); + start = xen_phys_offset_to_gaddr(start, length, TARGET_PAGE_MASK); if (length == 0) { length = TARGET_PAGE_SIZE; From patchwork Sat Mar 9 19:21:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=T+m7Zflt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXzZ03C9z1yX8 for ; Sun, 10 Mar 2024 06:24:42 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2IR-0001ae-IJ; Sat, 09 Mar 2024 14:23:51 -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 1rj2IL-00016n-O2 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:47 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2IJ-0002dC-3c for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:45 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a28a6cef709so272691666b.1 for ; Sat, 09 Mar 2024 11:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012220; x=1710617020; 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=nJ7HW/Ft7i83AZTN2mskut6mEUi0nRJo8gD5MOoOvrw=; b=T+m7ZfltFHJ7ycKtMIpk6QC45W396GSVtAi5n+ZrWKY3HMFd7SfOZ/RnwJt3XjBaaf WKhaPGAuZ5nF29FTKUYJY+SJ4KZTfFkJMK09bDKIoGU1M5mMF7iO4fENHPgh8nqAEPDd jgEor89q0C8t3Hk+tv5Dh04wkaH8Jl/EMcRbWPyxJwwp8rHdb/JYGQyGMDp+jh7+NE9Z mO4CqXzfVhctMh/K4E5rruDz7+qpOlsZlpqOkoZ34utMrHxIrxrd7Lct5ueBZLZ4ZwEJ 2eRBPKf1RAuEq+gqpE8gqiTQN6jUN1mYsYNBQuEFXopATGtCosLECW6cwEZMJZgktHzM 9qTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012220; x=1710617020; 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=nJ7HW/Ft7i83AZTN2mskut6mEUi0nRJo8gD5MOoOvrw=; b=ZchYJlupRcxJVGun8NIBk5bb/lmCckv4juZTujfLOKVLbRHxRnCucFdIO8v+kracjG j2lrt5pUPoKIW8RGZaCJ8/PueZ15iAgAceTr8X7uz3IhCRtd06PzMNfKPMnBpFW4b2Gc 0mVB4bbvRicDGqLeNDLieRbQqOvybbdBP9kuNWSP99lqqye3e0dIHbhaOPZvsZjXlklM lQAY0FyB+lP1Z0EiTZBY04dFnWb2XWfNBjIIrdOsVvQgsEvecHCk22z+yEL996g9ER/D u9SN3PDOyaNc8rVCOhLN+2lPux7np0TERx7pcJv/kk+yIX97QDfqkIm30efpnfiz58im aiPQ== X-Gm-Message-State: AOJu0Yx6mWmOuA9tQiGPyzufqbLdVJ3BTDVXwb2KhHom38jUGFH7n9x7 x2cLM7vZgpuzh+PboUeXgsX1BOxinM+3cdOF28bppyApxP4RIzvZxMdF1e4Jllw= X-Google-Smtp-Source: AGHT+IGJ8dRKKvAEJydBIDk5EIHimW4WL5gyfDXoimVbXutg1h6Ab0DpFGsPNz89nrlp7nNRGTQq2A== X-Received: by 2002:a17:907:96ab:b0:a44:17da:424 with SMTP id hd43-20020a17090796ab00b00a4417da0424mr1554598ejc.56.1710012220525; Sat, 09 Mar 2024 11:23:40 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id k9-20020a1709063e0900b00a45a73e0be9sm1167156eji.180.2024.03.09.11.23.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Manos Pitsidianakis , Stefano Stabellini , Anthony Perard , Paul Durrant , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , xen-devel@lists.xenproject.org Subject: [PULL 14/43] hw/xen/hvm: Get target page size at runtime Date: Sat, 9 Mar 2024 20:21:41 +0100 Message-ID: <20240309192213.23420-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org In order to build this file once for all targets, replace: TARGET_PAGE_BITS -> qemu_target_page_bits() TARGET_PAGE_SIZE -> qemu_target_page_size() TARGET_PAGE_MASK -> -qemu_target_page_size() Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Message-Id: <20231114163123.74888-4-philmd@linaro.org> --- hw/i386/xen/xen-hvm.c | 62 +++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 844b11ae08..7745cb3963 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -23,6 +23,7 @@ #include "hw/xen/xen-hvm-common.h" #include "hw/xen/arch_hvm.h" #include +#include "exec/target_page.h" static MemoryRegion ram_640k, ram_lo, ram_hi; static MemoryRegion *framebuffer; @@ -247,6 +248,9 @@ static int xen_add_to_physmap(XenIOState *state, MemoryRegion *mr, hwaddr offset_within_region) { + unsigned target_page_bits = qemu_target_page_bits(); + int page_size = qemu_target_page_size(); + int page_mask = -page_size; unsigned long nr_pages; int rc = 0; XenPhysmap *physmap = NULL; @@ -254,7 +258,7 @@ static int xen_add_to_physmap(XenIOState *state, hwaddr phys_offset = memory_region_get_ram_addr(mr); const char *mr_name; - if (get_physmapping(start_addr, size, TARGET_PAGE_MASK)) { + if (get_physmapping(start_addr, size, page_mask)) { return 0; } if (size <= 0) { @@ -294,9 +298,9 @@ go_physmap: return 0; } - pfn = phys_offset >> TARGET_PAGE_BITS; - start_gpfn = start_addr >> TARGET_PAGE_BITS; - nr_pages = size >> TARGET_PAGE_BITS; + pfn = phys_offset >> target_page_bits; + start_gpfn = start_addr >> target_page_bits; + nr_pages = size >> target_page_bits; rc = xendevicemodel_relocate_memory(xen_dmod, xen_domid, nr_pages, pfn, start_gpfn); if (rc) { @@ -310,8 +314,8 @@ go_physmap: } rc = xendevicemodel_pin_memory_cacheattr(xen_dmod, xen_domid, - start_addr >> TARGET_PAGE_BITS, - (start_addr + size - 1) >> TARGET_PAGE_BITS, + start_addr >> target_page_bits, + (start_addr + size - 1) >> target_page_bits, XEN_DOMCTL_MEM_CACHEATTR_WB); if (rc) { error_report("pin_memory_cacheattr failed: %s", strerror(errno)); @@ -323,11 +327,14 @@ static int xen_remove_from_physmap(XenIOState *state, hwaddr start_addr, ram_addr_t size) { + unsigned target_page_bits = qemu_target_page_bits(); + int page_size = qemu_target_page_size(); + int page_mask = -page_size; int rc = 0; XenPhysmap *physmap = NULL; hwaddr phys_offset = 0; - physmap = get_physmapping(start_addr, size, TARGET_PAGE_MASK); + physmap = get_physmapping(start_addr, size, page_mask); if (physmap == NULL) { return -1; } @@ -338,9 +345,9 @@ static int xen_remove_from_physmap(XenIOState *state, DPRINTF("unmapping vram to %"HWADDR_PRIx" - %"HWADDR_PRIx", at " "%"HWADDR_PRIx"\n", start_addr, start_addr + size, phys_offset); - size >>= TARGET_PAGE_BITS; - start_addr >>= TARGET_PAGE_BITS; - phys_offset >>= TARGET_PAGE_BITS; + size >>= target_page_bits; + start_addr >>= target_page_bits; + phys_offset >>= target_page_bits; rc = xendevicemodel_relocate_memory(xen_dmod, xen_domid, size, start_addr, phys_offset); if (rc) { @@ -369,13 +376,16 @@ static void xen_sync_dirty_bitmap(XenIOState *state, hwaddr start_addr, ram_addr_t size) { - hwaddr npages = size >> TARGET_PAGE_BITS; + unsigned target_page_bits = qemu_target_page_bits(); + int page_size = qemu_target_page_size(); + int page_mask = -page_size; + hwaddr npages = size >> target_page_bits; const int width = sizeof(unsigned long) * 8; size_t bitmap_size = DIV_ROUND_UP(npages, width); int rc, i, j; const XenPhysmap *physmap = NULL; - physmap = get_physmapping(start_addr, size, TARGET_PAGE_MASK); + physmap = get_physmapping(start_addr, size, page_mask); if (physmap == NULL) { /* not handled */ return; @@ -389,7 +399,7 @@ static void xen_sync_dirty_bitmap(XenIOState *state, return; } - rc = xen_track_dirty_vram(xen_domid, start_addr >> TARGET_PAGE_BITS, + rc = xen_track_dirty_vram(xen_domid, start_addr >> target_page_bits, npages, dirty_bitmap); if (rc < 0) { #ifndef ENODATA @@ -410,8 +420,7 @@ static void xen_sync_dirty_bitmap(XenIOState *state, j = ctzl(map); map &= ~(1ul << j); memory_region_set_dirty(framebuffer, - (i * width + j) * TARGET_PAGE_SIZE, - TARGET_PAGE_SIZE); + (i * width + j) * page_size, page_size); }; } } @@ -631,17 +640,21 @@ void xen_register_framebuffer(MemoryRegion *mr) void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) { + unsigned target_page_bits = qemu_target_page_bits(); + int page_size = qemu_target_page_size(); + int page_mask = -page_size; + if (unlikely(xen_in_migration)) { int rc; ram_addr_t start_pfn, nb_pages; - start = xen_phys_offset_to_gaddr(start, length, TARGET_PAGE_MASK); + start = xen_phys_offset_to_gaddr(start, length, page_mask); if (length == 0) { - length = TARGET_PAGE_SIZE; + length = page_size; } - start_pfn = start >> TARGET_PAGE_BITS; - nb_pages = ((start + length + TARGET_PAGE_SIZE - 1) >> TARGET_PAGE_BITS) + start_pfn = start >> target_page_bits; + nb_pages = ((start + length + page_size - 1) >> target_page_bits) - start_pfn; rc = xen_modified_memory(xen_domid, start_pfn, nb_pages); if (rc) { @@ -664,6 +677,9 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp) void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, bool add) { + unsigned target_page_bits = qemu_target_page_bits(); + int page_size = qemu_target_page_size(); + int page_mask = -page_size; hwaddr start_addr = section->offset_within_address_space; ram_addr_t size = int128_get64(section->size); bool log_dirty = memory_region_is_logging(section->mr, DIRTY_MEMORY_VGA); @@ -679,8 +695,8 @@ void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, trace_xen_client_set_memory(start_addr, size, log_dirty); - start_addr &= TARGET_PAGE_MASK; - size = ROUND_UP(size, TARGET_PAGE_SIZE); + start_addr &= page_mask; + size = ROUND_UP(size, page_size); if (add) { if (!memory_region_is_rom(section->mr)) { @@ -689,8 +705,8 @@ void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, } else { mem_type = HVMMEM_ram_ro; if (xen_set_mem_type(xen_domid, mem_type, - start_addr >> TARGET_PAGE_BITS, - size >> TARGET_PAGE_BITS)) { + start_addr >> target_page_bits, + size >> target_page_bits)) { DPRINTF("xen_set_mem_type error, addr: "HWADDR_FMT_plx"\n", start_addr); } From patchwork Sat Mar 9 19:21:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=cEFkM32o; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXzB201Hz1yX8 for ; Sun, 10 Mar 2024 06:24:22 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2IR-0001dX-W9; Sat, 09 Mar 2024 14:23:52 -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 1rj2IQ-0001T8-M3 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:50 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2IO-0002e4-2Z for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:50 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a44cdb2d3a6so447179066b.2 for ; Sat, 09 Mar 2024 11:23:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012226; x=1710617026; 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=ZjbUGqOjGDJ48BD/FCrBKjFot720kk8N7cpG04DHyuw=; b=cEFkM32oD0RRrFmm3ezWC4f/6Ro69Bk3Y2eijHCMbyThd3+mkkvOuxCUxwy+uPWwsW swfgcQA4cY4aHghj5zdS1EgxqQLf3Au0sZuadPK+LldR1Df4up2bnlKloPS9XoSy6CJQ Vlw0L7J3PdqRE5wj2zNX8NTxLbwmuhLGSRt8vR5wdCgi+3GsENyRQB+lZRecDNjvTLvC 8asWNO2CUvVTew0msoj7d7d/cwZwabrIbe/xU0hA5BaNU568f6bznJy8YWbNuK20KnOj 9YVFm4DyLcJ22JxDWMj8v87AMsqdQnvNjAYgP16wi1oKvjh9tLG0KOJS8uK7jfMeNlib FZIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012227; x=1710617027; 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=ZjbUGqOjGDJ48BD/FCrBKjFot720kk8N7cpG04DHyuw=; b=HeRa/isTQ8gZwvIeh9es3MJGCkpcpRfA27gnxW7c38ZXFYIOKTx0yXGftbIASd8Djl T+Zvav3ld492FwaagLOrifRS3yIJgRth8Fe6UtoqVH93Xxwm2U4jAn6Q+bTZruVR8ZqO pc161DkbMQOsL7AOYy35Gjs9ab6yk+u2WLOzWRIkPILVKXrfBIyr0RIPyjg9cCh54wsv LR3eiQcSjeNziwkqVvxAF5Kkvun4C1c36lAf+tbm2UsYK6QzdGx5yNcMLJOuKqBFYwgf ZUzm8cikz4bxl/9bZb80YgTZKn83LbTLkGn4A02zWYi3XuvtifVgNt5fvajA1TvdciT1 OyPw== X-Gm-Message-State: AOJu0YzXfcKtJqA9pQRwQ5HzsushZ9RY65oav8HIdIknRxhjfI0Rj8EU jj7R/Q0cmZmSbtH8qibAv6MvpkoQ9RegYtDqo2WvprnglYfh6ZpC8leBdgkssq8= X-Google-Smtp-Source: AGHT+IHsirtIOeTRkWpIs3e5yCTD71AujDzccS4QPk7Rv1bmDdnDigFagjmowzpwOIomavcvEpokKQ== X-Received: by 2002:a17:906:b0d0:b0:a44:8c1b:8877 with SMTP id bk16-20020a170906b0d000b00a448c1b8877mr1523044ejb.50.1710012226664; Sat, 09 Mar 2024 11:23:46 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id lt10-20020a170906fa8a00b00a45ab830eabsm1179687ejb.51.2024.03.09.11.23.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Stefano Stabellini , Anthony Perard , Paul Durrant , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , xen-devel@lists.xenproject.org Subject: [PULL 15/43] hw/char/xen_console: Fix missing ERRP_GUARD() for error_prepend() Date: Sat, 9 Mar 2024 20:21:42 +0100 Message-ID: <20240309192213.23420-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_prepend(), error_vprepend() or * error_append_hint(), because that doesn't work with &error_fatal. * ERRP_GUARD() lifts these restrictions. * * To use ERRP_GUARD(), add it right at the beginning of the function. * @errp can then be used without worrying about the argument being * NULL or &error_fatal. ERRP_GUARD() could avoid the case when @errp is the pointer of error_fatal, the user can't see this additional information, because exit() happens in error_setg earlier than information is added [1]. The xen_console_connect() passes @errp to error_prepend() without ERRP_GUARD(). There're 2 places will call xen_console_connect(): - xen_console_realize(): the @errp is from DeviceClass.realize()'s parameter. - xen_console_frontend_changed(): the @errp points its caller's @local_err. To avoid the issue like [1] said, add missing ERRP_GUARD() at the beginning of xen_console_connect(). [1]: Issue description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: "Marc-André Lureau" Cc: Paolo Bonzini Signed-off-by: Zhao Liu Acked-by: Anthony PERARD Message-ID: <20240228163723.1775791-15-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/char/xen_console.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index 5cbee2f184..683c92aca1 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -206,6 +206,7 @@ static bool con_event(void *_xendev) static bool xen_console_connect(XenDevice *xendev, Error **errp) { + ERRP_GUARD(); XenConsole *con = XEN_CONSOLE_DEVICE(xendev); unsigned int port, limit; From patchwork Sat Mar 9 19:21:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=D45f31p6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXz70hP6z1yX8 for ; Sun, 10 Mar 2024 06:24:19 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2IW-0001tZ-RI; Sat, 09 Mar 2024 14:23:56 -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 1rj2IV-0001t0-Ly for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:55 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2IU-0002ff-32 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:23:55 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a44f2d894b7so410846966b.1 for ; Sat, 09 Mar 2024 11:23:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012233; x=1710617033; 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=0qhkX9N0f7mv4U6Enm7PREVuXkmrXKzBrsiRapOf0sE=; b=D45f31p6YZNSPGyEI0JMwiP7W9vLR7q+9eAsn+HmAteLYhMy49YrwCppbmSS+Ik4kb Xq9enhSzrG7H5a1LfkOA5r0oW5dNhXOYwO1bGjkSu3ScXXkFWjdr2bntvDHhqTGobGlI N5eTJ4f49MJ2l2BKEkI2sN3FmoV2XN2cvOwWdvtnT0/hnLpReLwK0JBLsBKyHPS6floa dnYHW5JJKP2XoPR4pJ6DwtAdU1mmRi75oMhpxwxpkSepGw45x9GQthFbf9lBCLMAxHIT 18T8/IYJy8Nh8q5pjZbY5OWgHqSRMv5TpdDb9GI8vloYRI7hQhTtFDFtKq5EUKg5KDE+ 9KWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012233; x=1710617033; 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=0qhkX9N0f7mv4U6Enm7PREVuXkmrXKzBrsiRapOf0sE=; b=S47fEd4xq5aXpSECx9UzvA3FDl5ywaKwURuI2iSfzD4GcNWc/MO9SZngR7M3CkfzGf 2Jo9r9qDpyp1pWfJW8N5KY5OoLmEUE9IrHt6FtTi/OkQl673a3s1oXc9TMmgpIW3SF3J QiG/dgs5YMgU8bHNHbF5CxySPH0kBqXwuUgD0svQZnWPvBsGbODuwAny4SDdotFKM3Qh hD0NauoPxOMLVcG351VMdDccnoBuy17Sfer62Xg3FCqkuxKuO/necaqHbkxxdG/HI5WN c3OQw6juDvdhYntbHGyxbvWeop/0rO8vLWoiFKtIq/9tkwB6pzq5KK87TB6fHBp4rL3b 9MeQ== X-Gm-Message-State: AOJu0Ywspmiwy8GNZU/Xip2VyQlsI3m+FYy5Gz0dcBOWMvn89iuWcRXA WzkJ0gOK8QWZ99nE5waoQ7CGxOCKs9jmHUut99q1jaJJq6WX6KajH9Upy91WyOUGtJ+yvhCP2M4 g X-Google-Smtp-Source: AGHT+IE0pC1PtPPUFeJGmL9nn03Tms40CF9fkNhPdedtB8UjjmtZf/tpA8FjVipfHktzZdaLWkMqpQ== X-Received: by 2002:a17:907:c28a:b0:a43:900a:31c5 with SMTP id tk10-20020a170907c28a00b00a43900a31c5mr1698253ejc.4.1710012232757; Sat, 09 Mar 2024 11:23:52 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id k5-20020a170906578500b00a449ebf3d58sm1178448ejq.85.2024.03.09.11.23.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Stefano Stabellini , Anthony Perard , Paul Durrant , Jason Wang , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , xen-devel@lists.xenproject.org Subject: [PULL 16/43] hw/net/xen_nic: Fix missing ERRP_GUARD() for error_prepend() Date: Sat, 9 Mar 2024 20:21:43 +0100 Message-ID: <20240309192213.23420-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_prepend(), error_vprepend() or * error_append_hint(), because that doesn't work with &error_fatal. * ERRP_GUARD() lifts these restrictions. * * To use ERRP_GUARD(), add it right at the beginning of the function. * @errp can then be used without worrying about the argument being * NULL or &error_fatal. ERRP_GUARD() could avoid the case when @errp is the pointer of error_fatal, the user can't see this additional information, because exit() happens in error_setg earlier than information is added [1]. The xen_netdev_connect() passes @errp to error_prepend(), and its @errp parameter is from xen_device_frontend_changed(). Though its @errp points to @local_err of xen_device_frontend_changed(), to follow the requirement of @errp, add missing ERRP_GUARD() at the beginning of this function. [1]: Issue description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Jason Wang Signed-off-by: Zhao Liu Acked-by: Anthony PERARD Reviewed-by: Thomas Huth Message-ID: <20240229143914.1977550-3-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/net/xen_nic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 453fdb9819..89487b49ba 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -351,6 +351,7 @@ static bool net_event(void *_xendev) static bool xen_netdev_connect(XenDevice *xendev, Error **errp) { + ERRP_GUARD(); XenNetDev *netdev = XEN_NET_DEVICE(xendev); unsigned int port, rx_copy; From patchwork Sat Mar 9 19:21:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910053 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=phxrHw2B; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXzN2DVjz1yX8 for ; Sun, 10 Mar 2024 06:24:32 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Id-0002Cf-J7; Sat, 09 Mar 2024 14:24:03 -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 1rj2Ib-00029d-MV for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:01 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ia-0002gl-1Z for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:01 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5684073ab38so731837a12.0 for ; Sat, 09 Mar 2024 11:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012238; x=1710617038; 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=eUfL1w5ZY8ZGsSxKnH4ewPtSTSCallxtJeVJzhKEKHw=; b=phxrHw2BBwh2uFzWHY3uVG2xMA2LfJche52MECwKCXkFyzZZjOGMreejZ3ItqQxILI 4THaEuD/VGoiG+UbSgBcvh9t3H/lv3wYUMLlc+Ajg1XZDLt+XZfBHAwOfnPPffIA8fi+ s8405NdGqj3dF/hnV9qxuGdFKrSPl3FhsNKt6xbeneVHv/ii6yyt137JOC4XjKRcwCP0 L5d5M4hFiyk4VXWZWLKWzyvpDhKr5D83hnWj0DFzqSL1lUqXy4sDE5fghG+36PKakcq0 YiQsxsmg7eWHf+m/ihCmBm537rq3f73VRWAAAbZdJ5CX/kJSlXp5pW0KDnpuaKPQNKRl oCFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012238; x=1710617038; 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=eUfL1w5ZY8ZGsSxKnH4ewPtSTSCallxtJeVJzhKEKHw=; b=eSMneUnm7bYQEyETgR7Z9NCQrksiG3sWg/6pdz4NNruiBtt7SgX32VOr95/7H770Jf JzEKLg8JncFRvYTJ16IbN+jbKSRsGdwpfiJg6B5LZCH9+eC/mb841IdqZ5BzjuVxSnV+ vXen2QGnLFvDxAJmQXR08+ot3BE2JhK+DchbeiJJ3tIj9vjUbeU1Gt/c+7E3f9NN2O/D 8KYOzBX7jlH9GTK1+yCkbedUORmbWF+jaUMTnSaYOdaxKU+J+s7iZcQKnQsJa5HqCIEO HZvFNO0nsBPeIAut75f8PxmWWrhL/gyQ9X1e8FZ0Lk7rMbDlIxy27mQVJYFUbi+BWhMv 7yeg== X-Gm-Message-State: AOJu0Yx7A/E1FiLRCpdbuyb82fDTkdPTrS3wkh+ct00CicYPPaI7/yCz OvojGZ9pd8QgdO6NcXKpHE5BTJX8xVZjX/KB4HQlOWryhU/gtFm/7NJGbqI76kU= X-Google-Smtp-Source: AGHT+IFy8vQdWfIK3ozhS/fRZLOXohhmDLYe56O/gPHcpUJVtjcAsYxvO1Dhp7P3a/T5pumkkZy5uA== X-Received: by 2002:a50:8ad9:0:b0:566:1952:afc4 with SMTP id k25-20020a508ad9000000b005661952afc4mr3675368edk.6.1710012238657; Sat, 09 Mar 2024 11:23:58 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id et8-20020a056402378800b00566a4dec01fsm1154716edb.11.2024.03.09.11.23.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Elena Ufimtseva , Jagannathan Raman , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 17/43] hw/remote/remote-obj: hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend() Date: Sat, 9 Mar 2024 20:21:44 +0100 Message-ID: <20240309192213.23420-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_prepend(), error_vprepend() or * error_append_hint(), because that doesn't work with &error_fatal. * ERRP_GUARD() lifts these restrictions. * * To use ERRP_GUARD(), add it right at the beginning of the function. * @errp can then be used without worrying about the argument being * NULL or &error_fatal. ERRP_GUARD() could avoid the case when @errp is the pointer of error_fatal, the user can't see this additional information, because exit() happens in error_setg earlier than information is added [1]. The remote_object_set_fd() passes @errp to error_prepend(), and as a PropertyInfo.set method, its @errp is so widely sourced that it is necessary to protect it with ERRP_GUARD(). To avoid the issue like [1] said, add missing ERRP_GUARD() at the beginning of this function. [1]: Issue description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Elena Ufimtseva Cc: Jagannathan Raman Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240229143914.1977550-4-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/remote/remote-obj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/remote/remote-obj.c b/hw/remote/remote-obj.c index 65b6f7cc86..dc27cc8da1 100644 --- a/hw/remote/remote-obj.c +++ b/hw/remote/remote-obj.c @@ -49,6 +49,7 @@ struct RemoteObject { static void remote_object_set_fd(Object *obj, const char *str, Error **errp) { + ERRP_GUARD(); RemoteObject *o = REMOTE_OBJECT(obj); int fd = -1; From patchwork Sat Mar 9 19:21:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=MmdwC1MM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXzh2lQMz1yX8 for ; Sun, 10 Mar 2024 06:24:48 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ii-0002R4-NP; Sat, 09 Mar 2024 14:24:08 -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 1rj2Ih-0002Mv-G0 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:07 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2If-0002hT-Tv for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:07 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a45fd0a0980so92090966b.2 for ; Sat, 09 Mar 2024 11:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012244; x=1710617044; 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=w5JHLoxMjL6tDi9iKJsLNg13AWr77+ZJm44MiLunTng=; b=MmdwC1MMKT6KDmA3Pn+r4RpSuGSI8C7+rM0SgtGR6cwGOvYgZp2MR4UDT/QG/v19mx 3NNYJGQCskDz9cjNexhPl2ZbKvYMocnryyygfxtR7gYNLSgMICUk3DsvaOd5V4uoIPwD tNAUTcC+OzYhaDoVAOqQ1SH+A4TVqfVS4p96/Vr/ubemvSo6I34WHnJkbmPLNy5vNMf4 xyZ1ImbyBR/ZN5o0YQeAaMgVvcWOWQhGmwM1IeWh4QCo2/XuvI5pI5f9enyDThF9E7TQ uagd9fxoRwoGigd2tDvmwMPBVr8/jeW/3cwXes9XLugzwajlR4o0+ibNl8DxXz7LX17a DMlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012244; x=1710617044; 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=w5JHLoxMjL6tDi9iKJsLNg13AWr77+ZJm44MiLunTng=; b=fI6kZ9YvNVNNFfBie067WJ7JRs2jJL3Zzc9fFnhyTwa9zp/kOjc7JHHjVDwObxwMGQ r906XbDdpmTvovWIxdtnH49HDpynrqnjfo6Bd6QlLjpaiKGoPbH6uU/Rhu3eZgrKY4pK 5q8YHtDGL5yRxPfK/JSSI7dv+gCDm573t46zX6PJ1NK4HBOOkKQTIa5OHAFD3+unVGwd WXOZ40ew9PAWIgwAqznmoB9Cpv+N/rK100ljafwct8jhJdOGTRTAm9Jne1suFO+iP7a1 QtKHNfYeDNvx+j6baRflL3v1gPn6QE0hmqzVad4llcepuo6PlQDdmH9SdxVceKFDDy+o 5D4A== X-Gm-Message-State: AOJu0YwV3vhyzOiqNEFEKuKbTouO6VG+3YwRUcW4wYDCfGobIjeqbS1T 0fCDB4xnfVe4ADafs+otyhmAMJc3ULsUeWdS/vZh6nr2z4vOvp3wcNhswVT64yicdAr1T50MRxf M X-Google-Smtp-Source: AGHT+IEXrInFPh+kH3SDE3Bme3IOcnebaToNGDjHAkJEJb0gjDW/apXugYdiDV8CxRddh/CblW6jVA== X-Received: by 2002:a17:906:3984:b0:a44:1f3:e474 with SMTP id h4-20020a170906398400b00a4401f3e474mr1261620eje.23.1710012244545; Sat, 09 Mar 2024 11:24:04 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id w22-20020a1709067c9600b00a45a72fadfcsm1180096ejo.23.2024.03.09.11.24.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Paolo Bonzini , Marcelo Tosatti , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org Subject: [PULL 18/43] target/i386/sev: Fix missing ERRP_GUARD() for error_prepend() Date: Sat, 9 Mar 2024 20:21:45 +0100 Message-ID: <20240309192213.23420-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=philmd@linaro.org; helo=mail-ej1-x634.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_prepend(), error_vprepend() or * error_append_hint(), because that doesn't work with &error_fatal. * ERRP_GUARD() lifts these restrictions. * * To use ERRP_GUARD(), add it right at the beginning of the function. * @errp can then be used without worrying about the argument being * NULL or &error_fatal. ERRP_GUARD() could avoid the case when @errp is the pointer of error_fatal, the user can't see this additional information, because exit() happens in error_setg earlier than information is added [1]. The sev_inject_launch_secret() passes @errp to error_prepend(), and as an APIs defined in target/i386/sev.h, it is necessary to protect its @errp with ERRP_GUARD(). To avoid the issue like [1] said, add missing ERRP_GUARD() at the beginning of this function. [1]: Issue description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Paolo Bonzini Cc: Marcelo Tosatti Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240229143914.1977550-17-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/sev.c b/target/i386/sev.c index 173de91afe..72930ff0dc 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -1044,6 +1044,7 @@ sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp) int sev_inject_launch_secret(const char *packet_hdr, const char *secret, uint64_t gpa, Error **errp) { + ERRP_GUARD(); struct kvm_sev_launch_secret input; g_autofree guchar *data = NULL, *hdr = NULL; int error, ret = 1; From patchwork Sat Mar 9 19:21:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=P7/bU2la; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY3g0ckjz1yX6 for ; Sun, 10 Mar 2024 06:28:15 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ip-0002oY-9H; Sat, 09 Mar 2024 14:24:15 -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 1rj2In-0002gH-Cb for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:13 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Il-0002ju-Og for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:13 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5684f95cc9bso26023a12.1 for ; Sat, 09 Mar 2024 11:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012250; x=1710617050; 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=qjFrwxdzh9cIFuy3VrLZl1YDUiO+UYomEAH8YyqLi9E=; b=P7/bU2la/osimESifAkLanHeMCSxf8dYX3GeUifgR0pf3pcS7E5MaTlPj7fN3e+wV7 h+tBcnWBLvFVFFmvET8ChI2a+tnW35VTa+/NczjcYTDNset2v2ahJU6fClZrNmrkVU7z zS2S//Eu4+XRRZD49WfZhvNpnGZlEisclAKZm4vQjQx+w3c3KamRt2KAbrw5udzafMjM d05f2FsMifBNjNytjWC5f1ds8JDf8xkJY71/1My2qYsb13WuKd41lIgLzKSwN1pG6MBD cpUsdNKCIYb24Ksl2aogcjdCSwVMg6q03On9Qr93jwHtrdInHxP4yLEm0bcjY6uHy/Li Owfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012250; x=1710617050; 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=qjFrwxdzh9cIFuy3VrLZl1YDUiO+UYomEAH8YyqLi9E=; b=mL7TbBCpX1PScRDKIQRw5FVTelcMfYPGLwX48cx1xlXLGu3gN9lHJnGer5FlpR5rGN uv8prwra2vqeDA5tW+CJoV5HcjbhrWNd3q/0ZOQ9pYOU/OorTQk7yJranh3JRjBd4Bbo hG2r0pbRYiEpKUCAzN9q16btSObMZ7IuDFxnjH7+28pxyE4axXP75PCnDj+iQd06dBZk 5SNvgMaGq0rMKzhkjLYxsxEnXijiPBHsuCZanVOlbtUmd8+zxYXbsZbtbkuCSZQRutXx juq/kl7kWX8utQx8/VdhaJY75thPr3wnP1iAu3XBt7bkrQZju4LMPQHc7lDFeS97OMS1 Ptpw== X-Gm-Message-State: AOJu0Yw6ZykAJPcrsU26xvRPRzyNbgT5g0FACw5ZmlUf1G7OmuDOli6Q iNusQZL0vDD9Szabxq8MpHgnwiBeFUOBhz5wWXfC4SDMEDhv8s48xYDi7sqZkjE= X-Google-Smtp-Source: AGHT+IGuUctMA78NjZdtCAU9Y9aCkZkeDhz16yKH0hbVx551DJFp5YQmApTcRtGHo6YtY4fSt4CW5g== X-Received: by 2002:a05:6402:5c3:b0:566:cfca:e56f with SMTP id n3-20020a05640205c300b00566cfcae56fmr2549323edx.19.1710012250332; Sat, 09 Mar 2024 11:24:10 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id 9-20020a0564021f4900b00567e27c72c4sm1153365edz.62.2024.03.09.11.24.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 19/43] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations Date: Sat, 9 Mar 2024 20:21:46 +0100 Message-ID: <20240309192213.23420-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=philmd@linaro.org; helo=mail-ed1-x52e.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org These definitions were removed in commit ea985d235b ("pc_piix: remove pc-i440fx-1.4 up to pc-i440fx-1.7"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240301185936.95175-2-philmd@linaro.org> --- include/hw/i386/pc.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 5065590281..b958023187 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -288,18 +288,6 @@ extern const size_t pc_compat_2_1_len; extern GlobalProperty pc_compat_2_0[]; extern const size_t pc_compat_2_0_len; -extern GlobalProperty pc_compat_1_7[]; -extern const size_t pc_compat_1_7_len; - -extern GlobalProperty pc_compat_1_6[]; -extern const size_t pc_compat_1_6_len; - -extern GlobalProperty pc_compat_1_5[]; -extern const size_t pc_compat_1_5_len; - -extern GlobalProperty pc_compat_1_4[]; -extern const size_t pc_compat_1_4_len; - #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ { \ From patchwork Sat Mar 9 19:21:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=RW1+ZiNn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY940P0Rz1yWx for ; Sun, 10 Mar 2024 06:32:56 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Iv-0003PO-5V; Sat, 09 Mar 2024 14:24:21 -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 1rj2It-0003BH-AB for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:19 -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 1rj2Ir-0002lE-ER for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:19 -0500 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a45cdb790dfso351829666b.3 for ; Sat, 09 Mar 2024 11:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012256; x=1710617056; 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=97WMuYDRb3w8xARFK/GrtRAFlIvridMB6pm6DUjdKys=; b=RW1+ZiNnMgLzrLGBaoUUPSwngxaNdd3W+WXdEhzOXZOWCy+yZcdobHSaXJ+zldWyTS oGaMmb3fGBcRz0r8bZEFWshEt5SaC3h8hCe3P12d6WDYKfm4CmO+DvdYHSxoZCyHxlxh w3QLC/LTMKMwc0nmImY0x6A28KOL49ikbvt7PZYYfNzKQ9Y/jxAFblXggbQnGWMvF18R N1s/58tvUAU0pi4GiOMGpus95CSRR0lH7Vyfg+dtubUjISF+dzPZEHJUAUZXssAhE40o 44v7ffVBpilwvuoRwMnOf2mBdV6ECRduBL1w4aHZFyio1NXPU6CxLgH0MwuHbV+LkGXH mRGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012256; x=1710617056; 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=97WMuYDRb3w8xARFK/GrtRAFlIvridMB6pm6DUjdKys=; b=o+wGZJTCPUGwJNLnv1Xl7dQO56WmHcEubnhX0myuWo2ezhGfGXi7HfGV9HSGpkC31m Wxej72ZWtk5yj80TKhgySVmENaJ64rcKp1ac4bcExcZrdyQJgFT7qNfb3ZpRKOBwMglZ NgoBJ9PIErro0VyVAwts5cETi5y8NSOTFjWEi6lrs31hW3kpS/ZwG0aTjRoQbIYDdjtF ZSMii7FtntCOuaoRImbfSH/PHUzlZ8ZWkbcIBJ3Rg7HNJJ/ANauNzYDupvm/9noci6Yi A0m3epcvnQFXqMqITANmUxpyeba0T8RDt0Q1TAFHH7q99jSqqE0F/uYKk1fg1pN9xgQX jaPg== X-Gm-Message-State: AOJu0Yy0F0x3hdVeHiGCtH2fxlceUGrQIjIanFU9uJ7XDPqszJdZlTYL Z8EhQE2N/PNmsx+A2u6qAbpisGcu3NUhScBbG4NBS8NoHG9xv6d6/6CQKk9fTMw= X-Google-Smtp-Source: AGHT+IHu5x1rS7vf33hD/x5FbZhOzPD/xRWv1qGkw9cFC8XfZuY6JIqWN/Q1RZ95WsBkgIm3l4ycIw== X-Received: by 2002:a17:906:ba87:b0:a45:f262:bc2f with SMTP id cu7-20020a170906ba8700b00a45f262bc2fmr1624704ejd.5.1710012256103; Sat, 09 Mar 2024 11:24:16 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id l23-20020a170906a41700b00a440ec600e3sm1176464ejz.121.2024.03.09.11.24.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Eduardo Habkost Subject: [PULL 20/43] hw/i386/pc: Use generated NotifyVmexitOption_str() Date: Sat, 9 Mar 2024 20:21:47 +0100 Message-ID: <20240309192213.23420-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org NotifyVmexitOption_str() is QAPI-generated in "qapi/qapi-types-run-state.h", which "sysemu/runstate.h" already includes. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240301185936.95175-3-philmd@linaro.org> --- hw/i386/pc_piix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e123458bbc..ed777e3d61 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -61,6 +61,7 @@ #include "hw/xen/xen.h" #include "migration/global_state.h" #include "migration/misc.h" +#include "sysemu/runstate.h" #include "sysemu/numa.h" #include "hw/hyperv/vmbus-bridge.h" #include "hw/mem/nvdimm.h" @@ -383,9 +384,6 @@ static const QEnumLookup PCSouthBridgeOption_lookup = { .size = PC_SOUTH_BRIDGE_OPTION_MAX }; -#define NotifyVmexitOption_str(val) \ - qapi_enum_lookup(&NotifyVmexitOption_lookup, (val)) - static int pc_get_south_bridge(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); From patchwork Sat Mar 9 19:21:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ne1rZ2Vf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY22417hz1yX6 for ; Sun, 10 Mar 2024 06:26:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2J0-0003nh-Ip; Sat, 09 Mar 2024 14:24:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rj2Iz-0003iY-Ja for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:25 -0500 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ix-0002mQ-PI for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:25 -0500 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-512f54fc2dbso2841743e87.1 for ; Sat, 09 Mar 2024 11:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012262; x=1710617062; 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=gNfhZGSEMDNFGE0Bt1N9Am3VGUZ7rx8bc74P/nXROpw=; b=ne1rZ2Vf3nDTNU1KeRP3pQ0Lt+fHPTUsppkIg+7v1TPYIUOiMcBQXh6XwMaUTYVhVd RMJfoLOozhUJTEGaj+XOBH4Ry/zMU9JYd30J3FLYBWOqOFJNyo6APzniQP8MJtDYnCmE 02+SQsQmgQk69x9Qz7GfydSlp3iZlxgD5SCpSd9ehFL3KKbvtP6Kico/FFA4WjYdIPZg BjX8lQKkKxZUjhsJ1NCAB2+bNrwbcY37axSFYxl66KVESr6oMs5Gc8EOp8SaqZbuV6Nh uJVNBOcP4aFnNkihA3/ejWlspGhk02ondPBcgPvRz8fVfBmzjizdfZZw5WyZApNZDjsx 4vxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012262; x=1710617062; 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=gNfhZGSEMDNFGE0Bt1N9Am3VGUZ7rx8bc74P/nXROpw=; b=CTrrBpdM8d35wUfO/uheCKYMVOkTgTMx7P7SOqFVGWuCvVVOsigBXtatul+vV9imS7 T8Y2IA/ubYqCwiUJv8ac+ajs/0pJo4TfF6oEpLnLA7ASPBbfSpbszjJTpK0T9iHirdpU 9yJqhTAqPgcMRNDzMkFJA1lCyzA7pwEtqDGaerGKV3+APVNBvqpT3twNFX8/bJn9y4Lp 1hhNzVmM8uw7hdHX7hBhV/SZbrfqzsvQ4woW1wiKYCva5lBzJot4S82p+Pt+La0IIp08 GtPwZc7uiFyJGP2aRMzct0rbTJrNYz5j6sZsBE4kl1Ip/5ldWJD/O3FCwNbk8OYuyagu b7RQ== X-Gm-Message-State: AOJu0YysE78XUgv6U2mI+QKwuNXju2Vr+4td7Z7nEHnvgTDuSGLUXZCg ARSxjFn0eyp380A6KZ8YZtWWHPT+WQ8vwQeOCyyTfO7q0IzTklguZyW47NGdAw4= X-Google-Smtp-Source: AGHT+IH6VnIz1HhzZeWVzNFZZ81KnZan2vqiOitrnrYT+7W7ejewWsh1Bm28ZWgBPoyVvTrmJWk+3w== X-Received: by 2002:ac2:484a:0:b0:513:3741:7357 with SMTP id 10-20020ac2484a000000b0051337417357mr1595051lfy.56.1710012262092; Sat, 09 Mar 2024 11:24:22 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id l6-20020a1709060e0600b00a42ea946917sm1177309eji.130.2024.03.09.11.24.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 21/43] hw/i386/pc: Remove 'host_type' argument from pc_init1() Date: Sat, 9 Mar 2024 20:21:48 +0100 Message-ID: <20240309192213.23420-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=philmd@linaro.org; helo=mail-lf1-x129.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org All callers use host_type=TYPE_I440FX_PCI_HOST_BRIDGE. Directly use this definition within pc_init1(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240301185936.95175-4-philmd@linaro.org> --- hw/i386/pc_piix.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ed777e3d61..e14dce951d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -101,8 +101,7 @@ static void piix_intx_routing_notifier_xen(PCIDevice *dev) } /* PC hardware initialisation */ -static void pc_init1(MachineState *machine, - const char *host_type, const char *pci_type) +static void pc_init1(MachineState *machine, const char *pci_type) { PCMachineState *pcms = PC_MACHINE(machine); PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); @@ -194,7 +193,7 @@ static void pc_init1(MachineState *machine, memory_region_init(pci_memory, NULL, "pci", UINT64_MAX); rom_memory = pci_memory; - phb = OBJECT(qdev_new(host_type)); + phb = OBJECT(qdev_new(TYPE_I440FX_PCI_HOST_BRIDGE)); object_property_add_child(OBJECT(machine), "i440fx", phb); object_property_set_link(phb, PCI_HOST_PROP_RAM_MEM, OBJECT(ram_memory), &error_fatal); @@ -451,7 +450,7 @@ static void pc_compat_2_0_fn(MachineState *machine) #ifdef CONFIG_ISAPC static void pc_init_isa(MachineState *machine) { - pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, TYPE_I440FX_PCI_DEVICE); + pc_init1(machine, TYPE_I440FX_PCI_DEVICE); } #endif @@ -461,9 +460,7 @@ static void pc_xen_hvm_init_pci(MachineState *machine) const char *pci_type = xen_igd_gfx_pt_enabled() ? TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE : TYPE_I440FX_PCI_DEVICE; - pc_init1(machine, - TYPE_I440FX_PCI_HOST_BRIDGE, - pci_type); + pc_init1(machine, pci_type); } static void pc_xen_hvm_init(MachineState *machine) @@ -488,8 +485,7 @@ static void pc_xen_hvm_init(MachineState *machine) if (compat) { \ compat(machine); \ } \ - pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ - TYPE_I440FX_PCI_DEVICE); \ + pc_init1(machine, TYPE_I440FX_PCI_DEVICE); \ } \ DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn) From patchwork Sat Mar 9 19:21:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TQBRYj9o; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXzd0ZFVz1yX8 for ; Sun, 10 Mar 2024 06:24:45 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2J5-0004LC-PI; Sat, 09 Mar 2024 14:24:31 -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 1rj2J4-0004HG-W3 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:31 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2J3-0002oz-Bb for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:30 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a36126ee41eso426930366b.2 for ; Sat, 09 Mar 2024 11:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012268; x=1710617068; 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=+fuJ29vWBRe9UmwN0pN4V44UAyM0aAmIqNcBSmPyHVo=; b=TQBRYj9oVVvJad8rlOOGoPAGnUBtBMrNe/KfipJ2jsfgNFLgJxpMGrdpMZv15cBU66 wjguUt/JuktcOw2K0+vt8zScN+6wSx/NBgZHzKVh3KWtKc75qrERDku+w4XSChZfIO2z bleR5uAlL4jsH5ceFZqO54jUW/jiIWkSiXejrD4rlD4dWsCPAkbZ01yZzxH1uookLpdV Z8P9P417ZNiTMOIYk16VQR+EST5v513AththRotSyLW+rE1SBzpjR3NWje0/IRWVDagI //pd4mf7Mn71K+mKquo3XfOoiATSQJRuBVXzuNdpXs+OtT+x+DDp7g8KjDHjCt8D+pQG TFqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012268; x=1710617068; 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=+fuJ29vWBRe9UmwN0pN4V44UAyM0aAmIqNcBSmPyHVo=; b=VFPrkuJdNZQ0ED10jY00bFaTPl7sgUnWTIC8lReXycDeFF2pGCVnY+Ub3Fo4s6Qonc jvafIswqiiYu7p+Rm5OxWPJeAKEOPynVby08tg/muO2GFFsg4501XyW880jPmWyucU/k EiCSqujGZyWLA1u4Q5DsoIhBfO8yf5JCPcfK83ZbOqynSlfoqB5+WhUGK4+KBqzqZR5h JC/W93xPCYBZx0MjP13/bxzNj7PXdccYIcibayWp4cSscRKB31bKfosThzf7VCtkAcKJ RRq8Rp6wxtH4zb5BfvWZ9xpn8XplItLRyrCg/qMwrebifyDRlEQxspSmop1xiJTa3CH5 vj8A== X-Gm-Message-State: AOJu0Yxv4M1KkqZPYvxwxvhc204ZZwisAd7keyo7YwdnRGaBduaBM5hA KykNPXopXlYrzyKtQcwmCiLPtBCvo5W2iCh/mjgNvr4iDGvsc/UWO2IfY9lq+rc= X-Google-Smtp-Source: AGHT+IHBKp40+UGhTSq+bnnVjikzcWIqKwU0NtKt0/06ov0ZeaDcTOvxjP/0RQTp71adKFj8bvB30g== X-Received: by 2002:a17:906:52c8:b0:a45:a2cc:eb8d with SMTP id w8-20020a17090652c800b00a45a2cceb8dmr1224240ejn.25.1710012268039; Sat, 09 Mar 2024 11:24:28 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id bk15-20020a170906b0cf00b00a4617dfc36bsm124195ejb.178.2024.03.09.11.24.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Bernhard Beschow , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 22/43] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument Date: Sat, 9 Mar 2024 20:21:49 +0100 Message-ID: <20240309192213.23420-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org The "isapc" machine only provides an ISA bus, not a PCI one, and doesn't instanciate any i440FX south bridge. Its machine class defines PCMachineClass::pci_enabled = false, and pc_init1() only uses the pci_type argument when pci_enabled is true. Since for this machine the argument is not used, passing NULL makes more sense. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bernhard Beschow Message-Id: <20240301185936.95175-5-philmd@linaro.org> --- hw/i386/pc_piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e14dce951d..319bc4b180 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -450,7 +450,7 @@ static void pc_compat_2_0_fn(MachineState *machine) #ifdef CONFIG_ISAPC static void pc_init_isa(MachineState *machine) { - pc_init1(machine, TYPE_I440FX_PCI_DEVICE); + pc_init1(machine, NULL); } #endif From patchwork Sat Mar 9 19:21:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JrP5/veX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsXzj42Bjz1yX8 for ; Sun, 10 Mar 2024 06:24:49 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2JE-00059S-EN; Sat, 09 Mar 2024 14:24:40 -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 1rj2JB-0004pV-N0 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:37 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2J9-0002rt-E4 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:37 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-568241f40e9so2381727a12.0 for ; Sat, 09 Mar 2024 11:24:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012274; x=1710617074; 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=b9ZBcWCorweFf+2JD84jMS2xk8ntDrtFmiyqB/cRtXw=; b=JrP5/veXhnTCbopgrBHIatDR4Kk0YJftX+qGahmc3Ocyr7/S3jvI4RsyTKVmVJzXXh mvVaNYbflIiy0XlwwO3vkttCT/MDByIO9FlndAOqfhsENaqVhVVjVhR67vRWEHXA9tfM ZbQUyDB6d1hemZlBEdZkohNwUbycuWQuOCZnA+1yOuSNU7ucP0j19ZscIOg8+G4NuzTU REkapdV68Fplq6VaElHzFhyWa1PIXdFawAfc4sVl+IMPgVBbOChB/rLpc5mCcLqEneoT rZY3RbntcrnFWL7Vk54NseDG+0/zNgkQ8auTJsHzJ03+T7WeJpjTn6bHDScgJXGTT4Uu GCKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012274; x=1710617074; 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=b9ZBcWCorweFf+2JD84jMS2xk8ntDrtFmiyqB/cRtXw=; b=R5w5xQnxzrlbOLCi7qdMoY1+SIOQs/BI5nSygKOawUy58xYEkSntNSJ7VExP0oOQEp 6ulR72+DoWmZomk6pyTh8S+AnUeaRVGi1ZFelr/wA27N0BdkDZYaP4JBN2+h+qKjtkTp Bj3j7ci2WwLQKJlPmW/T544IugEns2OOvIR7ERBnVbxNxsBi9T/AcRUUdBAzkhtZKl3h Qq4b+odY4FTVM8RcReQ5HQLJZ9Df2GQqrz29VslVVxt8onc+FwR0m8xzwgaI7rOOzFCw giIsb6SVNcHX0OZI09kLU3Z261ZeHxPWVmXx+Nu9llbXcjYGTk5NpAAt1X2JeKgtOsF/ STtg== X-Gm-Message-State: AOJu0YyxeU80F5oPcz/oUftlVjPu7dv3OyhHfBzKDWMVvqNXbhmA9+Kc OTEVbB86/xcyjrsaMDcb04e+FoUH5unQ50yxO2S+A0YHiTWwr8EYe1NSLnfMTT4= X-Google-Smtp-Source: AGHT+IHgEf1VoGYbP8PX+uBQFBOrcqcJuu3+uWJK8B0gZBS4Ndlr4ufNHMEDWth1nZW5Ltal/PnjAQ== X-Received: by 2002:a17:906:9c8e:b0:a43:b50d:1074 with SMTP id fj14-20020a1709069c8e00b00a43b50d1074mr1601200ejc.23.1710012273937; Sat, 09 Mar 2024 11:24:33 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id gh16-20020a170906e09000b00a45380dfd09sm1168535ejb.105.2024.03.09.11.24.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bui Quang Minh , =?utf-8?q?Alex_Benn=C3=A9e?= , "Michael S. Tsirkin" Subject: [PULL 23/43] hw/intc/apic: fix memory leak Date: Sat, 9 Mar 2024 20:21:50 +0100 Message-ID: <20240309192213.23420-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Paolo Bonzini deliver_bitmask is allocated on the heap in apic_deliver(), but there are many paths in the function that return before the corresponding g_free() is reached. Fix this by switching to g_autofree and, while at it, also switch to g_new. Do the same in apic_deliver_irq() as well for consistency. Fixes: b5ee0468e9d ("apic: add support for x2APIC mode", 2024-02-14) Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Bui Quang Minh Reviewed-by: Alex Bennée Message-ID: <20240304224133.267640-1-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/apic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/intc/apic.c b/hw/intc/apic.c index 1d887d66b8..4186c57b34 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -291,14 +291,13 @@ static void apic_deliver_irq(uint32_t dest, uint8_t dest_mode, uint8_t delivery_mode, uint8_t vector_num, uint8_t trigger_mode) { - uint32_t *deliver_bitmask = g_malloc(max_apic_words * sizeof(uint32_t)); + g_autofree uint32_t *deliver_bitmask = g_new(uint32_t, max_apic_words); trace_apic_deliver_irq(dest, dest_mode, delivery_mode, vector_num, trigger_mode); apic_get_delivery_bitmask(deliver_bitmask, dest, dest_mode); apic_bus_deliver(deliver_bitmask, delivery_mode, vector_num, trigger_mode); - g_free(deliver_bitmask); } bool is_x2apic_mode(DeviceState *dev) @@ -662,7 +661,7 @@ static void apic_deliver(DeviceState *dev, uint32_t dest, uint8_t dest_mode, APICCommonState *s = APIC(dev); APICCommonState *apic_iter; uint32_t deliver_bitmask_size = max_apic_words * sizeof(uint32_t); - uint32_t *deliver_bitmask = g_malloc(deliver_bitmask_size); + g_autofree uint32_t *deliver_bitmask = g_new(uint32_t, max_apic_words); uint32_t current_apic_id; if (is_x2apic_mode(dev)) { @@ -708,7 +707,6 @@ static void apic_deliver(DeviceState *dev, uint32_t dest, uint8_t dest_mode, } apic_bus_deliver(deliver_bitmask, delivery_mode, vector_num, trigger_mode); - g_free(deliver_bitmask); } static bool apic_check_pic(APICCommonState *s) From patchwork Sat Mar 9 19:21:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ERIDBqFz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY1B6SRQz1yX6 for ; Sun, 10 Mar 2024 06:26:06 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2JJ-0005Vv-DX; Sat, 09 Mar 2024 14:24:45 -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 1rj2JI-0005VH-Mf for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:44 -0500 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2JF-0002w7-Qt for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:44 -0500 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-512f54fc2dbso2841811e87.1 for ; Sat, 09 Mar 2024 11:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012280; x=1710617080; 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=D23dj2T324O3GGxalmLgdyenzdMnRbpccgTLg/T9/aw=; b=ERIDBqFzmZ17pH8SpnAgGNi8hOYLx4icONDj6FjNkH8a9Lu86H+sb5p714/R3MmdMI tTUH/MCx004PSNJ3wsEPn89NsUoV8J/4Sh/boI3gwrhoBqepIm8kZh55/bJ+WzXUB3ra kAR0/XJCG7N+4vOUVvIq4mJ74GmNh7SyGInoY8frLjvAK+SBJloJjBpVhHidlL00fBIJ vw4XZkoXdP5AXC4BO4WeMEoOHqeThtvd8nyY6BWlm+IIEsKqm+89HhIXMJTSm9e9cH+a Nx0FFYvs1LRIVBZzPsr2nrq+yNk4SHW+/91JRl2ldY56z3sY6pVa+6QRc8K+mJyY8aeq ngzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012280; x=1710617080; 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=D23dj2T324O3GGxalmLgdyenzdMnRbpccgTLg/T9/aw=; b=bKEbp1xCzY9vH0Hxghhz3/CiRg5IM17cIkB2tUyngmbpMaojNbwI/WaLmOS8JZvHqu cWNyrrUN0mS6WbIuanfwxCAgTh57S2Oqt+pexDdyohyKhFdYiqtuwMG3f16WANbAiyYU hL6UdBh7wrCppV6OJtgQ5HzNsDQXq3PzjDpzO6wPZosgCtwPxhwz9NTxE1dCWxTDu6OJ 5+VCaXYrLPcQilTBkq5NB/ZhInz3UjKsXg5vVdGPkfZwphNcSi68sE/ztqh2ZwJ2inZS UEaraE+hUYrR8E75rtcHI/II+MjYuhFEFBOqYhc+H7AJVzD+J9v2bd/g28CU1V9FHptM AVZA== X-Gm-Message-State: AOJu0YyPZc+UTOa0ic70pEkd9KKkmimeaNWUKXpjcKDTQasvOk+nD4/b uOfDcn5BwgybPANSnkOQOV5PnUpLIht1Xevm/2RqViZTvWLeqQyTxhep4Xe6Bg/dQaKmGSETRBM N X-Google-Smtp-Source: AGHT+IFA50J8VdobEnvhTgONujOFAQqMGumZmVsqPZm2tigiFmqnxLyrWPJ3fo4dD/omaGVJjcrkYQ== X-Received: by 2002:a05:6512:a96:b0:513:1cc7:ae4b with SMTP id m22-20020a0565120a9600b005131cc7ae4bmr2003705lfu.4.1710012280216; Sat, 09 Mar 2024 11:24:40 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id rn16-20020a170906d93000b00a441a7a75b5sm1174678ejb.209.2024.03.09.11.24.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Eric Auger , Zhenzhong Duan , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , Eric Blake , Markus Armbruster Subject: [PULL 24/43] qdev: Add a granule_mode property Date: Sat, 9 Mar 2024 20:21:51 +0100 Message-ID: <20240309192213.23420-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Eric Auger Introduce a new enum type property allowing to set an IOMMU granule. Values are 4k, 8k, 16k, 64k and host. This latter indicates the vIOMMU granule will match the host page size. A subsequent patch will add such a property to the virtio-iommu device. Signed-off-by: Eric Auger Reviewed-by: Zhenzhong Duan Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240227165730.14099-2-eric.auger@redhat.com> --- qapi/virtio.json | 18 ++++++++++++++++++ include/hw/qdev-properties-system.h | 3 +++ hw/core/qdev-properties-system.c | 14 ++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/qapi/virtio.json b/qapi/virtio.json index a79013fe89..95745fdfd7 100644 --- a/qapi/virtio.json +++ b/qapi/virtio.json @@ -957,3 +957,21 @@ { 'struct': 'DummyVirtioForceArrays', 'data': { 'unused-iothread-vq-mapping': ['IOThreadVirtQueueMapping'] } } + +## +# @GranuleMode: +# +# @4k: granule page size of 4KiB +# +# @8k: granule page size of 8KiB +# +# @16k: granule page size of 16KiB +# +# @64k: granule page size of 64KiB +# +# @host: granule matches the host page size +# +# Since: 9.0 +## +{ 'enum': 'GranuleMode', + 'data': [ '4k', '8k', '16k', '64k', 'host' ] } diff --git a/include/hw/qdev-properties-system.h b/include/hw/qdev-properties-system.h index 06c359c190..626be87dd3 100644 --- a/include/hw/qdev-properties-system.h +++ b/include/hw/qdev-properties-system.h @@ -8,6 +8,7 @@ extern const PropertyInfo qdev_prop_macaddr; extern const PropertyInfo qdev_prop_reserved_region; extern const PropertyInfo qdev_prop_multifd_compression; extern const PropertyInfo qdev_prop_mig_mode; +extern const PropertyInfo qdev_prop_granule_mode; extern const PropertyInfo qdev_prop_losttickpolicy; extern const PropertyInfo qdev_prop_blockdev_on_error; extern const PropertyInfo qdev_prop_bios_chs_trans; @@ -47,6 +48,8 @@ extern const PropertyInfo qdev_prop_iothread_vq_mapping_list; #define DEFINE_PROP_MIG_MODE(_n, _s, _f, _d) \ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_mig_mode, \ MigMode) +#define DEFINE_PROP_GRANULE_MODE(_n, _s, _f, _d) \ + DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_granule_mode, GranuleMode) #define DEFINE_PROP_LOSTTICKPOLICY(_n, _s, _f, _d) \ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_losttickpolicy, \ LostTickPolicy) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 1a396521d5..b45e90edb2 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -679,6 +679,20 @@ const PropertyInfo qdev_prop_mig_mode = { .set_default_value = qdev_propinfo_set_default_value_enum, }; +/* --- GranuleMode --- */ + +QEMU_BUILD_BUG_ON(sizeof(GranuleMode) != sizeof(int)); + +const PropertyInfo qdev_prop_granule_mode = { + .name = "GranuleMode", + .description = "granule_mode values, " + "4k, 8k, 16k, 64k, host", + .enum_table = &GranuleMode_lookup, + .get = qdev_propinfo_get_enum, + .set = qdev_propinfo_set_enum, + .set_default_value = qdev_propinfo_set_default_value_enum, +}; + /* --- Reserved Region --- */ /* From patchwork Sat Mar 9 19:21:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910076 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TRpMwXKF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY2t2tDQz1yX6 for ; Sun, 10 Mar 2024 06:27:34 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2JP-0005xU-Is; Sat, 09 Mar 2024 14:24:51 -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 1rj2JN-0005jP-5I for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:49 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2JL-0002zt-DH for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:48 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a4429c556efso229346966b.0 for ; Sat, 09 Mar 2024 11:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012286; x=1710617086; 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=8IXK0wenZmYfT6yBITIHGYESwGfPru4qC6kLvjxG9yg=; b=TRpMwXKF63pdPAvGMgc6ixM4eoIBkr6yoc4X6K1oEkSpy9Wxpw4JPI+kljWmF0wg9D JE9PEE4DVSgebju7pEz34rvWN8LDjE6Tm8SYgT2BVCFRVZ2cTLc2/alKPlBFtEvr/csk 8GYG7NWZQwjgkGEseMrljxcEEbdVltS3/Ztk8VOZQZWAiM+FuNCcQ1Hh5OBGrXZ+VCDh sqUzjSBMrV25pyBviNeemAv0vw2EICEWfXOlAYAEQBWUxP+CvUms5441fmU2yYJ1jLUY GQSknB36f5mXe6W7Npw/Ei3aGNQjsbVgEQYPmnpH9/ksumQlzpavmapwQvXyfbkpX5B9 T5/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012286; x=1710617086; 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=8IXK0wenZmYfT6yBITIHGYESwGfPru4qC6kLvjxG9yg=; b=ui3RyAqTfj7IS9zOVGfNSvL730KI81Aoo5mJOtGYlhQisx7Jf7+o2UVD/V0UNxVhvf 7GyyYT+x9NzBiTocNN8smrnpTvy/JyLyLCVs9PhwBRJ2vdlTfK1hTpOVgnaVxqW9WNsO 57gHxr4WKNqnXNgmFsIX/myS++30DeSosM4JNYW+fLyWrK7wQczlXS3Hd2Quuf/AIfLP pq0xCylH3pGFiM+8PXxh88htiqvqVpH8KBjewQdZQbPQfdxcGDnwP9Gvdt44H1DEnbs9 iKjtpnK7pg3oq2bQVXnV7RWqfJCfkRlUQUk2kHqAwlsmPEIYIxxLWoHvZrVfJqcfsYJ2 MaoQ== X-Gm-Message-State: AOJu0YxgPTT9XFt9hooI1cO9TJ/N856GdLYTuIKajxlB3tofg7Ev93fX ieTqKv8fscQYPEkYx8wikK49R54Y7RDCT4fSFjS5SHJQ2FkxReBuNq/bFa41t2o= X-Google-Smtp-Source: AGHT+IHdZOGcI74LpqpnrucOzRjs+bV7tLhNh0HZy5RFuXIPB4cAJdoJYfXFqX4U5X9g7UUqrm1EgQ== X-Received: by 2002:a17:906:d0c5:b0:a45:110e:568f with SMTP id bq5-20020a170906d0c500b00a45110e568fmr1452152ejb.37.1710012286153; Sat, 09 Mar 2024 11:24:46 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id kq17-20020a170906abd100b00a40f7ed6cb9sm1173609ejb.4.2024.03.09.11.24.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, BALATON Zoltan , "Dr . David Alan Gilbert" , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PULL 25/43] hmp: Add option to info qtree to omit details Date: Sat, 9 Mar 2024 20:21:52 +0100 Message-ID: <20240309192213.23420-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: BALATON Zoltan The output of info qtree monitor command is very long. Add an option to print a brief overview omitting all the details. Signed-off-by: BALATON Zoltan Reviewed-by: Dr. David Alan Gilbert Message-ID: <20240307183812.0105D4E6004@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé --- system/qdev-monitor.c | 27 +++++++++++++++------------ hmp-commands-info.hx | 6 +++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index a13db763e5..ad91e74181 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -744,7 +744,6 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp) } #define qdev_printf(fmt, ...) monitor_printf(mon, "%*s" fmt, indent, "", ## __VA_ARGS__) -static void qbus_print(Monitor *mon, BusState *bus, int indent); static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props, int indent) @@ -784,13 +783,9 @@ static void bus_print_dev(BusState *bus, Monitor *mon, DeviceState *dev, int ind static void qdev_print(Monitor *mon, DeviceState *dev, int indent) { ObjectClass *class; - BusState *child; NamedGPIOList *ngl; NamedClockList *ncl; - qdev_printf("dev: %s, id \"%s\"\n", object_get_typename(OBJECT(dev)), - dev->id ? dev->id : ""); - indent += 2; QLIST_FOREACH(ngl, &dev->gpios, node) { if (ngl->num_in) { qdev_printf("gpio-in \"%s\" %d\n", ngl->name ? ngl->name : "", @@ -814,12 +809,9 @@ static void qdev_print(Monitor *mon, DeviceState *dev, int indent) class = object_class_get_parent(class); } while (class != object_class_by_name(TYPE_DEVICE)); bus_print_dev(dev->parent_bus, mon, dev, indent); - QLIST_FOREACH(child, &dev->child_bus, sibling) { - qbus_print(mon, child, indent); - } } -static void qbus_print(Monitor *mon, BusState *bus, int indent) +static void qbus_print(Monitor *mon, BusState *bus, int indent, bool details) { BusChild *kid; @@ -827,16 +819,27 @@ static void qbus_print(Monitor *mon, BusState *bus, int indent) indent += 2; qdev_printf("type %s\n", object_get_typename(OBJECT(bus))); QTAILQ_FOREACH(kid, &bus->children, sibling) { + BusState *child_bus; DeviceState *dev = kid->child; - qdev_print(mon, dev, indent); + qdev_printf("dev: %s, id \"%s\"\n", object_get_typename(OBJECT(dev)), + dev->id ? dev->id : ""); + if (details) { + qdev_print(mon, dev, indent + 2); + } + QLIST_FOREACH(child_bus, &dev->child_bus, sibling) { + qbus_print(mon, child_bus, indent + 2, details); + } } } #undef qdev_printf void hmp_info_qtree(Monitor *mon, const QDict *qdict) { - if (sysbus_get_default()) - qbus_print(mon, sysbus_get_default(), 0); + bool details = !qdict_get_try_bool(qdict, "brief", false); + + if (sysbus_get_default()) { + qbus_print(mon, sysbus_get_default(), 0, details); + } } void hmp_info_qdm(Monitor *mon, const QDict *qdict) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index da120f82a3..ad1b1306e3 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -540,9 +540,9 @@ ERST { .name = "qtree", - .args_type = "", - .params = "", - .help = "show device tree", + .args_type = "brief:-b", + .params = "[-b]", + .help = "show device tree (-b: brief, omit properties)", .cmd = hmp_info_qtree, }, From patchwork Sat Mar 9 19:21:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=J38xq4PG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY2T0Pq5z1yX6 for ; Sun, 10 Mar 2024 06:27:13 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2JW-0006ds-Gp; Sat, 09 Mar 2024 14:24:58 -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 1rj2JT-0006MA-NK for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:56 -0500 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2JR-00034O-OT for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:24:55 -0500 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2d269b2ff48so48617951fa.3 for ; Sat, 09 Mar 2024 11:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012292; x=1710617092; 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=sOxMDvWG7fYCMvOESgkL1lEMXJ1JQ08vQMhMIpxGM9I=; b=J38xq4PGGwtuqZGaJYM1qDPUggGtv+n5tzGS4pYERNsyVkqA7CDjhVHDXk31MW16bc hhHWlc90iduw8WwVaHM32aJEIMcPLDc6O9Rf80Uu/llk9p4QamSL8FWHc17uyQ3P28Ej OMNYvEfRbWivCBJ9bu8OEdfIZ5uG3vYlTsAaxqUw5LD2QS/nlcvRDDlzTJv4e3fsyY+5 KhVEBGQgZddbuwf2iD8L3jPXwPYgtB7sKt72wM/5lqcZhTvMmWBWVWe7nnc7ZDciE/cf JMi6fPQ8nMpSBq+SyEZQF6kgDd7w5KWK2pPp60Bd3Pg/Eeg/YyaD38bu0ax94ZqrfFd/ ZKVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012292; x=1710617092; 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=sOxMDvWG7fYCMvOESgkL1lEMXJ1JQ08vQMhMIpxGM9I=; b=G2C3fZ7RecGCJEz4LT5gbvDO+hxwJZ6IAkCyh/FSbKwdNM7p46d95xVqkekw8pbYGf IO2219ZYkls7ZmjsF7Ed5HFOKcnAeNdu3xJ+Naydw12x/jzB2CboroApY2Lg2i4wwaFZ 4e870qQqkRNiJLtD05bIAzOCbl1Usp7w4KID2F2ImAPQUnQiKjD2Z2rn69v/9qNXhZTA M0fevBGl+UFBwSfpJ0zZNIMoLw8FG/DpkwZgCvgn39veG0BtfCdbXYIt8CbbEEq1/SL2 zQg2rADrbN+vHOrieg7R6bXyjbZeBpoOIF+TNVudtmh46kZ48yRWuvfNODrbAhsSwfvs jvbw== X-Gm-Message-State: AOJu0YxI1dXP+N2tkpAbunBDLMKhLUWv7SRjbCa+yby4qwd9wb/klrh+ b0R6FZqHVfE4afYiYLgL5Rch+98VQjxYj8UadqWDVSmuCp6lBEVUyZtNEUF2b8o= X-Google-Smtp-Source: AGHT+IEnx0UAhxsWu3vMT5zFaVAqvYzcPHl1DIzHmPysNIU33oUo3sm7kvUgkXVueeIazkYyYxJspA== X-Received: by 2002:a2e:9b8e:0:b0:2d3:fa6b:9104 with SMTP id z14-20020a2e9b8e000000b002d3fa6b9104mr1393478lji.20.1710012292045; Sat, 09 Mar 2024 11:24:52 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id n10-20020aa7d04a000000b0056826248468sm1156009edo.89.2024.03.09.11.24.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 26/43] mac_newworld: change timebase frequency from 100MHz to 25MHz for mac99 machine Date: Sat, 9 Mar 2024 20:21:53 +0100 Message-ID: <20240309192213.23420-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=philmd@linaro.org; helo=mail-lj1-x22e.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Mark Cave-Ayland MacOS X uses multiple techniques for calibrating timers depending upon the detected hardware. One of these calibration routines compares the change in the timebase against the KeyLargo timer and uses this to recalculate the clock frequency, timebase frequency and bus frequency if the calibration exceeds certain limits. This recalibration occurs despite the correct values being passed via the device tree, and is likely due to buggy firmware on some hardware. The timebase frequency of 100MHz was set way back in 2005 by commit fa296b0fb4 ("PIC fix - changed back TB frequency to 100 MHz") and with this value on a mac99,via=pmu machine the OSX 10.2 timer calibration incorrectly calculates the bus frequency as 400MHz instead of 100MHz. The most noticeable side-effect is the UI appears sluggish and not very responsive for normal use. Change the timebase frequency from 100MHz to 25MHz which matches that of a real G4 AGP machine (the closest match to QEMU's mac99 machine) and allows OSX 10.2 to correctly detect all of the clock frequency, timebase frequency and bus frequency. Tested on various MacOS images from OS 9.2 through to OSX 10.4, along with Linux and NetBSD and I was unable to find any regressions from this change. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240304073548.2098806-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/mac_newworld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 3e796d2f6d..ff9e490c4e 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -77,7 +77,7 @@ #define MAX_IDE_BUS 2 #define CFG_ADDR 0xf0000510 -#define TBFREQ (100UL * 1000UL * 1000UL) +#define TBFREQ (25UL * 1000UL * 1000UL) #define CLOCKFREQ (900UL * 1000UL * 1000UL) #define BUSFREQ (100UL * 1000UL * 1000UL) From patchwork Sat Mar 9 19:21:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=hW/y+TVQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY474qJ1z1yXB for ; Sun, 10 Mar 2024 06:28:39 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lf-0000nU-Qx; Sat, 09 Mar 2024 14:27:11 -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 1rj2Jb-0006oM-Eo for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:08 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2JX-00035O-14 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:02 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a45aa7cb2b3so235325266b.3 for ; Sat, 09 Mar 2024 11:24:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012298; x=1710617098; 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=LXk2FBAU/I+Gq91SQ8W6u6cQEBqnEw8TniXn77xAtfE=; b=hW/y+TVQNEGOV3R6xUfA6rbqvDgFVTmeyaeKF6nw4CdPPoWGD+YUtJ8uUeHtiSXO66 Cs4lDp+wXeSNo6TvLWGy7bwR2U0tYGpFudeQ5osJ1nWOQ3I4D7CfbXmVHrHxjQUcln9J Joc48+Ki03C4j1Q24MnT9V5pwWHlZHoaTfPlQpZnnC+dYEuQjXF/OeUgUDIC6dRI4k0K uiPE1x6fypUQNsMoVcatwmuv53xrDWbnP2xCKz0vmNNJE9nD7Du/f/cGQxOsN8UcAKlu iy+1dHnqHFQubWdYPdt0bRL1H6ds8enlTXVFDGAYFJIKb5wvc3uaimWr75QWEkt8KKqK ip0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012298; x=1710617098; 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=LXk2FBAU/I+Gq91SQ8W6u6cQEBqnEw8TniXn77xAtfE=; b=tNRQ8CeWPVEm6S8HgTqUrdg7yjoLGxLYUqp/wx9Lpw9NH3AsP8dflkxl0vqNP7NOl1 wwrJpgqQiGvOUUEsXFHBVN2CPZpsgeMYf9tZGET+JQ3xTyP1tbPZY71F4JUJ6MQaz6hx 7Hfu7W0/YF3iuHVttoqSBibykdyzUuShc2Xr3aTKes4CpKSFXv96IC10SCRfrRltXrrg hhaLRs4qdzVheX84PPl0O+hF0c7biBqaChGcfwDeDyV6ml4tPy6/hnF+wXUYUDRxTREH CIwoJdVMHvCrP9/ohhbN0Mwu1zQkPsQwi+DSsegvIRSDhOjrInfN4GlPHE+6wcHIHsOC CFaA== X-Gm-Message-State: AOJu0YxFmbphT90tDH7DwGWd28PQy0MDp9uBbK9HDszsh7pythbiCqJ3 wWX29j08UZRqlRvORwM/iXOsEedqF/R0UQhuzd7Y3Y9vYr+J4cym2nBqhjQEw18= X-Google-Smtp-Source: AGHT+IEBzyj8x5j88N4i5jH/viOl5H6aPx6/nwZq2TgA2iE6c8rg5hdcZ88xN/9OgOJKqQObdvKRMg== X-Received: by 2002:a17:906:310f:b0:a43:dc5f:f271 with SMTP id 15-20020a170906310f00b00a43dc5ff271mr1326849ejx.42.1710012297770; Sat, 09 Mar 2024 11:24:57 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id r1-20020a170906364100b00a4320e22b31sm1195761ejb.19.2024.03.09.11.24.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Cl=C3=A9ment_Chigot?= , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Frederic Konrad Subject: [PULL 27/43] hw/intc/grlib_irqmp: abort realize when ncpus value is out of range Date: Sat, 9 Mar 2024 20:21:54 +0100 Message-ID: <20240309192213.23420-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Clément Chigot Even if the error is set, the build is not aborted when the ncpus value is wrong, the return is missing. Signed-off-by: Clément Chigot Reviewed-by: Peter Maydell Fixes: 6bf1478543 ("hw/intc/grlib_irqmp: add ncpus property") Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240308152719.591232-1-chigot@adacore.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/grlib_irqmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/grlib_irqmp.c b/hw/intc/grlib_irqmp.c index 144b121d48..c6c51a349c 100644 --- a/hw/intc/grlib_irqmp.c +++ b/hw/intc/grlib_irqmp.c @@ -356,6 +356,7 @@ static void grlib_irqmp_realize(DeviceState *dev, Error **errp) error_setg(errp, "Invalid ncpus properties: " "%u, must be 0 < ncpus =< %u.", irqmp->ncpus, IRQMP_MAX_CPU); + return; } qdev_init_gpio_in(dev, grlib_irqmp_set_irq, MAX_PILS); From patchwork Sat Mar 9 19:21:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910116 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=AHBwVgXq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY7C39gJz1yWx for ; Sun, 10 Mar 2024 06:31:19 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2KN-0007Nx-11; Sat, 09 Mar 2024 14:25:56 -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 1rj2Jj-00070n-Mn for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:15 -0500 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Je-0003GM-P0 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:08 -0500 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2d094bc2244so45065491fa.1 for ; Sat, 09 Mar 2024 11:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012303; x=1710617103; 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=7zPZ+tfLA0kEM+leCIAJpOJfakF+P7OF5niFNRbs0QA=; b=AHBwVgXq9ZG3/uDg62TUf5rnj5n6AJIgCw2RdDjkDn7Re4d2QILaZs2k5kW71jtwoh rm6zAao15W9zINZ3R2OKC+q/vdo6pbjLZ/UYX/3yMW5TSHtdn8pEMg1MQtHnENWpa/mG PJM8e57q+iJIWQS1ZIlwzvhWDEGA0GTjnOV1uvZVQ3sed7toNFxtDOIMDVW74UnUBRWt 2ZWnl7R/uDmtqOU36ZSmwOIcV+s9IzmarAuFOMHq8O/l/7uF9zWW1LcHd4G+eljxvGNH 2mNgOMIj13yIqI/ddN4mp5asQKSunHm1p96NKJCoNZGg73gPwQ6KAmDfQFg6Xvr6iLI3 6hPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012303; x=1710617103; 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=7zPZ+tfLA0kEM+leCIAJpOJfakF+P7OF5niFNRbs0QA=; b=UQuHil0uQbJWyuUBpwSKXaMku2K/cU5V3fO1FphV8YNi15D8Ol4KpebF0VoShG3KKZ RBptOZeD/Q6YFbQdU4U8RgpFIBRXGI8lJo1umR7BP9sPoAKyEG2U1B/CCGdJEpywIV96 R+lT6t68q2iEfBp1nycianDXIGAFjQVYEuzgP061xcdhCz1MH9WQ0CrulsyPlwTnDju7 jctDDwvNuacfbkAPPHb/KOEi0t9Zy+tfAVJbcy7KbE0uH7e8oQIib7S1l7P2IrivuVqp Nh0R/Ia758Y3wUvLbwFZLo3hOSXYK1eTN70N1KIqFSMByVqL25rApxhBGNlbjLgIfO/T OwHQ== X-Gm-Message-State: AOJu0Yy6AFYlTF9H2HfcFJMSl0HFQy7Vw4MceSycSwpt2cXzFj6gMd7K G8zZHdULGwkOqO68i6SkXE6To5NTXv9OIz+UjTGeQCffpCOD+NzxZ3EMQ7udMac= X-Google-Smtp-Source: AGHT+IH24Ht406wouiE5qSs+XSE1JrmIm/ZKODAoIJUUNI0MaGtabmYkhIaVOzO3mcklEOuqeSwLfA== X-Received: by 2002:a2e:87d3:0:b0:2d4:31a0:6adf with SMTP id v19-20020a2e87d3000000b002d431a06adfmr299482ljj.24.1710012303605; Sat, 09 Mar 2024 11:25:03 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id cn19-20020a0564020cb300b0056828004c75sm1167790edb.51.2024.03.09.11.25.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Thomas_Wei=C3=9Fschu?= =?utf-8?q?h?= , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kashyap Chamarthy Subject: [PULL 28/43] docs/interop/firmware.json: Align examples Date: Sat, 9 Mar 2024 20:21:55 +0100 Message-ID: <20240309192213.23420-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=philmd@linaro.org; helo=mail-lj1-x236.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Weißschuh Adjust indentation for commit d23055b8db8 (qapi: Require descriptions and tagged sections to be indented). Signed-off-by: Thomas Weißschuh Reviewed-by: Markus Armbruster Message-ID: <20240307-qapi-firmware-json-v2-1-3b29eabb9b9a@linutronix.de> [PMD: Reword description using Markus suggestion] Signed-off-by: Philippe Mathieu-Daudé --- docs/interop/firmware.json | 374 ++++++++++++++++++------------------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index cc8f869186..a024f1b9bf 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -435,203 +435,203 @@ # # Examples: # -# { -# "description": "SeaBIOS", -# "interface-types": [ -# "bios" -# ], -# "mapping": { -# "device": "memory", -# "filename": "/usr/share/seabios/bios-256k.bin" -# }, -# "targets": [ -# { -# "architecture": "i386", -# "machines": [ -# "pc-i440fx-*", -# "pc-q35-*" -# ] +# { +# "description": "SeaBIOS", +# "interface-types": [ +# "bios" +# ], +# "mapping": { +# "device": "memory", +# "filename": "/usr/share/seabios/bios-256k.bin" # }, -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-i440fx-*", -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "acpi-s4" -# ], -# "tags": [ -# "CONFIG_BOOTSPLASH=n", -# "CONFIG_ROM_SIZE=256", -# "CONFIG_USE_SMM=n" -# ] -# } +# "targets": [ +# { +# "architecture": "i386", +# "machines": [ +# "pc-i440fx-*", +# "pc-q35-*" +# ] +# }, +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-i440fx-*", +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "acpi-s4" +# ], +# "tags": [ +# "CONFIG_BOOTSPLASH=n", +# "CONFIG_ROM_SIZE=256", +# "CONFIG_USE_SMM=n" +# ] +# } # -# { -# "description": "OVMF with SB+SMM, empty varstore", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", -# "format": "raw" +# { +# "description": "OVMF with SB+SMM, empty varstore", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "requires-smm", -# "secure-boot", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a IA32", -# "-a X64", -# "-p OvmfPkg/OvmfPkgIa32X64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D SMM_REQUIRE", -# "-D SECURE_BOOT_ENABLE", -# "-D FD_SIZE_4MB" -# ] -# } +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "requires-smm", +# "secure-boot", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a IA32", +# "-a X64", +# "-p OvmfPkg/OvmfPkgIa32X64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D SMM_REQUIRE", +# "-D SECURE_BOOT_ENABLE", +# "-D FD_SIZE_4MB" +# ] +# } # -# { -# "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", -# "format": "raw" +# { +# "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.secboot.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.secboot.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "enrolled-keys", -# "requires-smm", -# "secure-boot", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a IA32", -# "-a X64", -# "-p OvmfPkg/OvmfPkgIa32X64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D SMM_REQUIRE", -# "-D SECURE_BOOT_ENABLE", -# "-D FD_SIZE_4MB" -# ] -# } +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "enrolled-keys", +# "requires-smm", +# "secure-boot", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a IA32", +# "-a X64", +# "-p OvmfPkg/OvmfPkgIa32X64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D SMM_REQUIRE", +# "-D SECURE_BOOT_ENABLE", +# "-D FD_SIZE_4MB" +# ] +# } # -# { -# "description": "OVMF with SEV-ES support", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.fd", -# "format": "raw" +# { +# "description": "OVMF with SEV-ES support", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "amd-sev-es", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a X64", -# "-p OvmfPkg/OvmfPkgX64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D FD_SIZE_4MB" -# ] -# } +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "amd-sev-es", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a X64", +# "-p OvmfPkg/OvmfPkgX64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D FD_SIZE_4MB" +# ] +# } # -# { -# "description": "UEFI firmware for ARM64 virtual machines", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/AAVMF/AAVMF_CODE.fd", -# "format": "raw" +# { +# "description": "UEFI firmware for ARM64 virtual machines", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/AAVMF/AAVMF_CODE.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/AAVMF/AAVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/AAVMF/AAVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "aarch64", -# "machines": [ -# "virt-*" -# ] -# } -# ], -# "features": [ +# "targets": [ +# { +# "architecture": "aarch64", +# "machines": [ +# "virt-*" +# ] +# } +# ], +# "features": [ # -# ], -# "tags": [ -# "-a AARCH64", -# "-p ArmVirtPkg/ArmVirtQemu.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000" -# ] -# } +# ], +# "tags": [ +# "-a AARCH64", +# "-p ArmVirtPkg/ArmVirtQemu.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000" +# ] +# } ## { 'struct' : 'Firmware', 'data' : { 'description' : 'str', From patchwork Sat Mar 9 19:21:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=pY4+LBsm; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY5D3R9Vz1yXB for ; Sun, 10 Mar 2024 06:29:36 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ld-000093-9h; Sat, 09 Mar 2024 14:27:09 -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 1rj2Jn-000721-Tz for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:21 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Jj-0003Io-Jt for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:14 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a293f2280c7so503206566b.1 for ; Sat, 09 Mar 2024 11:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012309; x=1710617109; 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=shKXB5mcwJL88T3p8o75GRzqkLr6uG1jmqPC2UukzhI=; b=pY4+LBsm4cXmBzCJybnR2Hy02QkbN0Bt/FH+E/VAwK8DCHjAFkyQ1ysrS7ckIyLDpr q0P1huPa1iAHzlkDqQlubQGYsdypCsGkrZO5sKMzurFY+tVGLt2OtcMm8klHbjwCYx1m UtVXzZSu3fZPpwQbwCwZIrihHeaPUVnR9iPJ9h3uIk0eOLoyUFZhUYkttNVJ5+LPHZB4 DijuYjuOUsu/tYq9RB5OAou816u5NakeAhA8Gtu8xhiDNcqFzSSMD4EPU+840x1ZlyiP yfjX7bcmffnthpvWh8lUCMk4scgSetGPhNXbACO7o8uS3mJJfaR8tMQkoAI1kn5mFlHb CW+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012309; x=1710617109; 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=shKXB5mcwJL88T3p8o75GRzqkLr6uG1jmqPC2UukzhI=; b=d7A5xq8xS0En4+DZH5xGViDHsqtTV46Cy54T5Teti8iNEBhJgwjezbYtQM67UX5yGb 1y/u21CEL3gDesPQwW+e8C7xoRScGD4DwhPB9Z9gDgWL47i9jFIVpl+DjEd05D1HzsZg CQ1umzjnVERiLEJJUf1jYznqw305hshpgkciw8xKVXgTQdX3IPheSK3GwYHzBH6llXt7 z70YqEfrZzmsbA42vT6ZWP8t4QNiQew5GVDaMrnWCjagm0p3BhvXvMFN3H+dIP4tVHz+ eCPuKnOvMRnTRrvOFaUFOwr8CrCvDUhJAUjtD1cOmE3hbrLbZZZosLScJf6PAtkLYy37 008A== X-Gm-Message-State: AOJu0YyHEvrSvEF2aKA4iVPD7doET7NEmeP5HBYEpelC5FilEKN8dHga SyuTzYBH634NREuAJCL3EiW/6aWrkrohszFAmql2hrFqxP1OKtX048KHwBwXNx8= X-Google-Smtp-Source: AGHT+IEdf1UFTYo3MXGvdv4E79IPcLBj7o3BSzYa5lB994OSUOKUxtNFgLGUlUitgmHMkoPZUGHxPQ== X-Received: by 2002:a17:907:7856:b0:a44:415d:fa3a with SMTP id lb22-20020a170907785600b00a44415dfa3amr1436642ejc.40.1710012309349; Sat, 09 Mar 2024 11:25:09 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id y20-20020a17090629d400b00a45cc1e8fe3sm1169038eje.211.2024.03.09.11.25.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Thomas_Wei=C3=9Fschu?= =?utf-8?q?h?= , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= , Kashyap Chamarthy Subject: [PULL 29/43] docs/interop/firmware.json: Fix doc for FirmwareFlashMode Date: Sat, 9 Mar 2024 20:21:56 +0100 Message-ID: <20240309192213.23420-30-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Weißschuh The doc title did not match the actual definition. Fixes: 2720ceda05 ("docs: expand firmware descriptor to allow flash without NVRAM") Signed-off-by: Thomas Weißschuh Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240307-qapi-firmware-json-v2-2-3b29eabb9b9a@linutronix.de> Signed-off-by: Philippe Mathieu-Daudé --- docs/interop/firmware.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index a024f1b9bf..54a1fc6c10 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -223,7 +223,7 @@ ## -# @FirmwareFlashType: +# @FirmwareFlashMode: # # Describes how the firmware build handles code versus variable # persistence. From patchwork Sat Mar 9 19:21:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=VALzPcEG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY3h3vDgz1yXB for ; Sun, 10 Mar 2024 06:28:16 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Le-0000gl-Uy; Sat, 09 Mar 2024 14:27:11 -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 1rj2Jw-00078z-14 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:26 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Jr-0003JY-9L for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:22 -0500 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d21cdbc85bso44795291fa.2 for ; Sat, 09 Mar 2024 11:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012315; x=1710617115; 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=XGUSMcXRtP0nqAsvDloxBVg/GDCFuWNCjxC0TZD6IEQ=; b=VALzPcEGP+swjEk0CC2jH3D7xSbmEfKWg7llXc2ttAtVpaNLIEppsF/Ftm+ZNNNgSg oLvw2R8ChC17kazIZUh79XAB2pKm06uskQLzYL3VjWa5up6toM1ECJU1yrhWX0np2Oo9 SBQkeSPdLXe7rjxkRiXDMstZc3OkNwdJuXy/ohn72Kl7dXGnISL67x4GVBso3PwXQ/qp oszvkcWDuneq9HTi5WwRGHj9I5VFoS4Vr5Fhb1hcnh4vEBrsYkwYsyodAbUM/kO2MZmR UA1avU3yP2CBcvLhie5FhQ9GlRfn+SHsDod8tpV6ZHfRiqs11AlzBW1WMODAxsKNCoDf Yljw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012315; x=1710617115; 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=XGUSMcXRtP0nqAsvDloxBVg/GDCFuWNCjxC0TZD6IEQ=; b=VUi/snx8/QlveVE1XMHYPL4raBPHzYZqWDAGBkGQeAbMjQLnxdYOvGUSHzq+u9ciAq QBjYczb6yuq+Xis5aI2zQK5BJS9/wTqWcDfq2Z+CyXfYtH3CDZgdYpZiB5VkrEIq4DhM Mz5EpUn8IamPU48qLxraQslovHUkePwlYLKbERgTDtgQoU3s9iFBBGorttxllY36fwHa dqvdYN9jCnZMoQD6C3GxQ9+FvlQTVxz5WETMngV5rBHgZhK6EPaYpqMS712dS+G+z6Zc doahJTQINyfSKorhRBfxW7nRiUR+VVyAh63nrriN7zjV3qn7GmnC2cq+HIy22OukA/On TFhw== X-Gm-Message-State: AOJu0Yxyc3JN1QMTU0V9noV8egKJqP3sfSkOAnW+2WYSL6S8ggT0pmMd Q6z8J+cPvT/NNXPM5gTmUk+1Hcb/0sQBucj/2O4mF1HVu6o8OKpwdaE8IdbYWJw= X-Google-Smtp-Source: AGHT+IEmK9UTnYDyWWDsJcs7b0d4OIlrfGDbTA9RfFxf5J0o4Iae+IN++bySO9CuxqRiaN6pq2r2Vg== X-Received: by 2002:a2e:9984:0:b0:2d2:71cc:253d with SMTP id w4-20020a2e9984000000b002d271cc253dmr1466595lji.25.1710012315435; Sat, 09 Mar 2024 11:25:15 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id w10-20020a056402128a00b005657eefa8e9sm1154766edv.4.2024.03.09.11.25.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Thomas Huth , Prasad Pandit , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , devel@lists.libvirt.org, Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 30/43] hw/core/machine-smp: Remove deprecated "parameter=0" SMP configurations Date: Sat, 9 Mar 2024 20:21:57 +0100 Message-ID: <20240309192213.23420-31-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu The "parameter=0" SMP configurations have been marked as deprecated since v6.2. For these cases, -smp currently returns the warning and adjusts the zeroed parameters to 1 by default. Remove the above compatibility logic in v9.0, and return error directly if any -smp parameter is set as 0. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Reviewed-by: Prasad Pandit Message-ID: <20240308160148.3130837-2-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 16 ---------------- docs/about/removed-features.rst | 15 +++++++++++++++ hw/core/machine-smp.c | 5 +++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 8565644da6..6e2f557682 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -36,22 +36,6 @@ and will cause a warning. The replacement for the ``nodelay`` short-form boolean option is ``nodelay=on`` rather than ``delay=off``. -``-smp`` ("parameter=0" SMP configurations) (since 6.2) -''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -Specified CPU topology parameters must be greater than zero. - -In the SMP configuration, users should either provide a CPU topology -parameter with a reasonable value (greater than zero) or just omit it -and QEMU will compute the missing value. - -However, historically it was implicitly allowed for users to provide -a parameter with zero value, which is meaningless and could also possibly -cause unexpected results in the -smp parsing. So support for this kind of -configurations (e.g. -smp 8,sockets=0) is deprecated since 6.2 and will -be removed in the near future, users have to ensure that all the topology -members described with -smp are greater than zero. - Plugin argument passing through ``arg=`` (since 6.1) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index 417a0e4fa1..f9cf874f7b 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -489,6 +489,21 @@ The ``-singlestep`` option has been turned into an accelerator property, and given a name that better reflects what it actually does. Use ``-accel tcg,one-insn-per-tb=on`` instead. +``-smp`` ("parameter=0" SMP configurations) (removed in 9.0) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Specified CPU topology parameters must be greater than zero. + +In the SMP configuration, users should either provide a CPU topology +parameter with a reasonable value (greater than zero) or just omit it +and QEMU will compute the missing value. + +However, historically it was implicitly allowed for users to provide +a parameter with zero value, which is meaningless and could also possibly +cause unexpected results in the -smp parsing. So support for this kind of +configurations (e.g. -smp 8,sockets=0) is removed since 9.0, users have +to ensure that all the topology members described with -smp are greater +than zero. User-mode emulator command line arguments ----------------------------------------- diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 25019c91ee..96533886b1 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -105,8 +105,9 @@ void machine_parse_smp_config(MachineState *ms, (config->has_cores && config->cores == 0) || (config->has_threads && config->threads == 0) || (config->has_maxcpus && config->maxcpus == 0)) { - warn_report("Deprecated CPU topology (considered invalid): " - "CPU topology parameters must be greater than zero"); + error_setg(errp, "Invalid CPU topology: " + "CPU topology parameters must be greater than zero"); + return; } /* From patchwork Sat Mar 9 19:21:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=gzHWvyZY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY732qnHz1yWx for ; Sun, 10 Mar 2024 06:31:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lf-0000kw-MJ; Sat, 09 Mar 2024 14:27:11 -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 1rj2Jz-0007AW-AH for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:36 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Jv-0003K3-AO for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:26 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a44665605f3so493179066b.2 for ; Sat, 09 Mar 2024 11:25:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012321; x=1710617121; 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=y5wggQ6ZmpYal9W3iEFAyHN5UYyn6LPkIJHsTwN5wMc=; b=gzHWvyZYMBxYglvhK6bLYIG+VIsGll18hNTto7mG+tkI1rOST7EtfjvtibDSNo1DXj xexX6ajenpfc7kbdX/iKHoyiXNkxGFGsinkP5FgVGzIQQl5xSIrxtcTW5JaTttXmHy8K 8xMC9oBD9OX5mlcSgmkI1dB6ezQDKVmlCNiQzmRsxlbu8tmkAMOSS6hUcOOgpw/s02ur ITES9owP4sELrsUNFdSHdzAoTbDbPNxA6aBc2Xnh0OxIFmbqIHrzKJPBkDjblkXsKY42 RdiDMEJC/XbnqZ9MreurytdMZKusSQ/JySPlVamwUdkya1CvsGkwcuU/t0su6fsLdtJl Q4WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012321; x=1710617121; 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=y5wggQ6ZmpYal9W3iEFAyHN5UYyn6LPkIJHsTwN5wMc=; b=huTj52q3JVHR2m//BwOVJ63LHpGd8BwzOa+ddyLdCNFdH7lSbVzIJ4ou7zZTmsKrph OGWbIdXZfOH4jhVIoHCKGS2jhGYfdYAnDv/W8x96GlJpmlXymVi0XcOsYNNkfO1Fd7zT BKIHCzhgLUBDDE+czB4NdK0rLt65CyFCNbRtW9RKDDro3letm1FxEh5EVh/fOd2z+veB 0Jk1Yi/B4DkA5VaNbsR47YdEG+8EOzJNR/of72O1v9cMRGVDd7zm3uwi7OJzg+lV0x2a bh9D1uYCUhJTHYpQI1sfVJRAggk5nwZz/AzbHITSs/W8ST2qAgU5Mg0Fe2FKzUCq88Ws 6YNg== X-Gm-Message-State: AOJu0YzLWDeZg1E6/HSF2XThiK2y6nvGSFOJsaxrqLF+yM6Rh9AkUWxS L2hBF914/V2kGv1jygOyb11Ta1pBmAk4ZLh73da271ja+Ee/AVW0nZKBqZHotm0= X-Google-Smtp-Source: AGHT+IEJxZoks7YvXqRPW3OSNTD8aUdPj/RfSePEzIYbzHAc1P3FPW//0nhmpJIeieRIE/jYMuCVYA== X-Received: by 2002:a17:906:f6d8:b0:a45:f89b:a916 with SMTP id jo24-20020a170906f6d800b00a45f89ba916mr1406551ejb.73.1710012321544; Sat, 09 Mar 2024 11:25:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id qt28-20020a170906ecfc00b00a45bb14b1a5sm1171650ejb.89.2024.03.09.11.25.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , devel@lists.libvirt.org, Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 31/43] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations Date: Sat, 9 Mar 2024 20:21:58 +0100 Message-ID: <20240309192213.23420-32-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu Currently, it was allowed for users to specify the unsupported topology parameter as "1". For example, x86 PC machine doesn't support drawer/book/cluster topology levels, but user could specify "-smp drawers=1,books=1,clusters=1". This is meaningless and confusing, so that the support for this kind of configurations is marked deprecated since 9.0. And report warning message for such case like: qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported clusters parameter mustn't be specified as 1 qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported books parameter mustn't be specified as 1 qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported drawers parameter mustn't be specified as 1 Users have to ensure that all the topology members described with -smp are supported by the target machine. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-3-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 14 +++++++++ hw/core/machine-smp.c | 65 +++++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 17 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 6e2f557682..dfd681cd02 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -57,6 +57,20 @@ The ``-p`` option pretends to control the host page size. However, it is not possible to change the host page size, and using the option only causes failures. +``-smp`` (Unsupported "parameter=1" SMP configurations) (since 9.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Specified CPU topology parameters must be supported by the machine. + +In the SMP configuration, users should provide the CPU topology parameters that +are supported by the target machine. + +However, historically it was allowed for users to specify the unsupported +topology parameter as "1", which is meaningless. So support for this kind of +configurations (e.g. -smp drawers=1,books=1,clusters=1 for x86 PC machine) is +marked deprecated since 9.0, users have to ensure that all the topology members +described with -smp are supported by the target machine. + QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 96533886b1..50a5a40dbc 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -112,30 +112,61 @@ void machine_parse_smp_config(MachineState *ms, /* * If not supported by the machine, a topology parameter must be - * omitted or specified equal to 1. + * omitted. */ - if (!mc->smp_props.dies_supported && dies > 1) { - error_setg(errp, "dies not supported by this machine's CPU topology"); - return; + if (!mc->smp_props.clusters_supported && config->has_clusters) { + if (config->clusters > 1) { + error_setg(errp, "clusters not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here clusters only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported clusters parameter mustn't be " + "specified as 1"); + } } - if (!mc->smp_props.clusters_supported && clusters > 1) { - error_setg(errp, "clusters not supported by this machine's CPU topology"); - return; - } - - dies = dies > 0 ? dies : 1; clusters = clusters > 0 ? clusters : 1; - if (!mc->smp_props.books_supported && books > 1) { - error_setg(errp, "books not supported by this machine's CPU topology"); - return; + if (!mc->smp_props.dies_supported && config->has_dies) { + if (config->dies > 1) { + error_setg(errp, "dies not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here dies only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported dies parameter mustn't be " + "specified as 1"); + } + } + dies = dies > 0 ? dies : 1; + + if (!mc->smp_props.books_supported && config->has_books) { + if (config->books > 1) { + error_setg(errp, "books not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here books only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported books parameter mustn't be " + "specified as 1"); + } } books = books > 0 ? books : 1; - if (!mc->smp_props.drawers_supported && drawers > 1) { - error_setg(errp, - "drawers not supported by this machine's CPU topology"); - return; + if (!mc->smp_props.drawers_supported && config->has_drawers) { + if (config->drawers > 1) { + error_setg(errp, "drawers not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here drawers only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported drawers parameter mustn't be " + "specified as 1"); + } } drawers = drawers > 0 ? drawers : 1; From patchwork Sat Mar 9 19:21:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=J3+6eU/P; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY3h3XzMz1yX6 for ; Sun, 10 Mar 2024 06:28:16 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lg-0000pq-7m; Sat, 09 Mar 2024 14:27:12 -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 1rj2K6-0007Ff-CU for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:37 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2K1-0003Kr-S5 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:32 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a45bdf6e9c2so372765366b.0 for ; Sat, 09 Mar 2024 11:25:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012328; x=1710617128; 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=E1R5kgOTA3lFvXSZnN7vgERJPXvNPz5gmsixt+yKpBc=; b=J3+6eU/PUwZW9aQ96ujTS6hvGa3rP7nq8miwGloalQ8rrKMJ95FjgCbcts9Cra58lk +JHRrnjp+82MalvBHSMDOvcMDP3e1Ba816NJLTRXVurC623MX9LFi/YCdkzLNN+iuKYD P1xqRacEG5pfplCPl2nltSyilXUxwIVNiJLQQLxlbE1qIHyrXmk3iecj2qqxLVA+RxDO XgqItcnazo+1nqt1IBWwcPdc1pf16Cd8MxaYmgVm8gqBvJjEOZ/ib3KixMueAKD5ntGQ HoGCR80UK21t6B2HcpcOJ12OdKePHGGY6KtcARgaUqWhCxoAjypn7xFq1RW6scO/NOIk 9fjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012328; x=1710617128; 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=E1R5kgOTA3lFvXSZnN7vgERJPXvNPz5gmsixt+yKpBc=; b=fxHsFg4LOnwTODPGcBDby40MHDO64S2zlxgdLsHSGZbrizvIIV8ytTgBO50oGV8ZHj h2d3yvORbyJWvdiPU3CPRtNt6QPFvxpOF1e20ZyDBqcQ52iEqtwFm6jW0OApeOBsSZbh RrJ9/7B4MhGGnVAL9CftRY7GyHIg0h4igteHUyldEzkQJmXwiLUsmGMLdxJ/hutQ7ve4 t3U5YMys5DibTOp3flcXLWXzVE8MG93h+QiN7o6dm5AfY6mFoKYufYd0DBSX4+JC1TVo Ar/RsfnuBHOB0np7du+r56UQnwKa310q+/4J2JLGjK0NV9XgeYvPoGS/x21hrEPDisrI W39g== X-Gm-Message-State: AOJu0Yw4G3cX0pPRbZKyeBRjr0rHPISFTy/oJHlbKYTGEQMXSzAcMddy w+klVIZC4S2tHRWahsfMJpovguvzRakJCeOeCPcRQZsaNHf0d0nwS2bMX8WJIKM= X-Google-Smtp-Source: AGHT+IHnJt8M27LNZsdWUZYAmOdG9O1rxorvjpIsHoYwysnj44GwFfZ16OKHYnr5YK+sg37ilhTTRg== X-Received: by 2002:a17:907:7644:b0:a43:eb29:a293 with SMTP id kj4-20020a170907764400b00a43eb29a293mr1284262ejc.5.1710012327713; Sat, 09 Mar 2024 11:25:27 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id hq31-20020a1709073f1f00b00a45c09107d6sm1182777ejc.29.2024.03.09.11.25.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 32/43] hw/core/machine-smp: Calculate total CPUs once in machine_parse_smp_config() Date: Sat, 9 Mar 2024 20:21:59 +0100 Message-ID: <20240309192213.23420-33-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu In machine_parse_smp_config(), the number of total CPUs is calculated by: drawers * books * sockets * dies * clusters * cores * threads To avoid missing the future new topology level, use a local variable to cache the calculation result so that total CPUs are only calculated once. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240308160148.3130837-4-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/core/machine-smp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 50a5a40dbc..27864c9507 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -91,6 +91,7 @@ void machine_parse_smp_config(MachineState *ms, unsigned cores = config->has_cores ? config->cores : 0; unsigned threads = config->has_threads ? config->threads : 0; unsigned maxcpus = config->has_maxcpus ? config->maxcpus : 0; + unsigned total_cpus; /* * Specified CPU topology parameters must be greater than zero, @@ -211,8 +212,8 @@ void machine_parse_smp_config(MachineState *ms, } } - maxcpus = maxcpus > 0 ? maxcpus : drawers * books * sockets * dies * - clusters * cores * threads; + total_cpus = drawers * books * sockets * dies * clusters * cores * threads; + maxcpus = maxcpus > 0 ? maxcpus : total_cpus; cpus = cpus > 0 ? cpus : maxcpus; ms->smp.cpus = cpus; @@ -228,8 +229,7 @@ void machine_parse_smp_config(MachineState *ms, mc->smp_props.has_clusters = config->has_clusters; /* sanity-check of the computed topology */ - if (drawers * books * sockets * dies * clusters * cores * threads != - maxcpus) { + if (total_cpus != maxcpus) { g_autofree char *topo_msg = cpu_hierarchy_to_string(ms); error_setg(errp, "Invalid CPU topology: " "product of the hierarchy must match maxcpus: " From patchwork Sat Mar 9 19:22:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910110 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=o71V9S/t; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY7309b3z23hc for ; Sun, 10 Mar 2024 06:31:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ld-00008q-9M; Sat, 09 Mar 2024 14:27:09 -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 1rj2KA-0007I6-W6 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:43 -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 1rj2K7-0003LV-9a for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:38 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-56838e00367so1123579a12.0 for ; Sat, 09 Mar 2024 11:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012333; x=1710617133; 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=i2x/6JhOMSh1e4AFrzigsCMOr4MSgOhrpELj7cZb/3o=; b=o71V9S/tFWCUUoD2gRbRDJumvGbsCbOE4vR3j3PnNWuG7uAa3wBxq5Iir8vUgJ+dRe 8Oe6M9/K1sxIexy3Io77iYFRO+mX1MWcPCxReK3boy/3hdkCJEF+FNj7ve1AydeTsHyE sKGnBC/TdM7VgsG/Yg5O31Jd4SLvEpM9ZhTV017X1J2smOatt2Xws0GWPZ9AdbG0552b y6dIK5x3ut+shu+w/W3B7qIzH07Wca45bwkWMam0nTs9+r/3q6X6TxlGEQbOFAsW5Y+D NbhjvgjU9mguO/Q0MPe9daryfmemZDruILxgte0WyNzOAtqJZFpsVvAPNQjZsmAG8yAi Yg5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012333; x=1710617133; 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=i2x/6JhOMSh1e4AFrzigsCMOr4MSgOhrpELj7cZb/3o=; b=bSAS9mwYmFG+lhxxXMBh0wOF5LY33nC7jRjisXHbSXsxgzWWgnhZD3hlOCS3fZjeSu JjMy2iTDih8GPlZyVkRojqrGGV8/oh5+k/0zn40bfmSSWxkZbYyvIk0CH73p3r8ypTKC 5A5hdtcRIdXtdKBqUBP+73gGfrMRy+5u5seITV2wXZGYDNsw9mL2HTFNbQWC9ZeTu6bB FRaCOuAHaxaS5yb3A4zi2fPrrKyD7EiQ6HOMna5DbAu9/3usuPFz+6pilFv5qwOd+AY2 E7A2czTUgSRdT19A/fX0sI93c8o37QvteMgi1SOsBwCigDG0imMeR+vAHLL/WJlFD+XX 4K9Q== X-Gm-Message-State: AOJu0YwSqUDXjeiNpN8mLIu+dwAuSFm5XOnxpj+lTMuxE2JrU2OOKMJF ygnxxf5Jb/7xIEzEmPbCS8DsLMH3XHg1TRaXex90PrwKC+ciQOzIkC3StEt2uA8= X-Google-Smtp-Source: AGHT+IFEkQNqTbtU2RBTq9eGHLCDEa8wZZyowcE+aPAYBK+1dEOfyC7DrVa1WHIhLTcYNbSSUNw42A== X-Received: by 2002:a17:907:a0cc:b0:a45:f6fa:8c20 with SMTP id hw12-20020a170907a0cc00b00a45f6fa8c20mr1533733ejc.14.1710012333792; Sat, 09 Mar 2024 11:25:33 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id h16-20020a1709067cd000b00a45f63d2959sm1165361ejp.210.2024.03.09.11.25.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 33/43] tests/unit/test-smp-parse: Drop the unsupported "dies=1" case Date: Sat, 9 Mar 2024 20:22:00 +0100 Message-ID: <20240309192213.23420-34-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu Unsupported "parameter=1" SMP configurations is marked as deprecated, so drop the related test case. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-5-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 24972666a7..1874bea086 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -607,11 +607,6 @@ static void test_generic_valid(const void *opaque) unsupported_params_init(mc, &data); smp_parse_test(ms, &data, true); - - /* Unsupported parameters can be provided with their values as 1 */ - data.config.has_dies = true; - data.config.dies = 1; - smp_parse_test(ms, &data, true); } object_unref(obj); From patchwork Sat Mar 9 19:22:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=N/fn7aln; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY5D2fV8z1yX6 for ; Sun, 10 Mar 2024 06:29:36 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lj-0001CW-GH; Sat, 09 Mar 2024 14:27:15 -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 1rj2KG-0007KM-MO for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:47 -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 1rj2KD-0003Mb-1V for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:44 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-563bb51c36eso3383408a12.2 for ; Sat, 09 Mar 2024 11:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012339; x=1710617139; 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=4izzVDpY+AQ8hh1OPoQkok5+Cmay4u8VvPo/ani8Qjo=; b=N/fn7alnSp9IdsX0dSZWScKpNNh+gwvaIuz+GllWqNE40p3+nUzNYUMqxxGqLDsBkW SY4L09EcM/AswTVjPfQlsbDbkgs3tq4fTnR+qjD6Sk2Qhm0okiO2PfRYbxmOxEPItX2V X9zNZZu6Fro9VLEaELA14czQ8KPOunIX+7N2/XDxFUYwAwCV0Pg3zW3o8a6s5bJ+/Xzf vMAqCm2IhnAF66GvjFAWhbxddPopXFaDbcRKHOngPoBWfjXlEHwesucX+Tfvl2prRX0z JMBZovSm9AWUzezluT4LMTjGIJ+O0Z+nLtvnLFwVIJ6K4XR+XP7+UiyBD6udqWwi9Ywi 9lQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012339; x=1710617139; 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=4izzVDpY+AQ8hh1OPoQkok5+Cmay4u8VvPo/ani8Qjo=; b=DY6olz4fBdO+5RJMG4nC7BHbZpiMSvWvigzMGYGI3HR+0debsJen90NW/B1/da8mrY gYKjW81/3hAtv9iYWPRI9rR9Cn9M2kiHS8Q2cL75RnouSsnD9pLXWgTMbf833Eqkp4H5 1T5OYrGk5ekD4w65LCqBN4mz1xjbYGebtc3Ck5DED2BBbfaASiwSQ48S5l9n4d5lGK9f /jJXA+ncuoDn8KjTFkGPV/NijHWX4Oljx7caChv39dLNQD86LqyiShV5lMds+O7UBhpB 95DdBariNrbDFtQe3PpYeykmVep3bpxF46gMRa2eJ7eMELE1MS8bjsgPi6WBKb6yhvtC 14nw== X-Gm-Message-State: AOJu0YzJvZ0mupKa4tfnONnWoiFwDZlWZnD0TxeqdeD5m6npx35My+DX zF1cciGGwOl3zknl6JJm3FzX/wKWDF6teaKAmzOw5aALwjGcYykNMNbY4cQzwQE= X-Google-Smtp-Source: AGHT+IHYQn/wV3sAEi0VFsI5hwT2XA7fxKADL4Tdvyqkbq1LXxwkEtcQ4rc7snCEpBUGrqzK3CV7Sw== X-Received: by 2002:a50:cd45:0:b0:568:2578:f520 with SMTP id d5-20020a50cd45000000b005682578f520mr1778835edj.35.1710012339700; Sat, 09 Mar 2024 11:25:39 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id n1-20020aa7c441000000b0056452477a5esm1183979edr.24.2024.03.09.11.25.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 34/43] tests/unit/test-smp-parse: Use CPU number macros in invalid topology case Date: Sat, 9 Mar 2024 20:22:01 +0100 Message-ID: <20240309192213.23420-35-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu Use MAX_CPUS/MIN_CPUS macros in invalid topology case. This gives us the flexibility to change the maximum and minimum CPU limits. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-6-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 1874bea086..84e3422774 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -323,15 +323,21 @@ static const struct SMPTestData data_generic_invalid[] = { "sockets (2) * cores (4) * threads (2) " "== maxcpus (16) < smp_cpus (18)", }, { - /* config: -smp 1 - * should tweak the supported min CPUs to 2 for testing */ - .config = SMP_CONFIG_GENERIC(T, 1, F, 0, F, 0, F, 0, F, 0), + /* + * config: -smp 1 + * The test machine should tweak the supported min CPUs to + * 2 (MIN_CPUS + 1) for testing. + */ + .config = SMP_CONFIG_GENERIC(T, MIN_CPUS, F, 0, F, 0, F, 0, F, 0), .expect_error = "Invalid SMP CPUs 1. The min CPUs supported " "by machine '" SMP_MACHINE_NAME "' is 2", }, { - /* config: -smp 512 - * should tweak the supported max CPUs to 511 for testing */ - .config = SMP_CONFIG_GENERIC(T, 512, F, 0, F, 0, F, 0, F, 0), + /* + * config: -smp 512 + * The test machine should tweak the supported max CPUs to + * 511 (MAX_CPUS - 1) for testing. + */ + .config = SMP_CONFIG_GENERIC(T, MAX_CPUS, F, 0, F, 0, F, 0, F, 0), .expect_error = "Invalid SMP CPUs 512. The max CPUs supported " "by machine '" SMP_MACHINE_NAME "' is 511", }, @@ -575,8 +581,8 @@ static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); /* Force invalid min CPUs and max CPUs */ - mc->min_cpus = 2; - mc->max_cpus = 511; + mc->min_cpus = MIN_CPUS + 1; + mc->max_cpus = MAX_CPUS - 1; } static void machine_with_dies_class_init(ObjectClass *oc, void *data) From patchwork Sat Mar 9 19:22:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=wTAGvnU7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY8C1KgGz1yWx for ; Sun, 10 Mar 2024 06:32:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ll-0001PM-Gb; Sat, 09 Mar 2024 14:27:17 -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 1rj2KL-0007NR-TU for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:54 -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 1rj2KJ-0003NT-8x for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:49 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-568107a9ff2so3517940a12.3 for ; Sat, 09 Mar 2024 11:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012345; x=1710617145; 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=b8wT84tp5Ct3Koz7/1+DQ3KNhe44GTMwlt4WEbo2CyY=; b=wTAGvnU7iv8knhIc9QM/CApgXDYdur06A/RIpA3EnwHXT30pnBduKbE8jxFdDLpkm8 lKPVdEEVsYEY5Ffp4AlujOMQq4YC4QQVT/iuaCOPX0n8s2Ti8SjVReIMFqqifIiYakXn LxLwPTh9Rn6zVNmvt/pPFx4LX+iSOnj6XTHgkt60EiI6Jr5g7/4DB4ozzN3m3FWi0eNY 5lkT1xHtK6mNb3K/1ZOdONNWx0ZKZj2VFrNjISN+UAmNAkMczQ5sIBou6XRYZT/BQFhU 0PeDplfTF1n2shOSLdJkXfGgPI/MVDEjRkDCvUSB73NyfGw6ERPFJa0De+o32dxfJAM2 rZbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012345; x=1710617145; 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=b8wT84tp5Ct3Koz7/1+DQ3KNhe44GTMwlt4WEbo2CyY=; b=esQPA0AT98ZzWydYvSwGHyuwojFHChyP8UDfkzOFcvi8dR5L+ZMNAoKarpsRw/NYym xS+zElaa74UsfDrF6kMh2QTp/xRFA2H585ZRAg4Q1m0WyP0iG3cc+00GNWae87fu7HsL sxVNLbNeKxrGvUzZClrFpKZ0coums33phSpK4bjWLmTeCcNHqUJhJcP+5fQRwLAadMCQ bKROfN0yg3xKCfI1AUI60mQtLatiWrgXaUGxNlv/aJGtNwzm3PP/0MAViY7HvDO5LFTZ jW20XyLxzMbnnypkyaRjYV7WE+7lmyMBij8PXPffOAFoHqA8X9fzii+GON0bMB0plPQ+ gCKA== X-Gm-Message-State: AOJu0YxjLpU30x6Iil6lrqyo9bP26bmoyEKJjXPcTUydYes7YY32SUzK ZyPZI+zHqkGKvMWsxis+QmQvINO/AjDVoBSg+eFoo3w1O6p0MN/7e0H7UALOAig= X-Google-Smtp-Source: AGHT+IHL2283zRWdp80KRzzkeAAhztph/YcLfqqeU3h8wTABynkHPOJPy2Af/Ap9CSy2HfDDt/3JMg== X-Received: by 2002:a50:ccd6:0:b0:566:d274:a41d with SMTP id b22-20020a50ccd6000000b00566d274a41dmr1546436edj.42.1710012345670; Sat, 09 Mar 2024 11:25:45 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id y18-20020a056402359200b005648d0eebdbsm1143695edc.96.2024.03.09.11.25.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 35/43] tests/unit/test-smp-parse: Bump max_cpus to 4096 Date: Sat, 9 Mar 2024 20:22:02 +0100 Message-ID: <20240309192213.23420-36-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu The q35 machine is trying to support up to 4096 vCPUs [1], so it's necessary to bump max_cpus in test-smp-parse to 4096 to cover the topological needs of future machines. [1]: https://lore.kernel.org/qemu-devel/20240228143351.3967-1-anisinha@redhat.com/ Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-7-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 84e3422774..2eb9533bc5 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -20,8 +20,8 @@ #define T true #define F false -#define MIN_CPUS 1 /* set the min CPUs supported by the machine as 1 */ -#define MAX_CPUS 512 /* set the max CPUs supported by the machine as 512 */ +#define MIN_CPUS 1 /* set the min CPUs supported by the machine as 1 */ +#define MAX_CPUS 4096 /* set the max CPUs supported by the machine as 4096 */ #define SMP_MACHINE_NAME "TEST-SMP" @@ -333,13 +333,13 @@ static const struct SMPTestData data_generic_invalid[] = { "by machine '" SMP_MACHINE_NAME "' is 2", }, { /* - * config: -smp 512 + * config: -smp 4096 * The test machine should tweak the supported max CPUs to - * 511 (MAX_CPUS - 1) for testing. + * 4095 (MAX_CPUS - 1) for testing. */ - .config = SMP_CONFIG_GENERIC(T, MAX_CPUS, F, 0, F, 0, F, 0, F, 0), - .expect_error = "Invalid SMP CPUs 512. The max CPUs supported " - "by machine '" SMP_MACHINE_NAME "' is 511", + .config = SMP_CONFIG_GENERIC(T, 4096, F, 0, F, 0, F, 0, F, 0), + .expect_error = "Invalid SMP CPUs 4096. The max CPUs supported " + "by machine '" SMP_MACHINE_NAME "' is 4095", }, }; From patchwork Sat Mar 9 19:22:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910074 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=y4zrCr6N; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY2g6sJCz1yX6 for ; Sun, 10 Mar 2024 06:27:23 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lg-0000rk-JD; Sat, 09 Mar 2024 14:27:12 -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 1rj2KR-0007Ql-8l for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:04 -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 1rj2KP-0003OO-HC for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:25:55 -0500 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a450bedffdfso408747466b.3 for ; Sat, 09 Mar 2024 11:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012351; x=1710617151; 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=O8i9QPEOlWhmU7xWF5BCURrysJXNiI85mOLr+pl+Sq0=; b=y4zrCr6NEJnj7wLuGdTWAvRnxx1fixFoDxypupMViHonccW3SwDnTGeJdGvu3+mzPk Kzf5h7ottiBT01ztt/V8/cXhSXfxjZ/be5eoNh3MZRBTrwqpr0jGGJhwZjd57wlyQcMq 3n+XEHhxy9/3K/zLEP8PbS1X4El+1X/KEUzT2viklt02T0nlDXerB283M/aQhplOgsS3 bF69AaDWEvKc+QL3uX4eU5PKqlw33hbnxRG4lRV0MGmZWR4YtE5beW76cI6FhhVvIZq4 3zXoUPXQuJwhFPXGrNiLZNiqD2heIUzXML7VqInfDn5Z7BTpQEt9MZ9rzzRZgMer+wIj k9mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012351; x=1710617151; 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=O8i9QPEOlWhmU7xWF5BCURrysJXNiI85mOLr+pl+Sq0=; b=ZKDRQVwzy3cKnCGf7K0K65p0P6xgcVTyshy92nuAF7gDWG2+QNzbMP1ajcBUZULW8Y /je/m3H/knXT9O5NTgxoWZaymgl3YfiLig3Ge525OSLUiGvBWuGYf1OK77nyqOcPQmLB 2TXe4z2fUtHenVGeHVlVFRKHKY8lO3pxM/GS/qSeQiKknxSp0ZhZqMOEnolgaP5mcJ3y py5y32etQTRnFLtlLlJb6FYg7Ao5rlGC3/r9bCnGCAo/VzzBwBb7Psj+1FmkoFSNI26K JiaPqqUX1QidPS5foxi698JUcmab5de0wEocKINk7EDEaLej9MZSJLkzIH7oceuiJyhn SipQ== X-Gm-Message-State: AOJu0YxMe5xy0gNZWnWWpG1kCpwhWA/JjYdIiA1hM/e+lFlVL3uKjoB5 9dvLQ1GKpeBYn0N7RtGSSH7qge2pVgnFxmyeYCt66eRTyeW0sT+062B7nvZ0Hw8= X-Google-Smtp-Source: AGHT+IHPWCYsTTLJR3Y5I7K9wr+9PlPTMOFzDgbyILfwcOWY9+UAhabN+Yjbc55cmBThQVWEk8mPng== X-Received: by 2002:a17:906:390:b0:a45:9347:e3d6 with SMTP id b16-20020a170906039000b00a459347e3d6mr1362000eja.66.1710012351548; Sat, 09 Mar 2024 11:25:51 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id lr1-20020a170906fb8100b00a442e2940fdsm1186112ejb.179.2024.03.09.11.25.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 36/43] tests/unit/test-smp-parse: Make test cases aware of the book/drawer Date: Sat, 9 Mar 2024 20:22:03 +0100 Message-ID: <20240309192213.23420-37-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu Currently, -smp supports 2 more new levels: book and drawer. It is necessary to consider the effects of book and drawer in the test cases to ensure that the calculations are correct. This is also the preparation to add new book and drawer test cases. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-8-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 2eb9533bc5..f656bbb6da 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -384,6 +384,8 @@ static char *smp_config_to_string(const SMPConfiguration *config) return g_strdup_printf( "(SMPConfiguration) {\n" " .has_cpus = %5s, cpus = %" PRId64 ",\n" + " .has_drawers = %5s, drawers = %" PRId64 ",\n" + " .has_books = %5s, books = %" PRId64 ",\n" " .has_sockets = %5s, sockets = %" PRId64 ",\n" " .has_dies = %5s, dies = %" PRId64 ",\n" " .has_clusters = %5s, clusters = %" PRId64 ",\n" @@ -392,6 +394,8 @@ static char *smp_config_to_string(const SMPConfiguration *config) " .has_maxcpus = %5s, maxcpus = %" PRId64 ",\n" "}", config->has_cpus ? "true" : "false", config->cpus, + config->has_drawers ? "true" : "false", config->drawers, + config->has_books ? "true" : "false", config->books, config->has_sockets ? "true" : "false", config->sockets, config->has_dies ? "true" : "false", config->dies, config->has_clusters ? "true" : "false", config->clusters, @@ -404,10 +408,10 @@ static char *smp_config_to_string(const SMPConfiguration *config) static unsigned int cpu_topology_get_threads_per_socket(const CpuTopology *topo) { /* Check the divisor to avoid invalid topology examples causing SIGFPE. */ - if (!topo->sockets) { + if (!topo->drawers || !topo->books || !topo->sockets) { return 0; } else { - return topo->max_cpus / topo->sockets; + return topo->max_cpus / topo->drawers / topo->books / topo->sockets; } } @@ -429,6 +433,8 @@ static char *cpu_topology_to_string(const CpuTopology *topo, return g_strdup_printf( "(CpuTopology) {\n" " .cpus = %u,\n" + " .drawers = %u,\n" + " .books = %u,\n" " .sockets = %u,\n" " .dies = %u,\n" " .clusters = %u,\n" @@ -438,7 +444,8 @@ static char *cpu_topology_to_string(const CpuTopology *topo, " .threads_per_socket = %u,\n" " .cores_per_socket = %u,\n" "}", - topo->cpus, topo->sockets, topo->dies, topo->clusters, + topo->cpus, topo->drawers, topo->books, + topo->sockets, topo->dies, topo->clusters, topo->cores, topo->threads, topo->max_cpus, threads_per_socket, cores_per_socket); } @@ -473,6 +480,8 @@ static void check_parse(MachineState *ms, const SMPConfiguration *config, if (is_valid) { if ((err == NULL) && (ms->smp.cpus == expect_topo->cpus) && + (ms->smp.drawers == expect_topo->drawers) && + (ms->smp.books == expect_topo->books) && (ms->smp.sockets == expect_topo->sockets) && (ms->smp.dies == expect_topo->dies) && (ms->smp.clusters == expect_topo->clusters) && @@ -564,6 +573,16 @@ static void unsupported_params_init(const MachineClass *mc, SMPTestData *data) data->expect_prefer_sockets.clusters = 1; data->expect_prefer_cores.clusters = 1; } + + if (!mc->smp_props.books_supported) { + data->expect_prefer_sockets.books = 1; + data->expect_prefer_cores.books = 1; + } + + if (!mc->smp_props.drawers_supported) { + data->expect_prefer_sockets.drawers = 1; + data->expect_prefer_cores.drawers = 1; + } } static void machine_base_class_init(ObjectClass *oc, void *data) From patchwork Sat Mar 9 19:22:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=fKeoVA4g; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY4L2k0Rz1yX6 for ; Sun, 10 Mar 2024 06:28:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lh-00010w-8s; Sat, 09 Mar 2024 14:27:13 -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 1rj2KW-0007SN-UC for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:04 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2KV-0003Ot-3Z for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:00 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a36126ee41eso427020666b.2 for ; Sat, 09 Mar 2024 11:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012357; x=1710617157; 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=81Sv1vN+6ujCHrYNAV0wa7bFS6ihhdM5ooxz7PBUBM8=; b=fKeoVA4gWnUf5UNcyQSH89SyThg7TU9J/i+i/72XTDUES6vMKjUD+SKx0LF8WqVYBR dXJqgyADJlUTROu/OORCev5+fYkSU49SC915XU9FNzb0pNimhjyIiHSQzJO6X2EB2z92 wen8Mj8kSpLuVkW2Pven6UpJTLeBfsaWyaww/oU9UACAkp32nFmS2xapskgiDscb7hcr qLJkKFLXhBByzevGTA9xEXJVj/6c8v/FqXHWs7TPRhcPkpcC46ogTPdC0rKUN6t72+Hl 0EXSVtf8+X75cUCJ48+1RaTbnH10x91gH5PZemtnPDJuo5rUoiMamufbCvFtcj12PweH cybA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012357; x=1710617157; 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=81Sv1vN+6ujCHrYNAV0wa7bFS6ihhdM5ooxz7PBUBM8=; b=RrWCSskkdUgdOLtSWpbqJp9xvCko1No35zgt7IlCKknw5zoWbBKql4VhWeMPHQR3yG 1bOArdfNTKUqr/6tNjPDYoDQ1oH345/iUMhuOAf+x76UjkHXpYNM8oNGGb7JLOoLMrhc uzdXi7kk0WW9RZCEA5VPk7XNAaYxj8LrWEJlyjEUwZLeopQ7Ojn/JxZY4cUZpM1A23mg ru/WEGfHKv+Q7UWNOfXLjS4qz283jgm0g/M04kiCFkeqcbZWsrDWleL0Tw8KC0Ood1FZ 0vKKkDSlGob/HLhXorwYJVWdg2Xf7DitYdRhPElz7Vp+wX6QRwiF64HmYqgTY7aWE+0N yXSw== X-Gm-Message-State: AOJu0YydsK2BQsdA0Pv9xnR0JuOl4m27GwGRUgkS+rf8AhZulbPC50Sc oTZMz8N1c9sx8sxQqN9rIDQS8iAy8C/97wQjWp1MjzSbjP52I23KJX4+GQJcprY= X-Google-Smtp-Source: AGHT+IGpFc4c3zWQ4HmMBDiLXLuln4/bMpyIXJn3WJUnAZk9JTk56gyPEpQHUl/2DK4OdZ6xBEy1Vg== X-Received: by 2002:a17:906:ad94:b0:a45:8ab6:5f3c with SMTP id la20-20020a170906ad9400b00a458ab65f3cmr1404683ejb.45.1710012357525; Sat, 09 Mar 2024 11:25:57 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id zh16-20020a170906881000b00a44d01aff81sm1178678ejb.97.2024.03.09.11.25.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 37/43] tests/unit/test-smp-parse: Test "books" parameter in -smp Date: Sat, 9 Mar 2024 20:22:04 +0100 Message-ID: <20240309192213.23420-38-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu Although book was introduced to -smp along with drawer by s390 machine, as a general topology level in QEMU that may be reused by other arches in the future, it is desirable to cover this parameter's parsing in a separate case. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-9-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index f656bbb6da..090238ab23 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -75,6 +75,22 @@ .has_maxcpus = hf, .maxcpus = f, \ } +/* + * Currently a 5-level topology hierarchy is supported on s390 ccw machines + * -drawers/books/sockets/cores/threads + */ +#define SMP_CONFIG_WITH_BOOKS_DRAWERS(ha, a, hb, b, hc, c, hd, \ + d, he, e, hf, f, hg, g) \ + { \ + .has_cpus = ha, .cpus = a, \ + .has_drawers = hb, .drawers = b, \ + .has_books = hc, .books = c, \ + .has_sockets = hd, .sockets = d, \ + .has_cores = he, .cores = e, \ + .has_threads = hf, .threads = f, \ + .has_maxcpus = hg, .maxcpus = g, \ + } + /** * @config - the given SMP configuration * @expect_prefer_sockets - the expected parsing result for the @@ -308,6 +324,11 @@ static const struct SMPTestData data_generic_invalid[] = { /* config: -smp 2,clusters=2 */ .config = SMP_CONFIG_WITH_CLUSTERS(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0), .expect_error = "clusters not supported by this machine's CPU topology", + }, { + /* config: -smp 2,books=2 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, F, 0, T, 2, F, + 0, F, 0, F, 0, F, 0), + .expect_error = "books not supported by this machine's CPU topology", }, { /* config: -smp 8,sockets=2,cores=4,threads=2,maxcpus=8 */ .config = SMP_CONFIG_GENERIC(T, 8, T, 2, T, 4, T, 2, T, 8), @@ -379,6 +400,26 @@ static const struct SMPTestData data_with_clusters_invalid[] = { }, }; +static const struct SMPTestData data_with_books_invalid[] = { + { + /* config: -smp 16,books=2,sockets=2,cores=4,threads=2,maxcpus=16 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 16, F, 1, T, 2, T, + 2, T, 4, T, 2, T, 16), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "books (2) * sockets (2) * cores (4) * threads (2) " + "!= maxcpus (16)", + }, { + /* config: -smp 34,books=2,sockets=2,cores=4,threads=2,maxcpus=32 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 34, F, 1, T, 2, T, + 2, T, 4, T, 2, T, 32), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "books (2) * sockets (2) * cores (4) * threads (2) " + "== maxcpus (32) < smp_cpus (34)", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -618,6 +659,13 @@ static void machine_with_clusters_class_init(ObjectClass *oc, void *data) mc->smp_props.clusters_supported = true; } +static void machine_with_books_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->smp_props.books_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -756,6 +804,56 @@ static void test_with_clusters(const void *opaque) object_unref(obj); } +static void test_with_books(const void *opaque) +{ + const char *machine_type = opaque; + Object *obj = object_new(machine_type); + MachineState *ms = MACHINE(obj); + MachineClass *mc = MACHINE_GET_CLASS(obj); + SMPTestData data = {}; + unsigned int num_books = 2; + int i; + + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* when books parameter is omitted, it will be set as 1 */ + data.expect_prefer_sockets.books = 1; + data.expect_prefer_cores.books = 1; + + smp_parse_test(ms, &data, true); + + /* when books parameter is specified */ + data.config.has_books = true; + data.config.books = num_books; + if (data.config.has_cpus) { + data.config.cpus *= num_books; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= num_books; + } + + data.expect_prefer_sockets.books = num_books; + data.expect_prefer_sockets.cpus *= num_books; + data.expect_prefer_sockets.max_cpus *= num_books; + data.expect_prefer_cores.books = num_books; + data.expect_prefer_cores.cpus *= num_books; + data.expect_prefer_cores.max_cpus *= num_books; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_with_books_invalid); i++) { + data = data_with_books_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + /* Type info of the tested machine */ static const TypeInfo smp_machine_types[] = { { @@ -780,6 +878,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-clusters"), .parent = TYPE_MACHINE, .class_init = machine_with_clusters_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-with-books"), + .parent = TYPE_MACHINE, + .class_init = machine_with_books_class_init, } }; @@ -803,6 +905,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_clusters", MACHINE_TYPE_NAME("smp-with-clusters"), test_with_clusters); + g_test_add_data_func("/test-smp-parse/with_books", + MACHINE_TYPE_NAME("smp-with-books"), + test_with_books); g_test_run(); From patchwork Sat Mar 9 19:22:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910127 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=dUAXyuSa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY972vtKz1yWx for ; Sun, 10 Mar 2024 06:32:59 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lq-0001tx-Er; Sat, 09 Mar 2024 14:27:22 -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 1rj2Kc-0007ej-Qq for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:22 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ka-0003T7-PR for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:06 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a3fb8b0b7acso214932966b.2 for ; Sat, 09 Mar 2024 11:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012363; x=1710617163; 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=tvU56TlvWLPvO+A3q9kkdbysgtf1x6xX0zRrOdKGxe8=; b=dUAXyuSaH80hBiFEDuHX/ug9wrvyJbsAkRoLQgaLUJM8oR1PicFyBFvTbwU4mhbAHc hp3aiQ9ZuTV0Yz7WaYZ1lmn/P6kcC1sDO96zgd3nsr3Dy7PVWvOhbT6xTguWf0P2zpQa uQDS0/M6+N1kXD8QmYbQP0wMuS4Tmyd7VzNdKEDiQABH1DJtXvjF/1zX6YVkByFBMOnF rQPVW721B0kX7brrFfOS8J9KIr4EihOyfbcVlKSWrOpCa1j9UmQQDnR/RxAP8szw5Pdf 5emPGM5f4GAV6JW4yHr7wllFiyvzX6M28s79hIu+xjNWrejtezY8YYr0e0351v+ShJy/ TNWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012363; x=1710617163; 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=tvU56TlvWLPvO+A3q9kkdbysgtf1x6xX0zRrOdKGxe8=; b=JjNp7aDIZP9SpWUz5Kf7MsEfcoXVfrD/pi9RujAS56KErBu3fHmyjsgh1j1bTI9X6K P9ULEJUL0wLOGTno0lcmkw26qExWeszpsDCf/VE079BSnMcbZVb6xfg/5Bo/B49m2Lqo XGksu6RLC3Rx28YtfrhSZzu63TUo4Sz7EDOisx6SakhpdF3wFiuXZyqTsNIc9kQ2nf3O P5rw7/vVTya7WITWkEL7XFpqlpp4e17xVpAqwWMrHDaqjGwZxYJzShfVxkh1fkkRCkX2 COKIy9iRefMTl4uQayj5mUGOI+bb9Z2VdfPwEFq3q01CxLVLIwbCQgFejW5G1ltU7zXP Pffw== X-Gm-Message-State: AOJu0YwtNh4OuY0jMO/ASvHj5+KFm6vs38JNU1yw+6z6poPxd/3TlTlL sE6HeSvA3VRPvuTOcO96Ar5bhPkM0PYnEOkPnP9+rzqoTguwMv0mkL+XNG91y8E= X-Google-Smtp-Source: AGHT+IHfT2hAfRe+WtbFJ1kzkxwQPFhEP56Dhvn+hVRyEafeupIP3X/uIiPanALxG+mUxP0FJc7bGw== X-Received: by 2002:a17:907:c783:b0:a3f:29c:c8fa with SMTP id tz3-20020a170907c78300b00a3f029cc8famr1757717ejc.66.1710012363488; Sat, 09 Mar 2024 11:26:03 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id d25-20020a170906371900b00a4410598eebsm1177473ejc.67.2024.03.09.11.26.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 38/43] tests/unit/test-smp-parse: Test "drawers" parameter in -smp Date: Sat, 9 Mar 2024 20:22:05 +0100 Message-ID: <20240309192213.23420-39-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu Although drawer was introduced to -smp along with book by s390 machine, as a general topology level in QEMU that may be reused by other arches in the future, it is desirable to cover this parameter's parsing in a separate case. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-10-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 89 +++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 090238ab23..aea1b2e73a 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -329,6 +329,11 @@ static const struct SMPTestData data_generic_invalid[] = { .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0, F, 0), .expect_error = "books not supported by this machine's CPU topology", + }, { + /* config: -smp 2,drawers=2 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, T, 2, F, 0, F, + 0, F, 0, F, 0, F, 0), + .expect_error = "drawers not supported by this machine's CPU topology", }, { /* config: -smp 8,sockets=2,cores=4,threads=2,maxcpus=8 */ .config = SMP_CONFIG_GENERIC(T, 8, T, 2, T, 4, T, 2, T, 8), @@ -420,6 +425,26 @@ static const struct SMPTestData data_with_books_invalid[] = { }, }; +static const struct SMPTestData data_with_drawers_invalid[] = { + { + /* config: -smp 16,drawers=2,sockets=2,cores=4,threads=2,maxcpus=16 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 16, T, 2, F, 1, T, + 2, T, 4, T, 2, T, 16), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "drawers (2) * sockets (2) * cores (4) * threads (2) " + "!= maxcpus (16)", + }, { + /* config: -smp 34,drawers=2,sockets=2,cores=4,threads=2,maxcpus=32 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 34, T, 2, F, 1, T, + 2, T, 4, T, 2, T, 32), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "drawers (2) * sockets (2) * cores (4) * threads (2) " + "== maxcpus (32) < smp_cpus (34)", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -666,6 +691,13 @@ static void machine_with_books_class_init(ObjectClass *oc, void *data) mc->smp_props.books_supported = true; } +static void machine_with_drawers_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->smp_props.drawers_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -854,6 +886,56 @@ static void test_with_books(const void *opaque) object_unref(obj); } +static void test_with_drawers(const void *opaque) +{ + const char *machine_type = opaque; + Object *obj = object_new(machine_type); + MachineState *ms = MACHINE(obj); + MachineClass *mc = MACHINE_GET_CLASS(obj); + SMPTestData data = {}; + unsigned int num_drawers = 2; + int i; + + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* when drawers parameter is omitted, it will be set as 1 */ + data.expect_prefer_sockets.drawers = 1; + data.expect_prefer_cores.drawers = 1; + + smp_parse_test(ms, &data, true); + + /* when drawers parameter is specified */ + data.config.has_drawers = true; + data.config.drawers = num_drawers; + if (data.config.has_cpus) { + data.config.cpus *= num_drawers; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= num_drawers; + } + + data.expect_prefer_sockets.drawers = num_drawers; + data.expect_prefer_sockets.cpus *= num_drawers; + data.expect_prefer_sockets.max_cpus *= num_drawers; + data.expect_prefer_cores.drawers = num_drawers; + data.expect_prefer_cores.cpus *= num_drawers; + data.expect_prefer_cores.max_cpus *= num_drawers; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_with_drawers_invalid); i++) { + data = data_with_drawers_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + /* Type info of the tested machine */ static const TypeInfo smp_machine_types[] = { { @@ -882,6 +964,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-books"), .parent = TYPE_MACHINE, .class_init = machine_with_books_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-with-drawers"), + .parent = TYPE_MACHINE, + .class_init = machine_with_drawers_class_init, } }; @@ -908,6 +994,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_books", MACHINE_TYPE_NAME("smp-with-books"), test_with_books); + g_test_add_data_func("/test-smp-parse/with_drawers", + MACHINE_TYPE_NAME("smp-with-drawers"), + test_with_drawers); g_test_run(); From patchwork Sat Mar 9 19:22:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910092 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=mvcjzE2l; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY4L3Fq3z1yXB for ; Sun, 10 Mar 2024 06:28:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ln-0001eK-P4; Sat, 09 Mar 2024 14:27:20 -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 1rj2Kt-0007r7-Nu for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:28 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Kp-0003X4-10 for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:20 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5654f700705so3904526a12.1 for ; Sat, 09 Mar 2024 11:26:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012369; x=1710617169; 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=iUC4gt3lxXhDXO4ThAk9t583cQlzaBs4BIxFd2rtuRE=; b=mvcjzE2liCot4Hk+YGLy9r6yBJyx6dnBEujXMJiDxRuS/prYkYKnDcYUOuma6duE7s p9eyBgsXrnA/fe709cVx2vqW1ggexQd4ZkwTeKPWEzBciJiFjBTu30pYMxaWHDNrUq3W jlh4+9DforgvW5jg6O2X/STqOL44OSPDZiaRGni1lTWUwUVT6/UeW7i6CjzXHfANI4PH baktCYE+f1rn+2YD6zOy62AMPYhK7QKyF3yjrlG4Qvt3/t7rQcYOa8olExFGKcQG6+3T OFwFBgILiDfIg6x2zxPsnXrh5rFdIAORZEuL1u17Png4apBTI7m3kQNaNaIZLHnNj6Go qZCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012369; x=1710617169; 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=iUC4gt3lxXhDXO4ThAk9t583cQlzaBs4BIxFd2rtuRE=; b=hLL22vEOYhUC6lwUdIfPIC3S4SiBJLLyP363r+juwlpBYJkxtr4qQH+EerqpJI9Hin N17AV2n0wvic8aQhZSyv7U4/xadtQ9UHHaIQw7xZqLuRT2hXWw7q8thll5OM2o3llfWr ub1xJpJvLFkyaIkJl4rfUyvkB0fBavrq3S2SD7dPIO8RKsK/hEuhQNI+/nX4b6ySNKtn DR4bp5nwrOk+sS3aNQtjPekYRjSRFSguOyN6kLlccDsVRG1hi3/lFuLY4NbWTYPCAvzL BDrZUrXYEWxKIZP/t3SKACqga+Wb6B4loIDelQBQmK3vD4DYAXPcgUdrLIEwOj0rKmbk UT/w== X-Gm-Message-State: AOJu0YwtKx/bPireI7dzVbFAII9i7VUf3NyvyUcV6fJUxj+MSsfRzDDe SewHW+CWtGcQ5w0BDL8YFbJ078dD89Xd16YeYlio2bY5bkNYSMPldD9Z8Ya+C8M= X-Google-Smtp-Source: AGHT+IEyHTZWHHCFdMvwfRVTSs9Fc0ywA1C7Tb/i7nNpXywYGFu3p6ZEm7Ayjkg5wWlsxstUFBn/IQ== X-Received: by 2002:a17:906:f150:b0:a45:b761:2c2 with SMTP id gw16-20020a170906f15000b00a45b76102c2mr1165498ejb.60.1710012369579; Sat, 09 Mar 2024 11:26:09 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id ce18-20020a170906b25200b00a44f3fb4f07sm1172207ejb.191.2024.03.09.11.26.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 39/43] tests/unit/test-smp-parse: Test "drawers" and "books" combination case Date: Sat, 9 Mar 2024 20:22:06 +0100 Message-ID: <20240309192213.23420-40-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=philmd@linaro.org; helo=mail-ed1-x536.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu Since s390 machine supports both "drawers" and "books" in -smp, add the "drawers" and "books" combination test case to match the actual topology usage scenario. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-11-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 103 ++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index aea1b2e73a..0cf6115198 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -445,6 +445,33 @@ static const struct SMPTestData data_with_drawers_invalid[] = { }, }; +static const struct SMPTestData data_with_drawers_books_invalid[] = { + { + /* + * config: -smp 200,drawers=2,books=2,sockets=2,cores=4,\ + * threads=2,maxcpus=200 + */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 200, T, 3, T, 5, T, + 2, T, 4, T, 2, T, 200), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "drawers (3) * books (5) * sockets (2) * " + "cores (4) * threads (2) != maxcpus (200)", + }, { + /* + * config: -smp 242,drawers=2,books=2,sockets=2,cores=4,\ + * threads=2,maxcpus=240 + */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 242, T, 3, T, 5, T, + 2, T, 4, T, 2, T, 240), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "drawers (3) * books (5) * sockets (2) * " + "cores (4) * threads (2) " + "== maxcpus (240) < smp_cpus (242)", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -698,6 +725,14 @@ static void machine_with_drawers_class_init(ObjectClass *oc, void *data) mc->smp_props.drawers_supported = true; } +static void machine_with_drawers_books_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->smp_props.drawers_supported = true; + mc->smp_props.books_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -936,6 +971,67 @@ static void test_with_drawers(const void *opaque) object_unref(obj); } +static void test_with_drawers_books(const void *opaque) +{ + const char *machine_type = opaque; + Object *obj = object_new(machine_type); + MachineState *ms = MACHINE(obj); + MachineClass *mc = MACHINE_GET_CLASS(obj); + SMPTestData data = {}; + unsigned int num_drawers = 5, num_books = 3; + int i; + + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* + * when drawers and books parameters are omitted, they will + * be both set as 1. + */ + data.expect_prefer_sockets.drawers = 1; + data.expect_prefer_sockets.books = 1; + data.expect_prefer_cores.drawers = 1; + data.expect_prefer_cores.books = 1; + + smp_parse_test(ms, &data, true); + + /* when drawers and books parameters are both specified */ + data.config.has_drawers = true; + data.config.drawers = num_drawers; + data.config.has_books = true; + data.config.books = num_books; + + if (data.config.has_cpus) { + data.config.cpus *= num_drawers * num_books; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= num_drawers * num_books; + } + + data.expect_prefer_sockets.drawers = num_drawers; + data.expect_prefer_sockets.books = num_books; + data.expect_prefer_sockets.cpus *= num_drawers * num_books; + data.expect_prefer_sockets.max_cpus *= num_drawers * num_books; + + data.expect_prefer_cores.drawers = num_drawers; + data.expect_prefer_cores.books = num_books; + data.expect_prefer_cores.cpus *= num_drawers * num_books; + data.expect_prefer_cores.max_cpus *= num_drawers * num_books; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_with_drawers_books_invalid); i++) { + data = data_with_drawers_books_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + /* Type info of the tested machine */ static const TypeInfo smp_machine_types[] = { { @@ -968,6 +1064,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-drawers"), .parent = TYPE_MACHINE, .class_init = machine_with_drawers_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-with-drawers-books"), + .parent = TYPE_MACHINE, + .class_init = machine_with_drawers_books_class_init, } }; @@ -997,6 +1097,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_drawers", MACHINE_TYPE_NAME("smp-with-drawers"), test_with_drawers); + g_test_add_data_func("/test-smp-parse/with_drawers_books", + MACHINE_TYPE_NAME("smp-with-drawers-books"), + test_with_drawers_books); g_test_run(); From patchwork Sat Mar 9 19:22:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=GjhEr7fN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY761fGsz1yWx for ; Sun, 10 Mar 2024 06:31:14 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ln-0001eM-Pk; Sat, 09 Mar 2024 14:27:20 -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 1rj2Kw-0007tA-2M for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:30 -0500 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ks-0003XY-1E for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:25 -0500 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2d288bac3caso24751971fa.2 for ; Sat, 09 Mar 2024 11:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012375; x=1710617175; 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=ipIrH8V6fqbpfd1iET2bFWtuJpnYjFZjo9qFhl65CP8=; b=GjhEr7fNWmXoOTRlmKiVY2V+oTPMg8eEC1Ogo7zYxZuQER1irqaFXDdIHVCOQpu5dB ROv/MBJ4Wquqqt+y6zgR+mW9sB0urhNCaTS0/UxGKdwsfCLNanXJpz2m/QVuMtZZ43pK Vxmy+jnJqTMSSiRdoGbJa6snV3U1QXpg0Sub1CcStRMWuGk5MYlGlB7pcbNaO0zLxoaP WjhfOa0BTFKWbUZtHTeYgEQn9wXbCOoH7ETmI2ioZCSakjVfKOzgtR3QWyOoOUSVBG7A NocOMxpDmeKXXS+H2etCZVfHurySsJj9Ps8kpZNx3344Gu8jqTZ2WiX2x7J4DjT8msFD pmdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012375; x=1710617175; 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=ipIrH8V6fqbpfd1iET2bFWtuJpnYjFZjo9qFhl65CP8=; b=qzQ6rpaleNfPkVj/6xTtH/hcLSW/36MZh53hDnjQMDQz0l33z/cNAN20z1WQtFGHMh mkSpbOrQftkaLtYbB4cnQY8zCFYUp9kPWjJnfLxX8eWPAhM3V0jrwkCm92FDl90w87bF EPI2C5oiY/eHwpRpOzlEiuP+YMgmFP/05ssoSKUmu/SIkrArgJ5481CkA3v9n208JxlQ FtF7jNZO9CqYArVYYoZ9bd/Fvh9OWs/BZ7/1Kdzti47dKycv+uLH7TTXP5jSun3k/4/g OFdoPganpE5bAMeAEwlX3K6Wiec3FgbUpqzyBWOg0Bnn7Ie9VzTaPr5W/LZJcx6Dq0mv 63pQ== X-Gm-Message-State: AOJu0Yzm0z3RK0iWbCuVjYpvI0X0BZSDJ6iAnkFNrLyh8ia/dQDsrsy7 rjvp6AKcnupPBrmb92VRC7umGnFYYBUlge9tiPIXyWjZSgNWYK6w4P+5E/FTF6s= X-Google-Smtp-Source: AGHT+IHKomGq3s52KVeoPjbaaT5z9zxBv4f5WlH3twWusv3U10muGTJfS2g/L5msV+GYscPHwNvxew== X-Received: by 2002:a2e:bea2:0:b0:2d3:2242:990 with SMTP id a34-20020a2ebea2000000b002d322420990mr1810214ljr.42.1710012375478; Sat, 09 Mar 2024 11:26:15 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id a3-20020a50e703000000b005661badcccesm1151185edn.87.2024.03.09.11.26.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 40/43] tests/unit/test-smp-parse: Test the full 7-levels topology hierarchy Date: Sat, 9 Mar 2024 20:22:07 +0100 Message-ID: <20240309192213.23420-41-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=philmd@linaro.org; helo=mail-lj1-x22a.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu Currently, -smp supports up to 7-levels topology hierarchy: -drawers/books/sockets/dies/clusters/cores/threads. Though no machine supports all these 7 levels yet, these 7 levels have the strict containment relationship and together form the generic CPU topology representation of QEMU. Also, note that the maxcpus is calculated by multiplying all 7 levels: maxcpus = drawers * books * sockets * dies * clusters * cores * threads. To cover this code path, it is necessary to test the full topology case (with all 7 levels). This also helps to avoid introducing new issues by further expanding the CPU topology in the future. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Acked-by: Thomas Huth Message-ID: <20240308160148.3130837-12-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 143 ++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 0cf6115198..7558169171 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -91,6 +91,24 @@ .has_maxcpus = hg, .maxcpus = g, \ } +/* + * Currently QEMU supports up to a 7-level topology hierarchy, which is the + * QEMU's unified abstract representation of CPU topology. + * -drawers/books/sockets/dies/clusters/cores/threads + */ +#define SMP_CONFIG_WITH_FULL_TOPO(a, b, c, d, e, f, g, h, i) \ + { \ + .has_cpus = true, .cpus = a, \ + .has_drawers = true, .drawers = b, \ + .has_books = true, .books = c, \ + .has_sockets = true, .sockets = d, \ + .has_dies = true, .dies = e, \ + .has_clusters = true, .clusters = f, \ + .has_cores = true, .cores = g, \ + .has_threads = true, .threads = h, \ + .has_maxcpus = true, .maxcpus = i, \ + } + /** * @config - the given SMP configuration * @expect_prefer_sockets - the expected parsing result for the @@ -472,6 +490,40 @@ static const struct SMPTestData data_with_drawers_books_invalid[] = { }, }; +static const struct SMPTestData data_full_topo_invalid[] = { + { + /* + * config: -smp 200,drawers=3,books=5,sockets=2,dies=4,\ + * clusters=2,cores=7,threads=2,maxcpus=200 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(200, 3, 5, 2, 4, 2, 7, 2, 200), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "drawers (3) * books (5) * sockets (2) * dies (4) * " + "clusters (2) * cores (7) * threads (2) " + "!= maxcpus (200)", + }, { + /* + * config: -smp 3361,drawers=3,books=5,sockets=2,dies=4,\ + * clusters=2,cores=7,threads=2,maxcpus=3360 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(3361, 3, 5, 2, 4, 2, 7, 2, 3360), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "drawers (3) * books (5) * sockets (2) * dies (4) * " + "clusters (2) * cores (7) * threads (2) " + "== maxcpus (3360) < smp_cpus (3361)", + }, { + /* + * config: -smp 1,drawers=3,books=5,sockets=2,dies=4,\ + * clusters=2,cores=7,threads=3,maxcpus=5040 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(3361, 3, 5, 2, 4, 2, 7, 3, 5040), + .expect_error = "Invalid SMP CPUs 5040. The max CPUs supported " + "by machine '" SMP_MACHINE_NAME "' is 4096", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -733,6 +785,16 @@ static void machine_with_drawers_books_class_init(ObjectClass *oc, void *data) mc->smp_props.books_supported = true; } +static void machine_full_topo_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->smp_props.drawers_supported = true; + mc->smp_props.books_supported = true; + mc->smp_props.dies_supported = true; + mc->smp_props.clusters_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -1032,6 +1094,80 @@ static void test_with_drawers_books(const void *opaque) object_unref(obj); } +static void test_full_topo(const void *opaque) +{ + const char *machine_type = opaque; + Object *obj = object_new(machine_type); + MachineState *ms = MACHINE(obj); + MachineClass *mc = MACHINE_GET_CLASS(obj); + SMPTestData data = {}; + unsigned int drawers = 5, books = 3, dies = 2, clusters = 7, multiplier; + int i; + + multiplier = drawers * books * dies * clusters; + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* + * when drawers, books, dies and clusters parameters are omitted, + * they will be set as 1. + */ + data.expect_prefer_sockets.drawers = 1; + data.expect_prefer_sockets.books = 1; + data.expect_prefer_sockets.dies = 1; + data.expect_prefer_sockets.clusters = 1; + data.expect_prefer_cores.drawers = 1; + data.expect_prefer_cores.books = 1; + data.expect_prefer_cores.dies = 1; + data.expect_prefer_cores.clusters = 1; + + smp_parse_test(ms, &data, true); + + /* when drawers, books, dies and clusters parameters are specified. */ + data.config.has_drawers = true; + data.config.drawers = drawers; + data.config.has_books = true; + data.config.books = books; + data.config.has_dies = true; + data.config.dies = dies; + data.config.has_clusters = true; + data.config.clusters = clusters; + + if (data.config.has_cpus) { + data.config.cpus *= multiplier; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= multiplier; + } + + data.expect_prefer_sockets.drawers = drawers; + data.expect_prefer_sockets.books = books; + data.expect_prefer_sockets.dies = dies; + data.expect_prefer_sockets.clusters = clusters; + data.expect_prefer_sockets.cpus *= multiplier; + data.expect_prefer_sockets.max_cpus *= multiplier; + + data.expect_prefer_cores.drawers = drawers; + data.expect_prefer_cores.books = books; + data.expect_prefer_cores.dies = dies; + data.expect_prefer_cores.clusters = clusters; + data.expect_prefer_cores.cpus *= multiplier; + data.expect_prefer_cores.max_cpus *= multiplier; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_full_topo_invalid); i++) { + data = data_full_topo_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + /* Type info of the tested machine */ static const TypeInfo smp_machine_types[] = { { @@ -1068,6 +1204,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-drawers-books"), .parent = TYPE_MACHINE, .class_init = machine_with_drawers_books_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-full-topo"), + .parent = TYPE_MACHINE, + .class_init = machine_full_topo_class_init, } }; @@ -1100,6 +1240,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_drawers_books", MACHINE_TYPE_NAME("smp-with-drawers-books"), test_with_drawers_books); + g_test_add_data_func("/test-smp-parse/full", + MACHINE_TYPE_NAME("smp-full-topo"), + test_full_topo); g_test_run(); From patchwork Sat Mar 9 19:22:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=NnxAPgg+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY52696Kz1yX6 for ; Sun, 10 Mar 2024 06:29:26 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lq-0001zA-Vk; Sat, 09 Mar 2024 14:27: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 1rj2Kx-0007tH-Ac for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:31 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Kt-0003Y5-Jo for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:27 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-566e869f631so3648643a12.0 for ; Sat, 09 Mar 2024 11:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012381; x=1710617181; 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=oXXCTTKtOqKGIkFeLbdf6BFuAhbM9FIUumQwfVgSOrQ=; b=NnxAPgg+MaI2MhPlQKj+BaKniQJ0Rv0no4GvooxGVwQXEn3V+wl60vioL77E+V7Bxe cSijFcXFXnfovMX5T7leg2Ne1pN0bxDBj5gcvIKn6VHJ3XqPtx/D8hRfkCM9s1xQref1 gepzhwyLHcpTBkgoZ1pj3Q1lLN+EY1cXQ4OyJJIjxHbJNuAQjpX+QJm1aeL4F6j5rGpx DR/ULNhxeKnJC4asKq7B+megyxkmHviFFIiUJguf0cdpuI/puVOxSnMgG9djEKXeAWL3 b2wjEnNoMRO/jlFaW3PEBSXTTtamzjuLr21pa25BTfEJUpsQRgoPn+9w6HZsXI+p4IUm qx5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012381; x=1710617181; 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=oXXCTTKtOqKGIkFeLbdf6BFuAhbM9FIUumQwfVgSOrQ=; b=lW5TuBME1sXtCGJVokqDhVmoKZJSC/d9m9yIsOb6kBX6otbaoteW4wt9dzS2UmAAhL +qSkL8FxQ+Ltg3dgXArHLOHJxVlUMKjjxPeQKq/C0EpWBsNC4/V/BjJZDJYOKHRW8X62 ZFZZ4NUPGfAYkQHxAOeZWl2twC3oJ3+rHn1+g3fyq5yQiaGCCZSxgAMb6N59W2qijI4m xi8ZxGerr69YnkNK4IyH9rUpwIJnBaSVqHVxVuQzoR34AUY198SM8XlxEGUjv1wsSIJJ 7d3uXgyPQXWOVgX9uPOHFcT74iiOc8QYXUnS9+O49tVRBezcam1tjRzNYl5+v3+zpECU eltw== X-Gm-Message-State: AOJu0Yzr/FpxU2Xvyxbof+oDyTwFOxCZMHFKGbLfpSRx+vEFegh368y3 lcE/Ir9AKDgDIp5vTfl+/ucGDEL+X6diR0WLE0XYx0tUzzru3S7GyesqqW3MFbY= X-Google-Smtp-Source: AGHT+IHHy8yH/1QEmz2EVUG4EtjwdEKmNz65w1h7i1yXUQaKHE69RGj7NANGhbsWnd9MqRRk5yBhTw== X-Received: by 2002:a50:aad2:0:b0:567:f643:fc5c with SMTP id r18-20020a50aad2000000b00567f643fc5cmr1867041edc.20.1710012381554; Sat, 09 Mar 2024 11:26:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id et8-20020a056402378800b00566a4dec01fsm1156535edb.11.2024.03.09.11.26.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 41/43] tests/unit/test-smp-parse: Test smp_props.has_clusters Date: Sat, 9 Mar 2024 20:22:08 +0100 Message-ID: <20240309192213.23420-42-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu The smp_props.has_clusters in MachineClass is not a user configured field, and it indicates if user specifies "clusters" in -smp. After -smp parsing, other module could aware if the cluster level is configured by user. This is used when the machine has only 1 cluster since there's only 1 cluster by default. Add the check to cover this field. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Acked-by: Thomas Huth Message-ID: <20240308160148.3130837-13-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 7558169171..d39cfdc19b 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -573,7 +573,8 @@ static unsigned int cpu_topology_get_cores_per_socket(const CpuTopology *topo) static char *cpu_topology_to_string(const CpuTopology *topo, unsigned int threads_per_socket, - unsigned int cores_per_socket) + unsigned int cores_per_socket, + bool has_clusters) { return g_strdup_printf( "(CpuTopology) {\n" @@ -588,17 +589,20 @@ static char *cpu_topology_to_string(const CpuTopology *topo, " .max_cpus = %u,\n" " .threads_per_socket = %u,\n" " .cores_per_socket = %u,\n" + " .has_clusters = %s,\n" "}", topo->cpus, topo->drawers, topo->books, topo->sockets, topo->dies, topo->clusters, topo->cores, topo->threads, topo->max_cpus, - threads_per_socket, cores_per_socket); + threads_per_socket, cores_per_socket, + has_clusters ? "true" : "false"); } static void check_parse(MachineState *ms, const SMPConfiguration *config, const CpuTopology *expect_topo, const char *expect_err, bool is_valid) { + MachineClass *mc = MACHINE_GET_CLASS(ms); g_autofree char *config_str = smp_config_to_string(config); g_autofree char *expect_topo_str = NULL, *output_topo_str = NULL; unsigned int expect_threads_per_socket, expect_cores_per_socket; @@ -611,15 +615,18 @@ static void check_parse(MachineState *ms, const SMPConfiguration *config, cpu_topology_get_cores_per_socket(expect_topo); expect_topo_str = cpu_topology_to_string(expect_topo, expect_threads_per_socket, - expect_cores_per_socket); + expect_cores_per_socket, + config->has_clusters); /* call the generic parser */ machine_parse_smp_config(ms, config, &err); ms_threads_per_socket = machine_topo_get_threads_per_socket(ms); ms_cores_per_socket = machine_topo_get_cores_per_socket(ms); - output_topo_str = cpu_topology_to_string(&ms->smp, ms_threads_per_socket, - ms_cores_per_socket); + output_topo_str = cpu_topology_to_string(&ms->smp, + ms_threads_per_socket, + ms_cores_per_socket, + mc->smp_props.has_clusters); /* when the configuration is supposed to be valid */ if (is_valid) { @@ -634,7 +641,8 @@ static void check_parse(MachineState *ms, const SMPConfiguration *config, (ms->smp.threads == expect_topo->threads) && (ms->smp.max_cpus == expect_topo->max_cpus) && (ms_threads_per_socket == expect_threads_per_socket) && - (ms_cores_per_socket == expect_cores_per_socket)) { + (ms_cores_per_socket == expect_cores_per_socket) && + (mc->smp_props.has_clusters == config->has_clusters)) { return; } From patchwork Sat Mar 9 19:22:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910106 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=xek2MJML; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY5s0CZ2z1yWx for ; Sun, 10 Mar 2024 06:30:09 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lr-00021T-BZ; Sat, 09 Mar 2024 14:27: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 1rj2L3-0007vl-6o for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:38 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ky-0003ZT-Pa for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:32 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a449c5411e1so409136866b.1 for ; Sat, 09 Mar 2024 11:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012387; x=1710617187; 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=3KwrSf6l5lMKRNbxBtTiB9ULE3uG/bpbp4V2erGNe1I=; b=xek2MJMLHOBU6xUmmvY9xtDHjOjCIFggKBT7Tpatqn7ltm/hn7/gMJTzWocPOhJwZI aDEgn7BIX1LE6+SREZXfUaIGAFgK91pmlcgXXTrRBMcXUGJeRsyJpcm0h4igL5UxFEAr Ca3UAD1CSA1mpcrKOum5BVxB7x1ZoE2NiPXQfnpZxlPMk9hhFc0vtKt+/mrPiGjz2L0M S9nLKVQk9l/JXlXc1oyt4G7AsvQzHJPcGzKTjgPYE1Pb1/vfmfPTdvquSE+4ZxXhWWd6 FGJbJ7cz5GSvWnpmBzETcdvDB0Wj5AVUVkmQsymjBL3zA5RqFrWl2vJ99Q1uYDx91PBd psWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012387; x=1710617187; 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=3KwrSf6l5lMKRNbxBtTiB9ULE3uG/bpbp4V2erGNe1I=; b=P0M5E7UOBvE6weVUGdEXCgcWQX8urHgWWXEZSEj6wH6glRxNsCD1J97JAMUefyVMC0 TPBTqe3daCuMJ9gZ8NIuIG1dxVDOTwMPh8/Jvu2dTbAhwPj9DF4LNpHO2CmiyT2LGVpj TrW5xHLJYdjEtas1snz/OCA6J8P7C9cBhlXIYC6Axu+wuPovKH7s5pX2+2DB/WnFZsOu FcYCLxyL1UVInju7XkFcSGqAiJEgFIZ3WFzqo3hgAWBG6IeFyX9DfNpdAutoqpCn4A9H kJPj6LoCYxNImlzaN6GRtznCM6nHy9BNz2sJCGhMeiqUNzZ+HsfWEwx9/TQWiQeZQdZc UvDA== X-Gm-Message-State: AOJu0YzeIdK1nfUQYfkWdTH6CuO/hWMaBAaDasx15kihyhw3Yu/1Hu2C vNNlAlujkyVpDWqDWEnKkOgRXEjOAzouzX3T5x1dl3M9POVOVNKzhlszS6J2tYA= X-Google-Smtp-Source: AGHT+IGIElPanJe/Ti8VGRYv0LI2UfeWcMivTBMYYVD03n7ExNVD9uCJSCKKPHlIvMXxCAfFQoWpOg== X-Received: by 2002:a17:906:b082:b0:a45:c99d:3625 with SMTP id x2-20020a170906b08200b00a45c99d3625mr1214493ejy.23.1710012387502; Sat, 09 Mar 2024 11:26:27 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id k16-20020a1709067ad000b00a4537466591sm1178153ejo.32.2024.03.09.11.26.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 42/43] tests/unit/test-smp-parse: Test "parameter=0" SMP configurations Date: Sat, 9 Mar 2024 20:22:09 +0100 Message-ID: <20240309192213.23420-43-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu The support for "parameter=0" SMP configurations is removed, and QEMU returns error for those cases. So add the related test cases to ensure parameters can't accept 0. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-14-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 92 +++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index d39cfdc19b..8994337e12 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -524,6 +524,91 @@ static const struct SMPTestData data_full_topo_invalid[] = { }, }; +static const struct SMPTestData data_zero_topo_invalid[] = { + { + /* + * Test "cpus=0". + * config: -smp 0,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(0, 1, 1, 1, 1, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "drawers=0". + * config: -smp 1,drawers=0,books=1,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 0, 1, 1, 1, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "books=0". + * config: -smp 1,drawers=1,books=0,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 0, 1, 1, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "sockets=0". + * config: -smp 1,drawers=1,books=1,sockets=0,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 0, 1, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "dies=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=0,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 0, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "clusters=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=0,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 0, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "cores=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=1,cores=0,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 0, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "threads=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=0,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 0, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "maxcpus=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=0 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 1, 0), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -1173,6 +1258,13 @@ static void test_full_topo(const void *opaque) smp_parse_test(ms, &data, false); } + for (i = 0; i < ARRAY_SIZE(data_zero_topo_invalid); i++) { + data = data_zero_topo_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + object_unref(obj); } From patchwork Sat Mar 9 19:22:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1910123 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Cr32ogUM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsY8g55mRz1yWx for ; Sun, 10 Mar 2024 06:32:35 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ll-0001OK-97; Sat, 09 Mar 2024 14:27:17 -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 1rj2L9-0007xY-8P for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:40 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2L6-0003a0-7R for qemu-ppc@nongnu.org; Sat, 09 Mar 2024 14:26:38 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a458b6d9cfeso248431866b.2 for ; Sat, 09 Mar 2024 11:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012393; x=1710617193; 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=+XiYruIl/Mk62y3f+ezGiMfqf4PWIQGmn/ntaltbgg8=; b=Cr32ogUMNB0hteF1iaaW05vW7XjpElPE8zvNhxVnw81+J0EDe9HxEIKbCrDfPKKuEQ TL/HuoIP2NcEvsf0SFxvmpXf17aOtmX2IXYTdg0J24JjW/UTtrHYvJoOKliK5FBjZveF fY6vlQ/w2qb/z8BazEx0tpMDJkgpijIlhYUHhRQUaCQN8H2ZuzXX9c2hqbE01OGJwFLm lTqxcFGm7VFNJIDFPZHQoAAZjnm8IZhnp+Mwb59idf6Y3aF29VzHpKlJl6z6jKVbx85P 4Kim4sn4A1++dOJjyi5JYpk1P2NKz4jRu3eAPRihh5DXouWGcUMBKm8gsRgHn5CtG60S 4K5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012393; x=1710617193; 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=+XiYruIl/Mk62y3f+ezGiMfqf4PWIQGmn/ntaltbgg8=; b=HKz+rOsjxjIzeJFO9ovuga1BjKpJdh49R4NHL/YPjA8TDV28ISGD854zoWgi3QyBhV 3VvXMoZONdALqhYCLz78FCEr0bfRdEd5KpljDeconAB9HWiMVzq98Y3rP8E4VehlrC1G Bu8bT/EQQljeiG0HEkDEYH6t3NTX4FXcMngEaK4vP+0joRqMv0j/TIItebIB7M4Uiiq/ HSyGoaG/k4HAK7cffNQlfqGFO/r68IhXuPavvC43tz15IntYXCC4Nw8L0ocwqJcm42zz uANn9Rek3T4hOyUazQ7HHt0dARgFa0pGifJVCumK6xEAuypH/iyYV+A2yUOuPeD8FUaI VxYA== X-Gm-Message-State: AOJu0Yx7Q0lX5mfrFD3Aiq6aqT4qGFbP3R3tfC6cE/jkz794e3wcGQgE gRcQP1s4GS775bG/Js+hw3CByLQydIrNJDVMGxMPr0FGq8O1Gsn/GV1F6Y74kn9NEu15zPUBfGK + X-Google-Smtp-Source: AGHT+IF5fXiTsXQM4PqHHP471lMuzrbFz64dQ8BACzdPeoX2Pnz8+csmIkUXGA5SOpRFZc8lVkCELA== X-Received: by 2002:a17:906:a1c8:b0:a44:1cb4:f496 with SMTP id bx8-20020a170906a1c800b00a441cb4f496mr1343853ejb.75.1710012393290; Sat, 09 Mar 2024 11:26:33 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id pw2-20020a17090720a200b00a456573f9c5sm1187380ejb.0.2024.03.09.11.26.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Angelo Dureghello , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 43/43] hw/m68k/mcf5208: add support for reset Date: Sat, 9 Mar 2024 20:22:10 +0100 Message-ID: <20240309192213.23420-44-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Angelo Dureghello Add reset support for mcf5208. Signed-off-by: Angelo Dureghello Reviewed-by: Thomas Huth Message-ID: <20240309093459.984565-1-angelo@kernel-space.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/m68k/mcf5208.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index 0cfb806c20..ec14096aa4 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -40,6 +40,8 @@ #define PCSR_PRE_SHIFT 8 #define PCSR_PRE_MASK 0x0f00 +#define RCR_SOFTRST 0x80 + typedef struct { MemoryRegion iomem; qemu_irq irq; @@ -185,12 +187,50 @@ static const MemoryRegionOps m5208_sys_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic) +static uint64_t m5208_rcm_read(void *opaque, hwaddr addr, + unsigned size) +{ + return 0; +} + +static void m5208_rcm_write(void *opaque, hwaddr addr, + uint64_t value, unsigned size) +{ + M68kCPU *cpu = opaque; + CPUState *cs = CPU(cpu); + switch (addr) { + case 0x0: /* RCR */ + if (value & RCR_SOFTRST) { + cpu_reset(cs); + cpu->env.aregs[7] = ldl_phys(cs->as, 0); + cpu->env.pc = ldl_phys(cs->as, 4); + } + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", + __func__, addr); + break; + } +} + +static const MemoryRegionOps m5208_rcm_ops = { + .read = m5208_rcm_read, + .write = m5208_rcm_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + +static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic, + M68kCPU *cpu) { MemoryRegion *iomem = g_new(MemoryRegion, 1); + MemoryRegion *iomem_rcm = g_new(MemoryRegion, 1); m5208_timer_state *s; int i; + /* RCM */ + memory_region_init_io(iomem_rcm, NULL, &m5208_rcm_ops, cpu, + "m5208-rcm", 0x00000080); + memory_region_add_subregion(address_space, 0xfc0a0000, iomem_rcm); /* SDRAMC. */ memory_region_init_io(iomem, NULL, &m5208_sys_ops, NULL, "m5208-sys", 0x00004000); memory_region_add_subregion(address_space, 0xfc0a8000, iomem); @@ -265,7 +305,7 @@ static void mcf5208evb_init(MachineState *machine) mcf_uart_create_mmap(0xfc064000, pic[27], serial_hd(1)); mcf_uart_create_mmap(0xfc068000, pic[28], serial_hd(2)); - mcf5208_sys_init(address_space_mem, pic); + mcf5208_sys_init(address_space_mem, pic, cpu); mcf_fec_init(address_space_mem, 0xfc030000, pic + 36);