From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469449; cv=none; d=zohomail.com; s=zohoarc; b=NJGg+xopVQRxtt77InJsP+iF7yKbvMq0Z/49pBpgrfN30EpXrRcXOnG2Is9qZHhZ93lTl5+2s6hC1nd4Yo4BBRJFlB+18+E8xn397YmAkTWwTgsJP+J6MdUcSYIAOeH0jCWQJmntkPvQwBaKRctOxdPmWvly75Bv4jxT9T3SkBM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469449; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dyYYg5j1yzG/KRM3hwRmq5l0B0UfdF1Z3FJP8e3OduU=; b=AtyefajFRpjMZcDNoq70iuRpCd6dyiMPh6NV2xqjbb0LwuXxzO7Mlntek6CeexfP99o3dnoHwFxRmzdJuCp/cx2RrhiwSo649ssb5i7rMiHe2qtPkLOk2azUyI3lMmn0A3JgOSYBtNjjktZRdWHx5/8tFYDFcBoDVWkNX2pRJy4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469449355890.4459333920021; Fri, 5 Jan 2024 07:44:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmM5-0004O8-Va; Fri, 05 Jan 2024 10:43:30 -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 1rLmLv-0004Dv-8K for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:19 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmLt-0002x6-Lf for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:19 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3368ae75082so381998f8f.1 for ; Fri, 05 Jan 2024 07:43:17 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id m3-20020a05600c3b0300b0040d91ab1d54sm1936603wms.6.2024.01.05.07.43.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469396; x=1705074196; 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=dyYYg5j1yzG/KRM3hwRmq5l0B0UfdF1Z3FJP8e3OduU=; b=cOTdFLzkEqK4Mqv8v7cggaUEx+hZJ2bidv4Rq5SR6kOu9ghWEGUBjDtQ1pnvK3yCsQ amWMvG7ZOSoCs0BD/m2VvYwi4eMHrQcQ6i/VSLuBKwelJH/0SPLN7z2xLpz+mWHmZ/ZQ uUdDdMaGHxNW0ZvqOJJb8YObL8l2Kw4PtazcOG5iMDa7onFCagajUqZOt+7g7qJglorN kNh/b29oShwcIjjJl+9s2PQsXXN5yDynHC/mZAM7or3QYv+r+x9eWHvQFx4thYwYOBql cvv1p1bR6ftkdOiV4qocHo1Pfyd5dU/Odt4RBl5xmuk+XB4YS+BosOj+guX1mUb6XY+4 iL2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469396; x=1705074196; 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=dyYYg5j1yzG/KRM3hwRmq5l0B0UfdF1Z3FJP8e3OduU=; b=t8VimpZ5kprdoDBWEzU+AQogxoA2NgKY7kTdXvYKw+Xn057/f7Ep4B1bpfkiieCXQi fqMX36qugJh5HVBFrerhLWlcDr5JkaxBnTj30XO3rJfHwMrzwRJ9Api9TCgThF+IhVWp /k/3bR/fRNNIhhHu6hnJrk1K8CdUOCKsijKWtNPHf8m4JvYD8bCH7VOWfYHt6GL2APSo QeeIZ8acN4NDCIVA0/vleqr+iOp5eOctSUMvDwey4a6PojoDK5X/DXC3AD98dQ4b34w0 kjvlQNb02x2hi0GQU1XrwGYV8BAepZWGu/5eB818ZSgWlBpSWn180eZnSebpEVe79sWe NRVw== X-Gm-Message-State: AOJu0YwrYdJkA4YeLrHUuEihY3XhCCFfUyGLB80dovMtjDfZwqea/55C wcqF8c6SG+U8fbK7VsMyumnh52lY7HLwoH9gNLc0ju8DFKk= X-Google-Smtp-Source: AGHT+IGEXDELUnfWjSH8cEyldisUN18wGhsk2Nh0xeSqB84muNDIOcvJYfd8ElDl5RA5raRsCrlfqw== X-Received: by 2002:a05:600c:3846:b0:40e:364d:d526 with SMTP id s6-20020a05600c384600b0040e364dd526mr821960wmr.87.1704469395811; Fri, 05 Jan 2024 07:43:15 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth Subject: [PULL 01/71] meson: Allow building binary with no target-specific files in hw/ Date: Fri, 5 Jan 2024 16:41:54 +0100 Message-ID: <20240105154307.21385-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469450972100003 Allow building a qemu-system-foo binary with target-agnostic only HW models. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20231121203129.67999-1-philmd@linaro.org> --- meson.build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 5a2582776c..371edafae6 100644 --- a/meson.build +++ b/meson.build @@ -3771,9 +3771,11 @@ foreach target : target_dirs arch_deps +=3D t.dependencies() =20 hw_dir =3D target_name =3D=3D 'sparc64' ? 'sparc64' : target_base_arch - hw =3D hw_arch[hw_dir].apply(config_target, strict: false) - arch_srcs +=3D hw.sources() - arch_deps +=3D hw.dependencies() + if hw_arch.has_key(hw_dir) + hw =3D hw_arch[hw_dir].apply(config_target, strict: false) + arch_srcs +=3D hw.sources() + arch_deps +=3D hw.dependencies() + endif =20 arch_srcs +=3D config_devices_h[target] link_args +=3D ['@block.syms', '@qemu.syms'] --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469467; cv=none; d=zohomail.com; s=zohoarc; b=UFDRJHaXqwKbGZvxL5QMigrPtRDXwsFKyGVl6WecS/CY6eKCU0dH3XGbZgQln3ng7R0othUZhdauxTugQkUbT3Dj01lAZfUJeWExNpS8PM7SgANFTpgJiOfThIczViGjWYS4x0goTX3pzSM6POpI0JtwrVMQ8K9KiTTTX6EqIQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469467; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZrhO0fF/4wCYRBDkij/JpNIZFZJdEux3joJ/5vLZ4GY=; b=hmpZRDRtlUp0zswj3GFt9/2jctquPXIj7TFWIzVeeVfq0qgWhSABq4PjUXdW3shdiqnfPFxJma1Ty2gAweVLHI6YyokIfOgTgi66OSmAB92pqs36qPHAIkm6B2c5v9Qx3SuUuKOPYanvHrtHvnfCf0LaKAcEd5X4b/+gNNgTgKQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469467637399.3543495525382; Fri, 5 Jan 2024 07:44:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmM6-0004QK-UT; Fri, 05 Jan 2024 10:43:30 -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 1rLmM1-0004Id-Ii for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:27 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmLz-0002zA-8y for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:24 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40d5ac76667so12842245e9.1 for ; Fri, 05 Jan 2024 07:43:22 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id f11-20020a5d50cb000000b00336ebf27d59sm1602952wrt.78.2024.01.05.07.43.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469401; x=1705074201; 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=ZrhO0fF/4wCYRBDkij/JpNIZFZJdEux3joJ/5vLZ4GY=; b=bwi3kpzGGNXCOg+20oW7rcdO6hXQlCRbkxobFttj7cxuRBleMFixnF2Ffg1G7TqmrC zyWrEFwzJZGrK8EdQzJLdfazNeoKvWs7HZK2MNvl+tD56VzMbScGxjlhxq6K0NZAIP3H GIt1Fq4zu/EwWdj/2oNgAA9VaZWUBLEADJkyV34Oyt+MtzQ+plYOnI4DGDXL8SentVz0 upHwkNMV60xGHNiqhX1Bq7nmm3M+3eanaKYgES8SO3B+eS6NqQ5jw0UFfxIL8aa6EwxO YHBPIxJlKa+zxEEMbe4jnbi4w2Oy/+63Hkwin2DLwSWNVdOesNH0kVhn7t2w5Pc9YWgd Q7pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469401; x=1705074201; 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=ZrhO0fF/4wCYRBDkij/JpNIZFZJdEux3joJ/5vLZ4GY=; b=Cn/l0Q3ntTjnh7ez5KmpVWZ1ED+XoS16rJzqm3YMBJv1dyP5GHo99bpxDyZ7OWe2le HQsk2511spyUlRhL4MSJMDuJvEdGE12Jz+JOD+euyxWh3LC5xe2XgxY2ZW6IEAZLwt/2 xNt+Jdej/aiJPT1hV1J5h/ozM3ccmPYb5BDILZf8ClaW3HKo6MQFN5JEQI0XrUBWasil L1dwZexkhJPPr8Q5qNTaVHz2QF+UGSqpXMCJS+8IR6230dfmlp4F9PIIn5jVdgvyjD7m nJK+TYUXpNxVemaI0T2A9Im0q2dij03hTl78V+u/okFtPIpnd41FiJgdQEha5PgrhGES 2OBg== X-Gm-Message-State: AOJu0YwlwbvmQhgNaVb8HiBOj3094WCcyI8yV+87zOBkbVLTSIBOtdMP paRia0zJ+QJguhI3r9TePUq2ZXz74AimxZi/sCt5c2ROfb8= X-Google-Smtp-Source: AGHT+IHxztSSE/NnhY4IOTid4JhG7CbAzUhLc9/SoRCe3oHUBTcxxyGJGlHE4o66X9PU5RD/GKJPIw== X-Received: by 2002:adf:f282:0:b0:337:39e3:3b71 with SMTP id k2-20020adff282000000b0033739e33b71mr1335279wro.74.1704469401108; Fri, 05 Jan 2024 07:43:21 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PULL 02/71] target/alpha: Remove fallback to ev67 cpu class Date: Fri, 5 Jan 2024 16:41:55 +0100 Message-ID: <20240105154307.21385-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469469046100003 From: Gavin Shan 'ev67' CPU class will be returned to match everything, which makes no sense as mentioned in the comments. Remove the logic to fall back to 'ev67' CPU class to match everything. Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-2-gshan@redhat.com> [PMD: Reword subject, replace 'any' -> 'ev67' on linux-user] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- linux-user/alpha/target_elf.h | 2 +- target/alpha/cpu.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/linux-user/alpha/target_elf.h b/linux-user/alpha/target_elf.h index 344e9f4d39..b77d638f6d 100644 --- a/linux-user/alpha/target_elf.h +++ b/linux-user/alpha/target_elf.h @@ -9,6 +9,6 @@ #define ALPHA_TARGET_ELF_H static inline const char *cpu_get_model(uint32_t eflags) { - return "any"; + return "ev67"; } #endif diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 39cf841b3e..91fe8ae095 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -141,11 +141,8 @@ static ObjectClass *alpha_cpu_class_by_name(const char= *cpu_model) typename =3D g_strdup_printf(ALPHA_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - - /* TODO: remove match everything nonsense */ - if (!oc || object_class_is_abstract(oc)) { - /* Default to ev67; no reason not to emulate insns by default. */ - oc =3D object_class_by_name(ALPHA_CPU_TYPE_NAME("ev67")); + if (!oc || !object_class_dynamic_cast(oc, TYPE_ALPHA_CPU)) { + return NULL; } =20 return oc; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469440; cv=none; d=zohomail.com; s=zohoarc; b=FsTeaMjtAnoARb+Gaae3nN9QrsUgK1FZZ8NxWACu0kcksjNYIkZH8PseNyryR391+hXyxzBIM9+gmXyJYNihDSQWwalW3Jur2NTyi34UTGYJszoGB/fmHPrRcseuJb+CGCBsaaolFCsvu+Wt8QDxZdG3ijqw5nSAeDdln1qgG4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469440; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kfCx4/gtR4YY4ivQoLXNfOFMl7NDjjAvmzs8gXTbe8k=; b=TM/F8wrJrsaLzLD9n02iUS7ACHw+zEc1zPDke+SfGgGCbWhNeilr/Y+5GlW9jO0eooML3MeRaW09qCjpKCtztX3fBqeweKaYlEzqBpVADgecXwe1VFMGbhqs3lLGKIjrtE1LxmtGm7eGCKEJDxtXz745hOoPzCVvsX9mj6Nkg+0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170446944057695.68756706795727; Fri, 5 Jan 2024 07:44:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMJ-0004YE-2D; Fri, 05 Jan 2024 10:43:44 -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 1rLmMI-0004Xg-48 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:42 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmM4-00030R-1H for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:41 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e3b43173eso2006805e9.1 for ; Fri, 05 Jan 2024 07:43:27 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id j26-20020a05600c1c1a00b0040e3804ea71sm1941923wms.10.2024.01.05.07.43.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469406; x=1705074206; 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=kfCx4/gtR4YY4ivQoLXNfOFMl7NDjjAvmzs8gXTbe8k=; b=pUhC2F9fWeiAW4HljsTiPYeOoM69zTLlFisGRC9T5nR52G8chwGncaBbHWAs4owznH yJ76w7XWpHvcLa0nVeDSPjO6g9rE0dC+dxreiuOwGj1K1mL48DnScxHs4zV2iXg1cs8F 6fYfuLxJlcrNM2LAbcr2zzJWuKlFVLEup2UhiZxifxK2hyKjFYnK0cnSFWes713vrG8D Jmxu5paBVlQ3DbqPYpoMhdyJ9k46T1jIBg1DrFmu7mHMtKftw0IOWbn3EJtowPkgTdWY fQONH2H9w21hXWsFPNX0s3lXFvvSCIbTBfaSwCOBTxwoefeR6n2C7n1XkdP6YXvq06Ao h0hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469406; x=1705074206; 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=kfCx4/gtR4YY4ivQoLXNfOFMl7NDjjAvmzs8gXTbe8k=; b=G6xi6WSyaorV3279xGk0avnqDEszfPWeK1HWebTBKBtF0JJUgkDTauhMiIcXh1IKjn qk3pwV6XV531oLcBmoR9Plg9xCa/iW1PAkcX3CCExlDL5G3lbWInPKCQ35UF3RhSvmM7 7Sxo9vaWVt5m8Eu6yLttQWnluRMltABDx3xHz6MasxDI93ygjHTEt+2CvZ6o/OvUGxIe YGwtBDMC1zE7LU2L2lC6ZP6wkr8jqz3lbzjLUbUiRF+2AHnvUHFeVlAkCquQG9mqCivl bCh4yHJrGfBReFIWarUFTrozwe/9SaKVG7qYy/A15YciD3eNQsKW4nRM2GBD6sS6gY29 UYzQ== X-Gm-Message-State: AOJu0Ywv/PLwCnjpnoaLv3gnypYlwq3tap4TiAb5ugm76pXfx9bhgqaY BH42UMr39Bo0L+E+OoQIxACELRl8+hTfLgUS8k/cHv+B5Xw= X-Google-Smtp-Source: AGHT+IGV9c/0JqFZKWsNy6fQZ9HeRwPQrwzjMLkJcB7pd1haJWgZF9t4P74YhreIQe3AS1/6Dv6uMA== X-Received: by 2002:a05:600c:1910:b0:40c:91f:506e with SMTP id j16-20020a05600c191000b0040c091f506emr829441wmq.126.1704469406291; Fri, 05 Jan 2024 07:43:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/71] target/hppa: Remove object_class_is_abstract() Date: Fri, 5 Jan 2024 16:41:56 +0100 Message-ID: <20240105154307.21385-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469440920100003 From: Gavin Shan Since commit 3a9d0d7b64 ("hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name()"), there is no need to check if @oc is abstract because it has been covered by cpu_class_by_name(). Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-3-gshan@redhat.com> [PMD: Mention commit 3a9d0d7b64] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/hppa/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 04de1689d7..e3e7200b1d 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -162,9 +162,7 @@ static ObjectClass *hppa_cpu_class_by_name(const char *= cpu_model) g_autofree char *typename =3D g_strconcat(cpu_model, "-cpu", NULL); ObjectClass *oc =3D object_class_by_name(typename); =20 - if (oc && - !object_class_is_abstract(oc) && - object_class_dynamic_cast(oc, TYPE_HPPA_CPU)) { + if (oc && object_class_dynamic_cast(oc, TYPE_HPPA_CPU)) { return oc; } return NULL; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469440; cv=none; d=zohomail.com; s=zohoarc; b=Q0MZqbBxPF2+T88YoDJDESnkNWTrfoyFK1Q2joV+vpl1YDCVjewA6Q19NGlpXbDFdbngVUJA5nJJ6hkrVs3YY+rM9jhWLlZuqsIFv1wNcfhu1ni5tDyx9nG0e9zVG7/obSb7W77z2LYoQ6b2Av1kk3KIhQjbsE0cvgU3juNi0kU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469440; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/gOHeYXZaENDpXVCc7dFmhih0x0gAZTHQNBrKsITHc4=; b=mBGFpYgk7wRcnGWxAJMJmOnPDKhKw6fNVweCZZ77LugMy6ahlhVPH1tlL5nUk4sVcTVz0IAZonZKqrxGMNo1LT1UZ3E2uW1ovPd8miVxRiJQ2C024w5ozG3DMa0ueuOsw+YeZlATeSrUcCghJy78ZDEe8ZzKYzdpb0VXZbvJ7Ko= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469440779861.241413832297; Fri, 5 Jan 2024 07:44:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMF-0004WV-Mt; Fri, 05 Jan 2024 10:43:39 -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 1rLmMD-0004VC-N4 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:37 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMA-000322-2P for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:37 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40d8e7a50c1so18915465e9.2 for ; Fri, 05 Jan 2024 07:43:33 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id i1-20020a05600c354100b0040d8ff79fd8sm1938104wmq.7.2024.01.05.07.43.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469412; x=1705074212; 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=/gOHeYXZaENDpXVCc7dFmhih0x0gAZTHQNBrKsITHc4=; b=y8mQE3h2tzrsIz9htvdngU0RPnnNiPdLIrqgWqaN6zRO47rzMwoKvm5cUHjzeZaJHc m5Uvixz/uMz3WDg2AGXQMhBOo44yPq+1pIRbfr67y2cRjhPdwm0vrxKoQHHzcY9ygT0p i0XxSCdWtlTrNuPm5b6aJOUzd1Ab6y5XIGpjFBCeDnwHAXEaDBDw8DzUOb59Y4l6d48U TkXCaYnQ8qj+T11tPJqz4hOWQpgjJeeaLIbhkrNzCWYwdgUGMQuFos24M2pKTrnqKGbc i1Eh6AfjOH2Np8HwEz9g74nu/Y8GD1LCg4Dd0LVHhksQ+kCsbQfyss0H4VT8AjwQ2eth kWGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469412; x=1705074212; 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=/gOHeYXZaENDpXVCc7dFmhih0x0gAZTHQNBrKsITHc4=; b=jsMHQLOT3TEOAcSQDl58CNd1VZgQIPdG9bTLWViJIBMfx0tj9VgdUUyLVvhw6VbkpE nulzU5X1bLaW/9QuCr0/ccdkNvgYMKRL9uU7qHRxK6bCPsrGqeqNEjc8KEBS5MyToCaz sx2Zrp4KaLdUbg+UTFJzV97+0+mKr/UYLZgcz6TXQph7UV/DOe/H/VoXr9BKOwp2N9pV yRdPyvmShPQhFtsDcFI83WzSJqAiULy6VILQxxpq9sDzSHsMjyM0HL5W3XOxsD1VV2kY E/ljow6k/HbZs0XDqkeeToyNl8TrCwAdQeR8L46+tadNQ+nvW7CrzKGjMQrnP9rxH+Fk MxTQ== X-Gm-Message-State: AOJu0YxLNHV1a1XyrRjKRexfnI6DdSr3TcOspChnwGyRNRLpTJD5N2Yl GjGFopDx5BsErpE4xvJIWTaLFjSbHFBtT6+qtypFDgAemzU= X-Google-Smtp-Source: AGHT+IGVkADY55ugDLxlxITmFq/isF2GGRRBD8zJSJXAPFCaVaOEhY5LL431zZbMGFij9Et44ZhMgQ== X-Received: by 2002:a05:600c:470b:b0:40d:5c50:573 with SMTP id v11-20020a05600c470b00b0040d5c500573mr1142490wmo.213.1704469412529; Fri, 05 Jan 2024 07:43:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gavin Shan , Igor Mammedov , Richard Henderson , Peter Maydell , Michael Rolnik , "Edgar E. Iglesias" , Brian Cain , Song Gao , Laurent Vivier , Stafford Horne , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Bastian Koppelmann , Max Filippov Subject: [PULL 04/71] cpu: Call object_class_dynamic_cast() once in cpu_class_by_name() Date: Fri, 5 Jan 2024 16:41:57 +0100 Message-ID: <20240105154307.21385-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469443266100010 For all targets, the CPU class returned from CPUClass::class_by_name() and object_class_dynamic_cast(oc, CPU_RESOLVING_TYPE) need to be compatible. Lets apply the check in cpu_class_by_name() for once, instead of having the check in CPUClass::class_by_name() for individual target. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Igor Mammedov Reviewed-by: Richard Henderson Signed-off-by: Gavin Shan Message-ID: <20231114235628.534334-4-gshan@redhat.com> --- hw/core/cpu-common.c | 8 +++++--- target/alpha/cpu.c | 3 --- target/arm/cpu.c | 4 +--- target/avr/cpu.c | 8 +------- target/cris/cpu.c | 4 +--- target/hexagon/cpu.c | 4 +--- target/hppa/cpu.c | 6 +----- target/loongarch/cpu.c | 8 +------- target/m68k/cpu.c | 4 +--- target/openrisc/cpu.c | 4 +--- target/riscv/cpu.c | 4 +--- target/tricore/cpu.c | 4 +--- target/xtensa/cpu.c | 4 +--- 13 files changed, 16 insertions(+), 49 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 82dae51a55..d0e7bbdf06 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -154,10 +154,12 @@ ObjectClass *cpu_class_by_name(const char *typename, = const char *cpu_model) assert(cc->class_by_name); assert(cpu_model); oc =3D cc->class_by_name(cpu_model); - if (oc =3D=3D NULL || object_class_is_abstract(oc)) { - return NULL; + if (object_class_dynamic_cast(oc, typename) && + !object_class_is_abstract(oc)) { + return oc; } - return oc; + + return NULL; } =20 static void cpu_common_parse_features(const char *typename, char *features, diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 91fe8ae095..83345c5c7d 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -141,9 +141,6 @@ static ObjectClass *alpha_cpu_class_by_name(const char = *cpu_model) typename =3D g_strdup_printf(ALPHA_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_ALPHA_CPU)) { - return NULL; - } =20 return oc; } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 650e09b29c..1c8b787482 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2411,9 +2411,7 @@ static ObjectClass *arm_cpu_class_by_name(const char = *cpu_model) oc =3D object_class_by_name(typename); g_strfreev(cpuname); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_ARM_CPU)) { - return NULL; - } + return oc; } =20 diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 999c010ded..3e478294a6 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -160,13 +160,7 @@ static Property avr_cpu_properties[] =3D { =20 static ObjectClass *avr_cpu_class_by_name(const char *cpu_model) { - ObjectClass *oc; - - oc =3D object_class_by_name(cpu_model); - if (object_class_dynamic_cast(oc, TYPE_AVR_CPU) =3D=3D NULL) { - oc =3D NULL; - } - return oc; + return object_class_by_name(cpu_model); } =20 static void avr_cpu_dump_state(CPUState *cs, FILE *f, int flags) diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 675b73ac04..a5083a0077 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -95,9 +95,7 @@ static ObjectClass *cris_cpu_class_by_name(const char *cp= u_model) typename =3D g_strdup_printf(CRIS_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc !=3D NULL && !object_class_dynamic_cast(oc, TYPE_CRIS_CPU)) { - oc =3D NULL; - } + return oc; } =20 diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 9d1ffc3b4b..aa48f5fe89 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -63,9 +63,7 @@ static ObjectClass *hexagon_cpu_class_by_name(const char = *cpu_model) oc =3D object_class_by_name(typename); g_strfreev(cpuname); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_HEXAGON_CPU)) { - return NULL; - } + return oc; } =20 diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index e3e7200b1d..1a5fb6c65b 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -160,12 +160,8 @@ static void hppa_cpu_initfn(Object *obj) static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) { g_autofree char *typename =3D g_strconcat(cpu_model, "-cpu", NULL); - ObjectClass *oc =3D object_class_by_name(typename); =20 - if (oc && object_class_dynamic_cast(oc, TYPE_HPPA_CPU)) { - return oc; - } - return NULL; + return object_class_by_name(typename); } =20 static void hppa_cpu_list_entry(gpointer data, gpointer user_data) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 07319d6fb9..81f2d8d8ed 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -718,15 +718,9 @@ static ObjectClass *loongarch_cpu_class_by_name(const = char *cpu_model) g_autofree char *typename =3D g_strdup_printf(LOONGARCH_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); - if (!oc) { - return NULL; - } } =20 - if (object_class_dynamic_cast(oc, TYPE_LOONGARCH_CPU)) { - return oc; - } - return NULL; + return oc; } =20 void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 43b1bde21c..1421e77c2c 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -111,9 +111,7 @@ static ObjectClass *m68k_cpu_class_by_name(const char *= cpu_model) typename =3D g_strdup_printf(M68K_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc !=3D NULL && object_class_dynamic_cast(oc, TYPE_M68K_CPU) =3D= =3D NULL) { - return NULL; - } + return oc; } =20 diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 1173260017..f7d53c592a 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -164,9 +164,7 @@ static ObjectClass *openrisc_cpu_class_by_name(const ch= ar *cpu_model) typename =3D g_strdup_printf(OPENRISC_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc !=3D NULL && !object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU))= { - return NULL; - } + return oc; } =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 83c7c0cf07..523e9a16ea 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -646,9 +646,7 @@ static ObjectClass *riscv_cpu_class_by_name(const char = *cpu_model) oc =3D object_class_by_name(typename); g_strfreev(cpuname); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_RISCV_CPU)) { - return NULL; - } + return oc; } =20 diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 034e01c189..8acacdf0c0 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -132,9 +132,7 @@ static ObjectClass *tricore_cpu_class_by_name(const cha= r *cpu_model) typename =3D g_strdup_printf(TRICORE_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (!oc || !object_class_dynamic_cast(oc, TYPE_TRICORE_CPU)) { - return NULL; - } + return oc; } =20 diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index e20fe87bf2..93e782a6e0 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -141,9 +141,7 @@ static ObjectClass *xtensa_cpu_class_by_name(const char= *cpu_model) typename =3D g_strdup_printf(XTENSA_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); g_free(typename); - if (oc =3D=3D NULL || !object_class_dynamic_cast(oc, TYPE_XTENSA_CPU))= { - return NULL; - } + return oc; } =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469656; cv=none; d=zohomail.com; s=zohoarc; b=PYzORMz1RewtmvsKnsPP7v8swjGlfL+Ov5VVQheIz5a6V7MX9uS4p4maknnpq6r/piPPMNm10Sy1syEoZR3EoYbYhBxQ6dxnpjxnpSpp1E4dMuipc9Zje7YLoz29IKBRCMbmEqT8B0PnxsJYmdCQj6i++QUl+NZgNqeIgeGzXVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469656; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ryursiHqH68ZqMgSdIiqgs1dXkhwVe0KhUL0m3rAt/Q=; b=D9QSjn6gtV6DJoycJAYM5+lE2BmQKXzn2Gv8WyDR/Fox/EIi5yrIJWg6wGOf3aa/GutKo9HokX8dBXua7UTcyJg043bYdNkjJFuxuJKvXSpL62FzW4CdVVzxRemidS3v/nW9n7/Uv4F9fb1+0LT2i8j05eQTjCEXFZtq0GG+iOA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469656103624.1778981255226; Fri, 5 Jan 2024 07:47:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMN-0004Zd-4Q; Fri, 05 Jan 2024 10:43:47 -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 1rLmMK-0004Yl-5V for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:44 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMG-00034E-IN for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:42 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-336746a545fso406959f8f.0 for ; Fri, 05 Jan 2024 07:43:40 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id q9-20020a05600000c900b003367eae8e18sm1613962wrx.57.2024.01.05.07.43.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469418; x=1705074218; 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=ryursiHqH68ZqMgSdIiqgs1dXkhwVe0KhUL0m3rAt/Q=; b=cmpwsCxDhwSGwMBLgEsmuqTLxYgA0itMEmKdxRtSKEMzV35Vd9hsHv3KejuodOfaPD axmk7Kc/Od9PYmTswgwB0argHEFOwMdquTwYLUYqlnud+zvFplJ5ChFQX91y9oangfMj NmdX4SfsN7V4TRs4jvo0BXjnSZbsbyqYU0BP847WnCnJGZxt9IXvqUbznJ8AyOtHNlYg 4Z4jD+WeuOG8xFOLeEMbNw7xe5oOuPjkY6F0PJ1ZTQ7MXZ8T0gCdxU2avzNLGbQ4xtKy VC+XY0MC9VG9qot/a8hV5HENUCzSOmTljqfZjDOlrOGCBTqCFKq8fkJ9aQDCiVCujQd+ 75qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469418; x=1705074218; 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=ryursiHqH68ZqMgSdIiqgs1dXkhwVe0KhUL0m3rAt/Q=; b=AKE0TmK3fK1JE/8J6dHa3t/S5nmh/qkbeyddqMuYZ7nu4K+JP4Fix3me41cZfR/Zx7 9f5UqHu8GELGHOij9vkM1JhDZBPR42umt3fYT+FAGIjxzHZZZV5sw6/pAtzTxbTvQZCu O2yW4UDVbZwnhDtHcWTMNA64F1J6Clg966/O/njb9Olmqn5wKJlipJ129Uwnz/RP2wjs 9LQGH1sK8ZhXy/DykTEBc4u77WnMxCm5tIBrxk9VwsZ21SfWeW0e0E/EVwKMawJ1JyuT ZpGqjLfdgu+PKuMr6iAnVfZaFEmqxNtFNzbhsqeCV26U2o4bHpSNgcgja8AorvEGw8g6 wEBg== X-Gm-Message-State: AOJu0YyjPp+DooiYYR8oo9Tz6hObavGTxioKEaAFAZOGZMuJ1ZEKqIFC UIEkUIrjja/RYY25kyyETrMTclR2xoY/oMQLBwzovIP4F8I= X-Google-Smtp-Source: AGHT+IFwFMEG+aMTvit6INMB+rfjp0j3CHIJPqSwSWzeDmqwp0km24jQox7Ja/PSir1Xpo34Ref0rQ== X-Received: by 2002:a5d:6104:0:b0:336:68c1:36fa with SMTP id v4-20020a5d6104000000b0033668c136famr1330955wrt.5.1704469418064; Fri, 05 Jan 2024 07:43:38 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 05/71] cpu: Add helper cpu_model_from_type() Date: Fri, 5 Jan 2024 16:41:58 +0100 Message-ID: <20240105154307.21385-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469657820100013 From: Gavin Shan Add helper cpu_model_from_type() to extract the CPU model name from the CPU type name in two circumstances: (1) The CPU type name is the combination of the CPU model name and suffix. (2) The CPU type name is same to the CPU model name. The helper will be used in the subsequent commits to conver the CPU type name to the CPU model name. Suggested-by: Igor Mammedov Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-6-gshan@redhat.com> [PMD: Mention returned string must be released with g_free()] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 13 +++++++++++++ cpu-target.c | 15 +++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index c0c8320413..76ef59de0a 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -779,6 +779,19 @@ void cpu_reset(CPUState *cpu); */ ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model= ); =20 +/** + * cpu_model_from_type: + * @typename: The CPU type name + * + * Extract the CPU model name from the CPU type name. The + * CPU type name is either the combination of the CPU model + * name and suffix, or same to the CPU model name. + * + * Returns: CPU model name or NULL if the CPU class doesn't exist + * The user should g_free() the string once no longer needed. + */ +char *cpu_model_from_type(const char *typename); + /** * cpu_create: * @typename: The CPU type. diff --git a/cpu-target.c b/cpu-target.c index 430dc53566..6f4afc1dbc 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -241,6 +241,21 @@ void cpu_exec_initfn(CPUState *cpu) #endif } =20 +char *cpu_model_from_type(const char *typename) +{ + const char *suffix =3D "-" CPU_RESOLVING_TYPE; + + if (!object_class_by_name(typename)) { + return NULL; + } + + if (g_str_has_suffix(typename, suffix)) { + return g_strndup(typename, strlen(typename) - strlen(suffix)); + } + + return g_strdup(typename); +} + const char *parse_cpu_option(const char *cpu_option) { ObjectClass *oc; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469450; cv=none; d=zohomail.com; s=zohoarc; b=OQS+Rk/NzlCv1YUac+Gx4V1eCZg67F1udVKBeFf9ilDSTQRprMRYSU5j6fPrcAHad9lh3Z3NJ7QQjAgy4uX//1Sv2Vt6UO3VvcDvTQ7dFMV6x6NuyYOjRCSkDFslOBacri9/XTY6gk3RaTv01q13IJTFdYCAHazgihIXt7myh9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469450; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kIbpZfgL2GdYvVTJqmdprGQ276jFAcijx1XENXuPWGk=; b=l29xmbHOZOHnvGmb96iP2KcYvzlX4YzgL/z75FjWwro3DearYZ7Sl/JFmoY0DXiCl7yZH8vk/UVBI2fPRThO+jr0Zbz42+L3kC4OWGuo9rEP9ouwoznApDymPH6aymBRGRuP2yQvNwSJIBlGuuCFi80qKyDEgZ7QZ3zNNJQLz8E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469450807565.0476032566844; Fri, 5 Jan 2024 07:44:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMP-0004bJ-TL; Fri, 05 Jan 2024 10:43:49 -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 1rLmMN-0004a6-RQ for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:47 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMM-00037b-37 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:47 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e37524fafso8903105e9.1 for ; Fri, 05 Jan 2024 07:43:44 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id u14-20020a05600c19ce00b0040d5ae2906esm1929189wmq.30.2024.01.05.07.43.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469423; x=1705074223; 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=kIbpZfgL2GdYvVTJqmdprGQ276jFAcijx1XENXuPWGk=; b=kddC/ty8CGTqJHmRGxs5FvNNFEcQOb84m/dtAls4cZS1vrL72cla8RnZUPhDu3FA1v lMTAVCyoqh1Y0/EoZHyj99u9DFo+r3/9zUWrziuMajrFA7rXHyC6TkhAmCqMBVNXQGf9 cRd6dNbmVOFeoHoGbPzAGq2zf0RjwODlvjOEZhOHqn/zDMYmVjx1UE49AQjF/vKqFK9M BsD1bAbq52gGJa1nAQTxzhWrjbqQjjpux2nS8ItoEaKDttlSMi80sqc5dLgYiNm1Covs Yg3K0ae3Bfhld5h0lIlslHeZUMqbMPfsBwwko4051LsiGfGcn5lBEywalkEEDCqlZjte OWnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469423; x=1705074223; 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=kIbpZfgL2GdYvVTJqmdprGQ276jFAcijx1XENXuPWGk=; b=fhfQ3moP49wyo5RmYoLD2Eho7FhBQTPbPSc4P8IivwgXm/D2MLdsx7ArJw6ntdVdHb 3xBQ8CnQKC/PZTLKoPEtGvpczdzduZg4mjacLHSfzQrUlyLst+Cv091SrC9lnqh3yr7S FkqUT6bXJaGypsCY1W2MObk2dyloXKcR3QtpWAmYEq0Pua+qwROM23pVJU/v4HXESWoZ pYHTbo7BlDp304PSOs1MJb5VZlf3v93L3L6Nwz+Q9iYQSGMdTABV3R7Ky7Ht/NC5slI0 xqFtfhXJCqzrtiPabEpWFAL7PUG0U7SD0jpdLJV2hc/MAvaHWJVx/FnW9wX2iehPX3Yc qriQ== X-Gm-Message-State: AOJu0YwFyXf30I274fUxVTYf3OQutnPFptrYVlf1jZm4DoY6NgyiDGGQ UrjZgFVMJSQTWcib4KbxY5+cILXf9OU16Hlr1dNASGGJhsU= X-Google-Smtp-Source: AGHT+IFNSGg21WHACL8WVEdlAMnB0moS6tkcRS+hCip3mongDPrSWiboIOw7D6dWHnEcdVKHsqBwug== X-Received: by 2002:a05:600c:4e8f:b0:40d:9238:df50 with SMTP id f15-20020a05600c4e8f00b0040d9238df50mr1269643wmq.81.1704469423467; Fri, 05 Jan 2024 07:43:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Warner Losh , Kyle Evans , Paolo Bonzini Subject: [PULL 06/71] cpu: Add generic cpu_list() Date: Fri, 5 Jan 2024 16:41:59 +0100 Message-ID: <20240105154307.21385-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469453183100003 From: Gavin Shan Add generic cpu_list() to replace the individual target's implementation in the subsequent commits. Currently, there are 3 targets with no cpu_list() implementation: microblaze and nios2. With this applied, those two targets switch to the generic cpu_list(). [gshan@gshan q]$ ./build/qemu-system-microblaze -cpu ? Available CPUs: microblaze-cpu [gshan@gshan q]$ ./build/qemu-system-nios2 -cpu ? Available CPUs: nios2-cpu Suggested-by: Richard Henderson Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-7-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- bsd-user/main.c | 5 +---- cpu-target.c | 29 ++++++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index e6014f517e..4de226d211 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -378,10 +378,7 @@ int main(int argc, char **argv) } else if (!strcmp(r, "cpu")) { cpu_model =3D argv[optind++]; if (is_help_option(cpu_model)) { - /* XXX: implement xxx_cpu_list for targets that still miss= it */ -#if defined(cpu_list) - cpu_list(); -#endif + list_cpus(); exit(1); } } else if (!strcmp(r, "B")) { diff --git a/cpu-target.c b/cpu-target.c index 6f4afc1dbc..5eecd7ea2d 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -24,6 +24,7 @@ #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "migration/vmstate.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" @@ -283,12 +284,34 @@ const char *parse_cpu_option(const char *cpu_option) return cpu_type; } =20 +#ifndef cpu_list +static void cpu_list_entry(gpointer data, gpointer user_data) +{ + CPUClass *cc =3D CPU_CLASS(OBJECT_CLASS(data)); + const char *typename =3D object_class_get_name(OBJECT_CLASS(data)); + g_autofree char *model =3D cpu_model_from_type(typename); + + if (cc->deprecation_note) { + qemu_printf(" %s (deprecated)\n", model); + } else { + qemu_printf(" %s\n", model); + } +} + +static void cpu_list(void) +{ + GSList *list; + + list =3D object_class_get_list_sorted(TYPE_CPU, false); + qemu_printf("Available CPUs:\n"); + g_slist_foreach(list, cpu_list_entry, NULL); + g_slist_free(list); +} +#endif + void list_cpus(void) { - /* XXX: implement xxx_cpu_list for targets that still miss it */ -#if defined(cpu_list) cpu_list(); -#endif } =20 #if defined(CONFIG_USER_ONLY) --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469474; cv=none; d=zohomail.com; s=zohoarc; b=hfYgrqB1pnXeFAJZ2co9bPexFXzAXsjnD4fav2p1wS8VkOPY+L/8Q08FFdF2hZc4r0q5DY4AK22zQN23ZZR48JB+6Q0ijdUqv5Dym608/HpPN5dkGt0rWoOkTvPoTwEYvc4mgcwqOA3l93/UR/pz1GWffOfL8WvUfdb1ZtUjg5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469474; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rLV8uDs3E9nSqverOGkh+8mNeXXqUDlTZQBJE1rP3g0=; b=DcuFWnACrbugiEfYj0I5r8hFodh1Zqyp8M2dKo3dzsT2CTFjIDMzG0eXHFSg01eUfPbgdIcaLnqvF9qWdbzrwVmxsuCPFAXBoTgyn895M798YhT29qqy/dlPoYBr40bamxmomUtguJQbryYp2fO1DN5jd1StqN7iWRxLuMH0iQk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469474759609.6982714593984; Fri, 5 Jan 2024 07:44:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMU-0004dk-7H; Fri, 05 Jan 2024 10:43:54 -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 1rLmMS-0004cz-F5 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:52 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMQ-0003AO-9J for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:52 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40d858c56cbso19526265e9.2 for ; Fri, 05 Jan 2024 07:43:49 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id k7-20020a5d6d47000000b0033725783839sm1599738wri.110.2024.01.05.07.43.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469428; x=1705074228; 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=rLV8uDs3E9nSqverOGkh+8mNeXXqUDlTZQBJE1rP3g0=; b=SKcVvpLX5hYD/oCShDsCadOdmGIZpC29ktiYlOnsidG8LcdFmOvFmSH1QEuhh/qESa YYPGBWkW2a1rPzYYFglCaIbw7bnOZJw0joqB5Kudwh1BN3duuCilg9ORZ4/nGBnXCjA5 BKZKh9/wDUHQIbVidQMa9V9a6t/iO9S+jU7y4NC9ecaLfJxJ/0uOaoffaKvLR75JTPJt +IpnIYY5Cdtv3zgFUSH1U3xry7p0AYApE0oc9BCO/SAavCZaIv9RUgjp2ARlmcKOwB9T vxjD/J/1iAdHvdCqXWaKzR3pb0QbEjR4EFELolDRJAFV7ufficbheNvpRmMPHhto/OXv KjNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469428; x=1705074228; 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=rLV8uDs3E9nSqverOGkh+8mNeXXqUDlTZQBJE1rP3g0=; b=naGuM6t1v4v1oqIDrss44Mm9+iNDrU4orwTFC1qW8D6/GjZ064ga140FimuAxj+hBD ptLlDo5F1V/f9+KddI5Z61ETODKu/Vcu5NvlEN7jgjwtWka3jm3a3/kvaDFJ9RNKr/ow Jm+Oc5Kq+jdOzrDqbR+7f4mCG5UCaxyDf9Vjo7hF/V5Z06HbfHVlVcInDitBEP8GwREt ieS9XNN36pg9DQYbHyulGjQdIz21SujewSudTcO8N5rIRi2agit/hxFWHzFGWcDVLnng xRHJ+SfMscrwHUWowh75KaumYmUDa3idDIU0uqXJsSKA8iYW47I6p/X4ZsDLPAEn/Qix DwYQ== X-Gm-Message-State: AOJu0YzsxTNIP2d+gdt9xgzkEKQCYL9bEnkMHmyRRtpAPUGk+rJ9wLOH jlTMq/3gallDIsdz5z/rNHcw92K5k/K0hqg0cGx98/SzrH0= X-Google-Smtp-Source: AGHT+IE9W+bwzv81LqReK2b8RnuBqkC9QkppVRtHF2hIbPI72uabkye4qhdaPPLzE+C38Xw8L+SGMQ== X-Received: by 2002:a05:600c:a45:b0:40e:3511:2c39 with SMTP id c5-20020a05600c0a4500b0040e35112c39mr1353505wmq.172.1704469428691; Fri, 05 Jan 2024 07:43:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 07/71] target/alpha: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:00 +0100 Message-ID: <20240105154307.21385-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469475073100001 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-alpha -cpu ? Available CPUs: ev4-alpha-cpu ev5-alpha-cpu ev56-alpha-cpu ev6-alpha-cpu ev67-alpha-cpu ev68-alpha-cpu pca56-alpha-cpu After it's applied: [gshan@gshan q]$ ./build/qemu-system-alpha -cpu ? Available CPUs: ev4 ev5 ev56 ev6 ev67 ev68 pca56 Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-8-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/cpu.h | 3 --- target/alpha/cpu.c | 17 ----------------- 2 files changed, 20 deletions(-) diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index d672e911dd..ce806587ca 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -292,8 +292,6 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int fl= ags); int alpha_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int alpha_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); =20 -#define cpu_list alpha_cpu_list - #include "exec/cpu-all.h" =20 enum { @@ -441,7 +439,6 @@ void alpha_translate_init(void); =20 #define CPU_RESOLVING_TYPE TYPE_ALPHA_CPU =20 -void alpha_cpu_list(void); G_NORETURN void dynamic_excp(CPUAlphaState *, uintptr_t, int, int); G_NORETURN void arith_excp(CPUAlphaState *, uintptr_t, int, uint64_t); =20 diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 83345c5c7d..b8ed29e343 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -87,23 +87,6 @@ static void alpha_cpu_realizefn(DeviceState *dev, Error = **errp) acc->parent_realize(dev, errp); } =20 -static void alpha_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - - qemu_printf(" %s\n", object_class_get_name(oc)); -} - -void alpha_cpu_list(void) -{ - GSList *list; - - list =3D object_class_get_list_sorted(TYPE_ALPHA_CPU, false); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, alpha_cpu_list_entry, NULL); - g_slist_free(list); -} - /* Models */ typedef struct AlphaCPUAlias { const char *alias; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469730; cv=none; d=zohomail.com; s=zohoarc; b=TPRyNlCocZvtwb2yqw4Hg8QEGxreIfho8NycscB3J/tMIK6LzeWEgmRqWH3xDSSwelyIyNKjYHBGOSkhL5tt/6slKQ+W8UVdlERTlWcKrpC4dT6RKEYMp5QdxTn+5V86Mz/qyDZV+Bhm1XNflR0OT6rAZnS8ja05JPVVjSrgSfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469730; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=woqU0CJbLpbBNTO5d7sFgz50JLFq3nMIZ0ht3SRJ1YE=; b=hO6RnzS1z800YBT7odYs9pPeqrcmH8wzDfswhVnUnXHxm+Qzrir/H8nBjVC/gmylZJHrDSVvgUEiWdgCz5zzQJg1FornEnBw4oCQstEzXDrHtTOF4DnvMlppgNC0Kr5s8W8w8vWVnfwI2yOGvxiur5sVs8+gt6VWdd8m1xBqjyo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469730088356.74241059856695; Fri, 5 Jan 2024 07:48:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMl-0004pv-Cg; Fri, 05 Jan 2024 10:44: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 1rLmMY-0004ga-Gu for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:58 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMV-0003Bn-NC for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:43:58 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40d41555f9dso16539035e9.2 for ; Fri, 05 Jan 2024 07:43:55 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id z6-20020a05600c0a0600b0040e3ac9f4c8sm898004wmp.28.2024.01.05.07.43.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469434; x=1705074234; 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=woqU0CJbLpbBNTO5d7sFgz50JLFq3nMIZ0ht3SRJ1YE=; b=xSpH4fYkHdsPRicQUBBr9yk+JuKO+SmbCrl1mHawHDzs73/ZTgDaMs9ug/h5bG6sC/ jMvOYRWaF5Kjz0YAtG94CQS0/wLiZx0jMnWALgBH1yMluVYF12j2RuLShZKfWl5bHce1 lX2wuo+HsFcrOwjVp3RbwJWT03fXukqPB6dKVmCy2FdQ5GoVpJGn0IPWlQJWu0s4uH9M rZTbNjmh4nA0zZBjG5LfP5M/nIKGJEjKJQn1vdGl9Va170gWDXkqZ1BclqLdf67nOC8c sOn4x/gXWdO1iSn/TW5V9AEDvH6I5kE6gKMJr2h4MKfT61DbzM23GbNvjrGL2TT5MTmH gcFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469434; x=1705074234; 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=woqU0CJbLpbBNTO5d7sFgz50JLFq3nMIZ0ht3SRJ1YE=; b=m7N1Z7Dr31ou/K0zOErA7Gd2FTc/TTACr7wGvS9NGXQAticFsk/xxBGMSAobTGX5L+ bR6lcIBgncFf84xooM+DdQtH5p8S+3cl24kFXamUPNVWZmiAgD+lfYoHiEE2G36V3KG4 w2F8opUCf8F+rdtVcuf7lWWRaHdu24eUi8BKie2x3VV8+4qJjcdbBGf5CKoK14HcBE0k WHTUPRJZsJntvhLdvhGS9Nx5rj1dqy16Uy/hYSOjBXbFIoX7TtVUrWMoaAYJiFJuyx1a YoOnKHpvffsrDtxp0YIVEMjFyahz/uNyxLt/5DtirYyRpKu3yxTrHQ1tWbBrt4DLFpvd kX+Q== X-Gm-Message-State: AOJu0Yxj/uH1WPLHBRir1dBchQxvYHKudmOhEB4vblOoVIJ51R7mIoHr dWeL9WwttjB3R06LcHSqSjcqQfEsFJotzRy7eFHbrl0kW08= X-Google-Smtp-Source: AGHT+IEeRcFLbKk4dFeAmeBvJcSygmKaaj/1gLM6njWmdPg6vzuBbto2c0jdOLbPMEUjorS5a5yEaA== X-Received: by 2002:a7b:cbd9:0:b0:40d:62f6:5d51 with SMTP id n25-20020a7bcbd9000000b0040d62f65d51mr1336159wmi.127.1704469434059; Fri, 05 Jan 2024 07:43:54 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 08/71] target/arm: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:01 +0100 Message-ID: <20240105154307.21385-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469732312100007 From: Gavin Shan No changes of the output from the following command before and after it's applied. [gshan@gshan q]$ ./build/qemu-system-aarch64 -cpu ? Available CPUs: a64fx arm1026 arm1136 arm1136-r2 arm1176 arm11mpcore arm926 arm946 cortex-a15 cortex-a35 cortex-a53 cortex-a55 cortex-a57 cortex-a7 cortex-a710 cortex-a72 cortex-a76 cortex-a8 cortex-a9 cortex-m0 cortex-m3 cortex-m33 cortex-m4 cortex-m55 cortex-m7 cortex-r5 cortex-r52 cortex-r5f max neoverse-n1 neoverse-n2 neoverse-v1 pxa250 pxa255 pxa260 pxa261 pxa262 pxa270-a0 pxa270-a1 pxa270 pxa270-b0 pxa270-b1 pxa270-c0 pxa270-c5 sa1100 sa1110 ti925t Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-9-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/cpu.h | 3 --- target/arm/helper.c | 46 --------------------------------------------- 2 files changed, 49 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index a0282e0d28..8c3ca2e231 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2737,7 +2737,6 @@ static inline bool access_secure_reg(CPUARMState *env) (arm_is_secure(_env) && !arm_el_is_aa64((_env), 3))= , \ (_val)) =20 -void arm_cpu_list(void); uint32_t arm_phys_excp_target_el(CPUState *cs, uint32_t excp_idx, uint32_t cur_el, bool secure); =20 @@ -2840,8 +2839,6 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_syn= c); =20 #define TYPE_ARM_HOST_CPU "host-" TYPE_ARM_CPU =20 -#define cpu_list arm_cpu_list - /* ARM has the following "translation regimes" (as the ARM ARM calls them): * * If EL3 is 64-bit: diff --git a/target/arm/helper.c b/target/arm/helper.c index fc546df5c7..a2a7f6c29f 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9468,52 +9468,6 @@ void register_cp_regs_for_features(ARMCPU *cpu) #endif } =20 -/* Sort alphabetically by type name, except for "any". */ -static gint arm_cpu_list_compare(gconstpointer a, gconstpointer b) -{ - ObjectClass *class_a =3D (ObjectClass *)a; - ObjectClass *class_b =3D (ObjectClass *)b; - const char *name_a, *name_b; - - name_a =3D object_class_get_name(class_a); - name_b =3D object_class_get_name(class_b); - if (strcmp(name_a, "any-" TYPE_ARM_CPU) =3D=3D 0) { - return 1; - } else if (strcmp(name_b, "any-" TYPE_ARM_CPU) =3D=3D 0) { - return -1; - } else { - return strcmp(name_a, name_b); - } -} - -static void arm_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - CPUClass *cc =3D CPU_CLASS(oc); - const char *typename; - char *name; - - typename =3D object_class_get_name(oc); - name =3D g_strndup(typename, strlen(typename) - strlen("-" TYPE_ARM_CP= U)); - if (cc->deprecation_note) { - qemu_printf(" %s (deprecated)\n", name); - } else { - qemu_printf(" %s\n", name); - } - g_free(name); -} - -void arm_cpu_list(void) -{ - GSList *list; - - list =3D object_class_get_list(TYPE_ARM_CPU, false); - list =3D g_slist_sort(list, arm_cpu_list_compare); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, arm_cpu_list_entry, NULL); - g_slist_free(list); -} - /* * Private utility function for define_one_arm_cp_reg_with_opaque(): * add a single reginfo struct to the hash table. --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469656; cv=none; d=zohomail.com; s=zohoarc; b=jd315kJ6GRbkAzHwEZeZtBtuZRRhgrNwMGCngLBu7ZP4hdo5IC6ZvLHllVQ631A+qjn3wxVLFgoXkaBA4hu5Bd3SLti3cOZG2X+BC3TJBPeTnPqWHGKErz34B0NC91fDAb4ZFgBnqMBbFmVAlK/Vj+TYE3bG4MuQatJ6SuKsHQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469656; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wJixAs+R9evY25N/DNdQZkg5UuMmYpP4W3heU6glhRE=; b=FfB/2SV3sWQrXkOm9D8AYml/ZshLiq4St/hUWxWc4kS5iN8UxMUQZVTD3xqRcEd27Cm/ApXtBsVLceg9LcdiGsdMjKnZQnwyR9BeQP1dE2SHlauo9kFq4NzQS+SVVP4+KCJE6Qyz27N6Ikm2GvpkpnujkUoN8mVwOqkzGl9JPu8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469656348676.1958172757741; Fri, 5 Jan 2024 07:47:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMo-0005DM-2V; Fri, 05 Jan 2024 10:44:14 -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 1rLmMh-0004rg-7i for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:09 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMa-0003Cq-Un for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:06 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40d4a7f0c4dso17351955e9.1 for ; Fri, 05 Jan 2024 07:44:00 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id n12-20020a05600c3b8c00b0040d62f89381sm1929866wms.35.2024.01.05.07.43.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469439; x=1705074239; 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=wJixAs+R9evY25N/DNdQZkg5UuMmYpP4W3heU6glhRE=; b=dXDd3JGIuaPHal0zUrDxlITmM54qS28iLzvT+rq/Gkdm52HjQzg0GEOVMF9jClL9sV eDFlkkG6cUlEIoojkUW2po6dEB4zi5vkfgdMqE1zNAfZ8IPEGvIr+FqDArz/n7YKTmaT pX9qcPhG/F+DmmejqoCM8uVfAAGJoeFaZfNCR7lXiVE1NZIWSiRAK6YQ6f241GbAtg+Z r8gCue8Kl/YsHkLZ8lnr0UGvzc2xQ8MZqw5qz4LsGD/PCGyATYNCI9yhWThtdEJ5sqfZ NjtHaygNVrWm6Qd3fTZnFUFL6Z5nvT7OGIZtCCOeuRLa8gJQxJj2Q5o1eKNEtf7tV6Ts lgdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469439; x=1705074239; 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=wJixAs+R9evY25N/DNdQZkg5UuMmYpP4W3heU6glhRE=; b=H5ZzPywx2Rhdi0dBuq9Fc9vNbcT2wvnbYhWZsRISO7weOZXB9Pzq+HPC5q3mVG4A2i f0I4wQonvcom8aCFZisPGJPkSI/ZeAfR4mmbJzHZRhwsP7o6Hmw0RB5pPIfiLEJ7hzJ8 xfRrFn/DMVjhew226//YibTSTWN8i7JR/trq+USk1muoaT+BAFT7Ca/hLaWkW45QE6we y1mmT2Z13qd+Mshvp9sVztdcEUgljVxiWKZmAf07UYMS4Lc16YVxb3+1MfLk6iVOb5iH p5NoKlcetVaRNYDja3to7vnvn+Ft2vEKnTkdQ2JWq5hlByNqAD9kJias6tayU0TUWoxr iGTA== X-Gm-Message-State: AOJu0Yx/HdB97sGAXI8Tt2XSe2tc/McZUzRxnagG3UtpMzq5wmt6onyd +qO5CBa3o63lul8ZGWrphfFCwa03Mm93XM6R1yuSqPSJJc8= X-Google-Smtp-Source: AGHT+IFoMWPlhBCtOmnYSXXJFu3jd4UtzUg6fxaXJ1pqnm8v3TQFe5yIc0clOVbJSI2P5kt4INIb/g== X-Received: by 2002:a05:600c:13d6:b0:40d:9336:2991 with SMTP id e22-20020a05600c13d600b0040d93362991mr1231609wmg.129.1704469439492; Fri, 05 Jan 2024 07:43:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Michael Rolnik Subject: [PULL 09/71] target/avr: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:02 +0100 Message-ID: <20240105154307.21385-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469657831100014 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-avr -cpu ? avr5-avr-cpu avr51-avr-cpu avr6-avr-cpu After it's applied: [gshan@gshan q]$ ./build/qemu-system-avr -cpu ? Available CPUs: avr5 avr51 avr6 Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-10-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/avr/cpu.h | 2 -- target/avr/cpu.c | 15 --------------- 2 files changed, 17 deletions(-) diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 7960c5c57a..7d5dd42575 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -184,7 +184,6 @@ static inline void set_avr_feature(CPUAVRState *env, in= t feature) env->features |=3D (1U << feature); } =20 -#define cpu_list avr_cpu_list #define cpu_mmu_index avr_cpu_mmu_index =20 static inline int avr_cpu_mmu_index(CPUAVRState *env, bool ifetch) @@ -194,7 +193,6 @@ static inline int avr_cpu_mmu_index(CPUAVRState *env, b= ool ifetch) =20 void avr_cpu_tcg_init(void); =20 -void avr_cpu_list(void); int cpu_avr_exec(CPUState *cpu); =20 enum { diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 3e478294a6..f5cbdc4a8c 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -362,21 +362,6 @@ typedef struct AVRCPUInfo { } AVRCPUInfo; =20 =20 -static void avr_cpu_list_entry(gpointer data, gpointer user_data) -{ - const char *typename =3D object_class_get_name(OBJECT_CLASS(data)); - - qemu_printf("%s\n", typename); -} - -void avr_cpu_list(void) -{ - GSList *list; - list =3D object_class_get_list_sorted(TYPE_AVR_CPU, false); - g_slist_foreach(list, avr_cpu_list_entry, NULL); - g_slist_free(list); -} - #define DEFINE_AVR_CPU_TYPE(model, initfn) \ { \ .parent =3D TYPE_AVR_CPU, \ --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470019; cv=none; d=zohomail.com; s=zohoarc; b=BkUETHHecH8ex368o9rUPzfarxJWURjYCdeZuQajw4j/gUo2GSTw7FkBbiF8t70TV7BYsxgtfBNNhK5n3lmHCWjevGT3CPo+02GhDppRXjA8WDGrgOEHfm/M/8B+PB3NoAzzMmCeQr/Nc5MoZuLK90NXYk5vdLnbnvVj8uEJZus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470019; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T2dHbEy97kiYKLMLDn2+e8bN6W1pBXRM0uBjrESXiSY=; b=WWU9J3cJXiCIcIHlOruEYLzWQ9b5YiAFvQ8N9oLE92kln/ukIwR0ad0/coWAbBuIh22ggQoQZTPp8YmOhoRVVgKY678ukBQswHrMEXaDBcF9RkFdfcuEtTJrXLwBVKwR4LyahMDU3uPbWbUP9Rh5cOdsZwCEKQsiWbvxPeUnC0g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470019495599.8923141813868; Fri, 5 Jan 2024 07:53:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMn-0005Ca-NV; Fri, 05 Jan 2024 10:44: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 1rLmMj-0004vc-Vm for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:11 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMg-0003Dj-UV for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:09 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40d41555f9dso16541075e9.2 for ; Fri, 05 Jan 2024 07:44:05 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id f13-20020a05600c4e8d00b0040d887fda00sm1904820wmq.26.2024.01.05.07.44.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469444; x=1705074244; 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=T2dHbEy97kiYKLMLDn2+e8bN6W1pBXRM0uBjrESXiSY=; b=ZBOGvIPLJTGuTvxZxFQsst4Jj8nIUCkX9RExawr2nM3HtE3xZ54Y1YeQGhRQeHMkTt tgk/zCqcNTK29KZEEOo0VRvQdFC/x8bhdxPiMB3Z1MFrW+UmV3B7FZhYUbn5Ru0Dbz82 dQDXwU7LfDVDdAgD33tZDhmUrrUJTVjA8tgHPQmenjGJ4jeomIi6+NX4Y2OQVks5OjCS LWfLbAkhtElDHngHLq3+HHiNtY805W1LCfGzuCOrO4vNHKvlhQVRwEb5oYdDdWaSzBpT kX0zd5qcjw6SD+/sVNoWURxBTQTqcU8z6Vr+q9n53AOG2Fy5KZhZbAwYhaog2pp5GJrd iB4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469444; x=1705074244; 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=T2dHbEy97kiYKLMLDn2+e8bN6W1pBXRM0uBjrESXiSY=; b=J0JoCWcnKJkqOlFRoguZUGjwj/2Nz7ssk6YMAISm+QIr8nXu32wn8PeylanmhTuC9r Qi2cu/A4VD+Ua62340EhKiXRInzP1wUQ+cY2FiVsrB/J2m6WOWt899zHNKbxTa3aXOtC WmwESIpVCrQexcCrBIYwpzv5FPUFB5f8VFJviMgSvupGXhpwNspZfxLHZszxv0Y516Dq Ic+PJrHWvNtO55h+7FujvIi3tBlwEny+pI0/cCEYG1dO/Lzx5kAoyEltb40HQ5nSylRT /1DFksTIq3fiIb63OKsCVk+wNdiRwFVtxi3WLoOdkBMxUaq6pAE21dQ9mcOlk2bD9V9a nhVQ== X-Gm-Message-State: AOJu0Ywwc4SiQ2Nbk1kV9zNj3rTKZXGs1G/0Voa6KinryXr2Ck8dchU2 dRpR9Gbij61VzOgRL7S2qUM27uJJpxAgalZz4Lo81OaDIo0= X-Google-Smtp-Source: AGHT+IETHnPqsHM1GdW+Gj8KyciMtd1i9lAL4lt9zXBCnXBgdgoqDX30kxvkx1lHmiH5KUelJx7iWg== X-Received: by 2002:a05:600c:8515:b0:40d:5a9f:2b59 with SMTP id gw21-20020a05600c851500b0040d5a9f2b59mr1265328wmb.41.1704469444712; Fri, 05 Jan 2024 07:44:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 10/71] target/cris: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:03 +0100 Message-ID: <20240105154307.21385-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470020831100001 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-cris -cpu ? Available CPUs: crisv8 crisv9 crisv10 crisv11 crisv17 crisv32 After it's applied: [gshan@gshan q]$ ./build/qemu-system-cris -cpu ? Available CPUs: crisv10 crisv11 crisv17 crisv32 crisv8 crisv9 Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-11-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/cris/cpu.h | 3 --- target/cris/cpu.c | 38 -------------------------------------- 2 files changed, 41 deletions(-) diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 1be7f90319..d830dcac5b 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -287,7 +287,4 @@ static inline void cpu_get_tb_cpu_state(CPUCRISState *e= nv, vaddr *pc, | X_FLAG | PFIX_FLAG)); } =20 -#define cpu_list cris_cpu_list -void cris_cpu_list(void); - #endif diff --git a/target/cris/cpu.c b/target/cris/cpu.c index a5083a0077..9ba08e8b0c 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -99,44 +99,6 @@ static ObjectClass *cris_cpu_class_by_name(const char *c= pu_model) return oc; } =20 -/* Sort alphabetically by VR. */ -static gint cris_cpu_list_compare(gconstpointer a, gconstpointer b) -{ - CRISCPUClass *ccc_a =3D CRIS_CPU_CLASS(a); - CRISCPUClass *ccc_b =3D CRIS_CPU_CLASS(b); - - /* */ - if (ccc_a->vr > ccc_b->vr) { - return 1; - } else if (ccc_a->vr < ccc_b->vr) { - return -1; - } else { - return 0; - } -} - -static void cris_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - const char *typename =3D object_class_get_name(oc); - char *name; - - name =3D g_strndup(typename, strlen(typename) - strlen(CRIS_CPU_TYPE_S= UFFIX)); - qemu_printf(" %s\n", name); - g_free(name); -} - -void cris_cpu_list(void) -{ - GSList *list; - - list =3D object_class_get_list(TYPE_CRIS_CPU, false); - list =3D g_slist_sort(list, cris_cpu_list_compare); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, cris_cpu_list_entry, NULL); - g_slist_free(list); -} - static void cris_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs =3D CPU(dev); --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469958; cv=none; d=zohomail.com; s=zohoarc; b=F7ZiPhYuwxH5jia6yabnjtyawWaxRapt5H6eS5NzzsYj7iK6tC3hq4hs8h0M3jX9nI+rLAtBQDj1CcpZjuVwC6gMSJIVb+AosTyjGEdx8D0oTwTDjqWUiLA1R97pCgZ4ze6KkfwfnRJRuWyh6OyJalGRSufZUOIxGJx9p8JkkNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469958; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MTyqf1UOhmXWKWjB2kbjbecKyF9tbZD+k3iPAVC8zqk=; b=mZ2vkV1TuUL0WPDftE87AitMU4jKmU/1b42PIeR/ApQCuZAjnWsL/0NDr8282WsVp2qJz7TkTJWm3ckfaeQCSdfC3OspUpiPXfOe8ilEsGVWmgyJ/7aWdY54sxWf0g7/1wFxg4KeniTG+VvBUqFvGKY/mZt4zrjdJrALR0YXguU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469958727315.81529719204946; Fri, 5 Jan 2024 07:52:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMr-0005Q5-43; Fri, 05 Jan 2024 10:44: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 1rLmMp-0005G9-8W for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:15 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMm-0003F6-5o for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:14 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d60c49ee7so17368705e9.0 for ; Fri, 05 Jan 2024 07:44:11 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id d3-20020a05600c34c300b0040c3953cda5sm1950432wmq.45.2024.01.05.07.44.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469450; x=1705074250; 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=MTyqf1UOhmXWKWjB2kbjbecKyF9tbZD+k3iPAVC8zqk=; b=HHmzfCbyDxgSNouK5PFaSTbIUfIyKA5KYDHdhQCM/v59CT/QVijLLoxM9MzIIlI8lk bzYTlobLBFs4KVVjenCvEkCw5I5Wy45FprpKkVv8wGc9PflKoqwb0nMU4etKQNytio+L pDHcbO3/fXusXREE50o/AH/HCe/n0Ict/ytBu2Y79mxe9HuDmruDJ9OKViQfxCFoaESR 0r7nsi8wFWRf5zhZMs2TuhZGNijGgN7zjRbdEroqN9KabFo57RNTrmXvdHp3gj9TWXKK eWa4SLmc/aJV2Gupw+FYDx0sP14G0nJUBlc+DCE2K3wFg6kM9Upv84+hA3lzkq8TjO8O Azkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469450; x=1705074250; 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=MTyqf1UOhmXWKWjB2kbjbecKyF9tbZD+k3iPAVC8zqk=; b=F8V+YWM7ebVHu0/zG9GMpXeuQibFz1TJxpniONSOa2HkgenoWlP7Ckc79EOJ72S7Dk G7zFpS+sfZNNvGt8bNbEf14aFlryWACsDAtmr23NskeZcLXSecmNK1WV1C00HYF7DLTD F607kf8Zn4CJ44WwiFRly8Xey7+T0Oe0fkkgokwxkm72CXl0AlbUQLpW3BgqkyR4ejF9 3TdaV5+Atyr1uwHp6qm21M7zxtFk3G3UpX3rtU7+ZTKOK5btftbyvIc1wA8BByx9rSs5 4LaREvUc6PP6niGaOsfSonx1E6fQSEqkgaiKKU3kHdFTrwy5iIatkw5S+dUMuD8vnbqw gByg== X-Gm-Message-State: AOJu0Yz5ESHqHZdF4h2cFbQQbdZ6pndC7+v3buXrO3U8xRqsxU9y50dV c0WvV2CrB7ZCFykhDxKZlagiPgrto2MHmcpslmwoxUh5FAU= X-Google-Smtp-Source: AGHT+IHA7oirNe2wIME7aj02ZELRt5Of3egWjhyWldJb1kuaKpK+en2JVra3k52zDOPgZEmv/BRvqw== X-Received: by 2002:a05:600c:5487:b0:40d:6e2f:da7b with SMTP id iv7-20020a05600c548700b0040d6e2fda7bmr1311698wmb.13.1704469450494; Fri, 05 Jan 2024 07:44:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Brian Cain Subject: [PULL 11/71] target/hexagon: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:04 +0100 Message-ID: <20240105154307.21385-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469960513100001 From: Gavin Shan No changes in the output from the following command. [gshan@gshan q]$ ./build/qemu-hexagon -cpu ? Available CPUs: v67 v68 v69 v71 v73 Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-12-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/hexagon/cpu.h | 3 --- target/hexagon/cpu.c | 20 -------------------- 2 files changed, 23 deletions(-) diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 7d16083c6a..5c11ae3445 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -37,9 +37,6 @@ =20 #define CPU_RESOLVING_TYPE TYPE_HEXAGON_CPU =20 -void hexagon_cpu_list(void); -#define cpu_list hexagon_cpu_list - #define MMU_USER_IDX 0 =20 typedef struct { diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index aa48f5fe89..c0cd739e15 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -32,26 +32,6 @@ static void hexagon_v69_cpu_init(Object *obj) { } static void hexagon_v71_cpu_init(Object *obj) { } static void hexagon_v73_cpu_init(Object *obj) { } =20 -static void hexagon_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - char *name =3D g_strdup(object_class_get_name(oc)); - if (g_str_has_suffix(name, HEXAGON_CPU_TYPE_SUFFIX)) { - name[strlen(name) - strlen(HEXAGON_CPU_TYPE_SUFFIX)] =3D '\0'; - } - qemu_printf(" %s\n", name); - g_free(name); -} - -void hexagon_cpu_list(void) -{ - GSList *list; - list =3D object_class_get_list_sorted(TYPE_HEXAGON_CPU, false); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, hexagon_cpu_list_entry, NULL); - g_slist_free(list); -} - static ObjectClass *hexagon_cpu_class_by_name(const char *cpu_model) { ObjectClass *oc; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469822; cv=none; d=zohomail.com; s=zohoarc; b=IXNoQz8NtNuX5FrbsJlKN/47gLR8rT6qqibgvRZJiU0EFSFknrvswWLGFZy4JM4K273VT0dvSqC1YqpkgSMr9kpxQtVmAUER3ce4yjTTrJCvjucd9Yc4AmXKLiPB8jAKDfW7dCfVAb/2vL/krjNeWUQ/sU4dl5ZeIE9rsbdaV5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469822; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eJb6ytKuwy0SF9EvoPkrRPYTidmv1mDxbmTN6G8AydI=; b=FnEcxTNS1kxFCUIp996EcPa2tM1qbeQQmnqM7sICjZxaV+PYGoVPSxs2CUYtULHI0FvXXUL9uWmfJJ5U+Uzcum4MuoT+snvutllnS/ItktTPaBECbLSPfFhmC/YmL28ih3fU+Po7h/gqciX5nxIMnXJf5eeQ8eyq2BKh7Q8q88A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469822072798.7967695917705; Fri, 5 Jan 2024 07:50:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmN1-0005ou-Tu; Fri, 05 Jan 2024 10:44:27 -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 1rLmN0-0005k7-6P for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:26 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMw-0003IG-LX for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:25 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40d5b89e2bfso16264625e9.0 for ; Fri, 05 Jan 2024 07:44:22 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id l3-20020a5d4bc3000000b00336843ae919sm1609483wrt.49.2024.01.05.07.44.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469461; x=1705074261; 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=eJb6ytKuwy0SF9EvoPkrRPYTidmv1mDxbmTN6G8AydI=; b=cfSamfYJHvttQZI8Hlw7NrxUWt7IHcgswNdOC/7jRPSGjPJHXM1phYlj9ij4zeBhbY Cya5Vxqm9tOIKMuuQxXhllcdJ7fzv9wPQyab0cL0ToP63txI8j1McsX3uSDkobRUmi+M iqGXG3/WJwfa9d/J4w9pXLFuqaz2OKeBUp3bRHlq2Zc3kjfz5kyEHDZyWXOeAdPaOl0o yCMjFSoy+s4iboDDITIqpKbW53XQuhMNijTUSUTE0bZPbPRv8yc90prpbWYGU7otXYws 9n/huM3w2FpolaNrWj6MayhMopyZhsxHCh9btHLmZQAKa29BWrFwS9DdWYKZUKE7aPtL N7ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469461; x=1705074261; 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=eJb6ytKuwy0SF9EvoPkrRPYTidmv1mDxbmTN6G8AydI=; b=ijxEVL+EazjW7E0xFb3m0BMRi4SO+NG2xWeWU+LCEGtKcRA4qFxYf7EDWlFNWL4P5H 5qNF/9rc23eUrMRH5QKZf87aF9hBShqo41AFgqE+GT77+ZO9I3Kb9ntUmjWdtJSSOWH3 myvwYm6ceay8epUu+HqUyLDzcoZiJrQBkxvNA2gMsZF8CRZafLCmMROetThZvf1KBQQf Aq+19zJfqM6ONVV1UTFFitC8K8HIT9+a3742H7mWPDGt/VLs8YVZG6XNiKPeCHlUL0R1 tgDkIusLbmyulFN8GjU4aLSM5TX66fuTeVHfQJ24OIrhL0q45vVMvWBtuaK5m+ZSoLsw cxBw== X-Gm-Message-State: AOJu0YxLpatEp35OAXmntXJm63Dza9iR9GqHrSboZwXcTapCuC7Y3dm/ AyKbOxyxuNZGw8T7mDXP0xZuV93PCU0em9src+MVrQbnd0c= X-Google-Smtp-Source: AGHT+IHbNwcC5okDDf21DaohbS/Vp64n4dA2Gl1RkPxFSRWlStomC5wqXhjZoxPUzXg5u/tF2EO4Mg== X-Received: by 2002:a05:600c:a001:b0:40d:5e0e:8648 with SMTP id jg1-20020a05600ca00100b0040d5e0e8648mr1228913wmb.159.1704469460842; Fri, 05 Jan 2024 07:44:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 12/71] target/hppa: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:05 +0100 Message-ID: <20240105154307.21385-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469822651100002 From: Gavin Shan No changes in the output from the following command. [gshan@gshan q]$ ./build/qemu-system-hppa -cpu ? Available CPUs: hppa hppa64 Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-13-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/hppa/cpu.h | 3 --- target/hppa/cpu.c | 24 ------------------------ 2 files changed, 27 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 8be45c69c9..fd659ca88b 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -402,7 +402,4 @@ G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, in= t excp, uintptr_t ra); =20 #define CPU_RESOLVING_TYPE TYPE_HPPA_CPU =20 -#define cpu_list hppa_cpu_list -void hppa_cpu_list(void); - #endif /* HPPA_CPU_H */ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 1a5fb6c65b..e1f252cc45 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -164,30 +164,6 @@ static ObjectClass *hppa_cpu_class_by_name(const char = *cpu_model) return object_class_by_name(typename); } =20 -static void hppa_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - CPUClass *cc =3D CPU_CLASS(oc); - const char *tname =3D object_class_get_name(oc); - g_autofree char *name =3D g_strndup(tname, strchr(tname, '-') - tname); - - if (cc->deprecation_note) { - qemu_printf(" %s (deprecated)\n", name); - } else { - qemu_printf(" %s\n", name); - } -} - -void hppa_cpu_list(void) -{ - GSList *list; - - list =3D object_class_get_list_sorted(TYPE_HPPA_CPU, false); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, hppa_cpu_list_entry, NULL); - g_slist_free(list); -} - #ifndef CONFIG_USER_ONLY #include "hw/core/sysemu-cpu-ops.h" =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469519; cv=none; d=zohomail.com; s=zohoarc; b=JL/M3IEcXGKuEHkLODO2JaagvaV66c2u9lBaaQ6hU3KsH+BJ1rDCs2oNvdaU/Dj2UrnYpsMiGHUl5Lr/HYLTNQNRA2jbMqrG1A4v4bBYMoOfZRNsZKi1/PEZp6oVjjeWjcvO5yQr65DUwIMn4PEtG/Lbc8z1cmJhDGM5s2ukJ6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469519; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3F01YLhzgjTdtmytUy5rbru1eD+VsYVlRXqJFlFh/Hg=; b=ZPi4iWVxjLR3SlKi4jVKg+6/ujmaPKycExlQjN95AGoXDPNE1+8S8gwOHCH4ufy0iL/cFez+QIZIbOEWCUQbyVXKv+ZkPt7z4FvFR590uZNE/Ib4urhDFo3b5xe20vnfquo6zz0/y6urkQZXThZq8YqYWFISlZ9jLzq81HvYANk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469519512931.825365719342; Fri, 5 Jan 2024 07:45:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmN8-0006Ls-QX; Fri, 05 Jan 2024 10:44:34 -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 1rLmN7-0006Ca-8r for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:33 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmN3-0003JZ-Ds for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:33 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33686649b72so1469411f8f.3 for ; Fri, 05 Jan 2024 07:44:29 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id p17-20020a5d4e11000000b003365951cef9sm1605022wrt.55.2024.01.05.07.44.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469468; x=1705074268; 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=3F01YLhzgjTdtmytUy5rbru1eD+VsYVlRXqJFlFh/Hg=; b=DTGr9hZhGcXyItA9vjUOyMeef6a4deRm4PvKLmdkqvVLo5dIUmdsBNIeLo5GiLEvlA yhhnyjCuWApfTCU0EOFfPQegTY0Bp80Wd2xdRDjDCR/gmiWMMw9S4ujpGbmJG+aK7HYH hQ8xRgCXSRP+7yYh+ni8aNJm28sVXPXIHg2HJilj9y1LZbzQUJ06vXuMge1IPwX/4x61 xDHddJih7EkNZ7xb8Kd79m4dEfcZLGzbLIWvlsDjDYuRF72T9yDjwptWP7gl+wKlsFTC QMxEpwke8fUiNJ8q6uatKNyD8bashtpV58ZCf4IwBPiJX+uSrdAfriE3KWVs4nGBh7Vv wt/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469468; x=1705074268; 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=3F01YLhzgjTdtmytUy5rbru1eD+VsYVlRXqJFlFh/Hg=; b=sJeFHKHlcVP493XwEMGpCU6EZrHV3Mv0JXTWcnaQbXiVa7pfzLBNmTNI73Y5ux9sYQ ww9CfMcDklQKXhRvQ9zFt6mUE59A9hW++yvhQt3dG4ejjSnnusAz8ztVEePXgVkJoUUJ vunxsgthe8B5kIFhtawFC7ue+rpEKuN9+wua/kDJyUmmya+b6AaG9IX6sd/y5wmD0M0c PN7YD4z7VmDp96i4wcAIGNrQEJw+JW3L0m/g6B/QSti5BJ7Aigp2oXiuvhvBWQyWe/RK dPTTAawr0MCosRGOPLo45pfdDr+0bftFG8jTV1varcu3bOvPwlLvkq9FFwm1GNkg4Jvy s+2Q== X-Gm-Message-State: AOJu0Yx5vMx3OPY+WdlwiqPLzxaNZKURxDixCS2Vayv5nM+F0muVjIeL c2VIEBRiLO+j33rMwEunb4m0WvJ7qcYcsuEA/y2fnVA7XoE= X-Google-Smtp-Source: AGHT+IHMrcC1y2jYMjaUBGOkIrrl9VgB3ASJ4FlwlNIejdtyL0PRqwm0EGOmSzw5lO3COmQNqU6NDw== X-Received: by 2002:a5d:638d:0:b0:336:95d2:c649 with SMTP id p13-20020a5d638d000000b0033695d2c649mr1282677wru.125.1704469467904; Fri, 05 Jan 2024 07:44:27 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao Subject: [PULL 13/71] target/loongarch: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:06 +0100 Message-ID: <20240105154307.21385-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469521275100003 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-loongarch64 -cpu ? la132-loongarch-cpu la464-loongarch-cpu max-loongarch-cpu After it's applied: [gshan@gshan q]$ ./build/qemu-system-loongarch64 -cpu ? Available CPUs: la132 la464 max Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-14-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/loongarch/cpu.h | 4 ---- target/loongarch/cpu.c | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index 00d1fba597..0c15a174e4 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -466,10 +466,6 @@ static inline void cpu_get_tb_cpu_state(CPULoongArchSt= ate *env, vaddr *pc, *flags |=3D is_va32(env) * HW_FLAGS_VA32; } =20 -void loongarch_cpu_list(void); - -#define cpu_list loongarch_cpu_list - #include "exec/cpu-all.h" =20 #define CPU_RESOLVING_TYPE TYPE_LOONGARCH_CPU diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 81f2d8d8ed..87dfcdb0a5 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -483,21 +483,6 @@ static void loongarch_max_initfn(Object *obj) loongarch_la464_initfn(obj); } =20 -static void loongarch_cpu_list_entry(gpointer data, gpointer user_data) -{ - const char *typename =3D object_class_get_name(OBJECT_CLASS(data)); - - qemu_printf("%s\n", typename); -} - -void loongarch_cpu_list(void) -{ - GSList *list; - list =3D object_class_get_list_sorted(TYPE_LOONGARCH_CPU, false); - g_slist_foreach(list, loongarch_cpu_list_entry, NULL); - g_slist_free(list); -} - static void loongarch_cpu_reset_hold(Object *obj) { CPUState *cs =3D CPU(obj); --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470062; cv=none; d=zohomail.com; s=zohoarc; b=ZSVvYV2Ux/qJYFe0LuKvSltaESKvWk9LLbMiNzy6yOjD/lxWqneoA9uFoJVxa3ZLOBkzZc4mh8th45M0FQ0nK4qAmoaNyjjATafzXWrHf+P1PQWog9sjknDnvts5P4KPNZLhmRJVQoVIm6bm8WgEDyr50uqMVhKDx7oLHtTYU7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470062; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7xMSbSX6JUqisE+ZC80AlkX0gZxRGpO/C3MZvmfxXXw=; b=Cy1werxYPKhxviBET2InksbVX9E5uA58Hq1EyyNKZLzDm0htKzvMN8f19m9FdAURH5cDqyxj9nuuTCt0K5cDwxLNWxxq30IeKb3wEv9InCHcItzogrelKWSf5lZI9HgeoIIovv2bZCs51dMOQmYBjEyZlYwpyVB6pelhLr5A5NU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470062903493.5221034883699; Fri, 5 Jan 2024 07:54:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmND-0006qu-Po; Fri, 05 Jan 2024 10:44:39 -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 1rLmNC-0006gb-8i for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:38 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmN9-0003Kp-3f for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:37 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40d6b4e2945so18053825e9.0 for ; Fri, 05 Jan 2024 07:44:34 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id fm26-20020a05600c0c1a00b0040d5e53d7c3sm1972654wmb.23.2024.01.05.07.44.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469473; x=1705074273; 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=7xMSbSX6JUqisE+ZC80AlkX0gZxRGpO/C3MZvmfxXXw=; b=LXY91qUUH1TUmvuQBu09q4hAozPHbS2k9DAfDt+/kStq0aiWQuk8boP1tWxU2Iz0Mh 2Z0HidpLfbAgEh17zxkdnnTO4ZQfFVJx4MHAnX3PKLxnNlSwXMUpnmQYfZgSZ5sOYVLZ WpARwsXsNNln+7mHTjrtxAUXSVnFfHrsggqDP67xhFo7+v1Hf2ngjOz924Wxvl62fZxk K8+Vik8J75c/9euLvAyAHXR2QUaervBwNX2FCxkN2I+UEF/F8ol+SFH8RFmvQmCUIsf4 1FRXD9L4RLmCt1GABjhBFmDLrWAHa6Yf8iNcWA2PHyTfU/iAyZ17VvmWA0MRD9pkzCci 0+FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469473; x=1705074273; 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=7xMSbSX6JUqisE+ZC80AlkX0gZxRGpO/C3MZvmfxXXw=; b=N7KoEkpzaym9HWaoNukbjtnKLaNXPCOdMNh1LqZKeb7PYpA+rd8pTHIsi8KIJqkIaV pAkqsB8Qf7ttRRlFiPiv0Gj6G8Yxgo7/BLZNajk1/+oaEOb3Tl1vb4bKfCcASOWQTSx6 T0LwXW8NjL1g2nqIHyLsquw2/VR6Ldn8nY5MoMwV+E2vgFs7Z5t3T2UFEPtyM86C8NqX 2OsSJiTMFNCPe4srnX59FMEEvvNYbHFaLR88k9N/wN4N3pxOBfTwpC+5OKkc2PFXokTT +JgIC1ZTs7QJNr71W3LLm33f6pSFaiViNyNKMF/2M8ZmBSC+h/3iQ4Tk0PhQM8FKdP78 26/A== X-Gm-Message-State: AOJu0YzHXb+YDpme1xCljgK5i15TL6ffuiD1z4DmME7pK0LvAdlOmG8m U6DJqjYDTi+EvxD+mAh7asXq/cFUnuC7Ly4nAMzw9xR7Q0c= X-Google-Smtp-Source: AGHT+IFEQOPByjJ+ZfLyQjLjuiKcBG0Ek0dj7SrLUFZkRO5L6I94AsbJcQMkO458+KpNe8VtvTujCg== X-Received: by 2002:a05:600c:19c7:b0:40c:2671:1553 with SMTP id u7-20020a05600c19c700b0040c26711553mr827570wmq.36.1704469473620; Fri, 05 Jan 2024 07:44:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PULL 14/71] target/m68k: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:07 +0100 Message-ID: <20240105154307.21385-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470065015100009 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-m68k -cpu ? cfv4e m5206 m5208 m68000 m68010 m68020 m68030 m68040 m68060 any After it's applied: [gshan@gshan q]$ ./build/qemu-system-m68k -cpu ? Available CPUs: any cfv4e m5206 m5208 m68000 m68010 m68020 m68030 m68040 m68060 Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-15-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/m68k/cpu.h | 4 ---- target/m68k/helper.c | 40 ---------------------------------------- 2 files changed, 44 deletions(-) diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 6cfc696d2b..d13427b0fe 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -556,8 +556,6 @@ static inline bool m68k_feature(CPUM68KState *env, int = feature) return (env->features & BIT_ULL(feature)) !=3D 0; } =20 -void m68k_cpu_list(void); - void register_m68k_insns (CPUM68KState *env); =20 enum { @@ -576,8 +574,6 @@ enum { =20 #define CPU_RESOLVING_TYPE TYPE_M68K_CPU =20 -#define cpu_list m68k_cpu_list - /* MMU modes definitions */ #define MMU_KERNEL_IDX 0 #define MMU_USER_IDX 1 diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 0a1544cd68..14508dfa11 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -29,46 +29,6 @@ =20 #define SIGNBIT (1u << 31) =20 -/* Sort alphabetically, except for "any". */ -static gint m68k_cpu_list_compare(gconstpointer a, gconstpointer b) -{ - ObjectClass *class_a =3D (ObjectClass *)a; - ObjectClass *class_b =3D (ObjectClass *)b; - const char *name_a, *name_b; - - name_a =3D object_class_get_name(class_a); - name_b =3D object_class_get_name(class_b); - if (strcmp(name_a, "any-" TYPE_M68K_CPU) =3D=3D 0) { - return 1; - } else if (strcmp(name_b, "any-" TYPE_M68K_CPU) =3D=3D 0) { - return -1; - } else { - return strcasecmp(name_a, name_b); - } -} - -static void m68k_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *c =3D data; - const char *typename; - char *name; - - typename =3D object_class_get_name(c); - name =3D g_strndup(typename, strlen(typename) - strlen("-" TYPE_M68K_C= PU)); - qemu_printf("%s\n", name); - g_free(name); -} - -void m68k_cpu_list(void) -{ - GSList *list; - - list =3D object_class_get_list(TYPE_M68K_CPU, false); - list =3D g_slist_sort(list, m68k_cpu_list_compare); - g_slist_foreach(list, m68k_cpu_list_entry, NULL); - g_slist_free(list); -} - static int cf_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int = n) { if (n < 8) { --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469635; cv=none; d=zohomail.com; s=zohoarc; b=FKcvKRVHoOevFEP3Cz75dfkG6KrDbsu+w1yEaRooN4fbW0SoIR/IalScU0klOyoSCWumSpP9ob/d/vPg6cxnWfy3aB7dY4WWq2JQcnEMp8wsXiudK0/vTk5JwAGvb410uckiI67XlRbec9gka+tKRo38r1IaGWDzxz89y8JFtAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469635; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=u+LOg4cE3e/L+FkF/kdo/NDds7gIy3v+MrTgt4iIEa4=; b=aWKraBqB7Br7M+Xz0d0ChdhFijnfwsF/rG3LH9FVlWEtcqn0G4bC/4fXoX5LYwE3KMccGWHGPmGu3swhsBdNKRQfPO9Xut9CgLP+bFku2x8pH5/4ZFU6wyb9PB+xbZzldHIgCq2txx1T2qe4zes63MNN1awAdfDxAyWv2upmrvs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469635551303.1653180026409; Fri, 5 Jan 2024 07:47:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmNR-000881-3u; Fri, 05 Jan 2024 10:44:53 -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 1rLmNN-0007sy-P8 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:49 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmNH-0003M3-30 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:49 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3367601a301so1314157f8f.2 for ; Fri, 05 Jan 2024 07:44:42 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id f11-20020a5d50cb000000b00336ebf27d59sm1604796wrt.78.2024.01.05.07.44.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469481; x=1705074281; 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=u+LOg4cE3e/L+FkF/kdo/NDds7gIy3v+MrTgt4iIEa4=; b=n5kSfdb/lfP7oDDbyCG5oqr7XHssSJaEsPSnUqsTFei00qGvkLC5F377mhnpJvZE/v pe1zbxhC7rYsHfDr+65vayV6/AelRC1ynexpKTGiDSUJddWM6m/EpBQ/fCL/rFzq429v Ies5iUwKXbTH0oWxDVWR8sIqeA8DYXe/lkEy4V63Uw4u6nQcsA+Ux6uvLRFawF55WJKF XOOVx3bzHJaD8hdAwnT7WpEtelvVEmbKO0kap2TItCVTL5G24Prh+j14VtxOnPm8/QNR PKbWArQzkF2Aj28LuacMuelFJJFoV5OHawvWr39qMV+4vM0libGicCScHhvOfzhpSTP7 4Rzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469481; x=1705074281; 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=u+LOg4cE3e/L+FkF/kdo/NDds7gIy3v+MrTgt4iIEa4=; b=MlNPBC+zDVW46Hdqjz9Xwek47oLciFX+C6MibV17yQ7xTYlE4X1YAOZ7Q97OqBjAVz ObC5Tg6yiYA7A4zxs3cPpldujOnsNi2XPfbXz4ZnB8FDyq8bWJZ41baqiIN76xf2hnj4 3BFFS8Pqi6qAJ2vZsiIBMfBy8W3EJHNNdQ6t3WmhnFoUd58nanGB/WC5+3V9bG6dBPxG hNVrct319pX+aGQGWxwhhQB6tRr1bwgYwZD/0FJPTI1zsj6aPlUMCI7ZTHHqX96tM6XZ EPEKIU+d4+KarC5uRh5sJmxF4W+hwZ9S17Ixpv5U4JOFTVHywzqZQ1SVs6dce9Pg3EoP TrIw== X-Gm-Message-State: AOJu0YwfMgkU7XXSsgoXXWiO0qZJuZRMEuuGBIM5FQswviurfrLHBuVZ GHcEAQ6nssAHHx6FmdL4xWO/yu4FjXlMDjeGYLwYPbRdjH0= X-Google-Smtp-Source: AGHT+IEarfJTD405bI94EVCg55vrH/dVFfv8hgbjU6uLDA50z0vQRFzAKUVK9+a0lSmqXfes6+iuWw== X-Received: by 2002:a5d:6445:0:b0:337:4e86:ebe1 with SMTP id d5-20020a5d6445000000b003374e86ebe1mr837995wrw.42.1704469481467; Fri, 05 Jan 2024 07:44:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PULL 15/71] target/mips: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:08 +0100 Message-ID: <20240105154307.21385-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469636029100001 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-mips64 -cpu ? MIPS '4Kc' MIPS '4Km' MIPS '4KEcR1' MIPS 'XBurstR1' MIPS '4KEmR1' MIPS '4KEc' MIPS '4KEm' MIPS '24Kc' MIPS '24KEc' MIPS '24Kf' MIPS '34Kf' MIPS '74Kf' MIPS 'XBurstR2' MIPS 'M14K' MIPS 'M14Kc' MIPS 'P5600' MIPS 'mips32r6-generic' MIPS 'I7200' MIPS 'R4000' MIPS 'VR5432' MIPS '5Kc' MIPS '5Kf' MIPS '20Kc' MIPS 'MIPS64R2-generic' MIPS '5KEc' MIPS '5KEf' MIPS 'I6400' MIPS 'I6500' MIPS 'Loongson-2E' MIPS 'Loongson-2F' MIPS 'Loongson-3A1000' MIPS 'Loongson-3A4000' MIPS 'mips64dspr2' MIPS 'Octeon68XX' After it's applied: [gshan@gshan q]$ ./build/qemu-system-mips64 -cpu ? Available CPUs: 20Kc 24Kc 24KEc 24Kf 34Kf 4Kc 4KEc 4KEcR1 4KEm 4KEmR1 4Km 5Kc 5KEc 5KEf 5Kf 74Kf I6400 I6500 I7200 Loongson-2E Loongson-2F Loongson-3A1000 Loongson-3A4000 M14K M14Kc mips32r6-generic mips64dspr2 MIPS64R2-generic Octeon68XX P5600 R4000 VR5432 XBurstR1 XBurstR2 Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-16-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/cpu.h | 4 ---- target/mips/cpu-defs.c.inc | 9 --------- 2 files changed, 13 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 52f13f0363..1163a71f3c 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1235,10 +1235,6 @@ struct MIPSCPUClass { bool no_data_aborts; }; =20 -void mips_cpu_list(void); - -#define cpu_list mips_cpu_list - void cpu_wrdsp(uint32_t rs, uint32_t mask_num, CPUMIPSState *env); uint32_t cpu_rddsp(uint32_t mask_num, CPUMIPSState *env); =20 diff --git a/target/mips/cpu-defs.c.inc b/target/mips/cpu-defs.c.inc index c0c389c59a..fbf787d8ce 100644 --- a/target/mips/cpu-defs.c.inc +++ b/target/mips/cpu-defs.c.inc @@ -1018,15 +1018,6 @@ const mips_def_t mips_defs[] =3D }; const int mips_defs_number =3D ARRAY_SIZE(mips_defs); =20 -void mips_cpu_list(void) -{ - int i; - - for (i =3D 0; i < ARRAY_SIZE(mips_defs); i++) { - qemu_printf("MIPS '%s'\n", mips_defs[i].name); - } -} - static void fpu_init (CPUMIPSState *env, const mips_def_t *def) { int i; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470508; cv=none; d=zohomail.com; s=zohoarc; b=gnNEZNgTGVe/ng8O6atYWzm7NClQS2ZbtZwjFuUVoWAj6x+dRGf8ZqUpBkKLwE7/ao9N4S8LWPE6AXhwJ1yW8BvFVPvuk76OpzXQnsow9eJS/2G1XPnNGOZ54HX/Jf/HB27bAi+4GOBKh+PK0GtpSt8gAvU8Gs5JcBsHDAA6iO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470508; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yaDY8QYkk1W3Mtkw1yjFTsfcx0RHMGOL7zHOvOfrIZM=; b=BpysNCDSFfvkkQ8ovF1xqRSw665Mb/ucxUdCRT8A/byp9/egw8n7c/EXs0p1XMxUgfo3wavVeC1PUPWB1wqQgFKPu1b3dxWyiERW6aowWfD6Fg0+sejyuNFWloB0ipsc6yj7ROEYG9ycPuD5SO2n2dd7pdkxcE80iqABgWiRuJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470508162672.5957434690711; Fri, 5 Jan 2024 08:01:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmNW-0000Do-Hk; Fri, 05 Jan 2024 10:44: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 1rLmNU-00005Q-0u for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:56 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmNN-0003Mz-Fe for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:55 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40d88fff7faso14847945e9.3 for ; Fri, 05 Jan 2024 07:44:48 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id q17-20020a05600c46d100b0040e375604ecsm1940574wmo.31.2024.01.05.07.44.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469486; x=1705074286; 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=yaDY8QYkk1W3Mtkw1yjFTsfcx0RHMGOL7zHOvOfrIZM=; b=e0UxCDTe7uC6Btd804/EDt7+PG+Ds0D00DG/EVBQrzOpEe6+QkvJ0DdQ1yGT0xMxU0 9AtLoRfcZSHlExD4IvNCcjuOIrD/DiOpy0Stbt2tLIaf7aQ4PolGj5kVd0skddfr4qpn TtBXQYvfHcNPNDCVH6RgBaWkhxMwbOdKuym0iN7dE73005aeQgZojXflBXNwmiFUlhg4 KFIpm/iRGxopyZN21KKqOyt3rkPiQRfa7NFqw8uOmm6mb2saDC1sKiZQFQI97I+xWZdh Pa3l01zBGOt3podG0IFl4+5ZMxq56KJP+XERACQTScimEqejRxmXqOE7/EbpRCZhEhxk GCuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469486; x=1705074286; 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=yaDY8QYkk1W3Mtkw1yjFTsfcx0RHMGOL7zHOvOfrIZM=; b=Q8QLg8/wteogPgj8cztRQ1v5YmSyE5AgvrKb9M5aUn/yAqnt9U+zEmuYBKmEByQdnp JRuE2FYK3IYBXFj9atVX/MOU3ni6w7ZwgF5fCqAwgNoy71B0IltThCdVCWrgAdsTD6ub vHeqq6unauptb1GTr7eC1YsnlTi7nuulQdSXO5Rd66IB6RUtYr5Qo2wv1yd4yySQnbuk Sfm5mlnRfZg8oqfJPbjdv+7bMUQtkJE5gbxcXa7L1O9LpLNzXQZlb5pwME21DpOQOmeD HQG4z6CFLvXzjdMdzvWDqF4P6l4NxM34v7B1noCLzjzXMClUr+QOYtUs5NmqsWngTFti Y5mA== X-Gm-Message-State: AOJu0Yw7tzVE2/0T2DWMiajQgrCuD/Wzr5tWy/+nwYULq2o9gmrRhW8e LE7TK3CSK50sRzcoCdLrQSHNG14VJ/CVdxcgHWS+aJnuetQ= X-Google-Smtp-Source: AGHT+IHY0byHYmf47rQ0Ty7m/fu8y+dbBIzHFBSmQY01g5UcWP8GuA3ykeJeMDCIdpydsqIuGbE0Mg== X-Received: by 2002:a05:600c:450d:b0:40d:938e:6b49 with SMTP id t13-20020a05600c450d00b0040d938e6b49mr697221wmo.131.1704469486736; Fri, 05 Jan 2024 07:44:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Stafford Horne Subject: [PULL 16/71] target/openrisc: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:09 +0100 Message-ID: <20240105154307.21385-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=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=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470509343100001 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-or1k -cpu ? Available CPUs: or1200 any After it's applied: [gshan@gshan q]$ ./build/qemu-or1k -cpu ? Available CPUs: any or1200 Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-17-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/openrisc/cpu.h | 3 --- target/openrisc/cpu.c | 42 ------------------------------------------ 2 files changed, 45 deletions(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index dedeb89f8e..b454014ddd 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -299,15 +299,12 @@ struct ArchCPU { CPUOpenRISCState env; }; =20 -void cpu_openrisc_list(void); void openrisc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); int openrisc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg= ); int openrisc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void openrisc_translate_init(void); int print_insn_or1k(bfd_vma addr, disassemble_info *info); =20 -#define cpu_list cpu_openrisc_list - #ifndef CONFIG_USER_ONLY hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); =20 diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index f7d53c592a..381ebe00d3 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -253,48 +253,6 @@ static void openrisc_cpu_class_init(ObjectClass *oc, v= oid *data) cc->tcg_ops =3D &openrisc_tcg_ops; } =20 -/* Sort alphabetically by type name, except for "any". */ -static gint openrisc_cpu_list_compare(gconstpointer a, gconstpointer b) -{ - ObjectClass *class_a =3D (ObjectClass *)a; - ObjectClass *class_b =3D (ObjectClass *)b; - const char *name_a, *name_b; - - name_a =3D object_class_get_name(class_a); - name_b =3D object_class_get_name(class_b); - if (strcmp(name_a, "any-" TYPE_OPENRISC_CPU) =3D=3D 0) { - return 1; - } else if (strcmp(name_b, "any-" TYPE_OPENRISC_CPU) =3D=3D 0) { - return -1; - } else { - return strcmp(name_a, name_b); - } -} - -static void openrisc_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - const char *typename; - char *name; - - typename =3D object_class_get_name(oc); - name =3D g_strndup(typename, - strlen(typename) - strlen("-" TYPE_OPENRISC_CPU)); - qemu_printf(" %s\n", name); - g_free(name); -} - -void cpu_openrisc_list(void) -{ - GSList *list; - - list =3D object_class_get_list(TYPE_OPENRISC_CPU, false); - list =3D g_slist_sort(list, openrisc_cpu_list_compare); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, openrisc_cpu_list_entry, NULL); - g_slist_free(list); -} - #define DEFINE_OPENRISC_CPU_TYPE(cpu_model, initfn) \ { \ .parent =3D TYPE_OPENRISC_CPU, \ --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469713; cv=none; d=zohomail.com; s=zohoarc; b=crgjDU/Wj8BvvTk+p+LFrDTiHeX3ggdM8l6ACbGbjWikihydPxqTZxwbxj5lgTJnfCAuFUnJV7QluEEMn5Pn03kQyrC71Yok0j057UYZvAiU9J1/wojSjkbdcBCAOhp7C//i1Mj3wSVJrJurGtqLzds1zrW1Fe0Ymp17XPWzsmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469713; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VN0awrbP5OQORGwTdpI9FL1dvbQ4lYRKpoXyYpVskO4=; b=c39BYDa9cRLxsE7h6yYBtQBjTjbvXvU12vmiRcWX+uMkb4CGsCIFtcdJiVSiLxHtkfPofS96V+PO/5oHZppMJxfUZxzDnzMIBaNmi51h1DqEqL+WwWSBJIgPJKC+nGFT/b97YmSmAqjqY72DtDhA7wyRUGQo/jHLBxT93pPVodg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469713794710.2295306538965; Fri, 5 Jan 2024 07:48:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmNk-0000pA-7r; Fri, 05 Jan 2024 10:45: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 1rLmNc-0000Ty-UR for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:04 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmNU-0003OW-Lf for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:04 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d76923ec4so16150265e9.3 for ; Fri, 05 Jan 2024 07:44:55 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id l8-20020a05600c1d0800b0040d6e07a147sm1938605wms.23.2024.01.05.07.44.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469493; x=1705074293; 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=VN0awrbP5OQORGwTdpI9FL1dvbQ4lYRKpoXyYpVskO4=; b=uDsRx22HU9SPJoRjW5EZmUusQOdM5juuuem7KmvDmMSmC21ft5eSOz0A8EelsndkkL yvLdtQ5T2T5dbhwOguPxw3Ouh3UA/UpdLBm+TEOOIe49tUH1AuRvW3zrzVL3jIoooL4e jzNpbPbGf8tGzf4mf/SXHTAU92X1dEtMVbEQf7pNVk8nCIU1VLLBQBB4NdBA1weSdFXN yUPi88L7njaqphZbehhPVtUZ35GmpBYRKLrdWjxn4gx2whGjTNOyrFrnSatbH2H0EoT0 DEKT9FpnXTIpraEGR1sgDuot99Wd9068pIAYMUqsZ0ZXUzRirvhSiDEXdZl0Vr2CdhdD aERA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469493; x=1705074293; 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=VN0awrbP5OQORGwTdpI9FL1dvbQ4lYRKpoXyYpVskO4=; b=fGTzquMp0DMzEmkN2PAkJlRCfgJT/3fMpItXY3CfIGyov10xDC17ISSh16qaQWmFqQ 4t1D3FNh1I6cDhB4O8Xn/FZsWk7VN9U61Q4Ayt4zZ9oDrL5W0gWEvbQCLDMD8VCheK0O 7BbZG6E6WXiKHT2KvvpJQ5skUBMgzS9HJXTS4xdYb/za37itAA3AVRlGDWCzYOazSA4A PQQ/L8P5gx5JzLc6uSs6KnjqbKQS8RMzL+Az5Y9UrA1leuJR3EU7s3VLATwb6wNc+nsE xEzDkH0tvcm+Vc2hGsDwJz/kLbO35yffZ177H/qhUGOcW8SkzJZ48QPM2SyxQjkSYzFX VJyg== X-Gm-Message-State: AOJu0YxInElMEvChfoSBWgZoOCprLlkfHZ+ayY8jJyylxWDJognWUv5N e7aCR3FAnCcMGjvAhHdrxtEGkNbFXtd4SCt3Ezyu6jegqMg= X-Google-Smtp-Source: AGHT+IHWSYp2jY1eYlnMa1CbjWJHJImj2Iyob8urRls6KMAyBOW061rgsbEXlE4kBPy9kYveR9woYA== X-Received: by 2002:a05:600c:5487:b0:40d:877d:ca1 with SMTP id iv7-20020a05600c548700b0040d877d0ca1mr1218138wmb.54.1704469493513; Fri, 05 Jan 2024 07:44:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei Subject: [PULL 17/71] target/riscv: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:10 +0100 Message-ID: <20240105154307.21385-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469714233100001 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-riscv64 -cpu ? any max rv64 shakti-c sifive-e51 sifive-u54 thead-c906 veyron-v1 x-rv128 After it's applied: [gshan@gshan q]$ ./build/qemu-system-riscv64 -cpu ? Available CPUs: any max rv64 shakti-c sifive-e51 sifive-u54 thead-c906 veyron-v1 x-rv128 Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-18-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/cpu.h | 2 -- target/riscv/cpu.c | 29 ----------------------------- 2 files changed, 31 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index d74b361be6..2725528bb5 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -490,9 +490,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, in= t size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); char *riscv_isa_string(RISCVCPU *cpu); -void riscv_cpu_list(void); =20 -#define cpu_list riscv_cpu_list #define cpu_mmu_index riscv_cpu_mmu_index =20 #ifndef CONFIG_USER_ONLY diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 523e9a16ea..22d7422c89 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1733,35 +1733,6 @@ char *riscv_isa_string(RISCVCPU *cpu) return isa_str; } =20 -static gint riscv_cpu_list_compare(gconstpointer a, gconstpointer b) -{ - ObjectClass *class_a =3D (ObjectClass *)a; - ObjectClass *class_b =3D (ObjectClass *)b; - const char *name_a, *name_b; - - name_a =3D object_class_get_name(class_a); - name_b =3D object_class_get_name(class_b); - return strcmp(name_a, name_b); -} - -static void riscv_cpu_list_entry(gpointer data, gpointer user_data) -{ - const char *typename =3D object_class_get_name(OBJECT_CLASS(data)); - int len =3D strlen(typename) - strlen(RISCV_CPU_TYPE_SUFFIX); - - qemu_printf("%.*s\n", len, typename); -} - -void riscv_cpu_list(void) -{ - GSList *list; - - list =3D object_class_get_list(TYPE_RISCV_CPU, false); - list =3D g_slist_sort(list, riscv_cpu_list_compare); - g_slist_foreach(list, riscv_cpu_list_entry, NULL); - g_slist_free(list); -} - #define DEFINE_CPU(type_name, initfn) \ { \ .name =3D type_name, \ --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469951; cv=none; d=zohomail.com; s=zohoarc; b=AvZtIcK23Nftvenh9mRVZazR5jdHm/rel1qd3IFKK0Oqsy9aznJ5wXc++uQepfJzaoGNP0GFVuKFDxh90m59f0rnF/DnbaSjvmTmggzYwC/XZmL6HP6J8zWU6A10XwkLPxn480sF9MTW8lcPMZ5vewoGlC+X61Gp4Efn88ur/Ak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469951; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QZuAr3GGN/pOvffPY8+fLddBxJHGJfB6Dvfc17Jcg0E=; b=ZiQ2SyEzRB6DULhxq1yLVuOujNCRN/6ZbsswgZOFNkvTYDUQwYEfg58QLrBYhJ/Y9vbDtS0ioJOZ6ijMTyVNpR2wvuuqeoF+5BVeRph2+XnsW1lR8seGvKffURltz4yyZWn/a9AES40n+f6PglNvoipNhAi7HgXIYmz1V+i/Ohs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469951662928.4595670024299; Fri, 5 Jan 2024 07:52:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmNs-0000jE-0u; Fri, 05 Jan 2024 10:45: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 1rLmNc-0000TB-AS for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:04 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmNZ-0003PU-CF for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:03 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e3b43173eso2025055e9.1 for ; Fri, 05 Jan 2024 07:45:00 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id fl13-20020a05600c0b8d00b0040d8af75e19sm1958682wmb.24.2024.01.05.07.44.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469499; x=1705074299; 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=QZuAr3GGN/pOvffPY8+fLddBxJHGJfB6Dvfc17Jcg0E=; b=hQiB8IA1hhYuYpdQNeCxIID2eAzyigfnquvRK+W0GKHdvwtMiaE4WLwvzI58qlGIWN l5BeDm0XbIhRqlK3yHTMhPBVNtAGuRnd5jb4w0bi9vJS4ZJ6kQ4zftDEJzlwwv9/bUwx QqIiBRmLKqqXXcaytTmeWYTj5YQOelenLOqrPkKCN/F8Bv9P9Aj/0IPYdNrkHngA11Ow XW1ngewoFSpeB8+270VllBuriwO9XEsVZH6ZSFJ4xgwE3jyNPmIfcc5pyxEtf65EWv9k NMEGozYDQCbEqX9y+DYEjtJWRSY1YBAbGeh1kKvy7wi6wmZmxR7VUbUi50GJpM6Ee+r0 /DAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469499; x=1705074299; 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=QZuAr3GGN/pOvffPY8+fLddBxJHGJfB6Dvfc17Jcg0E=; b=fK3qHfg1NFJzO0oCGoI3ovr3h1NWINnkXxmWavlBOBthemG9q7c/YN5Hf8h8wPMiHl CPV7tZYKeKCG8KUtCJAAx+anLPbxgwsXATQ0LPUVMelxnEz30TixBrUapOjY2nBFG+5A Vu08zmJBQOIg5wB+PDD+ZINFP9kLBUy6c2h6dOVT3/B3qmwcAep8a8S11dPzSR5fBH/U Ac//5+SpRa24aH7vNaJnAobzTbIbKxro/EB9K0maCd+Bdoe8T32/qzqfLbYLww/cJGdg 8NIo475TjcWqvee2R/4oXpIGszWvFqjFSnKKYuFP2dHGfih3lAmRgXnT+u7GxWaoo6aS u1tg== X-Gm-Message-State: AOJu0YznMbJWUIYfQDUCafuTib7qHZ9Ovw6CGcDD4qAkBXg35XhoUO1n GkB2fDAbFiQFa646vB9FHWQwyP4ft2JNIGj77XOUtrAVA/E= X-Google-Smtp-Source: AGHT+IGny8+SWTY6U144UBNwNlW/E/DP/64K/J5QwVFnNt0tgleVhyFrf3a592It1vnOgIMtqfPFDQ== X-Received: by 2002:a05:600c:510e:b0:40d:190c:160f with SMTP id o14-20020a05600c510e00b0040d190c160fmr885239wms.110.1704469499779; Fri, 05 Jan 2024 07:44:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yoshinori Sato Subject: [PULL 18/71] target/rx: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:11 +0100 Message-ID: <20240105154307.21385-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469952501100001 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-rx -cpu ? Available CPUs: rx62n-rx-cpu After it's applied: [gshan@gshan q]$ ./build/qemu-system-rx -cpu ? Available CPUs: rx62n Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-19-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/rx/cpu.h | 3 --- target/rx/cpu.c | 16 ---------------- 2 files changed, 19 deletions(-) diff --git a/target/rx/cpu.h b/target/rx/cpu.h index e931e77e85..65f9cd2d0a 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -139,11 +139,8 @@ int rx_cpu_gdb_read_register(CPUState *cpu, GByteArray= *buf, int reg); int rx_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); =20 void rx_translate_init(void); -void rx_cpu_list(void); void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte); =20 -#define cpu_list rx_cpu_list - #include "exec/cpu-all.h" =20 #define CPU_INTERRUPT_SOFT CPU_INTERRUPT_TGT_INT_0 diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 9cc9d9d15e..c5ffeffe32 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -89,22 +89,6 @@ static void rx_cpu_reset_hold(Object *obj) set_flush_inputs_to_zero(1, &env->fp_status); } =20 -static void rx_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - - qemu_printf(" %s\n", object_class_get_name(oc)); -} - -void rx_cpu_list(void) -{ - GSList *list; - list =3D object_class_get_list_sorted(TYPE_RX_CPU, false); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, rx_cpu_list_entry, NULL); - g_slist_free(list); -} - static ObjectClass *rx_cpu_class_by_name(const char *cpu_model) { ObjectClass *oc; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469657; cv=none; d=zohomail.com; s=zohoarc; b=mPMZKSmXmqOOwGscfEHUrxXEZJ+QooFsgWMqu1B1hYQG0y6wstDig13l4WVKwX6+zADaEi3XtI/Kg//jVOkufbfFf4xUKaJmfEs50Vhs24Eg7wTeacy0AH4aadVu5Pv08fckSVUF8e7VIxIJeSkj4E9/MIJuCnom5T9zg+pII88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469657; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=24gk9foSLxYRl9r29iWk8lo8oQhlMpaHzfjXYQc2w0g=; b=IKZjLPbQ7/fk4+JwuNBP7zuYQLTvwxb/B4x5dsMIclnIA8ulxlEIo3EA/A9CNDN4mhQpzj/nZwEU+EGLJQpBaqL4d0JzR8pRzNISNgcqnCxFjIEjjO9wWu44RmAVGT21vddpThvPx1BrUImSR/foYMbmHLba1emOna0Dd2iT3wM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469657088394.02850821285256; Fri, 5 Jan 2024 07:47:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmP9-0002jF-Qb; Fri, 05 Jan 2024 10:46: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 1rLmNl-0000x6-7X for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:20 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmNh-0003c9-Pu for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:12 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40d858c56cbso19542055e9.2 for ; Fri, 05 Jan 2024 07:45:06 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id g11-20020a05600c310b00b0040d94b65342sm1915385wmo.48.2024.01.05.07.45.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469505; x=1705074305; 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=24gk9foSLxYRl9r29iWk8lo8oQhlMpaHzfjXYQc2w0g=; b=Z0Za4Xu/w0dNjdmtf3ySVKB5dtUAAFIYjkirdl65q6kjc8SqOYSu0x8AHH53VoBcYP DxEtSaBVn8e+hbzgf3M94NDMvVUf+XdyF2Ta8pxuBZ/Tfn66M2CFd8NSfe7CkHwKfAfX cX7PPOfmkdKUJj9rASrpe07m0YMR07g1ysWqsHLbUg8jImO5IPoNRmGMN7VHCSFf5Xzc X6Qnf0z6D5UyBZcFDMXx0Hq7jFC/pWA0YC0JK0dnyyPhnbT8/A01Phh6SIe+DSb93422 FQLV+aRYxPcGdQeOeo+Gv+3q1xZjY5YKqphgBxxbQuYCCOKDzJLuTxgMGoCzcxpD34sL r5Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469505; x=1705074305; 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=24gk9foSLxYRl9r29iWk8lo8oQhlMpaHzfjXYQc2w0g=; b=KoWOyktMFSkBiE1XpSVSmibBT/DfipktDm/Kzmj5PZm71CGhPH6TsKqso6DsIIgoAn r9SScIb548MkXefZTkonTMaJsazIniGmtd8wsI7FzjiwQRNpZGWvoVoHl/kIbUevWFxs UifiBTFv3fnBru5R3baTpFjjsipQ0kXLVgnDU12PNuC5ms9mLjimNZ5JhgNogCskGDZF fc02dCXtgvlefneIL9+wLRuuYEoxFemgTZns8NOj/UcPz0MDPiGEY9/qlv7KH2wfdFDr lRKT1hhBi4Vqfsp33RtXBUR6UP5vRsB6lYKj4mhA3aVYLEO/G9vD442bVsGGu4SIAANw R+tA== X-Gm-Message-State: AOJu0YwsTVVYrfmVIu6ihqVhH0Y0C6N2RCj+P/NjvtuocP9b6fMSMnMi 9iDMKHprWCfZJUfKv6j3ORY39rXNaHGWRYq0synrf5t8exg= X-Google-Smtp-Source: AGHT+IF9Hyrc8xX9hjDg+0Xi42zw0SlUymSR/8Z5AOHy5liOxnJ81syNtIPExDT6wZVX6DmjPJst1Q== X-Received: by 2002:a05:600c:1d17:b0:40d:850b:a19e with SMTP id l23-20020a05600c1d1700b0040d850ba19emr1407108wms.82.1704469505433; Fri, 05 Jan 2024 07:45:05 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yoshinori Sato Subject: [PULL 19/71] target/sh4: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:12 +0100 Message-ID: <20240105154307.21385-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469657856100017 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-sh4 -cpu ? sh7750r sh7751r sh7785 After it's applied: [gshan@gshan q]$ ./build/qemu-system-sh4 -cpu ? Available CPUs: sh7750r sh7751r sh7785 Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-20-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sh4/cpu.h | 3 --- target/sh4/cpu.c | 17 ----------------- 2 files changed, 20 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 031dc0b457..0e6fa65bae 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -238,7 +238,6 @@ G_NORETURN void superh_cpu_do_unaligned_access(CPUState= *cpu, vaddr addr, uintptr_t retaddr); =20 void sh4_translate_init(void); -void sh4_cpu_list(void); =20 #if !defined(CONFIG_USER_ONLY) hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); @@ -272,8 +271,6 @@ void cpu_load_tlb(CPUSH4State * env); =20 #define CPU_RESOLVING_TYPE TYPE_SUPERH_CPU =20 -#define cpu_list sh4_cpu_list - /* MMU modes definitions */ #define MMU_USER_IDX 1 static inline int cpu_mmu_index (CPUSH4State *env, bool ifetch) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index a8ec98b134..806a0ef875 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -122,23 +122,6 @@ static void superh_cpu_disas_set_info(CPUState *cpu, d= isassemble_info *info) info->print_insn =3D print_insn_sh; } =20 -static void superh_cpu_list_entry(gpointer data, gpointer user_data) -{ - const char *typename =3D object_class_get_name(OBJECT_CLASS(data)); - int len =3D strlen(typename) - strlen(SUPERH_CPU_TYPE_SUFFIX); - - qemu_printf("%.*s\n", len, typename); -} - -void sh4_cpu_list(void) -{ - GSList *list; - - list =3D object_class_get_list_sorted(TYPE_SUPERH_CPU, false); - g_slist_foreach(list, superh_cpu_list_entry, NULL); - g_slist_free(list); -} - static ObjectClass *superh_cpu_class_by_name(const char *cpu_model) { ObjectClass *oc; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469678; cv=none; d=zohomail.com; s=zohoarc; b=gDO9IVdzIV6oNgTQJNAXxHCI0AL6nxYz+Q3ys6Lw8J7gMS42/e5NMc/Ktp+9tvhilXeqiCRYM7aWA6dn74F1dYjx7iP4Bs+dlnQn4gna8av5MVrKlSP6rzbI3YvdiKyKVc9rJvHqGMU35Pl88b5+oVm4rKxmxJ0SU3dnuULK1yY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469678; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=35Qj0GQ7d4D1oUKsUxN1TKydmHhPRhj2Vw6etTCLPUc=; b=kQuDo9AS+bJOHHyIo9nTnpow4H17GdrdeuNg919p88f4mExwUrwULIAhaKjWUBlfpnKxo0jp5G9SFSpgfXPqS1x57mGroUqMqV8+eumhHHcleBSzF0ZumeLhPogBKMKBSBzMxwDtlD/TF07tG1d9jlmf8QSaWOaahY1L02ZTRnI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170446967814685.87935662647749; Fri, 5 Jan 2024 07:47:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPC-0002yJ-6l; Fri, 05 Jan 2024 10:46:42 -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 1rLmNv-0001K3-4s for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:24 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmNs-0003hg-71 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:22 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40d2e56f3a6so4014495e9.1 for ; Fri, 05 Jan 2024 07:45:18 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id i1-20020a05600c354100b0040d8ff79fd8sm1942471wmq.7.2024.01.05.07.45.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:45:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469517; x=1705074317; 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=35Qj0GQ7d4D1oUKsUxN1TKydmHhPRhj2Vw6etTCLPUc=; b=SXSzjN5zWyCXIfuZZULVsIf/YAdeDLpQCLtYiKQhEQtIHCOg/tCEsdJN/o+54bniXf yxCOPKOOmUMnEo+/5umcL85i2lGcovdlzX8xbcn9evrNe7kQR+4piIgVl1P9rldaiL9f Y10HYqmNWsjYgE/jhxw8Owjwv+s62l145nLxzWuyOZBAHgSyOfQ1VVmttTr6ns2New1C o8N0VNsBPdGTbDdABtt5Z4wW67LwmimbgAuCpVl7ZEe368NIYezMmtJ04nlc7koX8rmt gt8CHJ4ZFgksOIBFouDmTwHKsIg+Xy5CnWtA5RBSrstj4WzONT+nHi9cy7BdQI4oR7D6 66mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469517; x=1705074317; 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=35Qj0GQ7d4D1oUKsUxN1TKydmHhPRhj2Vw6etTCLPUc=; b=rI1PjeWD7HPnLNdjd/pv+ks14VynZnZDXcmh48ar9WE0uSKN4DiJrVxV2w0tY6j6p6 IojGqhdjfIkkMKF7zgfV0JHHHtNJ23oXix4v6p582xZ+gVGFmrkPE4avyvaNThQ7CRnc 5NDcpFGuqSy8ebSnwkC44erfo+6+1bbu7nhDGE2idpkN2Xx2gTTzCuAadGjgKOX1HNoO /beCDF187zW0ijGy9Cg19GyMHQNSYe7Sn5QSjTo4jeRWmNmVvb3afCUut4VbEvMBi/v8 ujeBk/ctp2Fq3wnEWCS9Wpz8FWQfu+QBmUpHHEchoXesUAI+FcPsZGLVK92c5DZHkFyB zxFA== X-Gm-Message-State: AOJu0YwK431/0YqEDl2g+u2f8i20qNYjn32GVNWS4wnhdjMbgLOh1aim rhtUmaXAr4w9YJDRjtu54mX9w8q25FPkDXMXmsERZ1iu0dk= X-Google-Smtp-Source: AGHT+IFe4K4/RmO4+KF8oeY7r8n8T6mIXktmgY9KuOOOsrOrRMOXl/6b9lN4Esrd8XfJmPp0isCgPg== X-Received: by 2002:a05:600c:3482:b0:40d:922c:3fa2 with SMTP id a2-20020a05600c348200b0040d922c3fa2mr1276114wmq.166.1704469517228; Fri, 05 Jan 2024 07:45:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bastian Koppelmann Subject: [PULL 20/71] target/tricore: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:13 +0100 Message-ID: <20240105154307.21385-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469679896100001 From: Gavin Shan No changes in the output from the following command. [gshan@gshan q]$ ./build/qemu-system-tricore -cpu ? Available CPUs: tc1796 tc1797 tc27x tc37x Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231114235628.534334-21-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/tricore/cpu.h | 4 ---- target/tricore/helper.c | 22 ---------------------- 2 files changed, 26 deletions(-) diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index de3ab53a83..2d4446cea5 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -246,10 +246,6 @@ void fpu_set_state(CPUTriCoreState *env); =20 #define MMU_USER_IDX 2 =20 -void tricore_cpu_list(void); - -#define cpu_list tricore_cpu_list - static inline int cpu_mmu_index(CPUTriCoreState *env, bool ifetch) { return 0; diff --git a/target/tricore/helper.c b/target/tricore/helper.c index 7e5da3cb23..174f666e1e 100644 --- a/target/tricore/helper.c +++ b/target/tricore/helper.c @@ -96,28 +96,6 @@ bool tricore_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, } } =20 -static void tricore_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - const char *typename; - char *name; - - typename =3D object_class_get_name(oc); - name =3D g_strndup(typename, strlen(typename) - strlen("-" TYPE_TRICOR= E_CPU)); - qemu_printf(" %s\n", name); - g_free(name); -} - -void tricore_cpu_list(void) -{ - GSList *list; - - list =3D object_class_get_list_sorted(TYPE_TRICORE_CPU, false); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, tricore_cpu_list_entry, NULL); - g_slist_free(list); -} - void fpu_set_state(CPUTriCoreState *env) { switch (extract32(env->PSW, 24, 2)) { --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469687; cv=none; d=zohomail.com; s=zohoarc; b=n72lIvOSGISTaF1XUU0bMeMtdEwqpdIDJS8kPETb1AGRY3luxD2BTvqi7vVW7KDixTHtqk2LYN2a7h8yxIdGzy3/VrQ47hnd4T6D7nWfWYACcGVJRDc897hOtL2zXmNr7/p76lPxJvyvMKR8bAue3Hz19e8b2TDP1GdqAjvWlgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469687; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=amIzVl4R3+PRNgzKiNHopIA/d217u9I/36YG2i2vTZM=; b=CaqUrtxNTxa0pZYUL50Y1egUKVWVkftdiu25iYFtOVeSKM6lCgYRSW2rrpsSIM2NRduRm9c74M/fdftrSvCIIJLPKs5wr3B4Go2+eHjkvEJENTCqRmyGSrnhTx8fqYEQGxLCs+Lplq+DUn6jlz3wv90ycQ2vWlSOUSkAEpzgAR0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469687147171.28316505385374; Fri, 5 Jan 2024 07:48:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPC-0002zZ-CN; Fri, 05 Jan 2024 10:46:42 -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 1rLmO2-0001NS-NK for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:35 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmNy-0003jr-PR for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:30 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-337520892f7so389818f8f.0 for ; Fri, 05 Jan 2024 07:45:25 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id w15-20020adfe04f000000b00336471bc7ffsm1592013wrh.109.2024.01.05.07.45.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:45:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469524; x=1705074324; 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=amIzVl4R3+PRNgzKiNHopIA/d217u9I/36YG2i2vTZM=; b=jo4c14uMlTmfF7eTggkWu51n178e1EZRoMEUHTEbJi2FO0JGfgbLcSV8d4fTEzouPc uZ75aS29g4RJRozIdJQmXqC8F5pxlC32ao+vUeZZQFmdvgVHcLAXS1dC3AMCUOduJ0ir Gv6cgk783qjPXF2Lrga1PYOFRfmRV2D6yOF+bw+JIitCKGkYolpU8pbN3onp4kRVHvdI 3088w1Syvt1/9ce1RN3SbCkaJ09m8+0x2F+Kc1dgW0nV4TxFkMOOgPYfhDgZTMbIJ3b1 gs2Bvsz22P7LnoCCG4IHrvMA4IrbxeCidQU7fKV6M8fFIJuYDj7d7/j3bILKR/QYqJ1+ cYMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469524; x=1705074324; 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=amIzVl4R3+PRNgzKiNHopIA/d217u9I/36YG2i2vTZM=; b=S6jJF0RF2PZnNOsZ6PTMUyorqqSBYzVyGRK2lPXIT2tT87fQ+/TznuZ7EKYbD/Ao0G H8Cm839ZILGWOFROY8DjpOXV/IbbZg9t/0pyLgcWfBXvLqf3txF76ifwMnDKwpHw2D7z YGeDORQ2xLncKikNVOJYNJiy14uLXRhs62cXSuZLIDo5M4h/g2NWrrEygj2vlOeKpWjy kgjA7HZuKbifcl3i+AEbbNdi8MypphEClZbJflFdAdLE2owbPwIA+DUdQ2HJwFrbYjem qDvw7D7AvzgxAHB1QWv0BdoCe7Y82VFDyxNbVkyUFaXaLecKUY7egISEdp70Uv/w7sWd 7Q4w== X-Gm-Message-State: AOJu0YxO0m7VRtle7sok6ZWfrESdNMIcNsto0Flbrh5XDXvaokCOY32O fwv+u9ZFXH4bN4Rhl/zCJYQKmOnMsijlZGv4Vf6l22RRhSg= X-Google-Smtp-Source: AGHT+IGqufJs3Mill6aJTL/2a2/pz7WmfNQLIUSgYOYhQoGFbsfG9/6rCYzCbj6/n2jSFigkySsbxg== X-Received: by 2002:a05:600c:34c7:b0:40d:5ae4:a487 with SMTP id d7-20020a05600c34c700b0040d5ae4a487mr1247589wmq.25.1704469524057; Fri, 05 Jan 2024 07:45:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov Subject: [PULL 21/71] target/xtensa: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:14 +0100 Message-ID: <20240105154307.21385-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469687925100003 From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-xtensa -cpu ? Available CPUs: test_mmuhifi_c3 sample_controller lx106 dsp3400 de233_fpu de212 dc233c dc232b After it's applied: [gshan@gshan q]$ ./build/qemu-system-xtensa -cpu ? Available CPUs: dc232b dc233c de212 de233_fpu dsp3400 lx106 sample_controller test_mmuhifi_c3 Signed-off-by: Gavin Shan Message-ID: <20231114235628.534334-22-gshan@redhat.com> [PMD: Split patch in 2, only include the "Use generic cpu_list" change] Message-ID: <51ffd060-b2f8-405c-83e1-a0663c0183f5@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/xtensa/cpu.h | 3 --- target/xtensa/helper.c | 9 --------- 2 files changed, 12 deletions(-) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index dd81729306..d9c49a35fa 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -600,8 +600,6 @@ G_NORETURN void xtensa_cpu_do_unaligned_access(CPUState= *cpu, vaddr addr, MMUAccessType access_type, = int mmu_idx, uintptr_t retaddr); =20 -#define cpu_list xtensa_cpu_list - #define CPU_RESOLVING_TYPE TYPE_XTENSA_CPU =20 #if TARGET_BIG_ENDIAN @@ -626,7 +624,6 @@ void check_interrupts(CPUXtensaState *s); void xtensa_irq_init(CPUXtensaState *env); qemu_irq *xtensa_get_extints(CPUXtensaState *env); qemu_irq xtensa_get_runstall(CPUXtensaState *env); -void xtensa_cpu_list(void); void xtensa_sync_window_from_phys(CPUXtensaState *env); void xtensa_sync_phys_from_window(CPUXtensaState *env); void xtensa_rotate_window(CPUXtensaState *env, uint32_t delta); diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index dbeb97a953..f6632df646 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -234,15 +234,6 @@ void xtensa_breakpoint_handler(CPUState *cs) } } =20 -void xtensa_cpu_list(void) -{ - XtensaConfigList *core =3D xtensa_cores; - qemu_printf("Available CPUs:\n"); - for (; core; core =3D core->next) { - qemu_printf(" %s\n", core->config->name); - } -} - #ifndef CONFIG_USER_ONLY void xtensa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469654; cv=none; d=zohomail.com; s=zohoarc; b=In+XGj2GBmba+w6lpGELDq/VdIcq1jiniuVJE/E2Oyfi5yt4B358S7DkCl6qjmoFsws6EfdX/DfxEszKLHSTRMvZ+74MKBvmqlxYOzHxjIkvE2HpbSeoTdVoY4uEb5f7NuveeLXNsVN5Nxl3N1rJfTjV6vXK9JNZqlFHUvq+69I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469654; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e4mZu4dIothIAeIYl7XbtHN8Q7Ylsc498FBOxXuUI0M=; b=La03nKstbZzQ/vn0EkJQIUoGxAAFsFQBPHL7+4xDv0gc8th26U+QziPSeeiRxGK9w3I9w2lJMDPhkxTqGuGCEAkgkWduAO9EWVPC7Rn+nS8zjNLb72yxP+i1iD2s8KpDPCGP8AequCGiiJAR3sEPoX7GSwWyBMA5XvekluxCLng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170446965475123.933072133844803; Fri, 5 Jan 2024 07:47:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPF-0003HG-2y; Fri, 05 Jan 2024 10:46: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 1rLmOG-0001Tm-H9 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:57 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmOE-0003lb-G8 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:45:44 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40d76923ec4so16157925e9.3 for ; Fri, 05 Jan 2024 07:45:40 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id p11-20020a05600c468b00b0040d81ca11casm1930040wmo.28.2024.01.05.07.45.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469539; x=1705074339; 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=e4mZu4dIothIAeIYl7XbtHN8Q7Ylsc498FBOxXuUI0M=; b=HH2M+j4yRxWzQcnuQvd5Y/pUTR+1/p1Y2UdaJ6hbg9KQ4DP94ihA8QEvcVHoqzAFUY m6O4jdu1aPujtudvL8mX4+zdeif6w/9+jYsFxkpSATRzjxYLvWLsHEbU8fsXpzb2hma/ Qok1uLqIBr6PQhkc2VPbwPLTD9wgqOFNi8jAFBcnwYD7R6W+NhST/5wSoIJgs1oy0EIq kosYve95eJM13WZgIeHUC6xQxnfmwG7a8KIOIWOE4xZX2i3oA8T1BaEAVQt+Z9dzElIT vjufjMlLkWwhvIARBhsxNfuJ8EgINQEIEFPoOg1GXX+k6h5hyjLNTX8Aj2YtUJW4uU4o +owg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469539; x=1705074339; 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=e4mZu4dIothIAeIYl7XbtHN8Q7Ylsc498FBOxXuUI0M=; b=aPz5kVpuVYNX6Nup0OERi1vsR6Ar7XgXfTuvfiVTI57wi9465gEz+afLwE4rx5Hl/m RlxPH5CMS6g78FK0yErleZ5BPXmgmSyCWVW7423w56j//EBtg9JVFbv3n+iPQqdjSqls Ffkt/HQLnCDwwUjU5Pc5+xmm4VZYp8otb7D1AvBGq9xKjJlLh+8UKU7epKmYjI9xA+Zg pKGmzNtFJf9m+kYX7tN9UVIBNBaca6NfNSDW5OsgCLvWy2Yq7LeSBpDxMtJvd8NeaOWJ S6+pBAHU/f9+1BYy+Dsmiq+BangAF7us5EDRiVM7UkZR9O/Ibxx9VU5XwivI6/ma7/a6 nRXw== X-Gm-Message-State: AOJu0YxSNjzUH1TL+uZ4vCZ2963vUYYWTgNkeAB+d0OYWDsL1QG5e5Sm 1t2nv9s/2D6OacIcD4COWw5+NjZXsOKg60RxHiRzOp52HfI= X-Google-Smtp-Source: AGHT+IFcVp0qR9MGObXw9lQNSxmy+uatTj5gwKdD6WMxmUrW8rksiYX3pMmatWQHOxh1RrOMRB/8nQ== X-Received: by 2002:a05:600c:5487:b0:40d:877d:ca1 with SMTP id iv7-20020a05600c548700b0040d877d0ca1mr1218741wmb.54.1704469539200; Fri, 05 Jan 2024 07:45:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell , Paolo Bonzini , Song Gao , Huacai Chen , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei Subject: [PULL 22/71] target: Use generic cpu_model_from_type() Date: Fri, 5 Jan 2024 16:42:15 +0100 Message-ID: <20240105154307.21385-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469655846100003 From: Gavin Shan Use generic cpu_model_from_type() when the CPU model name needs to be extracted from the CPU type name. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231114235628.534334-23-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/arm-qmp-cmds.c | 3 +-- target/i386/cpu.c | 3 +-- target/loongarch/loongarch-qmp-cmds.c | 3 +-- target/mips/sysemu/mips-qmp-cmds.c | 3 +-- target/ppc/cpu_init.c | 3 +-- target/ppc/ppc-qmp-cmds.c | 3 +-- target/riscv/cpu.c | 3 +-- target/riscv/riscv-qmp-cmds.c | 3 +-- 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index b53d5efe13..2250cd7ddf 100644 --- a/target/arm/arm-qmp-cmds.c +++ b/target/arm/arm-qmp-cmds.c @@ -237,8 +237,7 @@ static void arm_cpu_add_definition(gpointer data, gpoin= ter user_data) =20 typename =3D object_class_get_name(oc); info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strndup(typename, - strlen(typename) - strlen("-" TYPE_ARM_CPU)); + info->name =3D cpu_model_from_type(typename); info->q_typename =3D g_strdup(typename); =20 QAPI_LIST_PREPEND(*cpu_list, info); diff --git a/target/i386/cpu.c b/target/i386/cpu.c index fd47ee7def..2524881ce2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1744,8 +1744,7 @@ static char *x86_cpu_class_get_model_name(X86CPUClass= *cc) { const char *class_name =3D object_class_get_name(OBJECT_CLASS(cc)); assert(g_str_has_suffix(class_name, X86_CPU_TYPE_SUFFIX)); - return g_strndup(class_name, - strlen(class_name) - strlen(X86_CPU_TYPE_SUFFIX)); + return cpu_model_from_type(class_name); } =20 typedef struct X86CPUVersionDefinition { diff --git a/target/loongarch/loongarch-qmp-cmds.c b/target/loongarch/loong= arch-qmp-cmds.c index 645672ff59..ec33ce81f0 100644 --- a/target/loongarch/loongarch-qmp-cmds.c +++ b/target/loongarch/loongarch-qmp-cmds.c @@ -22,8 +22,7 @@ static void loongarch_cpu_add_definition(gpointer data, g= pointer user_data) CpuDefinitionInfo *info =3D g_new0(CpuDefinitionInfo, 1); const char *typename =3D object_class_get_name(oc); =20 - info->name =3D g_strndup(typename, - strlen(typename) - strlen("-" TYPE_LOONGARCH_CP= U)); + info->name =3D cpu_model_from_type(typename); info->q_typename =3D g_strdup(typename); =20 QAPI_LIST_PREPEND(*cpu_list, info); diff --git a/target/mips/sysemu/mips-qmp-cmds.c b/target/mips/sysemu/mips-q= mp-cmds.c index 6db4626412..7340ac70ba 100644 --- a/target/mips/sysemu/mips-qmp-cmds.c +++ b/target/mips/sysemu/mips-qmp-cmds.c @@ -19,8 +19,7 @@ static void mips_cpu_add_definition(gpointer data, gpoint= er user_data) =20 typename =3D object_class_get_name(oc); info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strndup(typename, - strlen(typename) - strlen("-" TYPE_MIPS_CPU)); + info->name =3D cpu_model_from_type(typename); info->q_typename =3D g_strdup(typename); =20 QAPI_LIST_PREPEND(*cpu_list, info); diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 40fe14a6c2..344196a8ce 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7036,8 +7036,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointe= r user_data) return; } =20 - name =3D g_strndup(typename, - strlen(typename) - strlen(POWERPC_CPU_TYPE_SUFFIX)); + name =3D cpu_model_from_type(typename); qemu_printf("PowerPC %-16s PVR %08x\n", name, pcc->pvr); for (i =3D 0; ppc_cpu_aliases[i].alias !=3D NULL; i++) { PowerPCCPUAlias *alias =3D &ppc_cpu_aliases[i]; diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c index f9acc21056..c0c137d9d7 100644 --- a/target/ppc/ppc-qmp-cmds.c +++ b/target/ppc/ppc-qmp-cmds.c @@ -181,8 +181,7 @@ static void ppc_cpu_defs_entry(gpointer data, gpointer = user_data) =20 typename =3D object_class_get_name(oc); info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strndup(typename, - strlen(typename) - strlen(POWERPC_CPU_TYPE_SUFF= IX)); + info->name =3D cpu_model_from_type(typename); =20 QAPI_LIST_PREPEND(*first, info); } diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 22d7422c89..b07a76ef6b 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -657,8 +657,7 @@ char *riscv_cpu_get_name(RISCVCPU *cpu) =20 g_assert(g_str_has_suffix(typename, RISCV_CPU_TYPE_SUFFIX)); =20 - return g_strndup(typename, - strlen(typename) - strlen(RISCV_CPU_TYPE_SUFFIX)); + return cpu_model_from_type(typename); } =20 static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags) diff --git a/target/riscv/riscv-qmp-cmds.c b/target/riscv/riscv-qmp-cmds.c index 2f2dbae7c8..c5551d2cfe 100644 --- a/target/riscv/riscv-qmp-cmds.c +++ b/target/riscv/riscv-qmp-cmds.c @@ -44,8 +44,7 @@ static void riscv_cpu_add_definition(gpointer data, gpoin= ter user_data) const char *typename =3D object_class_get_name(oc); ObjectClass *dyn_class; =20 - info->name =3D g_strndup(typename, - strlen(typename) - strlen("-" TYPE_RISCV_CPU)); + info->name =3D cpu_model_from_type(typename); info->q_typename =3D g_strdup(typename); =20 dyn_class =3D object_class_dynamic_cast(oc, TYPE_RISCV_DYNAMIC_CPU); --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469666; cv=none; d=zohomail.com; s=zohoarc; b=BOcUv8T9hXO09eilMw08j0C6R9gW/230uaj/GBO2+yowA+LEmbN+o4Dhg2Gm3j0S/sD5x/fXm5Bm3IdqReXvyJE9mgcGCi8LBDLF+McwONEd2NEbJMDKvuZOPihCsVPJWYVcaF65rdwpkEo7cdK0F6YVrdRGdwgNw1P1VEoiTc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469666; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3jkeu47vffO/ERd6kLypsT3czQKlKT7aS4JG6Pky2DY=; b=J+aPMpOMvTzE95xulcls3nvnsHM/9dghdPsY+KznwlNJ5M5e4gdL1UTBgxc4uz/+aNOE0KYUtbbHDUbbuB5MGRunKBTPaOV4Z61HIK8Adp4VUtPklDeLvFJXEaQdSKGu7N8o3z6+YjIja7motpPE60ctD4sdpCTPxRgTgduAGqA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469665992455.4585285801285; Fri, 5 Jan 2024 07:47:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPJ-0003j0-Fz; Fri, 05 Jan 2024 10:46:49 -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 1rLmOa-0001iO-P6 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:06 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmOU-0003mg-Tu for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:01 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3367632ce7bso1226428f8f.2 for ; Fri, 05 Jan 2024 07:45:50 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id d7-20020adfe2c7000000b00336d24b4847sm1592885wrj.114.2024.01.05.07.45.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469549; x=1705074349; 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=3jkeu47vffO/ERd6kLypsT3czQKlKT7aS4JG6Pky2DY=; b=h9EycmOGdrNO5rvwWd01oYWHv05fzv3TQOZuWVJE4irUf8D6knzOusi9vZM65kRooH BEm9jur62/mXsreihLsy0Ttwdqcp6z8LIde3lXEc6xdDoz/dJhY32YF4Yx1slTjbfU/y XD3f1tVWwy3d+lsa3TQD0TtFURSS4fvcSiW6s6TvHWtpQfgghuaCSAoCYOmBNKht3aDc HbttmLSi7tlKkplwsxdxnnhu8F/YZ8CS08Tea+Pwx49ZGs9oHyd0WCxZVjeKYSuGPluZ eZS8RDARtOWdy8jD9QopSseYJuZWLC0lSd3ghyYrIZM1d0AYuvJTLPHdmMbO6/Sj246l NDdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469549; x=1705074349; 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=3jkeu47vffO/ERd6kLypsT3czQKlKT7aS4JG6Pky2DY=; b=mnWQtfd3l/bvBpKqBVhyLknSEAZPiqCju0tgYiqSuI12Xk5QMNE0TMRQARSgZEMZw+ oAWH+LXKsmVieIFog6Dj/rh+hTYQ8sI+JhBvIwT/vSf7vTjRQAPBqMqHPp8UF6CklAj5 wfxKID5wiasSXfhl/QMRYhmeuQxeEi/Lraaenxwt+SbFlqXbFafpRjRM1MACiWBpWYi9 RvrLJ9CFOB1Os/MBXyjTHOy1xJ9XN5+XspbeJTLoNG8dJIfNKI/2FlwTOnobb5b+Vh5/ uXOk/70PykpNsAyc+lztUomkBYWZNh9Ck38Apm3b40hO5ZrwH7n4MoQD3ve9KqQC9JnQ bGlg== X-Gm-Message-State: AOJu0Yy5m2FNcFjoy/RwZn9vaRL9cLL7I6ALsYH7Noz78XH3Lk4rwU5s vWZ3mbs5a88I3tCrkLta8Hl9KpsNcW5FUTC+Sqok4rs1z1A= X-Google-Smtp-Source: AGHT+IEYAvOKmZbGFZqgZ8JX8GTX59rCOn9IIqs3TPU4/SxaUYqyvkZImfDIkP70g1JHlRCNwNu+ow== X-Received: by 2002:a5d:5227:0:b0:337:5588:801f with SMTP id i7-20020a5d5227000000b003375588801fmr1201012wra.57.1704469549409; Fri, 05 Jan 2024 07:45:49 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Paolo Bonzini Subject: [PULL 23/71] hw/core: Add machine_class_default_cpu_type() Date: Fri, 5 Jan 2024 16:42:16 +0100 Message-ID: <20240105154307.21385-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469667924100003 Add a helper to return a machine default CPU type. If this machine is restricted to a single CPU type, use it as default, obviously. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231116163726.28952-1-philmd@linaro.org> --- include/hw/boards.h | 6 ++++++ hw/core/machine.c | 8 ++++++++ system/vl.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 8af165f4dc..bcfde8a84d 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -24,6 +24,12 @@ OBJECT_DECLARE_TYPE(MachineState, MachineClass, MACHINE) =20 extern MachineState *current_machine; =20 +/** + * machine_class_default_cpu_type: Return the machine default CPU type. + * @mc: Machine class + */ +const char *machine_class_default_cpu_type(MachineClass *mc); + void machine_add_audiodev_property(MachineClass *mc); void machine_run_board_init(MachineState *machine, const char *mem_path, E= rror **errp); bool machine_usb(MachineState *machine); diff --git a/hw/core/machine.c b/hw/core/machine.c index 2699bcba53..0198b54b39 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1390,6 +1390,14 @@ out: return r; } =20 +const char *machine_class_default_cpu_type(MachineClass *mc) +{ + if (mc->valid_cpu_types && !mc->valid_cpu_types[1]) { + /* Only a single CPU type allowed: use it as default. */ + return mc->valid_cpu_types[0]; + } + return mc->default_cpu_type; +} =20 void machine_run_board_init(MachineState *machine, const char *mem_path, E= rror **errp) { diff --git a/system/vl.c b/system/vl.c index 6b87bfa32c..fbdf8bd55a 100644 --- a/system/vl.c +++ b/system/vl.c @@ -3737,7 +3737,7 @@ void qemu_init(int argc, char **argv) migration_object_init(); =20 /* parse features once if machine provides default cpu_type */ - current_machine->cpu_type =3D machine_class->default_cpu_type; + current_machine->cpu_type =3D machine_class_default_cpu_type(machine_c= lass); if (cpu_option) { current_machine->cpu_type =3D parse_cpu_option(cpu_option); } --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469656; cv=none; d=zohomail.com; s=zohoarc; b=aFcJYx+5Idg42vBCyyUhsT5/n30rnfzBxMQY0CNygINR8CvyO1Ei5NuYA2OE0TOiB27mOObEuVBxesn4JC6nnzAeE3KeRBLDOTd5ZL8UCMO7KDtTvJuENxfDUoTiOHCJgEbPQDB2h2AdfaSwk7gjm6OzCaQtU0UxGzqvG0mNotk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469656; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RbnewdzJw2WIotOB6UCheBhSeiFExHVz6pISXRX/KZs=; b=SQKdEyCD1qvcJw17REN8KsYVqQvXYRq9vnYvkY1NSWC17qc1hjnw5HdI6kzrLCcaF+1bhctykzYEPWDPVwGv7/mEcA/n+Inece1tk4qTU5c7RB+ZA1/oqVGS0cQfY23CiBHf2m78+IyiKPiyFSSfSpseBzXTf4XeSgzq3ImWGwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469656281669.1921133619122; Fri, 5 Jan 2024 07:47:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPS-0004Ie-HZ; Fri, 05 Jan 2024 10:47:00 -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 1rLmOa-0001iK-Op for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:06 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmOU-0003n6-VQ for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:02 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3367601a301so1315070f8f.2 for ; Fri, 05 Jan 2024 07:45:56 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id x17-20020a5d6511000000b0033743c2d17dsm1609158wru.28.2024.01.05.07.45.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469555; x=1705074355; 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=RbnewdzJw2WIotOB6UCheBhSeiFExHVz6pISXRX/KZs=; b=wWWcE4ZMz7jSyR8BERdVhQ5fdM5Uw0UJqJBGbybWADWqeHA/6Zm+NazIwCBvMKycrW jncj9/hpBZXlwyUFGSMy6Riz8Jlr+8I4QRNcBVY/fl1ayHL7O3BJwICGD/nMI7a5pOTV TKZUKgXS+nQOLv/KJYSeartncYUbmHpGjR2XXh3B8szDogVIK9k331Kbnpnm/Cya54HM D1tt9Lj8FKpEot1W9qouSfpYd3sKQ8oczIo2gxP42tjRz3qGiSsUXgAyFzRDJ8rd5zIW c32mAF3NyJGvxzgGXul4gxoMf3RT0LACVzMYeqWbD66cAiMttpncleQDzstsCyXOazHe 4cIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469555; x=1705074355; 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=RbnewdzJw2WIotOB6UCheBhSeiFExHVz6pISXRX/KZs=; b=xD0zJoG20bH/U8tA1sI84aCvCkIc4UIFvToW7lcItR1QigqHodkiZ1fXxlkCdBWSE5 cjs3hsTlVJivElOw+/A1+IdLjDIHSCT3QLoUzgA7z9WxqpM4zuVklY+b4CXdXj5oGZg1 wMWEY6b3bo6ti88vjS6yXRw5MbFRzW31tzpd0Gtfk5Z4PkxQDKniQtyJXgl/o55jaWKM XeLshw3hXUvGEWnylr3B2+mYyAqJZnaRut1S7UwaO7iM54eegR/nHPMh+zLaPlKTm1KY HmwAmV/Xi486V4g5LH3Ng01VYfmBVZpTGbPBR+Hic11fHqFNCat7rBL26KXAj4yD8qPl FHUg== X-Gm-Message-State: AOJu0YxHvUxoDbnGg8JtbPfO5ZEFu91UE3u1F57nSXgo3fe0RF9hsV35 uJIrL7K9v645q1zyWtOyk01LK4it3e+VYLebaOIu0kYzxrw= X-Google-Smtp-Source: AGHT+IHg+0OT3KRSSE5x1DHXNTZTW9W0UuTexnJBd7wkFGmaURJNKZhXNVpCc2y41EKLDdnS3IPcDg== X-Received: by 2002:a5d:650c:0:b0:337:5280:a14 with SMTP id x12-20020a5d650c000000b0033752800a14mr856805wru.170.1704469555497; Fri, 05 Jan 2024 07:45:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Igor Mammedov , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 24/71] machine: Use error handling when CPU type is checked Date: Fri, 5 Jan 2024 16:42:17 +0100 Message-ID: <20240105154307.21385-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469657866100018 From: Gavin Shan Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. The principle is violated by machine_run_board_init() because it calls error_report(), error_printf(), and exit(1) when the machine doesn't support the requested CPU type. Clean this up by using error_setg() and error_append_hint() instead. No functional change, as the only caller passes &error_fatal. Suggested-by: Igor Mammedov Signed-off-by: Gavin Shan Reviewed-by: Markus Armbruster Message-ID: <20231204004726.483558-2-gshan@redhat.com> [PMD: Correct error_append_hint() argument] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/machine.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 0198b54b39..1898d1d1d7 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1477,15 +1477,16 @@ void machine_run_board_init(MachineState *machine, = const char *mem_path, Error * =20 if (!machine_class->valid_cpu_types[i]) { /* The user specified CPU is not valid */ - error_report("Invalid CPU type: %s", machine->cpu_type); - error_printf("The valid types are: %s", - machine_class->valid_cpu_types[0]); + error_setg(errp, "Invalid CPU type: %s", machine->cpu_type); + error_append_hint(errp, "The valid types are: %s", + machine_class->valid_cpu_types[0]); for (i =3D 1; machine_class->valid_cpu_types[i]; i++) { - error_printf(", %s", machine_class->valid_cpu_types[i]); + error_append_hint(errp, ", %s", + machine_class->valid_cpu_types[i]); } - error_printf("\n"); =20 - exit(1); + error_append_hint(errp, "\n"); + return; } } =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469739; cv=none; d=zohomail.com; s=zohoarc; b=ItYzCj/zLeE9VPxuph82HiQeXPhrS9kZ+gBM1cjHfl6KE8w7h5mmylZMObM/XGSE/S93DYSq9qYBQiq4RvuBQwzikd1JBm6Aei0WrIYHojbyDCk+fqXLq2TulqEpaIEqxwipwKNddB/vMcBTHOFmhJqH4aK2m00MDEzOE9qbK/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469739; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z1uFhaGSAXCVtK5H8w3hTtFzEkQOw8kna05bCiblS/M=; b=L6B0IzvowtZvuchxfRdCEJNEQnOrTfiqxZYLRHwwfqdaSwi6J/7KOYEs+yB1dshvORSuoOvKgkETupps5eHy4fyMjQEalfxu8H/TpGemTLpe8FBQ10JUCYtoALnNrGCaGRlK4/AiNYdavTiBKJgQ19d/ob2l5nlWhVfOTxMOHsk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170446973984590.69189288700954; Fri, 5 Jan 2024 07:48:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPd-0004i5-9y; Fri, 05 Jan 2024 10:47: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 1rLmOh-0001qc-9s for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:12 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmOa-0003o3-VF for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:11 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40d3352b525so16183265e9.1 for ; Fri, 05 Jan 2024 07:46:01 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id f13-20020a05600c154d00b0040e3635ca65sm1945854wmg.2.2024.01.05.07.45.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469561; x=1705074361; 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=Z1uFhaGSAXCVtK5H8w3hTtFzEkQOw8kna05bCiblS/M=; b=f+PT+rUvYR9fqDBm8gjVu32P9inyKy7hXUYxxSF8Nm5iMU6IIL/QaayarcXkX86jN0 ddqtdXG29N9ymQdvb/Q4DIkDf7qtkmW5KtkNRv8wBMVR/dqD8yCg8HuVmZiooWz8kYW+ T4EVbq3y1P8OdhUnDoWCgionN9RQoFVQ/lxWP14p5UwHRKDzgO4AT9HWSOip9AeOXb7g MwAZsFozCxcCk0Qf/kqrZ07wOE7Kyy6RyBgfXUaqTyzdQkv8dVOpjegVm8iHvXDVuRNp 3AL5ocMUl6zbxkiD/5bqwyJXiLtsffKsBzSFPyoPVcYbZeMBYduoLC7oF93QCrbRwaWg F1TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469561; x=1705074361; 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=Z1uFhaGSAXCVtK5H8w3hTtFzEkQOw8kna05bCiblS/M=; b=iE3TpbrS9g8FgKI32rop5BZrQVEyCMieh3jDo1mZpAJy3aQlNHjplcVV8YGskPPYIX zCOGNIeMGACBnQpbEWEMancefvpTbFVataGRuNAzB23ReGqKSpOhjui08A/8RVF37zvQ EurPL+fIiKtyq8T5CBAlEAWSO3wx+m8m95PxHQpEi5v/Rb65oVeiOUW7FsLTCPOlPQQu S0f0pYO9EMVciArSD1QK9GMhrH9PBXK4pXnwQtbeIVdG+HY/WPSnc3+NFZN6Uw11E03M 6Dc1xuNkF5lBNq15Ykb6jIViuvWlmd646XrROZBIuYIY/fkNFGAdxh1ddCPih5A+HFGh BcdQ== X-Gm-Message-State: AOJu0YzGs24T5DA+x2nK1RLLVWdmtDaezcNk3OhnJh1o4K9sjxuBvnwd 9IuTxPheSDXRd2nrQbB6BKGJigwwSC04IC89SIZuhpUX/zk= X-Google-Smtp-Source: AGHT+IGNIP2qF+lk734+mVjuRLP7zjtWDlqmba3PqBdgJ+gZ58KdYl5CKMtUGzmbo0p3bP/yZnjyKQ== X-Received: by 2002:a05:600c:3b95:b0:40e:3532:2f6f with SMTP id n21-20020a05600c3b9500b0040e35322f6fmr1208080wms.182.1704469560809; Fri, 05 Jan 2024 07:46:00 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 25/71] machine: Introduce helper is_cpu_type_supported() Date: Fri, 5 Jan 2024 16:42:18 +0100 Message-ID: <20240105154307.21385-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469740259100001 From: Gavin Shan The logic, to check if the specified CPU type is supported in machine_run_board_init(), is independent enough. Factor it out into helper is_cpu_type_supported(). machine_run_board_init() looks a bit clean with this. Since we're here, @machine_class is renamed to @mc to avoid multiple line spanning of code. The comments are tweaked a bit either. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231204004726.483558-3-gshan@redhat.com> [PMD: Only call new helper if machine->cpu_type is not NULL] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/machine.c | 84 ++++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 1898d1d1d7..0119b11fc8 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1399,12 +1399,53 @@ const char *machine_class_default_cpu_type(MachineC= lass *mc) return mc->default_cpu_type; } =20 +static bool is_cpu_type_supported(const MachineState *machine, Error **err= p) +{ + MachineClass *mc =3D MACHINE_GET_CLASS(machine); + ObjectClass *oc =3D object_class_by_name(machine->cpu_type); + CPUClass *cc; + int i; + + /* + * Check if the user specified CPU type is supported when the valid + * CPU types have been determined. Note that the user specified CPU + * type is provided through '-cpu' option. + */ + if (mc->valid_cpu_types) { + for (i =3D 0; mc->valid_cpu_types[i]; i++) { + if (object_class_dynamic_cast(oc, mc->valid_cpu_types[i])) { + break; + } + } + + /* The user specified CPU type isn't valid */ + if (!mc->valid_cpu_types[i]) { + error_setg(errp, "Invalid CPU type: %s", machine->cpu_type); + error_append_hint(errp, "The valid types are: %s", + mc->valid_cpu_types[0]); + for (i =3D 1; mc->valid_cpu_types[i]; i++) { + error_append_hint(errp, ", %s", mc->valid_cpu_types[i]); + } + + error_append_hint(errp, "\n"); + return false; + } + } + + /* Check if CPU type is deprecated and warn if so */ + cc =3D CPU_CLASS(oc); + if (cc && cc->deprecation_note) { + warn_report("CPU model %s is deprecated -- %s", + machine->cpu_type, cc->deprecation_note); + } + + return true; +} + void machine_run_board_init(MachineState *machine, const char *mem_path, E= rror **errp) { ERRP_GUARD(); MachineClass *machine_class =3D MACHINE_GET_CLASS(machine); - ObjectClass *oc =3D object_class_by_name(machine->cpu_type); - CPUClass *cc; =20 /* This checkpoint is required by replay to separate prior clock reading from the other reads, because timer polling functions query @@ -1459,42 +1500,9 @@ void machine_run_board_init(MachineState *machine, c= onst char *mem_path, Error * machine->ram =3D machine_consume_memdev(machine, machine->memdev); } =20 - /* If the machine supports the valid_cpu_types check and the user - * specified a CPU with -cpu check here that the user CPU is supported. - */ - if (machine_class->valid_cpu_types && machine->cpu_type) { - int i; - - for (i =3D 0; machine_class->valid_cpu_types[i]; i++) { - if (object_class_dynamic_cast(oc, - machine_class->valid_cpu_types[i= ])) { - /* The user specified CPU is in the valid field, we are - * good to go. - */ - break; - } - } - - if (!machine_class->valid_cpu_types[i]) { - /* The user specified CPU is not valid */ - error_setg(errp, "Invalid CPU type: %s", machine->cpu_type); - error_append_hint(errp, "The valid types are: %s", - machine_class->valid_cpu_types[0]); - for (i =3D 1; machine_class->valid_cpu_types[i]; i++) { - error_append_hint(errp, ", %s", - machine_class->valid_cpu_types[i]); - } - - error_append_hint(errp, "\n"); - return; - } - } - - /* Check if CPU type is deprecated and warn if so */ - cc =3D CPU_CLASS(oc); - if (cc && cc->deprecation_note) { - warn_report("CPU model %s is deprecated -- %s", machine->cpu_type, - cc->deprecation_note); + /* Check if the CPU type is supported */ + if (machine->cpu_type && !is_cpu_type_supported(machine, errp)) { + return; } =20 if (machine->cgs) { --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470231; cv=none; d=zohomail.com; s=zohoarc; b=IcQe/5ijuXDehKB+0/eR0R7HVhVC3zuqKyhfWdvUydJGwVx7UTVVepe/vW6MVGlFLGFL4TTAZpp6QgIZoHCGVaB/FDfoDIBgai3GGq40S2qO61smcwx9I1YWSsTNkJ8SEG64wCdkHKjU4/Mv/kFRl0udjMQPLaeAQC75HM68qDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470231; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1OMJ2J/9TeJEsVbvbtgjbGV5MuipQ2Dh2Ow8E2AaclY=; b=lEoD9n4qd4Rf3+nltzypDtleaYJe/N+QGU4sH9HZetn2TBnUOvXuwmviqTvhHpBdTRbYpiLxERHLzl/bGMeKfc+PLXimVJH+ggD2F9L68jCQXR1i69gPNC5kMktfi3JnS+2m7o+pXztH3wVZuO6R/jIcKqXbNJjangiN0bBpoU8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470231920215.09489254395442; Fri, 5 Jan 2024 07:57:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPe-0004qI-BN; Fri, 05 Jan 2024 10:47: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 1rLmOj-0001wJ-3V for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:14 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmOe-0003pA-RC for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:12 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40d5336986cso18963555e9.1 for ; Fri, 05 Jan 2024 07:46:07 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id p15-20020a05600c358f00b0040d90407f7esm1931456wmq.8.2024.01.05.07.46.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469566; x=1705074366; 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=1OMJ2J/9TeJEsVbvbtgjbGV5MuipQ2Dh2Ow8E2AaclY=; b=Q1SsD5VVAHJmO+jOod0cqpLhrRuuvNV3fyxFAkIeyZmyfL74xygwDD/J1dpm8oLjbR msuNkNT5Yt2vB5CLgIU7YjX8GB91mEJogAFOZb44BtDKX/SRjjcrdB26exdEO0W4OfAR KuB1wZiNSrsRSbCQK0Vzd0SIZDiV2PLs5MQs6Nh4V3AQFC5++K3GXJ9Brar7sPdTaN+U stc5Mh8+zCwkmKMfdUup+UJfGKDYAHDCXuys27hYGnVsFDmwOcIPsm0wsZ8Cr7hw9kKu OvFfPOl4SV0J9udBgy9HB+hqsKuulC55LBe4CMSGy2yCYh1GSyuGqc/xWK81Del+p9Ag AOww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469566; x=1705074366; 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=1OMJ2J/9TeJEsVbvbtgjbGV5MuipQ2Dh2Ow8E2AaclY=; b=FBtPXNa5GSQqxAEpHv8wPVJSlb11eHPoX7xnl5o/OffYzP7koX6Z1wfsEhZ7q6GzzJ PoRvNc/+L8YZZu56Awrs970RwiJ4rBaveKgHPQv+blkC2jx9EJdgOh+30+AdcrhmHHNT r0v9k5ah91yBWqdvzwMu6hQtsNRHjTYl/tLW8YQbVrNlC29vO4BBHCf4vY5pg52jCkca rPerOf5Iod8OzYlW64PqfscvNoKZhMLRnkLuZaAd4aUvIJ0tuZrNG4kxxe82ylsxo2Gu ndYUDNbBAn1/z8oO5HPBukNzVxERhaZ/GzDHoJJ3CJ/CzF/tQyc/Xjrho/F3blWNRbAt 4RMg== X-Gm-Message-State: AOJu0YwY2z+s2/lMGc+/MojJPEu1L9zP8iOPoLUvE2/AaQ9mhxvO5zuH TiAVGpuvzTGRiwABnPDjzUdp8jD9cuwBa6j334OFjrmanRg= X-Google-Smtp-Source: AGHT+IFRxnhVVDCfQBopyfbXhH7RtM2Ah4+sNf5mWm1YUcourIH6uZAJTYc6GI0mRZhX+CMRCdg9EQ== X-Received: by 2002:a05:600c:1d82:b0:40e:36ba:e51a with SMTP id p2-20020a05600c1d8200b0040e36bae51amr729802wms.132.1704469566494; Fri, 05 Jan 2024 07:46:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 26/71] machine: Improve is_cpu_type_supported() Date: Fri, 5 Jan 2024 16:42:19 +0100 Message-ID: <20240105154307.21385-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470233822100001 From: Gavin Shan It's no sense to check the CPU type when mc->valid_cpu_types[0] is NULL, which is a program error. Raise an assert on this. A precise hint for the error message is given when mc->valid_cpu_types[0] is the only valid entry. Besides, enumeration on mc->valid_cpu_types[0] when we have mutiple valid entries there is avoided to increase the code readability, as suggested by Philippe Mathieu-Daud=C3=A9. Besides, @cc comes from machine->cpu_type or mc->default_cpu_type. For the later case, it can be NULL and it's also a program error. We should use assert() in this case. Signed-off-by: Gavin Shan Message-ID: <20231204004726.483558-4-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/machine.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 0119b11fc8..c523ce32eb 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1412,6 +1412,7 @@ static bool is_cpu_type_supported(const MachineState = *machine, Error **errp) * type is provided through '-cpu' option. */ if (mc->valid_cpu_types) { + assert(mc->valid_cpu_types[0] !=3D NULL); for (i =3D 0; mc->valid_cpu_types[i]; i++) { if (object_class_dynamic_cast(oc, mc->valid_cpu_types[i])) { break; @@ -1421,20 +1422,27 @@ static bool is_cpu_type_supported(const MachineStat= e *machine, Error **errp) /* The user specified CPU type isn't valid */ if (!mc->valid_cpu_types[i]) { error_setg(errp, "Invalid CPU type: %s", machine->cpu_type); - error_append_hint(errp, "The valid types are: %s", - mc->valid_cpu_types[0]); - for (i =3D 1; mc->valid_cpu_types[i]; i++) { - error_append_hint(errp, ", %s", mc->valid_cpu_types[i]); + if (!mc->valid_cpu_types[1]) { + error_append_hint(errp, "The only valid type is: %s\n", + mc->valid_cpu_types[0]); + } else { + error_append_hint(errp, "The valid types are: "); + for (i =3D 0; mc->valid_cpu_types[i]; i++) { + error_append_hint(errp, "%s%s", + mc->valid_cpu_types[i], + mc->valid_cpu_types[i + 1] ? ", " : = ""); + } + error_append_hint(errp, "\n"); } =20 - error_append_hint(errp, "\n"); return false; } } =20 /* Check if CPU type is deprecated and warn if so */ cc =3D CPU_CLASS(oc); - if (cc && cc->deprecation_note) { + assert(cc !=3D NULL); + if (cc->deprecation_note) { warn_report("CPU model %s is deprecated -- %s", machine->cpu_type, cc->deprecation_note); } --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470004; cv=none; d=zohomail.com; s=zohoarc; b=L7Diq1obI8UHdUWuZaPpw1IY8oW45WWnHAqSkA0y9T8YI0i76mztwNG/J5ZIZHHlaSlGpel8xAALYavjArTlC3+qp4UsIkdLV872mpsjfWvkBOGdf144LwYjPefHR+0mlgru7Sn+pb3KdRILvW9md50J8RcoJo7dX2nbe6kA4Sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470004; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TaWEpr5f/U/wZNl7ClicoZnkchpUab2rsBaBsce3JqA=; b=csrTG3d1Y7CW3mamy4np4ArLPiutXlf1+ifXGMSNMBNKsuNvpAztgMDiphGLbcQYOV9tKGS0hU/2C/bG2Hm+8DYUGFT6bvtDT/P11jEJ6CxSW0HLd7hQbuQUzfzJv7hDj15eRpHByl6aIJF49mdsnSv+pFqgoHi+st7NqGhCP6E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17044700048942.9012683235598615; Fri, 5 Jan 2024 07:53:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPg-000581-V1; Fri, 05 Jan 2024 10:47: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 1rLmOm-000204-QK for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:25 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmOj-0003qM-D4 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:16 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40d4f5d902dso16146425e9.2 for ; Fri, 05 Jan 2024 07:46:12 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id k9-20020a05600c1c8900b0040e3a1f88f2sm1376690wms.15.2024.01.05.07.46.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469572; x=1705074372; 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=TaWEpr5f/U/wZNl7ClicoZnkchpUab2rsBaBsce3JqA=; b=ILKT0InOW9Wh0TE9nnBj+WiviH/WaLZ2lala2LTM3Aovv0TCxl0Pbwsc9kFU21n0b9 1DerARmCTs0ZNtAjGFfFlADSzSrWqBtdT6c9OexpGORqpgTGKiQNneNccpIuTSkvuVZB KblNMxRPeXNDg8ICd5uQ0ErMktTa9w/pq+f3jAKVX9Lm6tqPTV8f5bFBW0wf9himunrL ykMetXUvmr1a3RXbLacRdY3kjsrVVVT3RWv61tAUS4HoEu+kGsd6HSiup7Df9XZOy+8D CBcAwY2UHg1DBoGyKfZi4IIGiL+7BQuOmcT36oKycCdiqNVOKEpVv4U2tglj2CqkVMAT ED9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469572; x=1705074372; 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=TaWEpr5f/U/wZNl7ClicoZnkchpUab2rsBaBsce3JqA=; b=bjk89RuKEXhwB+Asie2e5wH9KzpAd9ED+4PEC0w/osYf9lxtxdNTVxJpTrKp6KweNt F8ZtvE8yesQ6Pt+OY7vjPg7GP8hOiIjqrroPhYJwwxsgDctLCKL4taF2YkN9KvA9S7L3 ApgbkSso9tynJuWEUn2sKgjxhpm2+fJ/OuqaWAzdSSy0ze4XRi2T0ayN/ATnhJDCyafV WNGnamsWRvzuIKsQrCjbl9cYGPP1RXjhhcuzyZYlMwjfxWFJrPWM92zv3Og4WU+cBfYZ rPc0wjyGDp9pyUleTuLcydHyxxpWzz+5YoKR8atPsoca6blgabjgHOI/pwjbcXP7QZaz dFmA== X-Gm-Message-State: AOJu0YxfiFnYXOQBrpcEja0AWM3sDd+ic8AdyIUWlU3tOBoaUN6DQSGx zDVzR3SbgPi4XE7wtLwyJ3xFxuDh+2ZLXuU8m+KKg0O7mBw= X-Google-Smtp-Source: AGHT+IHchGDzGZUXyaUKE7Ua7noUpkAg1Gg/cGtAMRVa5jV2c1mKHycg+NpR9CLOzU4msVwipqj0dQ== X-Received: by 2002:a05:600c:138e:b0:40d:9485:cc89 with SMTP id u14-20020a05600c138e00b0040d9485cc89mr1204952wmf.74.1704469571776; Fri, 05 Jan 2024 07:46:11 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 27/71] machine: Print CPU model name instead of CPU type Date: Fri, 5 Jan 2024 16:42:20 +0100 Message-ID: <20240105154307.21385-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470006798100001 From: Gavin Shan The names of supported CPU models instead of CPU types should be printed when the user specified CPU type isn't supported, to be consistent with the output from '-cpu ?'. Correct the error messages to print CPU model names instead of CPU type names. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231204004726.483558-5-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/machine.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index c523ce32eb..fc239101f9 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1421,15 +1421,19 @@ static bool is_cpu_type_supported(const MachineStat= e *machine, Error **errp) =20 /* The user specified CPU type isn't valid */ if (!mc->valid_cpu_types[i]) { - error_setg(errp, "Invalid CPU type: %s", machine->cpu_type); + g_autofree char *requested =3D cpu_model_from_type(machine->cp= u_type); + error_setg(errp, "Invalid CPU model: %s", requested); if (!mc->valid_cpu_types[1]) { - error_append_hint(errp, "The only valid type is: %s\n", - mc->valid_cpu_types[0]); + g_autofree char *model =3D cpu_model_from_type( + mc->valid_cpu_types[0]); + error_append_hint(errp, "The only valid type is: %s\n", mo= del); } else { - error_append_hint(errp, "The valid types are: "); + error_append_hint(errp, "The valid models are: "); for (i =3D 0; mc->valid_cpu_types[i]; i++) { + g_autofree char *model =3D cpu_model_from_type( + mc->valid_cpu_types[i]); error_append_hint(errp, "%s%s", - mc->valid_cpu_types[i], + model, mc->valid_cpu_types[i + 1] ? ", " : = ""); } error_append_hint(errp, "\n"); --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469813; cv=none; d=zohomail.com; s=zohoarc; b=lpvVJbZMNA1XvpHQ8TpPEvZkvUr6aV8ieYAIx5XcNkpbfQ9pTSqYu/tYyWbkGuk5Zam6AWDcRuQmpp7OtFGssOOvy6A6iBQiOrx9Xs0VTJbFyuqh4r4vlxEuBR/8rwNSOYmTfYL5waMEMHjh13tqvsc6bBvIZs8Fy2iHTumUdlc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469813; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SzfKYNH1/2wbsF3ubLhxzVujUnJw+6X9RP1nI43IQ80=; b=RkcLPFKTyvM3Nq3HOZ9VtZRcof/t/1S3TfxuJohuH1h4yDwwSWKD0dR3cG3m8Ai7IB9jdyPj6ObwCZp717yNM7J/HEY99q4PPeerw3HmJ6kFGNl3BdyBbcLdwQws1QnqXL4T+15qYtN4/04fjEWceAVuyRtCdUpW974U8Lb+LzI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17044698138249.493300409436301; Fri, 5 Jan 2024 07:50:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQ0-0006Ec-8G; Fri, 05 Jan 2024 10:47:33 -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 1rLmP6-0002D6-MQ for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:37 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmOo-0003t8-Ky for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:24 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3373a30af67so1322941f8f.0 for ; Fri, 05 Jan 2024 07:46:18 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id y10-20020a5d620a000000b003372befd19bsm1607838wru.104.2024.01.05.07.46.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469577; x=1705074377; 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=SzfKYNH1/2wbsF3ubLhxzVujUnJw+6X9RP1nI43IQ80=; b=ER+J0fYiSRL3gi+24IzzqLi/vohO2TpKTOVS8ZxzSZqC9Ai0Lvseqm8dV9Kb08KJcp dYjRgEm1GVRhyi4n6XMmL8INkuwKezBuUIawlv4TubUjXFsSTgJ/DFg4WcnSeoboAMTK S+yc4RVCPE4zI4/4tydWnrUyfNWbDUt/gsyoeG+sgYjCylUll4xy5ogWnaE8+jJqNMqc nO3UhJexhrOY0FIBb7wXYBO9DaweNrAaVyYzMJ1Bw9HqfBJPSMyE+sMjpLVaFTLmVLbx UO/vG7esM3RKdCkk8QRV1KJNRnx9iuIHWcXVWE4cTzyTo1xIqwepADnoYvsOZTHPxjq1 F79w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469577; x=1705074377; 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=SzfKYNH1/2wbsF3ubLhxzVujUnJw+6X9RP1nI43IQ80=; b=AUiW8IKyrCJrxJIqs5KSaYSggJkGqliOHk3II4wN7wgtFlQeuwjqZOLlLKa1gkGfwt 3dmv/SOFWrn9DE0IsvQc2U9yzd53iw/34FM3oTRBO0l/Dq8FENX77qvdfqauilzFt387 A+FAhFna2XFSf5RdYYQOiki35DdF9RougBwGVybb4broRDG9DLxnhoJ677jPrAWbcT9E bXUrllQ90+J5FGcQBnnKzBcaVpPKBH5vLo+pehVUQJV9rgW4oJbe6rcSrTbqFhZealBp gj269pgLEmIGBiFVToqlEOPstPVNzpP2hUgxFsWRuZLLBIh0NnskAPcVhjpMkY8R3qOG IztQ== X-Gm-Message-State: AOJu0YxxsDirRU+eoDMmsS7h7ykdHCLVgJdt71lAKrPX1NnNihX7MYHO WtlXK2hNNaX+f0e8Tq6Xt2cMda5J4XXiwTlHh4qPwSEmRIo= X-Google-Smtp-Source: AGHT+IEhkyu+mJt4ZgaI2HopS0VuCObVFwdS74M/k0bvowJHwD76KBU/9p3O6T1tSG4xTvFzEZ3yWg== X-Received: by 2002:adf:f552:0:b0:336:b9b3:f554 with SMTP id j18-20020adff552000000b00336b9b3f554mr797130wrp.133.1704469577055; Fri, 05 Jan 2024 07:46:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 28/71] hw/arm/virt: Hide host CPU model for tcg Date: Fri, 5 Jan 2024 16:42:21 +0100 Message-ID: <20240105154307.21385-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469814609100008 From: Gavin Shan The 'host' CPU model isn't available until KVM or HVF is enabled. For example, the following error messages are seen when the guest is started with option '-cpu cortex-a8' on tcg after the next commit is applied to check the CPU type in machine_run_board_init(). ERROR:../hw/core/machine.c:1423:is_cpu_type_supported: \ assertion failed: (model !=3D NULL) Bail out! ERROR:../hw/core/machine.c:1423:is_cpu_type_supported: \ assertion failed: (model !=3D NULL) Aborted (core dumped) Hide 'host' CPU model until KVM or HVF is enabled. With this applied, the valid CPU models can be shown. qemu-system-aarch64: Invalid CPU type: cortex-a8 The valid types are: cortex-a7, cortex-a15, cortex-a35, \ cortex-a55, cortex-a72, cortex-a76, cortex-a710, a64fx, \ neoverse-n1, neoverse-v1, neoverse-n2, cortex-a53, \ cortex-a57, max Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231204004726.483558-6-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 8b69aba189..8b060ef1d9 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -220,7 +220,9 @@ static const char *valid_cpus[] =3D { #endif ARM_CPU_TYPE_NAME("cortex-a53"), ARM_CPU_TYPE_NAME("cortex-a57"), +#if defined(CONFIG_KVM) || defined(CONFIG_HVF) ARM_CPU_TYPE_NAME("host"), +#endif ARM_CPU_TYPE_NAME("max"), }; =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469742; cv=none; d=zohomail.com; s=zohoarc; b=CZv/TtQUSiA7B+Nc4h9Xt99A8K1ez2s8dnB8Q3VNsl8OFCKhxrE86pF43RoTdDCaDg1Nki50/ocxkAmF8z6YAqoKpUVEZhipUJMzQ6U8Mu55XUs8H4vovr3ukpANCeaTcL2mVcCHvwTLQK4Vrg5tuY8jkTf6fjqAB4gyFwkzb0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469742; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+mHMa1tnUIKC/Lz8fv92EG3G72QPfm2OOOA3/xxqo/c=; b=QraDNXAGlKMi5EJo85YUf91igG+PK2Favc3Dfdwezx6gyWCfCqE6I4ebF7B30RlSJ6lSYEfubFef7VzyRzgrXarmaZbIQWZSnbRZfjWO/CvD45ukSta3e+cD+muTQ1gXYADJaxXQR0x1OgWw0rSmz/MZcWhX3gaFxWT8OYGAYnU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469742267639.3323136364517; Fri, 5 Jan 2024 07:49:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQC-0007Dg-Qy; Fri, 05 Jan 2024 10:47:44 -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 1rLmPM-0004Gs-W9 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:54 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmP7-0003ty-EX for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:52 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40e384404e7so8453145e9.1 for ; Fri, 05 Jan 2024 07:46:24 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id w17-20020a05600c475100b0040d802a7619sm1924026wmo.38.2024.01.05.07.46.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469583; x=1705074383; 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=+mHMa1tnUIKC/Lz8fv92EG3G72QPfm2OOOA3/xxqo/c=; b=EOwq83hELeFzXU3fhCBRM97RIkwnmLILDORrxh2bmW24QwPbULqfd7wsz4Es911bwh HdII4/a4ZCwGC9VW56p7W5feklrHxYBna9uTCe341/xVNowZ3avbynacCH77WfUYR60Q ZaCY7UxQ0WGLEy21tWmX2eT5T4Bt9zYXj6+laWTuPUCNhZltkj+yMEISf/d/v34VhwmL jrjUG82zcNtDpGldhTm23oAuh7i7AeYLKoliImOelsmRmqE5Z16AFCj38dkmVkW0cMrS 09eE1C8LkROMEyAI9rH2h+M0wvhTU1MsRRi/MgI1y9Vc2S8tCnYcpDib6p846AWgd+84 B3Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469583; x=1705074383; 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=+mHMa1tnUIKC/Lz8fv92EG3G72QPfm2OOOA3/xxqo/c=; b=ZCbsg+ndCigijr6MuBpEbUPXbvjrHzmJdfWmW/s4V0gVkVrahZUvtXT1IbWeShMgJU ZkIkHFXXkUH8LjtR8kQkL58K2iOxCpwPCuRPuQdmumQzThb9bgKMd2wQQuROtZPTebdj 5S6Qo1xN6DYkWLeNcv565IJP0lDBJwxyObsKlQK/wT9vkLdZm2goMZZ6P6KkcxtbNsT8 RAVYubP7LIkvTvvA8xCsXuVo2Z/qyfletLEc0G0icTWPVoFZkAAUS40nqsO77E6wVSxb jY8ZQ5j0FWnBzkPIq6QH3HsThwHXHjw1QfNzVy/DtNU0CxO7HYduc3a60nm0+An8nMcs 6dTQ== X-Gm-Message-State: AOJu0YzuggUz85FwnWy9I5yu3fOnl/FXNSdckKTIRVKkzZhEZVQuCfAZ h5xKkEWNvx916Zg3jyaLpo468tuwmiFQUUUfxPfVzEajhGo= X-Google-Smtp-Source: AGHT+IHbN4E41ZlazsyoOTJ5LzfFOMiJcO8+dAFbXHe8CBIdrEOKUqtHQ59bIh72eSQInN0a9G9cKQ== X-Received: by 2002:a05:600c:a45:b0:40e:3511:2c39 with SMTP id c5-20020a05600c0a4500b0040e35112c39mr1355661wmq.172.1704469583308; Fri, 05 Jan 2024 07:46:23 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 29/71] hw/arm/virt: Check CPU type in machine_run_board_init() Date: Fri, 5 Jan 2024 16:42:22 +0100 Message-ID: <20240105154307.21385-30-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469744302100011 From: Gavin Shan Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do the check by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20231204004726.483558-7-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/virt.c | 62 +++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 39 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 8b060ef1d9..2793121cb4 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -204,40 +204,6 @@ static const int a15irqmap[] =3D { [VIRT_PLATFORM_BUS] =3D 112, /* ...to 112 + PLATFORM_BUS_NUM_IRQS -1 */ }; =20 -static const char *valid_cpus[] =3D { -#ifdef CONFIG_TCG - ARM_CPU_TYPE_NAME("cortex-a7"), - ARM_CPU_TYPE_NAME("cortex-a15"), - ARM_CPU_TYPE_NAME("cortex-a35"), - ARM_CPU_TYPE_NAME("cortex-a55"), - ARM_CPU_TYPE_NAME("cortex-a72"), - ARM_CPU_TYPE_NAME("cortex-a76"), - ARM_CPU_TYPE_NAME("cortex-a710"), - ARM_CPU_TYPE_NAME("a64fx"), - ARM_CPU_TYPE_NAME("neoverse-n1"), - ARM_CPU_TYPE_NAME("neoverse-v1"), - ARM_CPU_TYPE_NAME("neoverse-n2"), -#endif - ARM_CPU_TYPE_NAME("cortex-a53"), - ARM_CPU_TYPE_NAME("cortex-a57"), -#if defined(CONFIG_KVM) || defined(CONFIG_HVF) - ARM_CPU_TYPE_NAME("host"), -#endif - ARM_CPU_TYPE_NAME("max"), -}; - -static bool cpu_type_valid(const char *cpu) -{ - int i; - - for (i =3D 0; i < ARRAY_SIZE(valid_cpus); i++) { - if (strcmp(cpu, valid_cpus[i]) =3D=3D 0) { - return true; - } - } - return false; -} - static void create_randomness(MachineState *ms, const char *node) { struct { @@ -2042,11 +2008,6 @@ static void machvirt_init(MachineState *machine) unsigned int smp_cpus =3D machine->smp.cpus; unsigned int max_cpus =3D machine->smp.max_cpus; =20 - if (!cpu_type_valid(machine->cpu_type)) { - error_report("mach-virt: CPU type %s not supported", machine->cpu_= type); - exit(1); - } - possible_cpus =3D mc->possible_cpu_arch_ids(machine); =20 /* @@ -2940,6 +2901,28 @@ static void virt_machine_class_init(ObjectClass *oc,= void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); HotplugHandlerClass *hc =3D HOTPLUG_HANDLER_CLASS(oc); + static const char * const valid_cpu_types[] =3D { +#ifdef CONFIG_TCG + ARM_CPU_TYPE_NAME("cortex-a7"), + ARM_CPU_TYPE_NAME("cortex-a15"), + ARM_CPU_TYPE_NAME("cortex-a35"), + ARM_CPU_TYPE_NAME("cortex-a55"), + ARM_CPU_TYPE_NAME("cortex-a72"), + ARM_CPU_TYPE_NAME("cortex-a76"), + ARM_CPU_TYPE_NAME("cortex-a710"), + ARM_CPU_TYPE_NAME("a64fx"), + ARM_CPU_TYPE_NAME("neoverse-n1"), + ARM_CPU_TYPE_NAME("neoverse-v1"), + ARM_CPU_TYPE_NAME("neoverse-n2"), +#endif + ARM_CPU_TYPE_NAME("cortex-a53"), + ARM_CPU_TYPE_NAME("cortex-a57"), +#if defined(CONFIG_KVM) || defined(CONFIG_HVF) + ARM_CPU_TYPE_NAME("host"), +#endif + ARM_CPU_TYPE_NAME("max"), + NULL + }; =20 mc->init =3D machvirt_init; /* Start with max_cpus set to 512, which is the maximum supported by K= VM. @@ -2966,6 +2949,7 @@ static void virt_machine_class_init(ObjectClass *oc, = void *data) #else mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("max"); #endif + mc->valid_cpu_types =3D valid_cpu_types; mc->get_default_cpu_node_id =3D virt_get_default_cpu_node_id; mc->kvm_type =3D virt_kvm_type; assert(!mc->get_hotplug_handler); --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469721; cv=none; d=zohomail.com; s=zohoarc; b=NCmyQY2GNnzIUOMfZA3lbHvPtrN+PrD5d5aQ+YXFtcSbVu9/9d4uOU0bEbuCRPYB+P4J1o2HEk4FzZ0gU+a8mO/Sl1jDpjE6yIZgcE+Okad2ndS17IErlONWHxvGz2qAGz+LufyLrvE96pGs8DomJYNYti6uNyaz0nAXkqexhlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469721; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1hi5jkBMNGBwDBii6AMSMwfhTDlF/mIwoAbJvzijOtI=; b=h8EElYYF09WmpHG9cs3z8N6O749xZbsz/sVdbzsdyqYGjztUnY0CvE5RJO4fhYA8dpR/KiCu3pdrLooyONLH4tnj9tDRbV9X6Vsucl4im4LP2ZnZowoTYdZCfxR8VAQoZTIn6LQl3qS3qFxkfWGz47v247mEDDGfhFvty4v88eo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469721804364.9574850464676; Fri, 5 Jan 2024 07:48:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQC-00075s-6t; Fri, 05 Jan 2024 10:47:44 -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 1rLmPO-0004JD-SU for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:56 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmP8-0003vS-0e for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:54 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33687627ad0so1402680f8f.2 for ; Fri, 05 Jan 2024 07:46:37 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id o14-20020adfeace000000b0033690139ea5sm1617406wrn.44.2024.01.05.07.46.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469595; x=1705074395; 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=1hi5jkBMNGBwDBii6AMSMwfhTDlF/mIwoAbJvzijOtI=; b=qCQrTSHeb8lhQbAHPNaI2JAkUkJ1CVQkgO/ZBQF5lCeLNDuCcgM9afPxF+/FJ/TBhc zMxILoEuhw0Sw6EwTEQAVe/c0ZLzUf6jwnaD2ftjefVezmm8S3EBsHDvA18vn1bEKJ/O Kr38nY0Sb9XYsQoe7syHuCY3InuUs2WgWZkZkYtkFyUT4GmBiv6TLN4mQlKVp+/IRyp7 NWtEHAzcmjI3iX3PdR4vLqsXRA99q0FzH74EGUpqNhRHy5hYK9f/KTJzCGUMzx0syOpQ VyL1Jd/AkSnDIcdJ2joyzvcAciLEZW+/LJ9mYJPK8rUTQZ/j4WEzO32HhAuydZmb4Yf8 wOTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469595; x=1705074395; 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=1hi5jkBMNGBwDBii6AMSMwfhTDlF/mIwoAbJvzijOtI=; b=j+KeE4kvKSsid0KL0gMG/XGYxs1as45vnufEQsut7AbUI3rjYj3/NRGWQlZURjOx6b U18gtl09FRctUDNcLCAim/MSAaFe5rcQLTHfxFCpemh9rkLyD5/OG4KDI+qv/JoHOqVY BVW91cqVfctt5hEiQN8grC68lIm8PPk19XBBZqH4HZUSooSzDnVxXp/rLQu47sjI+g7s NYE99/r55MAQ8h7RvHZdVvH4z1f50DBijwgphkF3VVEIZG4lzb1OllqvGOSHmlZ9LtpJ BQYkfGPMlGfm3mPJ8WlOlIw3mJzUQIzkUnzp1URWx5ZrNpOrCbcdgRBHMDwaLW0NUCkV +p/w== X-Gm-Message-State: AOJu0Yy8c10wtk8HuywuMKf4DedaC5fvLS1+t5+Tj0vDOM0uWPY0VVT4 vA54LGFF0x/Hnixbw+B53PB14DaApEzfLqjkZMJ31GdFEE0= X-Google-Smtp-Source: AGHT+IG9tc/jLgaKDL2Qg6eCM9FJfemxntZKCZaoRWdcSm9eNff6H0Y80zJN+t6b6DZhbrFf3lxssA== X-Received: by 2002:a5d:4808:0:b0:333:5665:fa86 with SMTP id l8-20020a5d4808000000b003335665fa86mr1445590wrq.18.1704469595241; Fri, 05 Jan 2024 07:46:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Leif Lindholm , Richard Henderson , Radoslaw Biernacki , Peter Maydell , Marcin Juszkiewicz Subject: [PULL 30/71] hw/arm/sbsa-ref: Check CPU type in machine_run_board_init() Date: Fri, 5 Jan 2024 16:42:23 +0100 Message-ID: <20240105154307.21385-31-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469722230100001 From: Gavin Shan Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Leif Lindholm Reviewed-by: Richard Henderson Message-ID: <20231204004726.483558-8-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/sbsa-ref.c | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index f3c9704693..477dca0637 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -145,27 +145,6 @@ static const int sbsa_ref_irqmap[] =3D { [SBSA_GWDT_WS0] =3D 16, }; =20 -static const char * const valid_cpus[] =3D { - ARM_CPU_TYPE_NAME("cortex-a57"), - ARM_CPU_TYPE_NAME("cortex-a72"), - ARM_CPU_TYPE_NAME("neoverse-n1"), - ARM_CPU_TYPE_NAME("neoverse-v1"), - ARM_CPU_TYPE_NAME("neoverse-n2"), - ARM_CPU_TYPE_NAME("max"), -}; - -static bool cpu_type_valid(const char *cpu) -{ - int i; - - for (i =3D 0; i < ARRAY_SIZE(valid_cpus); i++) { - if (strcmp(cpu, valid_cpus[i]) =3D=3D 0) { - return true; - } - } - return false; -} - static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx) { uint8_t clustersz =3D ARM_DEFAULT_CPUS_PER_CLUSTER; @@ -733,11 +712,6 @@ static void sbsa_ref_init(MachineState *machine) const CPUArchIdList *possible_cpus; int n, sbsa_max_cpus; =20 - if (!cpu_type_valid(machine->cpu_type)) { - error_report("sbsa-ref: CPU type %s not supported", machine->cpu_t= ype); - exit(1); - } - if (kvm_enabled()) { error_report("sbsa-ref: KVM is not supported for this machine"); exit(1); @@ -898,10 +872,20 @@ static void sbsa_ref_instance_init(Object *obj) static void sbsa_ref_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-a57"), + ARM_CPU_TYPE_NAME("cortex-a72"), + ARM_CPU_TYPE_NAME("neoverse-n1"), + ARM_CPU_TYPE_NAME("neoverse-v1"), + ARM_CPU_TYPE_NAME("neoverse-n2"), + ARM_CPU_TYPE_NAME("max"), + NULL, + }; =20 mc->init =3D sbsa_ref_init; mc->desc =3D "QEMU 'SBSA Reference' ARM Virtual Machine"; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("neoverse-n1"); + mc->valid_cpu_types =3D valid_cpu_types; mc->max_cpus =3D 512; mc->pci_allow_0_address =3D true; mc->minimum_page_bits =3D 12; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469821; cv=none; d=zohomail.com; s=zohoarc; b=JR8Mnqy0QJdkeMqBuieaDeucGevgocpJqnDy5D/y3t+KQTHV8dFsnG79ra96W+t4SBWzm8t9jm7vFuphpjc/lMND5LlEpwofW3GoqbdVY4+0eLwCP+WoBqzCh1vTxy4GvPKmaFGC7qSnsMB4/24Vyf0UGh2kX5Vebk8yiLXBFVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469821; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=igqP4AsDHHqLX93X0pavaFsHsYcJ7nUJnv89zKZWOB0=; b=Y451PAZBuPdXNel+dgHJZbsAaPyF1jWyugjTIuk4kfSB2Ce2J9C9lcBnniNlioWCYAMRvNnKcumG4KWfp2nQsgOV+CyjeHUFFAwxT2RGbkm27Y6dCc7QM+NhOVO3Iv3ZE9LvJ8bw9U4od8TOR69KOT9KojWdcCZ+9GgtGKMjaT8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170446982187934.09662832537492; Fri, 5 Jan 2024 07:50:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQf-00009g-3i; Fri, 05 Jan 2024 10:48:14 -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 1rLmPQ-0004Kv-TC for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:58 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPF-0003wy-Ry for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:54 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40d76fefd6bso14830575e9.2 for ; Fri, 05 Jan 2024 07:46:44 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id t11-20020a05600c450b00b0040d724896cbsm1936432wmo.18.2024.01.05.07.46.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469602; x=1705074402; 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=igqP4AsDHHqLX93X0pavaFsHsYcJ7nUJnv89zKZWOB0=; b=QC17MOec52OREMZe7sLa+OQlzzPWdGrwnn2BHI79sZdQg75ddLDVYhdyOkO55H+fqR P6I1MwOJT3kTfFqDV4pAyWdJ/HIsWHVnFXhP+2McFPXL9PbXK7lqAcAnVjM+a+LYiSYz 4pOH90fuXbOorBshUxXXgucOFjS43vnkzIZBaizo2N0y28w0Ji+7fHwkQjUWSbEPZ4pY aBN9ekRa4WKi+Rkhb6YNsb8yodjolTCUI6o/lNf/HmnL7KbmhYxf0VxVPWT71VDOiQPl dkc10bgW/j2L9aCi1y4rnbFfRxvIIeTS/0dtp3eEp2PCPhn6DVQlOz2P8KKYqBn54ki9 YhlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469602; x=1705074402; 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=igqP4AsDHHqLX93X0pavaFsHsYcJ7nUJnv89zKZWOB0=; b=CIoIoAqULPLRlpoOK47WdNwyMYh95BP5waeZZBqEap4kHQcKB5RiaDBxjZMtJCXrXR luh2rPip0uKhGzVVZ7kAlz5pbyXWia7YkYTu9oE9GyieJ+yp0iarDEwh2+tKdslOBRzD ygmZTZ60IzwrTuD3DD6LwxgpaxQb0D0IHodT4o6wixiHPudHUCpnjjhv9J7CVF1zh9G2 cQCZ2/cXCOC5MZ3Yk5vaDX5RSkTASTk3ZDbOomMEXuiIR2CvahJe/gPEh0fF08z28vcf fj2zziprU/CCpcLlTxcegIGypr+ZWFoJhg9tQyh2WqXqjJNkl/KVrKI4jnE43Pd7vRkz gxsQ== X-Gm-Message-State: AOJu0YzJnRVYsChEHU6pmo8/H4qagNsh0VnWPcGgnZ6345d3wk4AUijY 7kTUkX4rj3onC8/eibirg7O564PFZMXZD6S+Unv4vat0zKE= X-Google-Smtp-Source: AGHT+IHTMgqkL3WkZWOrmm2ZX9vV7noWtpW91jR2J/NgNkouKS0hp0ofZryj55RklowzXmYAOHzLjA== X-Received: by 2002:a05:600c:3798:b0:40d:81c1:186 with SMTP id o24-20020a05600c379800b0040d81c10186mr664385wmr.155.1704469602022; Fri, 05 Jan 2024 07:46:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Beniamino Galvani , Strahinja Jankovic , Subbaraya Sundeep , Tyrone Ting , Hao Wu , Niek Linnenbank Subject: [PULL 31/71] hw/arm: Check CPU type in machine_run_board_init() Date: Fri, 5 Jan 2024 16:42:24 +0100 Message-ID: <20240105154307.21385-32-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469822713100005 From: Gavin Shan Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231204004726.483558-9-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/bananapi_m2u.c | 12 ++++++------ hw/arm/cubieboard.c | 12 ++++++------ hw/arm/mps2-tz.c | 26 ++++++++++++++++++++------ hw/arm/mps2.c | 26 ++++++++++++++++++++------ hw/arm/msf2-som.c | 12 ++++++------ hw/arm/musca.c | 12 +++++------- hw/arm/npcm7xx_boards.c | 12 +++++------- hw/arm/orangepi.c | 12 ++++++------ 8 files changed, 74 insertions(+), 50 deletions(-) diff --git a/hw/arm/bananapi_m2u.c b/hw/arm/bananapi_m2u.c index 8f24b18d8c..0a4b6f29b1 100644 --- a/hw/arm/bananapi_m2u.c +++ b/hw/arm/bananapi_m2u.c @@ -71,12 +71,6 @@ static void bpim2u_init(MachineState *machine) exit(1); } =20 - /* Only allow Cortex-A7 for this board */ - if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a7")) !=3D 0) { - error_report("This board can only be used with cortex-a7 CPU"); - exit(1); - } - r40 =3D AW_R40(object_new(TYPE_AW_R40)); object_property_add_child(OBJECT(machine), "soc", OBJECT(r40)); object_unref(OBJECT(r40)); @@ -133,12 +127,18 @@ static void bpim2u_init(MachineState *machine) =20 static void bpim2u_machine_init(MachineClass *mc) { + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-a7"), + NULL + }; + mc->desc =3D "Bananapi M2U (Cortex-A7)"; mc->init =3D bpim2u_init; mc->min_cpus =3D AW_R40_NUM_CPUS; mc->max_cpus =3D AW_R40_NUM_CPUS; mc->default_cpus =3D AW_R40_NUM_CPUS; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a7"); + mc->valid_cpu_types =3D valid_cpu_types; mc->default_ram_size =3D 1 * GiB; mc->default_ram_id =3D "bpim2u.ram"; } diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index 29146f5018..b976727eef 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -52,12 +52,6 @@ static void cubieboard_init(MachineState *machine) exit(1); } =20 - /* Only allow Cortex-A8 for this board */ - if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a8")) !=3D 0) { - error_report("This board can only be used with cortex-a8 CPU"); - exit(1); - } - a10 =3D AW_A10(object_new(TYPE_AW_A10)); object_property_add_child(OBJECT(machine), "soc", OBJECT(a10)); object_unref(OBJECT(a10)); @@ -114,8 +108,14 @@ static void cubieboard_init(MachineState *machine) =20 static void cubieboard_machine_init(MachineClass *mc) { + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-a8"), + NULL + }; + mc->desc =3D "cubietech cubieboard (Cortex-A8)"; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a8"); + mc->valid_cpu_types =3D valid_cpu_types; mc->default_ram_size =3D 1 * GiB; mc->init =3D cubieboard_init; mc->block_default_type =3D IF_IDE; diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 668db5ed61..5d8cdc1a4c 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -813,12 +813,6 @@ static void mps2tz_common_init(MachineState *machine) int num_ppcs; int i; =20 - if (strcmp(machine->cpu_type, mc->default_cpu_type) !=3D 0) { - error_report("This board can only be used with CPU %s", - mc->default_cpu_type); - exit(1); - } - if (machine->ram_size !=3D mc->default_ram_size) { char *sz =3D size_to_str(mc->default_ram_size); error_report("Invalid RAM size, should be %s", sz); @@ -1318,6 +1312,10 @@ static void mps2tz_an505_class_init(ObjectClass *oc,= void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); MPS2TZMachineClass *mmc =3D MPS2TZ_MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m33"), + NULL + }; =20 mc->desc =3D "ARM MPS2 with AN505 FPGA image for Cortex-M33"; mc->default_cpus =3D 1; @@ -1325,6 +1323,7 @@ static void mps2tz_an505_class_init(ObjectClass *oc, = void *data) mc->max_cpus =3D mc->default_cpus; mmc->fpga_type =3D FPGA_AN505; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m33"); + mc->valid_cpu_types =3D valid_cpu_types; mmc->scc_id =3D 0x41045050; mmc->sysclk_frq =3D 20 * 1000 * 1000; /* 20MHz */ mmc->apb_periph_frq =3D mmc->sysclk_frq; @@ -1347,6 +1346,10 @@ static void mps2tz_an521_class_init(ObjectClass *oc,= void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); MPS2TZMachineClass *mmc =3D MPS2TZ_MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m33"), + NULL + }; =20 mc->desc =3D "ARM MPS2 with AN521 FPGA image for dual Cortex-M33"; mc->default_cpus =3D 2; @@ -1354,6 +1357,7 @@ static void mps2tz_an521_class_init(ObjectClass *oc, = void *data) mc->max_cpus =3D mc->default_cpus; mmc->fpga_type =3D FPGA_AN521; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m33"); + mc->valid_cpu_types =3D valid_cpu_types; mmc->scc_id =3D 0x41045210; mmc->sysclk_frq =3D 20 * 1000 * 1000; /* 20MHz */ mmc->apb_periph_frq =3D mmc->sysclk_frq; @@ -1376,6 +1380,10 @@ static void mps3tz_an524_class_init(ObjectClass *oc,= void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); MPS2TZMachineClass *mmc =3D MPS2TZ_MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m33"), + NULL + }; =20 mc->desc =3D "ARM MPS3 with AN524 FPGA image for dual Cortex-M33"; mc->default_cpus =3D 2; @@ -1383,6 +1391,7 @@ static void mps3tz_an524_class_init(ObjectClass *oc, = void *data) mc->max_cpus =3D mc->default_cpus; mmc->fpga_type =3D FPGA_AN524; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m33"); + mc->valid_cpu_types =3D valid_cpu_types; mmc->scc_id =3D 0x41045240; mmc->sysclk_frq =3D 32 * 1000 * 1000; /* 32MHz */ mmc->apb_periph_frq =3D mmc->sysclk_frq; @@ -1410,6 +1419,10 @@ static void mps3tz_an547_class_init(ObjectClass *oc,= void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); MPS2TZMachineClass *mmc =3D MPS2TZ_MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m55"), + NULL + }; =20 mc->desc =3D "ARM MPS3 with AN547 FPGA image for Cortex-M55"; mc->default_cpus =3D 1; @@ -1417,6 +1430,7 @@ static void mps3tz_an547_class_init(ObjectClass *oc, = void *data) mc->max_cpus =3D mc->default_cpus; mmc->fpga_type =3D FPGA_AN547; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m55"); + mc->valid_cpu_types =3D valid_cpu_types; mmc->scc_id =3D 0x41055470; mmc->sysclk_frq =3D 32 * 1000 * 1000; /* 32MHz */ mmc->apb_periph_frq =3D 25 * 1000 * 1000; /* 25MHz */ diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index 292a180ad2..bd873cc5de 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -142,12 +142,6 @@ static void mps2_common_init(MachineState *machine) QList *oscclk; int i; =20 - if (strcmp(machine->cpu_type, mc->default_cpu_type) !=3D 0) { - error_report("This board can only be used with CPU %s", - mc->default_cpu_type); - exit(1); - } - if (machine->ram_size !=3D mc->default_ram_size) { char *sz =3D size_to_str(mc->default_ram_size); error_report("Invalid RAM size, should be %s", sz); @@ -484,10 +478,15 @@ static void mps2_an385_class_init(ObjectClass *oc, vo= id *data) { MachineClass *mc =3D MACHINE_CLASS(oc); MPS2MachineClass *mmc =3D MPS2_MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m3"), + NULL + }; =20 mc->desc =3D "ARM MPS2 with AN385 FPGA image for Cortex-M3"; mmc->fpga_type =3D FPGA_AN385; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m3"); + mc->valid_cpu_types =3D valid_cpu_types; mmc->scc_id =3D 0x41043850; mmc->psram_base =3D 0x21000000; mmc->ethernet_base =3D 0x40200000; @@ -498,10 +497,15 @@ static void mps2_an386_class_init(ObjectClass *oc, vo= id *data) { MachineClass *mc =3D MACHINE_CLASS(oc); MPS2MachineClass *mmc =3D MPS2_MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m4"), + NULL + }; =20 mc->desc =3D "ARM MPS2 with AN386 FPGA image for Cortex-M4"; mmc->fpga_type =3D FPGA_AN386; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m4"); + mc->valid_cpu_types =3D valid_cpu_types; mmc->scc_id =3D 0x41043860; mmc->psram_base =3D 0x21000000; mmc->ethernet_base =3D 0x40200000; @@ -512,10 +516,15 @@ static void mps2_an500_class_init(ObjectClass *oc, vo= id *data) { MachineClass *mc =3D MACHINE_CLASS(oc); MPS2MachineClass *mmc =3D MPS2_MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m7"), + NULL + }; =20 mc->desc =3D "ARM MPS2 with AN500 FPGA image for Cortex-M7"; mmc->fpga_type =3D FPGA_AN500; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m7"); + mc->valid_cpu_types =3D valid_cpu_types; mmc->scc_id =3D 0x41045000; mmc->psram_base =3D 0x60000000; mmc->ethernet_base =3D 0xa0000000; @@ -526,10 +535,15 @@ static void mps2_an511_class_init(ObjectClass *oc, vo= id *data) { MachineClass *mc =3D MACHINE_CLASS(oc); MPS2MachineClass *mmc =3D MPS2_MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m3"), + NULL + }; =20 mc->desc =3D "ARM MPS2 with AN511 DesignStart FPGA image for Cortex-M3= "; mmc->fpga_type =3D FPGA_AN511; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m3"); + mc->valid_cpu_types =3D valid_cpu_types; mmc->scc_id =3D 0x41045110; mmc->psram_base =3D 0x21000000; mmc->ethernet_base =3D 0x40200000; diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c index 7b3106c790..eb74b23797 100644 --- a/hw/arm/msf2-som.c +++ b/hw/arm/msf2-som.c @@ -55,12 +55,6 @@ static void emcraft_sf2_s2s010_init(MachineState *machin= e) MemoryRegion *ddr =3D g_new(MemoryRegion, 1); Clock *m3clk; =20 - if (strcmp(machine->cpu_type, mc->default_cpu_type) !=3D 0) { - error_report("This board can only be used with CPU %s", - mc->default_cpu_type); - exit(1); - } - memory_region_init_ram(ddr, NULL, "ddr-ram", DDR_SIZE, &error_fatal); memory_region_add_subregion(sysmem, DDR_BASE_ADDRESS, ddr); @@ -106,9 +100,15 @@ static void emcraft_sf2_s2s010_init(MachineState *mach= ine) =20 static void emcraft_sf2_machine_init(MachineClass *mc) { + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m3"), + NULL + }; + mc->desc =3D "SmartFusion2 SOM kit from Emcraft (M2S010)"; mc->init =3D emcraft_sf2_s2s010_init; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m3"); + mc->valid_cpu_types =3D valid_cpu_types; } =20 DEFINE_MACHINE("emcraft-sf2", emcraft_sf2_machine_init) diff --git a/hw/arm/musca.c b/hw/arm/musca.c index 6eeee57c9d..770ec1a15c 100644 --- a/hw/arm/musca.c +++ b/hw/arm/musca.c @@ -355,7 +355,6 @@ static void musca_init(MachineState *machine) { MuscaMachineState *mms =3D MUSCA_MACHINE(machine); MuscaMachineClass *mmc =3D MUSCA_MACHINE_GET_CLASS(mms); - MachineClass *mc =3D MACHINE_GET_CLASS(machine); MemoryRegion *system_memory =3D get_system_memory(); DeviceState *ssedev; DeviceState *dev_splitter; @@ -366,12 +365,6 @@ static void musca_init(MachineState *machine) assert(mmc->num_irqs <=3D MUSCA_NUMIRQ_MAX); assert(mmc->num_mpcs <=3D MUSCA_MPC_MAX); =20 - if (strcmp(machine->cpu_type, mc->default_cpu_type) !=3D 0) { - error_report("This board can only be used with CPU %s", - mc->default_cpu_type); - exit(1); - } - mms->sysclk =3D clock_new(OBJECT(machine), "SYSCLK"); clock_set_hz(mms->sysclk, SYSCLK_FRQ); mms->s32kclk =3D clock_new(OBJECT(machine), "S32KCLK"); @@ -604,11 +597,16 @@ static void musca_init(MachineState *machine) static void musca_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m33"), + NULL + }; =20 mc->default_cpus =3D 2; mc->min_cpus =3D mc->default_cpus; mc->max_cpus =3D mc->default_cpus; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m33"); + mc->valid_cpu_types =3D valid_cpu_types; mc->init =3D musca_init; } =20 diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index 2aef579aac..2999b8b96d 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -121,15 +121,8 @@ static NPCM7xxState *npcm7xx_create_soc(MachineState *= machine, uint32_t hw_straps) { NPCM7xxMachineClass *nmc =3D NPCM7XX_MACHINE_GET_CLASS(machine); - MachineClass *mc =3D MACHINE_CLASS(nmc); Object *obj; =20 - if (strcmp(machine->cpu_type, mc->default_cpu_type) !=3D 0) { - error_report("This board can only be used with %s", - mc->default_cpu_type); - exit(1); - } - obj =3D object_new_with_props(nmc->soc_type, OBJECT(machine), "soc", &error_abort, NULL); object_property_set_uint(obj, "power-on-straps", hw_straps, &error_abo= rt); @@ -463,12 +456,17 @@ static void npcm7xx_set_soc_type(NPCM7xxMachineClass = *nmc, const char *type) static void npcm7xx_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-a9"), + NULL + }; =20 mc->no_floppy =3D 1; mc->no_cdrom =3D 1; mc->no_parallel =3D 1; mc->default_ram_id =3D "ram"; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a9"); + mc->valid_cpu_types =3D valid_cpu_types; } =20 /* diff --git a/hw/arm/orangepi.c b/hw/arm/orangepi.c index f3784d45ca..77e328191d 100644 --- a/hw/arm/orangepi.c +++ b/hw/arm/orangepi.c @@ -49,12 +49,6 @@ static void orangepi_init(MachineState *machine) exit(1); } =20 - /* Only allow Cortex-A7 for this board */ - if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a7")) !=3D 0) { - error_report("This board can only be used with cortex-a7 CPU"); - exit(1); - } - h3 =3D AW_H3(object_new(TYPE_AW_H3)); object_property_add_child(OBJECT(machine), "soc", OBJECT(h3)); object_unref(OBJECT(h3)); @@ -111,6 +105,11 @@ static void orangepi_init(MachineState *machine) =20 static void orangepi_machine_init(MachineClass *mc) { + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-a7"), + NULL + }; + mc->desc =3D "Orange Pi PC (Cortex-A7)"; mc->init =3D orangepi_init; mc->block_default_type =3D IF_SD; @@ -119,6 +118,7 @@ static void orangepi_machine_init(MachineClass *mc) mc->max_cpus =3D AW_H3_NUM_CPUS; mc->default_cpus =3D AW_H3_NUM_CPUS; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a7"); + mc->valid_cpu_types =3D valid_cpu_types; mc->default_ram_size =3D 1 * GiB; mc->default_ram_id =3D "orangepi.ram"; } --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469729; cv=none; d=zohomail.com; s=zohoarc; b=oKdgpe+Y0lNonzQ0CWHiYNMRHYHXvvJms01iD55tzV5jCzR4/SKri7vOTgSaP/yRgevx4codq1XPUz32sx+HN3t3+Rb8p9JjSC87G9xADvcoRij852Vpd6lpQGAPskl/MGTDlORvg28XVnO7YS/nGKIMH70p6zEzCzNdmq12f/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469729; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H4P3qee4jFL51Nbb/746jQf4mN+fePYfOB7VeiIaJ9s=; b=TUHLc/RbaPBAcR1HdWyBkMbT5sjXgWI5Ql+qq0MJQcfyCLwgkruvI80f+eFqf3fApM3MJbtV4Zy+czYz8nJToQfivBPy0D91tzf5RoFGGvxMpasx3x6oaSuRYQsoZylpN2v3pHCSkOUA3NbvX/wJ8hmaOuQ6Nat38hn+rIOhZoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469729593120.66872791532; Fri, 5 Jan 2024 07:48:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQQ-00084E-1Z; Fri, 05 Jan 2024 10:47:59 -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 1rLmPQ-0004L1-V9 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:58 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPJ-0003yA-CP for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:56 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3368b1e056eso1398869f8f.3 for ; Fri, 05 Jan 2024 07:46:48 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id d18-20020adff2d2000000b003374d8306cesm1606073wrp.86.2024.01.05.07.46.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469608; x=1705074408; 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=H4P3qee4jFL51Nbb/746jQf4mN+fePYfOB7VeiIaJ9s=; b=Kkwah4b1tougeMRIpTCAQAwZ9p+kwT5uP9F0d1TekDZxKNFruCjHlyyMhiRX/Eaq5Y 620c6kZHtKSeyiKEdKRLGJpUM+wRdzTLIY1sAWXrDEbW9OnKXBKyPrVdxXOGm5aIiCEV EThdXcWqHbRbHXDHBIXJ/REptiyqGo5hX5F+fFLoCxiIC6puZ/cTTiP9sdNeBeuBGtWe EYROdmlU8GkXnBy1y0PhRsD9TiIIMQsRoqLeqGFXFc/x8sYh/Aew/MXHLuAi8H7WhNwz gRT3HYkCGkE3vheDOhyo7w8g+XACjxGXEIa0DMGezH5n5CPlcoVZQGPTX6CNyAzXrRGe wZRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469608; x=1705074408; 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=H4P3qee4jFL51Nbb/746jQf4mN+fePYfOB7VeiIaJ9s=; b=PrvcXaMqpBDm1nAvhYA3or4JcmGwS1Qa8uNoG0N02145MnGQN3fT2b83e7vudXgbHh TQ6zzolm+sLyA4anD+y93OVsI+yN7uV1eRyXOD52jiKSeB+7j502Deia/aICsdaj9zMP /jjj4ZuL91vFKRvrn1NFj1bV3zYK5v/Dafme6LBedbHcx9TCHBohgkrZZ3jxLDtaPUSq k7AdmHnhaGUu2Slw+krvsYvchKsGTqwIUc2MdUQf50CLmbAR/Rv8PtEt/bBlnO0jQH5M WRaJdRVXiTvsoAPIUIcUDaSfsGNRh89w6xz6tgRS9uUULKioQ6TqOXNftP55RIEWFM46 iWIg== X-Gm-Message-State: AOJu0YxSmjRw/ez7ih31zUHpncZphCDQSM8hswjXkSQ5WQ0zrhCyCZCi NxkeCi1RIF+GLM0sUNfX5WpRYpLFWWZ/Nt48uXc+KSGy63A= X-Google-Smtp-Source: AGHT+IEyGA9a4ElA/usmcvq/rVU/Gq5rSOiQpNsrPhNyNUufj8qQ00o5kNeZX8axqLWUwPTy/4YXaA== X-Received: by 2002:a05:6000:1972:b0:337:4221:5525 with SMTP id da18-20020a056000197200b0033742215525mr1273664wrb.46.1704469607760; Fri, 05 Jan 2024 07:46:47 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Vijai Kumar K , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei Subject: [PULL 32/71] hw/riscv/shakti_c: Check CPU type in machine_run_board_init() Date: Fri, 5 Jan 2024 16:42:25 +0100 Message-ID: <20240105154307.21385-33-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469730216100001 From: Gavin Shan Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231204004726.483558-10-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/riscv/shakti_c.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/riscv/shakti_c.c b/hw/riscv/shakti_c.c index 12ea74b032..3888034c2b 100644 --- a/hw/riscv/shakti_c.c +++ b/hw/riscv/shakti_c.c @@ -28,7 +28,6 @@ #include "exec/address-spaces.h" #include "hw/riscv/boot.h" =20 - static const struct MemmapEntry { hwaddr base; hwaddr size; @@ -47,12 +46,6 @@ static void shakti_c_machine_state_init(MachineState *ms= tate) ShaktiCMachineState *sms =3D RISCV_SHAKTI_MACHINE(mstate); MemoryRegion *system_memory =3D get_system_memory(); =20 - /* Allow only Shakti C CPU for this platform */ - if (strcmp(mstate->cpu_type, TYPE_RISCV_CPU_SHAKTI_C) !=3D 0) { - error_report("This board can only be used with Shakti C CPU"); - exit(1); - } - /* Initialize SoC */ object_initialize_child(OBJECT(mstate), "soc", &sms->soc, TYPE_RISCV_SHAKTI_SOC); @@ -82,9 +75,15 @@ static void shakti_c_machine_instance_init(Object *obj) static void shakti_c_machine_class_init(ObjectClass *klass, void *data) { MachineClass *mc =3D MACHINE_CLASS(klass); + static const char * const valid_cpu_types[] =3D { + RISCV_CPU_TYPE_NAME("shakti-c"), + NULL + }; + mc->desc =3D "RISC-V Board compatible with Shakti SDK"; mc->init =3D shakti_c_machine_state_init; mc->default_cpu_type =3D TYPE_RISCV_CPU_SHAKTI_C; + mc->valid_cpu_types =3D valid_cpu_types; mc->default_ram_id =3D "riscv.shakti.c.ram"; } =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470014; cv=none; d=zohomail.com; s=zohoarc; b=JlelYukgIR885USGeg9DMdLREse+9GMW+DPLtPkbofv5/DDpU32KJ1ztP/nLZ5ywG34axQ1wkLCCaZGML2aO6HSE8MC8UTw8SOPNWdgB7NgVbgHdkrSfvNW02frY08Rre4QTSaw0aDIbFSBzZxPxvqQIVWs4jJFRRcr7hJ2AqxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470014; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cFGPQoyiNDNESAoFxHgGgEpoIvyyYwdHUPQolOFmxbE=; b=iYFOS3exePpz3nnLN5i+85v7VMPTV8xbMHQxe+W0f5CldQeNEO1ZKC3QqV/lr3tjuo9Duu04sFPbp1joVfOeYhf8nCcNoxAnBEaZ1QZ0Zrb64VauBM4jgM56yNes0F8ekfLT/mDkDSV+zfMyYHYHXHgqHxpf5LhaMJ8mVW7IvQM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470014804249.52060632865914; Fri, 5 Jan 2024 07:53:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQv-00017n-Rh; Fri, 05 Jan 2024 10:48:30 -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 1rLmPT-0004OO-0c for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:00 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPO-0003za-Pw for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:58 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-33687627ad0so1403136f8f.2 for ; Fri, 05 Jan 2024 07:46:54 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id u10-20020adfa18a000000b00336ca349bdesm1626770wru.47.2024.01.05.07.46.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469613; x=1705074413; 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=cFGPQoyiNDNESAoFxHgGgEpoIvyyYwdHUPQolOFmxbE=; b=yDHJUZtuJ+/pbAiwQ7FJM6Y7cA9os0eiFqDzVhm3WM69UHx4LvAMpspc3VSq7FMsfr Qg2vgeASyHqK9nB1MgQMnbKrjeBKPFzmMg5CZWEuM75fok6QhuEVX1TmGUVp7EwgTwQA Uq/I+c4a4ig9NuVW6dAFhlcattXWiYKYA+lOmxuL2UdTn/SnAockYNgdNMTQm7BkzUW1 oB+JMyvUUfWNp6dVTX726vWXDydMFhE2ZcrVd7aGugP7beY28JgxT6lyC3tzEWEnDcLz XhmWIUXQdOGuH5rQjN4/955fObhC8wi3LJiZ2eMw7OIEORdf+0XmFJqlNiQAJxjNjs+E DVIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469613; x=1705074413; 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=cFGPQoyiNDNESAoFxHgGgEpoIvyyYwdHUPQolOFmxbE=; b=GcnaTJNQ+VZXFKvc2GxM8mw7+BiK0NIdHPshgNbJ7VhwpNhCzjF36DLESrSg3K10EY GN4GCauWi7eFNIGVLeqiJWlTdEWqUtvHVHNtUBbMLI9OXUdGCWkt87qic1A48BFwZkGn lEylvWgdgkkpk62G14+fcYDloPiI//eo2ihVk/+uoxPljlBQhKo+YMRZCHHqnXTQ5BJY DZQsxYkayoKYluzlpBUTuDtMUofLYbPqUK6CuBBL2P5ArU7YN8sK/qIpSbAgjQsRxNs/ +N3vT/23bnwzHl83GDAd8rb18bPUYuBpPOPBY27bmLN8E+SYmGgcXwZWLHbW6KGyYUHk tjIw== X-Gm-Message-State: AOJu0YwmDS/uT+rJBtmm8113ooSKDMj2z7lxD6ZO5S3T0+X696kP2Pxk VZ5t8rNfi5X7AP4oqh2BT6UdpIpr+WUPstJLdLfyVHJS/7M= X-Google-Smtp-Source: AGHT+IFZLC2sKOmV+bj7XyN2s9p4gXiuKgjYCZfd/aPNXehtVwbSuR+sykW++shNHUXHHv21xtufkA== X-Received: by 2002:a5d:4b83:0:b0:337:49b6:8bea with SMTP id b3-20020a5d4b83000000b0033749b68beamr1188216wrt.78.1704469613220; Fri, 05 Jan 2024 07:46:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 33/71] hw/core/cpu: Remove final vestiges of dynamic state tracing Date: Fri, 5 Jan 2024 16:42:26 +0100 Message-ID: <20240105154307.21385-34-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470016825100011 The dynamic state tracing was removed in commit d0aaf08bb9. Fixes: d0aaf08bb9 ("tcg: remove the final vestiges of dstate") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231129182734.15565-1-philmd@linaro.org> --- include/hw/core/cpu.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 76ef59de0a..44ff954207 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -437,9 +437,6 @@ struct qemu_work_item; * @kvm_fd: vCPU file descriptor for KVM. * @work_mutex: Lock to prevent multiple access to @work_list. * @work_list: List of pending asynchronous work. - * @trace_dstate_delayed: Delayed changes to trace_dstate (includes all ch= anges - * to @trace_dstate). - * @trace_dstate: Dynamic tracing state of events for this vCPU (bitmask). * @plugin_mask: Plugin event bitmap. Modified only via async work. * @ignore_memory_transaction_failures: Cached copy of the MachineState * flag of the same name: allows the board to suppress calling of the --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469797; cv=none; d=zohomail.com; s=zohoarc; b=hNF/TpMeeYYBTcqnAIq4UeIVGiKtFzJAe9eLqj5DNaTIXpT5MB73gj7HhGEq20IIbRKq59AslEEEvyb3V6411Rq8XJesYEZon9sv1KHv32OZyCKmFijxKSHaDvhJOG9iTnsW61WhNm3ak5V3H89SmLgtKhi4LgiTgzWpHwQJDWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469797; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CbggecaPR1KDAEaq2ZCHfcAMG72AfEJs1+ws0Qr91Tw=; b=Obp/ZGVI1JT1d22Rq+3pgsaJEANBT/WcLKvYEUPj3BWm6RPPmmMgi7Jzo0+bIhjpm83jBj9OrQmTENRiacxzO9knAhM1wjoT7RrbW6+/cFtU3Xm35iaQQtE6yD5UVJ169ovaPNuR2enYd4xf918Q2Muc8S+Dc2ekNrfN3YRkeUY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469797754720.5109627246383; Fri, 5 Jan 2024 07:49:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQy-0001jY-Eg; Fri, 05 Jan 2024 10:48: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 1rLmPX-0004We-NU for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:06 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPU-00041q-8Q for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:02 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40d4a7f0c4dso17389355e9.1 for ; Fri, 05 Jan 2024 07:46:59 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id bi16-20020a05600c3d9000b0040d5ae2905asm1921248wmb.30.2024.01.05.07.46.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469618; x=1705074418; 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=CbggecaPR1KDAEaq2ZCHfcAMG72AfEJs1+ws0Qr91Tw=; b=KOIgIvdlo5bzOC3eFeSIBVzpCqo29wstSXlbatMD3Gb9Y1HMhUOTYtOqMTI5Xlp3sm PPppdL+O0nb/MiqF/ch2a3P+ypKdrQB0HTKB3XKbVpupd/etZdYwKn8I/NUhdfTCsCtq 8F3xqC029CcZGh/hT0QnBiK2bXSy5CwOxNn+BEOTyoUo91r+wo3iOOF4dFKxlJuB759k /KnTtcS959Dky4F0iLQT1S+AB+K4yCilYqyEaSepR0QiqV6nsGyfYYEQZoT16BhQ54LX NlGcAFYPHdxj5obvFZc2Qq037sJWEDrbei6/reDZXmZNruiKIoHpMYUCEz6An2rzcuEN +STw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469618; x=1705074418; 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=CbggecaPR1KDAEaq2ZCHfcAMG72AfEJs1+ws0Qr91Tw=; b=tlsrCohFDO/CWovexFW0gWXhB4webudWzNTwi5F1QzpHOUK91TDQ9VkXnVXJ7bY80P HjfJFtkcNZR0H5eHkint58R/eR7sCqGqC3SoERA3zk8YGlQPr0rED/bZhDAVaL0C1MxM xDRMPqFHU4NeP84Pm5QlHInZaRlZO0JygxtoCx57jJhna38425vLBd0AH/DT8Jx8huOS Gujo7bYYAKTXUF5QhMZ62GFfNlM9SZOg3NyV4nPacyUcrqQhjWVtR4JRKYqg96ErR+kE jxtltfU6mribIkSehoqv80UjznhYt0fCvwTElqHpHbax7E16HJ0Y5pHXRWi6k5mIklOf +eFg== X-Gm-Message-State: AOJu0Yz7qlovWLpoA+1iBW1OxjJ9TrN+lMW38vUUrCPgAXJbZLYx8Qn6 Zp33jyAYaPOSG60KYz/OT6ihjoVbduWCcYLGNW/J5BsluLM= X-Google-Smtp-Source: AGHT+IFA6+yO0f0vXnTz70uP27qlie96sO6Bbg1BzKCi0WprYekO/LbeL7sOPB8XwtAxlMBBBBGzgw== X-Received: by 2002:a7b:c5d9:0:b0:40c:35b9:e2dd with SMTP id n25-20020a7bc5d9000000b0040c35b9e2ddmr1254424wmk.85.1704469618702; Fri, 05 Jan 2024 07:46:58 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 34/71] hw/core/cpu: Update description of CPUState::node Date: Fri, 5 Jan 2024 16:42:27 +0100 Message-ID: <20240105154307.21385-35-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469798453100003 'next_cpu' was converted to 'node' in commit bdc44640cb ("cpu: Use QTAILQ for CPU list"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20231129183243.15859-1-philmd@linaro.org> --- include/hw/core/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 44ff954207..238c02c05e 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -430,7 +430,7 @@ struct qemu_work_item; * @gdb_regs: Additional GDB registers. * @gdb_num_regs: Number of total registers accessible to GDB. * @gdb_num_g_regs: Number of registers in GDB 'g' packets. - * @next_cpu: Next CPU sharing TB cache. + * @node: QTAILQ of CPUs sharing TB cache. * @opaque: User data. * @mem_io_pc: Host Program Counter at which the memory was accessed. * @accel: Pointer to accelerator specific state. --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469741; cv=none; d=zohomail.com; s=zohoarc; b=MpTjlevMqFLzBbHPYFa9SablFFDnWHwo40D1/DF4E5yr1QwYsyDmi7xZi44xtGZRLy31ehlx4D+o1Pl6lO2WjTIk2ZBjeFPpuSLK++fw9H/pVKVjlyZHirR3hABblYSvM+jP/Ny1DO53b7qqneUNtfD9HAZasi5itxV1wimI05o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469741; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1jtVroaWgerQaDsLUvyZtuo+bUywnLD5o4M9nlpDsZ0=; b=HqPW5WYBJTkVrVJA6ol/5lWYl+qUjgVTK1ccNlru4GiiQg5Y/hDb6A1kylQbp8gWihQ+Ju21YJO7rT1FxeFoxF7Yv+qMEUf4bCFLf2jXsZpB/zl3b8oDmRJojdZE9FehqhUt98QT3QHiUh0iYdoojGDLBEFO13DRyS9fD0H/qeE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469741921600.4570323850322; Fri, 5 Jan 2024 07:49:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQw-0001O4-O5; Fri, 05 Jan 2024 10:48:30 -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 1rLmPc-0004cE-2a for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:08 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPZ-00043A-S5 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:07 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3367f8f8cb0so1468698f8f.2 for ; Fri, 05 Jan 2024 07:47:05 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id cx12-20020a056000092c00b00336b702af06sm1612524wrb.16.2024.01.05.07.47.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469624; x=1705074424; 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=1jtVroaWgerQaDsLUvyZtuo+bUywnLD5o4M9nlpDsZ0=; b=VDQijkwCJ1HQdAfQ8E/PlYw7sxAyESEgnmZs6dVZKBNsnXMuMg6CBFOswzB1oBXfqb Ubf4CdJQL+seN+B9F+atrsqRkPt4pWS7x004/4aAwP3/r9aO0Nq1ThB8ekZbNZOt83yq LCLTsYha78OMsOfhiRfOgE+rU+NJYsScHk6fKIK39i4wzOj9snK6GL8wu+Pxu1W0iADH UtJS/T1ewG3je3XyHlqotnMpg0z6Fb+RkpiGizwE6v2mlLBxMrFKh+wrFsUP0MoXx5oj Sq5ZsNyq6OjI6uawou0unKvZPEMZGvGI197tzV8VNds4saxStWFRfOWHincotvqr1AW6 KMqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469624; x=1705074424; 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=1jtVroaWgerQaDsLUvyZtuo+bUywnLD5o4M9nlpDsZ0=; b=D4uZp3xaDsKpyc3ozj3Oby8Phda76fh579VdAL6rf3pNS4+PkN2VSt+7jD0XBwEhTN qQjh8ulx5ZNWMmyLt8PN+ASXVcfFjfIcwzVHeJ0V8AIzJ1rRwvp0VVdg9r/77Up/RD97 t/9uaKb9tARjRcL+FiUQaBHDpRD2LkRbcCaVa02SaUkKUb/Bm41Z313VWEzzcCn7UBJW nTh9tSsfq1BB1g8Jwt01N98kKWtrWJ5KZylTjc5NEigTDJkHHC/T06how/Xp3X/7y7Ww MpS5tVh4Z0OCfBpjYc8nxt5CirWmCEznq++64gFNnpBGvj0LVPI/0/9jzacljGi0M8Bh 481w== X-Gm-Message-State: AOJu0YymvdtB06JbFswOnfksb61tTDxR2JkgDzPnYh+4/y+/n9aNTeyQ Qp1Iq0lmHvzGOx/PGaqhOxy8K8HIKRGwgT3Jksi3c+/1JRE= X-Google-Smtp-Source: AGHT+IGfX7XLY0IInv1rRiBr+Cbo3ElbzjQJv5YKvlcD1AnhJvNIAIYMskwmmCU3K/gIuIls72lsow== X-Received: by 2002:a5d:4c46:0:b0:334:ada5:3835 with SMTP id n6-20020a5d4c46000000b00334ada53835mr1414314wrt.4.1704469623925; Fri, 05 Jan 2024 07:47:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Zhao Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 35/71] hw/cpu/core: Cleanup unused included header in core.c Date: Fri, 5 Jan 2024 16:42:28 +0100 Message-ID: <20240105154307.21385-36-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469742236100007 From: Zhao Liu Remove unused header (qemu/module.h and sysemu/cpus.h) in core.c, and reorder the remaining header files (except qemu/osdep.h) in alphabetical order. Tested by "./configure" and then "make". Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231127145611.925817-2-zhao1.liu@linux.intel.com> --- hw/cpu/core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 9876075155..495a5c30ff 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -8,12 +8,11 @@ */ =20 #include "qemu/osdep.h" -#include "hw/cpu/core.h" -#include "qapi/visitor.h" -#include "qemu/module.h" -#include "qapi/error.h" -#include "sysemu/cpus.h" + #include "hw/boards.h" +#include "hw/cpu/core.h" +#include "qapi/error.h" +#include "qapi/visitor.h" =20 static void core_prop_get_core_id(Object *obj, Visitor *v, const char *nam= e, void *opaque, Error **errp) --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470136; cv=none; d=zohomail.com; s=zohoarc; b=IZ+fZjncW08WTZKUy9dTcXU35kSmypqIVDkGbq82BNJi+rfPQ09ipgpsISqqJD8GIG8PW+dg19dqu0RS01ZaY6N0O3jBYTQ2n1FUdJ6MOc9ZT3HTTF/+dcAkh4mTsP/ACSZL47jjVBmavrTvzUoeCr2xaZkCZ1MZOOMgoGEhkI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470136; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XEzWZCwZQ+htA+jgYj3rjLFf9tHBeYLo9LMvIOXJj6w=; b=a7YI/Nop0OuFv4a3/4EH6KLm4DkH9m82KL4fYmMjrFxBAP81J69QwsimeP+bExCN3/S2twL46/Ash+dS9Btwg5gNriuFYX2OmAsHzWnNvVYhG3c1TskGGEGgwvSeD+3uNhZ3c9xFbEzmRSsbiPaRsJnRaxdIMM8E2OKg425qVks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470136762401.53942237178853; Fri, 5 Jan 2024 07:55:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmQx-0001fN-VP; Fri, 05 Jan 2024 10:48: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 1rLmPp-0005YB-UY for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:25 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPg-000449-CX for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:20 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e3a67ca9fso3855415e9.0 for ; Fri, 05 Jan 2024 07:47:11 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id l15-20020a5d410f000000b00336e43e8e57sm1612761wrp.58.2024.01.05.07.47.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469629; x=1705074429; 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=XEzWZCwZQ+htA+jgYj3rjLFf9tHBeYLo9LMvIOXJj6w=; b=nCXK817td/VnpUirjMpwSpCEYNUAYudv11qv9iNTOD7o68idIefMi81ju6uJ/gBNNQ qO+Aqq4ShJk7vh4MIfDQabsrn5Nv2Cxa+RBMTzZtZwAJvMOqgbd76jcr4Gyo7TGnopiP YKRkwriNpcIQW7RuKO1tLzBY9OFF5ftIeqgAUfVsWTFpyG430WBDUDoXzwVJ3+OzA2IP QnzqWnax+VuwrCJozRhB9zorZ2/94jgvaOINaHaQyZ2vn+r0qSvTfDkeEdhHIY2WvMur DEa25eVMa1pbXNcI2nwyUdp1+5ZbKKw81WFnRpS4C4B2XIRlQk6rKmn4W4ZQUQdStk0t nHbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469629; x=1705074429; 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=XEzWZCwZQ+htA+jgYj3rjLFf9tHBeYLo9LMvIOXJj6w=; b=qb5m7O2c1ug1nLhQL35ekKDJby5TNZVhClQi955zMjIkRVhJ8Pew217u1LG0tHPZ6f chgbKmb1JaCjcev7PKwqb5yBydUjG86M4ZbTlckPNK4LBdt+4pAY2XbHbs1mub5DQR2d CHs3CdNfDNlTgBB35Fl3rzdexwkrBZ/ZlO7tsCGkjp8CpWreUU6M4rigUGr9Hn4zy0Lp IYGhZSLWLtnyia08e9sq5pAfFjTaxn1+LbY3ZMZ6RkDFt2WduG5Ep/0h5cag8mHK7RzD +OnkDdRI/ULnfOmUDGlIZZg63qc2ngTT1xYnA4RP6qk+66m2fquoGKY50Xr2EB1Aiqvj yUZQ== X-Gm-Message-State: AOJu0YwytYrETflfxb8Vt8PcaLMqpNrbEJxq7pTd/EMBszy+rKUyDw4u mFrZ0+Ru790Gc5BPFkx1yQhWUl2soFIJRpdL/FQTMwLFUr8= X-Google-Smtp-Source: AGHT+IGpMdZvwtpFKg8Ac2YweuI5drk6D1PAK9d+aE9dppTyEEE7C+yJu/aUnuEZ+DzDoPHdjTUHrQ== X-Received: by 2002:a1c:790b:0:b0:40d:79ec:bb4f with SMTP id l11-20020a1c790b000000b0040d79ecbb4fmr1232048wme.26.1704469629159; Fri, 05 Jan 2024 07:47:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Zhao Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 36/71] hw/cpu/cluster: Cleanup unused included header in cluster.c Date: Fri, 5 Jan 2024 16:42:29 +0100 Message-ID: <20240105154307.21385-37-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470137495100001 From: Zhao Liu Remove unused header (qemu/module.h and qemu/cutils.h) in cluster.c, and reorder the remaining header files (except qemu/osdep.h) in alphabetical order. Tested by "./configure" and then "make". Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231127145611.925817-3-zhao1.liu@linux.intel.com> --- hw/cpu/cluster.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/cpu/cluster.c b/hw/cpu/cluster.c index e444b7c29d..61289a840d 100644 --- a/hw/cpu/cluster.c +++ b/hw/cpu/cluster.c @@ -19,12 +19,11 @@ */ =20 #include "qemu/osdep.h" + +#include "hw/core/cpu.h" #include "hw/cpu/cluster.h" #include "hw/qdev-properties.h" -#include "hw/core/cpu.h" #include "qapi/error.h" -#include "qemu/module.h" -#include "qemu/cutils.h" =20 static Property cpu_cluster_properties[] =3D { DEFINE_PROP_UINT32("cluster-id", CPUClusterState, cluster_id, 0), --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469933; cv=none; d=zohomail.com; s=zohoarc; b=LQ/BqOHK5PTSXem8uGU+cPAU7lbnfBuBucw5vLrGbOr0hhKjpstyQq/dnCnk02r46KdaszNQSKCEvFfDxirPj7RJcZwq00GugJOduO8l0nrgVRCXWlnAW+Gr5wPQvihGGuuec6EOC1d+m1xWsyoyBaOyTGIz2mLRh4nYrIOVauQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469933; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=foPbRN9kgz3ubIukCDMoVcakJKSu99lNJLUQRej2Dsg=; b=RCrvWvbtq/etRo8R4mf3FWUmfOFR0SNO4ILICwFP4kTQEX+/TkcU6FIN3tT2m9t1zLZw6RF49jTqjOuXHMiRPKiU3dDIqEg2H/3e5hU8VVHwafLCcHBKBCm7/xLgFVuY/2EfjYxOZOdgBG1yNYgkLCqL4zh9X82+EnT5mkbZnIc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469933261851.6659468243248; Fri, 5 Jan 2024 07:52:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmR2-0002Ab-0v; Fri, 05 Jan 2024 10:48:36 -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 1rLmPl-0005MS-La for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:19 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPj-00045A-UF for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:17 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33748c4f33dso1402314f8f.1 for ; Fri, 05 Jan 2024 07:47:15 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id g18-20020adfa492000000b003365f5e87f4sm1623391wrb.95.2024.01.05.07.47.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469634; x=1705074434; 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=foPbRN9kgz3ubIukCDMoVcakJKSu99lNJLUQRej2Dsg=; b=pAJGDXvCXqCWtmEX24PENeF/S6BWfWmbADoC/oGYDGPwQKutZ5aONcv7Q3kSxSaRsj Vu1dKH40+YAhYVZ7ElIXYKG0OUx6y6xhkG8jaidL7xoZVDljyNVB9qb/gcn66glAF2Ej VADCTDYsNLlH/NBBSWO8K0crq+FVsvtxd1WsgGMiKvJDumxUi3bpkr0+gz1s5XSO55CQ 2H1E3rcmYnn9EzUtcSsrdkwF3eoYzC0hlkyc7a0GnoOvAgaf278CFXcxQKO9qj8ggKRE dolEz3LzOa9vJ4XLQMRq/OC+E2g2ngAL1ZDrJWgWWG3DDk2OpuAsv+t9H7skvwZJxfuG htyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469634; x=1705074434; 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=foPbRN9kgz3ubIukCDMoVcakJKSu99lNJLUQRej2Dsg=; b=AYBWjTv2WOVeTbjsp0IL+3uy3VlAwnoXFSsKl8tr7yj29aWJGjEcwwui1IDaLEUc8F TFuMja47zyNBShc0s93HDyXLsLn83f2rNnwfchaGvcLbWadX9b+8e0Jgy1wc8+MW6G94 M7wUlpciROWugSKi4LKwAFFyZFC7LIWB88cBgjTLFJ+gE70yLquKncjP4q71BMpe9Vl0 b03SW56QZB/6aHfrG3BxglxS8Jw/ancUFyc4iYaGciwIz30rfnE6NkWR7LAN7wh+oDEr bOlCsZNpOgbnrN7zma6z9KKuCmJCDcHrxfRlKEsIXj1X3yd1f/FGsXesxvKHYzmMxqel D4jw== X-Gm-Message-State: AOJu0YydBaZuhR5jcHE43LVwZ2pKJchD7QP6GSteBwPBF4V/FribfeA/ DTwtw+yU7Lvk43zJjwk/QBbUiE8TcBcrhPp0RPepPjlZ9ss= X-Google-Smtp-Source: AGHT+IHg1HQZbW3JaXorahcPs3JXuhS2e6/ZjANSl9hTUp1wBVq9xc+bE8w9O8VzKqOqqQuwrYzHSA== X-Received: by 2002:a5d:550d:0:b0:332:e667:4277 with SMTP id b13-20020a5d550d000000b00332e6674277mr1265526wrv.40.1704469634427; Fri, 05 Jan 2024 07:47:14 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fabiano Rosas , Gerd Hoffmann Subject: [PULL 37/71] hw/audio/sb16: Do not migrate qdev properties Date: Fri, 5 Jan 2024 16:42:30 +0100 Message-ID: <20240105154307.21385-38-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469934343100001 Since commit f7b4f61f63 ("qdev/isa: convert soundblaster") these fields have been converted to qdev properties, so don't need to be migrated: static Property sb16_properties[] =3D { DEFINE_AUDIO_PROPERTIES(SB16State, card), DEFINE_PROP_UINT32 ("version", SB16State, ver, 0x0405), /* 4.5 */ DEFINE_PROP_UINT32 ("iobase", SB16State, port, 0x220), DEFINE_PROP_UINT32 ("irq", SB16State, irq, 5), DEFINE_PROP_UINT32 ("dma", SB16State, dma, 1), DEFINE_PROP_UINT32 ("dma16", SB16State, hdma, 5), DEFINE_PROP_END_OF_LIST (), }; Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Fabiano Rosas Message-Id: <20231124182615.94943-1-philmd@linaro.org> --- hw/audio/sb16.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index bf7f35a42b..fd76e78d18 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1325,11 +1325,11 @@ static const VMStateDescription vmstate_sb16 =3D { .minimum_version_id =3D 1, .post_load =3D sb16_post_load, .fields =3D (const VMStateField[]) { - VMSTATE_UINT32 (irq, SB16State), - VMSTATE_UINT32 (dma, SB16State), - VMSTATE_UINT32 (hdma, SB16State), - VMSTATE_UINT32 (port, SB16State), - VMSTATE_UINT32 (ver, SB16State), + VMSTATE_UNUSED( 4 /* irq */ + + 4 /* dma */ + + 4 /* hdma */ + + 4 /* port */ + + 4 /* ver */), VMSTATE_INT32 (in_index, SB16State), VMSTATE_INT32 (out_data_len, SB16State), VMSTATE_INT32 (fmt_stereo, SB16State), --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469939; cv=none; d=zohomail.com; s=zohoarc; b=M3NByc3WIOvgc8ITq1HLirfohGFdzERrG0nfgMZv0Rj2ALJN5M5X9u8C19WRzhBDJcV2SlXODVw336jNDizJ/VDLdG5qEC7tJzlSVwm/seb3lWpal97qenqTKyEV/CS0Ei6O/jQidAZqt//9Ocn6oS8iL2+ta0qH/lu6a/BqaAM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469939; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iQqVZQAplGXwt087ddAaGknca/07pmUL/gFu1d2+27U=; b=JEJh8wIWDSRFlFuBmJAf5ptwTWBDh69kk52WfvjYi9OEM+pQGqRBDdYQS+DBOCQQlS3wWeG+rZx+npaNmesRgD/ZkfCdMC5zhktj36nqPlJvv1GuNLW3w/m9GmrWyne0uv//zI6+iOrDpUC8DiRpGCVGPkdj+twNpFoe3SumjWM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469939697469.8194420121829; Fri, 5 Jan 2024 07:52:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmR8-0002yi-9b; Fri, 05 Jan 2024 10:48:42 -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 1rLmPs-0005aC-EP for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:26 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPp-00047Y-M3 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:23 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-336c9acec03so1301787f8f.2 for ; Fri, 05 Jan 2024 07:47:20 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id k7-20020a5d6d47000000b0033725783839sm1605061wri.110.2024.01.05.07.47.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469640; x=1705074440; 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=iQqVZQAplGXwt087ddAaGknca/07pmUL/gFu1d2+27U=; b=rBQ6eBIXuAdfLu0GR0eKsWS8Azq3u6wuQt/JBZFPQA+UTw1BKa/4aqxs2MlLyDkxHa Dmybi4K6P90/kCOiGPp2usL4/dwMPfcqH+zZrUDqv3EyikR2zLsQtZHQE3qbcDGAOmEa wPZKoWXBjmPDfeF6OMULLPtdOE8ukQJD5SuD+86lD1MMo17Fgj7aIHczzKJvC9Jr14WL jnYu6MaFy2xKM7Ur1xTqjl1flVigApzvxBjIEOCWe1GaOlid4kY9wYAi6XpqqOhpODW0 qyE9bL84xhawbACVPZSv2pzucEcTBZyYN8JEHUn1LA/5cPTOtZmhjD/1VlzqX1o2xpgN wgWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469640; x=1705074440; 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=iQqVZQAplGXwt087ddAaGknca/07pmUL/gFu1d2+27U=; b=cv0M0dn3MvBN4A3+Hwny/QXkneNYOcbGf/Aqrm4EJnrGXEZlzriF3XHHharf0O5J17 gX4gFoo5Q3xvvVogg9XC8+55P6AJpjwZsIclJ3Tfxy6v4XyCr6BKXPTq2R45ejk+Wt98 E8oTAEiz3rtvFt1auGhexlZ9804Hm1bMwavlcHhPCFLw2sAXQZr3hH8AZ/3YxqmVsP6h Klr0pwAP82JX1y11bDou+rg2rKQZ814UyIDd0BF3+vO4OCf5LMGrLoKJppZ4a5KPzoMf 2/xlW3xKUqnafnQZBAmsVq0bc6qYfTh/44HYRsJw9fk8isKyZeGsm+QnwcZvNGZCiViX ABmw== X-Gm-Message-State: AOJu0YxcAj8RpkPVR029E5ler4izx+50aD4eIsjO8Fym5W9pqUPc4gjS eb90Y+yno/YViFzi9rvf74HGVjuYEQ9ioL5YylNcG3Zrezk= X-Google-Smtp-Source: AGHT+IFR0sHSGxpKEI+Ag2hwXAsaEAvXTLccumut7zi7pHF38anQ7KYbLL7zcyI7JlDChab5stlH/g== X-Received: by 2002:adf:ed8c:0:b0:337:d82:5106 with SMTP id c12-20020adfed8c000000b003370d825106mr1218971wro.99.1704469639779; Fri, 05 Jan 2024 07:47:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 38/71] hw/arm/bcm2836: Simplify use of 'reset-cbar' property Date: Fri, 5 Jan 2024 16:42:31 +0100 Message-ID: <20240105154307.21385-39-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469940419100001 bcm2836_realize() is called by - bcm2836_class_init() which sets: bc->cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a7") - bcm2837_class_init() which sets: bc->cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a53") Both Cortex-A7 / A53 have the ARM_FEATURE_CBAR set. If it isn't, then this is a programming error: use &error_abort. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20231123143813.42632-3-philmd@linaro.org> --- hw/arm/bcm2836.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 166dc896c0..a1bd1406e1 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -131,10 +131,8 @@ static void bcm2836_realize(DeviceState *dev, Error **= errp) s->cpu[n].core.mp_affinity =3D (bc->clusterid << 8) | n; =20 /* set periphbase/CBAR value for CPU-local registers */ - if (!object_property_set_int(OBJECT(&s->cpu[n].core), "reset-cbar", - bc->peri_base, errp)) { - return; - } + object_property_set_int(OBJECT(&s->cpu[n].core), "reset-cbar", + bc->peri_base, &error_abort); =20 /* start powered off if not enabled */ if (!object_property_set_bool(OBJECT(&s->cpu[n].core), --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470281; cv=none; d=zohomail.com; s=zohoarc; b=fU1irQQFZ0uELDzwBmeJwnnujwdLT+Ao4YDkbgZxz33IMl0pqdWGdZckVkkvcCko0y92PmS26KC7ZpUo8nqYjlPbXm+gyEq1jgG8/+jXaH43pYF83Ag4CQK9oQ0e5wplM/m/AuLUirKh+GskvChV26VYIOudIC2iHpOwEONOmug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470281; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QIi494ZIPpClTlGLpiqU0qCpof/tLsTarUcBXXHQbq8=; b=aVSdiYS2FRJiYTYQNY+5lZ/f9gPMejXetDIOnvY3y1s4Iqt3U0GPLHRZ9AZSumyXtl/k3Jf3x0W1ARLXpGVC9DBKoPJemVpJnyEbi0Y4+7+gzTYHXAhv9qUb/M6SC6u5JV7z8S9NiUplmi/jugEzi8ynr74kWgqkzmVWhai+lgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470281314359.3140599668458; Fri, 5 Jan 2024 07:58:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmR6-0002pI-IY; Fri, 05 Jan 2024 10:48: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 1rLmPx-0005yh-Go for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:29 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmPu-00048O-Dc for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:29 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40e37524fafso8947865e9.1 for ; Fri, 05 Jan 2024 07:47:26 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id iv20-20020a05600c549400b0040b3d8907fesm1928352wmb.29.2024.01.05.07.47.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469645; x=1705074445; 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=QIi494ZIPpClTlGLpiqU0qCpof/tLsTarUcBXXHQbq8=; b=vF/Df9YLbCjANguPuSTnr5QfBzVSnVUxQLKWNRIi39PkE0VqwfoMXZwtY6i9ev2Y3G k1c044BErpcFaMnnVAmS27oU/FYDSUs/07xVVhlVDTcgiZRasF7PxTLhn0nhwQzRYJjF P9wnNG/gEJPshWBVVLfQpz3KqP4AQyeL1SUIkhYQ+igni1G5atHybX1NltpzRDGmE5kG tXsgdGji5hVH79JHmL9/7/qXTDl6d3Hhy8kVx3KxRmZ52OlbqNGD89B/rVuN3ZFeWJHj T2qVhc50YHGebsufMNlPCQzVCGLbFHERMejo+B43BAYGIjLgjXmRM0Oigxac2DKatPhX Y0FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469645; x=1705074445; 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=QIi494ZIPpClTlGLpiqU0qCpof/tLsTarUcBXXHQbq8=; b=KpeGe8Zm2kiv1NDKB5IOduVkuWvvC/izIbntfphkxc8Vqc8zxzIjatQqC6W/XsLSxx xR9EMjLECeC0XzflYxa/nIyl6pHK1lTj9NCh7vsNOnbA4K4kb5N/iEuwX+wqnKG8XEhP xjxp/0mV1vIzzUR8AaTggs4Dqjbb+WyxlAYfn6wBk+rWmJZnmM6N9QcBHaJIyAgpNioe gVxsH86c6XYZy3ABn1AnWvYqyAWb6cpphm+50ULXCJW4FuX+nJt8el3OKBeInW2Ob0yz CYKY75JNJJdMY9nBEQvaNAG4Hr+FgctVdy3EOar1OXI7rPsB4qVE0d51xu+C/oiMcqbz a0Xw== X-Gm-Message-State: AOJu0YwrvIrUr8CpLZpbvdQNGvI3hEOr6EVN5XsiOe11dj/CzPC/c2Px 1e9PVSUbdyRs9KymDmsT1tG6chmr13GKwDEM/3keJz9T59Q= X-Google-Smtp-Source: AGHT+IE0XlPSZc9tFbMSGblHOADfNL01MnPGMi6FOcPBZRLMhQw7ZmRMlo0tISzqYBwqCFrICq5QzA== X-Received: by 2002:a05:600c:4f02:b0:40b:5e21:ec3f with SMTP id l2-20020a05600c4f0200b0040b5e21ec3fmr1175525wmq.113.1704469644973; Fri, 05 Jan 2024 07:47:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 39/71] hw/arm/bcm2836: Use ARM_CPU 'mp-affinity' property Date: Fri, 5 Jan 2024 16:42:32 +0100 Message-ID: <20240105154307.21385-40-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470281993100001 The 'mp-affinity' property is present since commit 15a21fe028 ("target-arm: Add mp-affinity property for ARM CPU class"). Use it and remove a /* TODO */ comment. Since all ARM CPUs have this property, use &error_abort, because this call can not fail. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20231123143813.42632-4-philmd@linaro.org> --- hw/arm/bcm2836.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index a1bd1406e1..289c30e6b6 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -127,8 +127,8 @@ static void bcm2836_realize(DeviceState *dev, Error **e= rrp) qdev_get_gpio_in_named(DEVICE(&s->control), "gpu-fiq", 0)); =20 for (n =3D 0; n < BCM283X_NCPUS; n++) { - /* TODO: this should be converted to a property of ARM_CPU */ - s->cpu[n].core.mp_affinity =3D (bc->clusterid << 8) | n; + object_property_set_int(OBJECT(&s->cpu[n].core), "mp-affinity", + (bc->clusterid << 8) | n, &error_abort); =20 /* set periphbase/CBAR value for CPU-local registers */ object_property_set_int(OBJECT(&s->cpu[n].core), "reset-cbar", --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469822; cv=none; d=zohomail.com; s=zohoarc; b=XvVQTirFQoNqP+YM/PKQMjVYGB52wLvnuQ+y5vNcT2DhsAuXoZKkiC+aCguVc646zH1aNf6iN23+Bh4aPAz/5BCqIltrRqO3dkzBW6pbx2ZeXcmGZhfjzftTfPTALM4QFlLC17HxE8/9OLP9YtMnM5Ui1zMWFjoLM78wbFmLe2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469822; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3QQ/o8R5/vZPDmg4xKxtglyBmLRK3vBkRVa+vx66Ggc=; b=UGdy0S0SUoWXMMIr6wOSDbWMGOS9/inSAM2MqjoTbnWUlrv+Af6bsjCh2TTa6rzeGjgI6/egSdB3WwR+8PeblU7uQF6txm/A/VbijanM9aXUKOVwTWMSm8FgEROFdN7s9TrYFHl2nok/OlfaDCJYwYPUBB/PPYuO61qopWlaKxQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469822588715.2882943110907; Fri, 5 Jan 2024 07:50:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRF-0003re-6J; Fri, 05 Jan 2024 10:48:49 -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 1rLmQ3-0006db-QB for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:36 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQ1-0004Fv-9S for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:35 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40d2e56f3a6so4032425e9.1 for ; Fri, 05 Jan 2024 07:47:31 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id cx12-20020a056000092c00b00336b702af06sm1613139wrb.16.2024.01.05.07.47.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469650; x=1705074450; 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=3QQ/o8R5/vZPDmg4xKxtglyBmLRK3vBkRVa+vx66Ggc=; b=gzNgdQPXPyjo0e59+p2+dOCfBNfxyuQQCVoz1hYTsUQgktONxBoVkdqtkzt2RqWLX0 UphElLe0/bONr7wFZY77YWN/JtT49wtgD3wopOUbKNxq818eaLpq04F28C5XYAyVEEDv 4KymZ7QFi3RxRWrHaKFSscJ4lGAuUQVfqTz7cajRwr+b3zxWpIaNt5A+H0FpClFs/tlK vLlzlloKi87hyq0XFqCBZW65CQNFnJq7Y2blXFKtOcZ1Q8ujbyjZJgazTpGvA7NihO+8 drOCpcCrZDE8Vs8YiKYiq+dvTYLaDkjkvjtncRRMbmtPF7N/lXgZBcsX8Tuhts15qdCn Tgqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469650; x=1705074450; 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=3QQ/o8R5/vZPDmg4xKxtglyBmLRK3vBkRVa+vx66Ggc=; b=g5Ge2VmNG8Wbs8s9aPIYopu4ZGS4rgGx66DX9Ggmuy/kE4MFOh+mPmXTwvQeEm4AzL ipLRxU9pph0QMrGN+bouop0i/Qj3imo8bxLbyNLsbsyZoeoFluLuLLegLrCjgri4WZqb tnS7MA0EM0zj1sgMbhc2W+dO9JCNrfv7lGLQHFa8G6MmuiHt09Lqvnc5ww08LOtvJwBy DdbMAed8vDqz+mopEJxXvEUJYc4PJbG+ogpKC7BWvebOj7H1sRK2idUcWA2e1EImHmMn x+e58JUeb1LFinJPKtBy5+o8c9gIZv/x/iu0du9acvDqVnenXA7+GLvPPO9vvq6MfgxP jyiw== X-Gm-Message-State: AOJu0Yy3aB1ZRRAHAMZrTXTMszQeAJPRBQm1wiW5eM2rlbLrfTLWeqnM grmSnSVy11rm/1/NlZCvi6t8cg4av10onOFA9m5TRM+EDZ8= X-Google-Smtp-Source: AGHT+IE0NVRH1AsKnMTaK60vgA9dgB0tn9TEVo7as9L+MBZ95qRbYdTbsnbpI/cUI4AvDNkqubBNdA== X-Received: by 2002:a05:600c:3112:b0:40d:62f7:3097 with SMTP id g18-20020a05600c311200b0040d62f73097mr1318661wmo.130.1704469650602; Fri, 05 Jan 2024 07:47:30 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson Subject: [PULL 40/71] hw/ppc/spapr_cpu_core: Access QDev properties with proper API Date: Fri, 5 Jan 2024 16:42:33 +0100 Message-ID: <20240105154307.21385-41-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469832256100001 CPUState::start_powered_off field is part of the internal implementation of a QDev CPU. It is exposed as the QDev "start-powered-off" property. External components should use the qdev properties API to access it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Harsh Prateek Bora Message-Id: <20231123143813.42632-2-philmd@linaro.org> --- hw/ppc/spapr_cpu_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 710078e9f7..5aa1ed474a 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -306,7 +306,7 @@ static PowerPCCPU *spapr_create_vcpu(SpaprCpuCore *sc, = int i, Error **errp) * All CPUs start halted. CPU0 is unhalted from the machine level rese= t code * and the rest are explicitly started up by the guest using an RTAS c= all. */ - cs->start_powered_off =3D true; + qdev_prop_set_bit(DEVICE(obj), "start-powered-off", true); cs->cpu_index =3D cc->core_id + i; if (!spapr_set_vcpu_id(cpu, cs->cpu_index, errp)) { return NULL; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470497; cv=none; d=zohomail.com; s=zohoarc; b=HMorgXqSOqQYHwNJxq+yAINKdu2OmoOBEoyvuJqkQADBZgCsUMMyByP0l+kMv2HXaYoYWn133e+/xcPkEPv3pV0MKRYeLEszN5RrtbF0uXgpawvmTgNygJJp8/fAp05cnJEh7JmkJ+xbr1JbFRBur9dNzx4xH69cHlrXSErWZBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470497; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=E6gZ5WhughGxcVou1a2gSnMeSMbcizgPZgg8bhDFRA4=; b=FUCBwkkMpH7IPO3xO8LmlWdVnXb3gMozExo5Uoan8ikhVcD6G1ZoHxhaxn+oLsIGizDeh007JGbAGcTEFWpEtZSG96pHE0k9oZuySy3fwcbtBmVXBnmp1xgS8ou3//sA7RBi+fVp2579SIzzlUCf/H8PBYjKWsIQAmTQ/gwT7v4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470497374566.392614968294; Fri, 5 Jan 2024 08:01:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRK-0004VA-1r; Fri, 05 Jan 2024 10:48:54 -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 1rLmQB-000746-1V for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:43 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQ5-0004QO-US for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:41 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40e3b3fb6f6so1877005e9.2 for ; Fri, 05 Jan 2024 07:47:37 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b0040d6d755c90sm1933844wmq.42.2024.01.05.07.47.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469656; x=1705074456; 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=E6gZ5WhughGxcVou1a2gSnMeSMbcizgPZgg8bhDFRA4=; b=qhcaafY2wK1cDcfgx5MrK949O89dJJEHfaQa9rTTbysHcJivO4WmkmbPTEOpwWr1KW bHoD76itI+sdJQQq0quf06rpAZAXn7iIKB6AGPG5kNteKAlt2gTcuZ7j17SXBn0gNPgi XC672JaKdTfiLUxN6QN7+uLrDp5XY63k5w+yW1EVQTJzOFtvJOQpOFsy5OSpaiXEsYni 2wIIjeTvG5gUym1imHNTTxcSvA28AHDMjwn84XNdmZ6ekAGz8855I7D9oRxmYUUoKsg8 ZzVc7jYbFLh+zQ3PklsjDjbVsEmX1fHTfgvtbwtCreTeIH11At5HFulLf67+WoiTpNZh x+XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469656; x=1705074456; 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=E6gZ5WhughGxcVou1a2gSnMeSMbcizgPZgg8bhDFRA4=; b=EWFkGLf6M5a2nBr9YtpXdI7LCC/Q6wUOSNV2C5Fqlpnmi668Q0k5wo05X6NZ1GarPc 6OxxA+Ol3a3IJjfY+oZi7nxnDg68lmp7MBs4yF6usYc/NVAIUyy8/G7nTqm2mGVwgiVx BO5xVUFHtSsZKJYFJB0d2SxrlP7PjGu0K92PqM1okdZm8alD9deSFQIXBNpPKm/2cb0c Q68AEB4FWN/Ojs9rmjr+3HXgLcLclg1WWWqsQTWsUldklVcxy+gVI+OUY3M7618YI+ta +3Vn7XmQkn23v7uZPgSlO0UW7+GqjdW1XKVhj255iJf13WrrAD2fTGY1FHifsenDWHYg OUOQ== X-Gm-Message-State: AOJu0YwvbDAcb9X7vR92HJz8niTkFxe36YRF450lSt1qfDr79HV3f3Dh Vrem9W4yK7JSKCazRrkpOdEmbqmHsNj/00JVO9a78ZRJ0Ao= X-Google-Smtp-Source: AGHT+IFzrXk92OVa4Hc07WKubLX2pJnxCM7cZFqkIG+NhLFeRoIPs2kbo2iPM/Isgll3aWiz+yLeQw== X-Received: by 2002:a1c:4b10:0:b0:40d:8810:620c with SMTP id y16-20020a1c4b10000000b0040d8810620cmr1318587wma.52.1704469656069; Fri, 05 Jan 2024 07:47:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell , Mark Cave-Ayland , Artyom Tarasenko Subject: [PULL 41/71] hw: Simplify accesses to the CPUState::'start-powered-off' property Date: Fri, 5 Jan 2024 16:42:34 +0100 Message-ID: <20240105154307.21385-42-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470499289100007 The 'start-powered-off' property has been added to ARM CPUs in commit 5de164304a ("arm: Allow secondary KVM CPUs to be booted via PSCI"), then eventually got generalized to all CPUs in commit c1b701587e ("target/arm: Move start-powered-off property to generic CPUState"). Since all CPUs have it, no need to check whether it is available. Updating this property can't fail, so use &error_abort. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20231123143813.42632-5-philmd@linaro.org> --- hw/arm/armsse.c | 6 ++---- hw/arm/armv7m.c | 8 ++------ hw/arm/bcm2836.c | 8 ++------ hw/mips/cps.c | 7 +++---- hw/ppc/e500.c | 2 +- hw/sparc/sun4m.c | 2 +- 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 02b4f6596f..91502d157a 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -1022,10 +1022,8 @@ static void armsse_realize(DeviceState *dev, Error *= *errp) * later if necessary. */ if (extract32(info->cpuwait_rst, i, 1)) { - if (!object_property_set_bool(cpuobj, "start-powered-off", tru= e, - errp)) { - return; - } + object_property_set_bool(cpuobj, "start-powered-off", true, + &error_abort); } if (!s->cpu_fpu[i]) { if (!object_property_set_bool(cpuobj, "vfp", false, errp)) { diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 375a40962f..e39b61bc1a 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -318,12 +318,6 @@ static void armv7m_realize(DeviceState *dev, Error **e= rrp) return; } } - if (object_property_find(OBJECT(s->cpu), "start-powered-off")) { - if (!object_property_set_bool(OBJECT(s->cpu), "start-powered-off", - s->start_powered_off, errp)) { - return; - } - } if (object_property_find(OBJECT(s->cpu), "vfp")) { if (!object_property_set_bool(OBJECT(s->cpu), "vfp", s->vfp, errp)= ) { return; @@ -334,6 +328,8 @@ static void armv7m_realize(DeviceState *dev, Error **er= rp) return; } } + object_property_set_bool(OBJECT(s->cpu), "start-powered-off", + s->start_powered_off, &error_abort); =20 /* * Real M-profile hardware can be configured with a different number of diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 289c30e6b6..b0674a22a6 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -135,12 +135,8 @@ static void bcm2836_realize(DeviceState *dev, Error **= errp) bc->peri_base, &error_abort); =20 /* start powered off if not enabled */ - if (!object_property_set_bool(OBJECT(&s->cpu[n].core), - "start-powered-off", - n >=3D s->enabled_cpus, - errp)) { - return; - } + object_property_set_bool(OBJECT(&s->cpu[n].core), "start-powered-o= ff", + n >=3D s->enabled_cpus, &error_abort); =20 if (!qdev_realize(DEVICE(&s->cpu[n].core), NULL, errp)) { return; diff --git a/hw/mips/cps.c b/hw/mips/cps.c index b6612c1762..4f12e23ab5 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -78,10 +78,9 @@ static void mips_cps_realize(DeviceState *dev, Error **e= rrp) CPUMIPSState *env =3D &cpu->env; =20 /* All VPs are halted on reset. Leave powering up to CPC. */ - if (!object_property_set_bool(OBJECT(cpu), "start-powered-off", tr= ue, - errp)) { - return; - } + object_property_set_bool(OBJECT(cpu), "start-powered-off", true, + &error_abort); + /* All cores use the same clock tree */ qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock); =20 diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 384226296b..566f1200dd 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -955,7 +955,7 @@ void ppce500_init(MachineState *machine) * when implementing non-kernel boot. */ object_property_set_bool(OBJECT(cs), "start-powered-off", i !=3D 0, - &error_fatal); + &error_abort); qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); =20 if (!firstenv) { diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 17bf5f2879..64895aebe3 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -804,7 +804,7 @@ static void cpu_devinit(const char *cpu_type, unsigned = int id, =20 qemu_register_reset(sun4m_cpu_reset, cpu); object_property_set_bool(OBJECT(cpu), "start-powered-off", id !=3D 0, - &error_fatal); + &error_abort); qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal); cpu_sparc_set_id(env, id); *cpu_irqs =3D qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS); --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469766; cv=none; d=zohomail.com; s=zohoarc; b=WtkxwJAgb4Bc6X57Ugo91Ihn06HINcMLfO72aNpqZzWPNbYdsUeZwt5ui7RU398L7AdXjNBJtobBGGjxBl5I2MOBoWym7KB6o2fDV57K8LikLkkzXNzmmw4SeMustCS3KSkIfRZRZfkiiLuvAlajUYPOZ8UNjpJwvOITxlMtkfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469766; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MxNkugF37b5fEcbJO0/Zfbyy2DcJjrIhzRUUZIZhOZ4=; b=OPo57OFoj+CGPMQIOKyEV8+1NA85eW2kHu58/2ghLjlXvD+LOlseWzTVgMGzCXAUxmb9Ph/Hw6dPjaMPBZNb1iJ1IpK7Jz53m2csTvhecHj6EgQ5wDp90QZeWm5zwE7NeK/MPyPJCXYqhGHrZV3ggJ4KWZmfgD5epTPe+KuMseg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469766962710.9717827480864; Fri, 5 Jan 2024 07:49:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmR4-0002YA-Mb; Fri, 05 Jan 2024 10:48:38 -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 1rLmQE-0007VR-6B for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:47 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQB-0004R6-3U for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:45 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40d2e56f3a6so4035035e9.1 for ; Fri, 05 Jan 2024 07:47:42 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id q16-20020adfea10000000b003365fcc1846sm1605027wrm.52.2024.01.05.07.47.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469661; x=1705074461; 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=MxNkugF37b5fEcbJO0/Zfbyy2DcJjrIhzRUUZIZhOZ4=; b=yYLmrPiFphG60m57lWmC4wzmjjC5wVNp3yXqvYn5hD2n/4yIBy7JfY251rW0btPeVh K8jX2XUEbDcJJsBNOYaM33TPegWCZy6Db1d2U7ge6EKZQ6H9yhtAPOwYGJJrwdWAdDyJ SSksFTsyvOlezel6aiee7zY+Pfsf0aDX4C0W2Aa4/J9dgq96kepL0zHsxZC7lcN3bpNM ZuxqOz63Yr5gIr/EuCp6YDRSBvOFOVcf1FVuneMfxkwwqxVxLi3W5PXHJPtpW6Cbidis 9xLUSHsHjlTeVj4cJIb5Hhg1xKaJFikrm/5YS773otLAsL4Yt7do9EUMZoHQJZI3ocj7 uFJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469661; x=1705074461; 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=MxNkugF37b5fEcbJO0/Zfbyy2DcJjrIhzRUUZIZhOZ4=; b=VfE+dowLyZ7XABI5RPTHm5/qm7ffZLTxHv/OcV/XVx6EJwq4qC920DB7HDTC9zmxpJ za0kof+EXDpKj4wNb//DNdYB8RmInNeBkPpOScLq8dfKQVuG7j1b6v0gSrICn/pRVa7y Sw2JIjOrJ+oqdurEE+V9wmpRPi6q8OSM4lLmE4qbhDBX76pxXWFyJ45OYUvppyuYU9h0 70RSVVsK3CtG1It6G+KDNPM48yUtUohke3juBJGYqBDiezbx9dmzidoZ1SMRVrf3P1UQ Bm700qODbjkE/9rWxfdkcNuFHhnFhH+fu3nHBtE/BBrlwP98x67K9Qb3gUVp7hL5wPFN u94w== X-Gm-Message-State: AOJu0Yx8HrEkvJJVjm5C3HJMf56GpAZ4zLSCUfRN4jKCRguj7SkLW2pT ol4SAda6PGMOT8YgSrg+lSysmzcu8JGy8Q3bq4nPPo5JwdU= X-Google-Smtp-Source: AGHT+IGM7TSXyvi6nTWIU+c3D2escNz9iFzkqR69cwYwMN9KqtMPqAbvVdgqTB5wSmv0ub17vOgY9A== X-Received: by 2002:a05:600c:1d0a:b0:40d:81bd:9d12 with SMTP id l10-20020a05600c1d0a00b0040d81bd9d12mr1310560wms.147.1704469661441; Fri, 05 Jan 2024 07:47:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= Subject: [PULL 42/71] hw/ppc/xive2_regs: Remove unnecessary 'cpu.h' inclusion Date: Fri, 5 Jan 2024 16:42:35 +0100 Message-ID: <20240105154307.21385-43-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469768384100003 xive2_regs.h only requires declarations from "qemu/bswap.h". Include it instead of the huge target-specific "cpu.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20231122183920.17905-1-philmd@linaro.org> --- include/hw/ppc/xive2_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/ppc/xive2_regs.h b/include/hw/ppc/xive2_regs.h index b7adbdb7b9..816f5d0e84 100644 --- a/include/hw/ppc/xive2_regs.h +++ b/include/hw/ppc/xive2_regs.h @@ -10,7 +10,7 @@ #ifndef PPC_XIVE2_REGS_H #define PPC_XIVE2_REGS_H =20 -#include "cpu.h" +#include "qemu/bswap.h" =20 /* * Thread Interrupt Management Area (TIMA) --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470245; cv=none; d=zohomail.com; s=zohoarc; b=GitGBbCQvcYwh9N/PhO96K2UoCOywTE5+3Kz0//8t5+CHTYEnMAJyQgmRHn3fIJunMO8s/eXo0cs0CemLWQqjS8H7/X9vNGPQqNR3OSL8P4BfK7/aDAJqQv/YbJAJq9Wi7K7GqPRQD3cLeOJEukXZGNmcCULa0RJPlH2iMH/04U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470245; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pzBOft/r+pQ28bPRm3cZUcB0Cj6Ii9RnBaNZcpiqy/g=; b=aytGTFs2c27CPjT3IEGtv1zYfiv927hAQHxa5eM8Mb5VkJm0IJ5pPiVpka/GUC7mOp8zAt2ES/2UkhhHOAmXqiooGflY2/dVKzv0TnuCVaQtXMsLZNcX4tp0TKldEiGjGTMOag7zIJRFiZcf2WcbJnI+z4pnVdYKX19nu4GKIls= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170447024508345.12848336926231; Fri, 5 Jan 2024 07:57:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRD-0003dI-Ca; Fri, 05 Jan 2024 10:48:47 -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 1rLmQL-000820-Dt for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:53 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQG-0004mO-I9 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:51 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40d8909a6feso18011475e9.2 for ; Fri, 05 Jan 2024 07:47:48 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id v1-20020adfe281000000b003365aa39d30sm1617394wri.11.2024.01.05.07.47.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469667; x=1705074467; 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=pzBOft/r+pQ28bPRm3cZUcB0Cj6Ii9RnBaNZcpiqy/g=; b=DC9QmywZGIdHeP4Ut5HMMTGn8IGKL3B7RdqJaFqiUeLPUox1E7Hd/jfol0RnJ1MPet aFITvVqau9AxgvptyeESL/Q7BfchVxrLQpkURXUk31PpzwSVRnA2YpfDzc8dolkS/9WR t6kp50tdnRfhi3w4EZMJPRoxOnX/bpBo1vnd4hsiosjRAsUwTlBgcjampXHdEgZ0GfiJ FZICIvyg3jr4JHJkePp7dqzH9CbCVkFORDXpCNpGiCHHlbHueRBCM+0/VzuKhhSG4ALY DkVQSZmpJ1WTJo8LX+mYI7VX+z5lGceL7UeKO2NNQowc1KG6R1ARASFfZW0kP7feZynN WYQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469667; x=1705074467; 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=pzBOft/r+pQ28bPRm3cZUcB0Cj6Ii9RnBaNZcpiqy/g=; b=QQmP5S848pkQCDeenmlP/76HZs6Y3TH9Y0GRPgChP5ERLaYhrlWMqJ7qOxUkR3K5GX +9I8I/f2fBex+O9nnShJs3rhc9yY9b15UhQF6aC3q0b3XBZuZNd/LhRQdUdcx9cs6Zo9 +Bw7/GIZ+QQlMUBKGcEMIR/RUjrzECRIhC56BweLKeVelwNmL5J1Jx2wFWQra86r0kWe Od5wHnvqdn+vV2FP9/kFoTsUVSy9Phh/55IbIHd9i89/T0ppPciX+Nq6lSYiOzOg4H0b fWBsaHv9AUbMjPkdDY20Qu6+Id7TWlzXCi1NRaiMXRaQEeFsSy6u/jUAKCdXVNF7QMTt 01jQ== X-Gm-Message-State: AOJu0YzdK9kZYSbDOiZnpdLflUs5tvmytXyRJAL2ulqkl0jnXe8sbHW2 1biZLFJ7QCdCAav9iyih1NlOUONh5S5H+hEW7Vpir/ki6nM= X-Google-Smtp-Source: AGHT+IEq2dH0mD+4SouSDcOeEkmlMA8U+22hBrUXAhGW/EQH2oulgKBO8Uch2pieq/K24qQT3n23ag== X-Received: by 2002:a05:600c:c0b:b0:40e:351d:53fd with SMTP id fm11-20020a05600c0c0b00b0040e351d53fdmr848618wmb.239.1704469666949; Fri, 05 Jan 2024 07:47:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aleksandar Rikalo , Aurelien Jarno , Jiaxun Yang Subject: [PULL 43/71] hw/mips: Inline 'bios.h' definitions Date: Fri, 5 Jan 2024 16:42:36 +0100 Message-ID: <20240105154307.21385-44-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470245909100002 There is no universal BIOS, each machine needs a specific one. Move the machine-specific definitions to each machine code and remove this bogus header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20231122184334.18201-1-philmd@linaro.org> --- include/hw/mips/bios.h | 14 -------------- hw/mips/jazz.c | 10 +++++++++- hw/mips/malta.c | 9 ++++++++- hw/mips/mipssim.c | 10 +++++++++- 4 files changed, 26 insertions(+), 17 deletions(-) delete mode 100644 include/hw/mips/bios.h diff --git a/include/hw/mips/bios.h b/include/hw/mips/bios.h deleted file mode 100644 index 44acb6815b..0000000000 --- a/include/hw/mips/bios.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HW_MIPS_BIOS_H -#define HW_MIPS_BIOS_H - -#include "qemu/units.h" -#include "cpu.h" - -#define BIOS_SIZE (4 * MiB) -#if TARGET_BIG_ENDIAN -#define BIOS_FILENAME "mips_bios.bin" -#else -#define BIOS_FILENAME "mipsel_bios.bin" -#endif - -#endif diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index d33a76ad4d..0d2348aa5a 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -36,7 +36,6 @@ #include "hw/boards.h" #include "net/net.h" #include "hw/scsi/esp.h" -#include "hw/mips/bios.h" #include "hw/loader.h" #include "hw/rtc/mc146818rtc.h" #include "hw/timer/i8254.h" @@ -53,12 +52,19 @@ #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" #endif /* CONFIG_TCG */ +#include "cpu.h" =20 enum jazz_model_e { JAZZ_MAGNUM, JAZZ_PICA61, }; =20 +#if TARGET_BIG_ENDIAN +#define BIOS_FILENAME "mips_bios.bin" +#else +#define BIOS_FILENAME "mipsel_bios.bin" +#endif + static void main_cpu_reset(void *opaque) { MIPSCPU *cpu =3D opaque; @@ -147,6 +153,8 @@ static void mips_jazz_init_net(NICInfo *nd, IOMMUMemory= Region *rc4030_dma_mr, prom[7] =3D 0xff - checksum; } =20 +#define BIOS_SIZE (4 * MiB) + #define MAGNUM_BIOS_SIZE_MAX 0x7e000 #define MAGNUM_BIOS_SIZE = \ (BIOS_SIZE < MAGNUM_BIOS_SIZE_MAX ? BIOS_SIZE : MAGNUM_BIOS_SIZE_M= AX) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 049de46a9e..d22bb1edef 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -40,7 +40,6 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "qemu/log.h" -#include "hw/mips/bios.h" #include "hw/ide/pci.h" #include "hw/irq.h" #include "hw/loader.h" @@ -59,6 +58,7 @@ #include "hw/qdev-clock.h" #include "target/mips/internal.h" #include "trace.h" +#include "cpu.h" =20 #define ENVP_PADDR 0x2000 #define ENVP_VADDR cpu_mips_phys_to_kseg0(NULL, ENVP_PADDR) @@ -71,6 +71,7 @@ #define RESET_ADDRESS 0x1fc00000ULL =20 #define FLASH_SIZE 0x400000 +#define BIOS_SIZE (4 * MiB) =20 #define PIIX4_PCI_DEVFN PCI_DEVFN(10, 0) =20 @@ -91,6 +92,12 @@ typedef struct { bool display_inited; } MaltaFPGAState; =20 +#if TARGET_BIG_ENDIAN +#define BIOS_FILENAME "mips_bios.bin" +#else +#define BIOS_FILENAME "mipsel_bios.bin" +#endif + #define TYPE_MIPS_MALTA "mips-malta" OBJECT_DECLARE_SIMPLE_TYPE(MaltaState, MIPS_MALTA) =20 diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index 4f743f37eb..01e323904d 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -35,7 +35,6 @@ #include "net/net.h" #include "sysemu/sysemu.h" #include "hw/boards.h" -#include "hw/mips/bios.h" #include "hw/loader.h" #include "elf.h" #include "hw/sysbus.h" @@ -43,6 +42,15 @@ #include "qemu/error-report.h" #include "sysemu/qtest.h" #include "sysemu/reset.h" +#include "cpu.h" + +#define BIOS_SIZE (4 * MiB) + +#if TARGET_BIG_ENDIAN +#define BIOS_FILENAME "mips_bios.bin" +#else +#define BIOS_FILENAME "mipsel_bios.bin" +#endif =20 static struct _loaderparams { int ram_size; --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469812; cv=none; d=zohomail.com; s=zohoarc; b=VQSUbXD5GQTI4zNwC2Xmv6I3+ZwY+7EvdvJwf8D4miyeHNqyPuzdl1ZI/kjD2Wjxg8es4g08C+nGaS1Qg41wLU33jmSZpXawgCiEnzmFGIF11Nr/v3HT7ihNfghIyCvUa/Hb3Q4IpQ6X6UW3uiC2JJDrdoTwiZDIc6J1iMQxCjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469812; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ImxUabCyGAsbEkeWSJUeGE5vK4aQJgpXA7LrF1s1fHM=; b=Ypq+RzoLHQXd7kzZEeAiF819aRknakwC5qcngwphhN+z+oRTEFAp2wjwWyoalRpcbQc5MQX1loWkkswws1SBgla+Dy38he/zpx6GP19uKhsZNzG56+wT/MESicqujXbUZ+5clomVjhLEdLEN43OqlVNl51x8RSH0AOr9JcMA9wA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469812645850.0761660870503; Fri, 5 Jan 2024 07:50:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRR-0005Ny-Uz; Fri, 05 Jan 2024 10:49:02 -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 1rLmQP-00088H-27 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:59 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQL-0004uG-QU for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:47:56 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40d5d898162so12849695e9.3 for ; Fri, 05 Jan 2024 07:47:53 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id f8-20020a5d4dc8000000b003367ff4aadasm1612817wru.31.2024.01.05.07.47.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469672; x=1705074472; 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=ImxUabCyGAsbEkeWSJUeGE5vK4aQJgpXA7LrF1s1fHM=; b=oVNdv/uWyOZgf1GY0aF6VlQRLpBiHwoX7YB0A4ap1RtTb/F1bzgUxCpbFhkWVN+9c8 QjGBR2OknXGcGFjboXKq4lrWLmUsqW5GIEk2/K0fiXsR4lGNQtJD2aKbzaSw9IBsps2I Zm8PtmmmYn4FAb42ZA7A50/fzThFEp+xntWu7dRCaQlNEFmAm1eQg0Jlh1GFsXffJYcl FeHo2Kgar8qj9R3knAc4ZSOOEfb5SRHuQhkjbmar5LUqpGmcpNZmppOPIT+8D+g4LUZ/ HWaAWtL65O2AuD/pR0ihX/U3wieCBDdoZEajRoNTHccSgb3LxgAntb105+ZTRUfLiSeU vz4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469672; x=1705074472; 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=ImxUabCyGAsbEkeWSJUeGE5vK4aQJgpXA7LrF1s1fHM=; b=abQOQYE+H8bHTsSKOPIl1Z/AV30Uqo618cHSzMvj/RTlfgKtW9DOrDQLd1r8foU1pM INVi7/6JeKuQnWWVZzDFhMyzsmz0H0ucZt0J+0SmArmfx2hpVrCclsuRqDXQzkEXfq3W awuk7z/esqyza2EX6IbQpjNQGSR86XP5i1flnUgWyquXJ/kpNaIZazVbh0yDR2BIVI2+ 7i39TNPre2pQ1cc+oG1kKNx/sWkkWoNfky1sRISrGn+emUN0IJsiQCZbzzid1RIIp54r 06JUKjtPLL0VGovYei2jDT9BSIxDKX2XA5NFcxazjiAJD7DbFbGpA42CQSNNthwoeYaJ AMGw== X-Gm-Message-State: AOJu0YxjHMiJ23sn1pm51on9fgMKAKKT7NQ/9CBgwItTvf+XZW8V+6Fh mZ4NzsQw/nZ0Hl/4SL0wXnEkoMXnCg2YVOPWohFL3YFuXIE= X-Google-Smtp-Source: AGHT+IHHfz1UOEpqcQnTd9ccMLsRnf9Lo0xc/4tkBrCh7E1A9C6fIzsvi92poVRtXthuFCHiY5oaYg== X-Received: by 2002:a05:600c:4686:b0:40d:5cea:895f with SMTP id p6-20020a05600c468600b0040d5cea895fmr1291944wmo.115.1704469672293; Fri, 05 Jan 2024 07:47:52 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 44/71] memory: Have memory_region_init_ram_flags_nomigrate() return a boolean Date: Fri, 5 Jan 2024 16:42:37 +0100 Message-ID: <20240105154307.21385-45-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469814601100007 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_ram_nomigrate return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-2-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index f172e82ac9..1df7fb0fed 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1310,8 +1310,10 @@ void memory_region_init_ram_nomigrate(MemoryRegion *= mr, * * Note that this function does not do anything to cause the data in the * RAM memory region to be migrated; that is the responsibility of the cal= ler. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, +bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index 798b6c0a17..6110e851f1 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1555,7 +1555,7 @@ void memory_region_init_ram_nomigrate(MemoryRegion *m= r, memory_region_init_ram_flags_nomigrate(mr, owner, name, size, 0, errp); } =20 -void memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, +bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, @@ -1572,7 +1572,9 @@ void memory_region_init_ram_flags_nomigrate(MemoryReg= ion *mr, mr->size =3D int128_zero(); object_unparent(OBJECT(mr)); error_propagate(errp, err); + return false; } + return true; } =20 void memory_region_init_resizeable_ram(MemoryRegion *mr, --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470495; cv=none; d=zohomail.com; s=zohoarc; b=mBElLztJiasoS2bg5tuz6TDM3WzrksSQAtQu0+5mfrpTYB/dFhvyoe4rhNqBcIM0oH3CEZujYZh/6AIxM6b9C5jHzZJzZJC7eoIN7+vUbCM+FlRc3/ThYVixtQVdOCJVklZdOizcB83NVqWYoc26nyVFgqRmPeia0PyLmeL9iA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470495; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ts6/p06DbcZO3DzbdTMKNYyTx2gw5NVQT7hGpH+Yf50=; b=n4ZTHDotPX4wX3Kvtuv1ztRf3uA2ArjfXlHEI71ZTF1tALVoQWa3HGN01UmrYXLrNZiAfsFPAvSlmBa6HVwntzu1JDXdqmImEuiQisk47wlWGcER+LYX5TfQ3tv804NpjtKE7cJ+DKEthiFfugm9gzKK6KtcsBwzi/mBebz976M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170447049535314.636680108155701; Fri, 5 Jan 2024 08:01:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRA-0003Ev-Ao; Fri, 05 Jan 2024 10:48:44 -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 1rLmQV-0000F3-MX for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:06 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQR-0004wM-Hx for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:02 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40d5b89e2bfso16307005e9.0 for ; Fri, 05 Jan 2024 07:47:58 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id o16-20020adfcf10000000b003364a0e6983sm1601482wrj.62.2024.01.05.07.47.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469677; x=1705074477; 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=Ts6/p06DbcZO3DzbdTMKNYyTx2gw5NVQT7hGpH+Yf50=; b=zEu7/IrGDpDeIr2dIyiR40b6RX7Rw5UhbZ6q/QeeQvsdv03PzLd3jldCm7pSJMuLLv SjmnKVdLeKEXJfesS3NLTJbhxto3zAlomPsnYD0Csd5QGfCbF7Evk1M8jLzGnKuEBqzS b6H8SKBm4DKSfFXyzxSHeUqiShDU1BZDb8QkYlw6QVwAlJqHw7wp2XtauZPqCLAB+FaK aZ/d8YmaWrm6yp9Nb58HzkmyvqEPN7b3Wkk7lQPHHJ4YT3lPxcFvYtTNa36QOzcDuIzC 1Wvrc9TbagoepY2xHIdgxmQ8yuBBeeNRNWGypPlS1hr0mflAmRF2yUXN6tLyqYvIqeCl hFfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469677; x=1705074477; 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=Ts6/p06DbcZO3DzbdTMKNYyTx2gw5NVQT7hGpH+Yf50=; b=rh9C9rVP5rRaEn/yHp9uzkg21+66K4W38qXuxIxzDK1h5xaplmmgnyfvPXyEXCLIH5 AUOjaJ5i2cQSoJhGY+VNzRJPhBmffkvwyIj4sp/wHb3PdU3yTPHSl6uEq1uHQhzxAVaO bndDwSVoYXDXOONrYmvvFYBCMK9Q+alsWdA9BDZuOL3Haq9AeI5ZSzVcEX8GLJoWUlEH NN6uh3Vkv5kS+iyJobqCkUXpUrVo6ptMoAbu3DMphhupzNWtIJpS9sLAPatg3siQi2mG TMuELS4alZ8SrDok64DmvN3PFO/sWNLl23EHoaKLsA8jCp2Y7yZiXdEhg/ciGBMI/z5K IJUQ== X-Gm-Message-State: AOJu0Yw8UsxHhmyQQj7X+b6kmTffPxdHrae/cqDVadKbvw2c8eMHlKeh h61WPu/s+kw/x9K6+47uFSiR/foq93VDXPh0JR9ocs6nX3s= X-Google-Smtp-Source: AGHT+IHhV7/5t2tWHWEtXRwGQGY19G/nj2WV2pTsMSyTzhFkSw+Px430TLhVpOPFlJYhDK69W+N89A== X-Received: by 2002:a05:600c:1c0d:b0:40d:7f71:3f4f with SMTP id j13-20020a05600c1c0d00b0040d7f713f4fmr1300112wms.176.1704469677641; Fri, 05 Jan 2024 07:47:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 45/71] memory: Have memory_region_init_ram_nomigrate() handler return a boolean Date: Fri, 5 Jan 2024 16:42:38 +0100 Message-ID: <20240105154307.21385-46-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470497390100003 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_ram_nomigrate return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-3-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 1df7fb0fed..413fbda089 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1288,8 +1288,10 @@ void memory_region_init_io(MemoryRegion *mr, * * Note that this function does not do anything to cause the data in the * RAM memory region to be migrated; that is the responsibility of the cal= ler. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_ram_nomigrate(MemoryRegion *mr, +bool memory_region_init_ram_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index 6110e851f1..f9e5ae22d5 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1546,13 +1546,14 @@ void memory_region_init_io(MemoryRegion *mr, mr->terminates =3D true; } =20 -void memory_region_init_ram_nomigrate(MemoryRegion *mr, +bool memory_region_init_ram_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, Error **errp) { - memory_region_init_ram_flags_nomigrate(mr, owner, name, size, 0, errp); + return memory_region_init_ram_flags_nomigrate(mr, owner, name, + size, 0, errp); } =20 bool memory_region_init_ram_flags_nomigrate(MemoryRegion *mr, --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470213; cv=none; d=zohomail.com; s=zohoarc; b=QMYYq19gkLAbVrQRrmh3NPkjV2NWrjZ36Rbr9v8VsMKEGt2fMXaBIw7dUeTG5FCGmHAuHJCWpzOLtiZkeozPgzWY4IPRLX2w8H0pI64dCn7e1EZPLGj7WjnwecLJccoYTbDKHqDCexCO9v5cNt1aEdQUOXrTakSg5Rrt4WHFHsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470213; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9bo0EnTBB3RSA39/U6I4CQ9tWQh3q7HE8iXyXM+NS6g=; b=V1MNYn3QSlTKQi2XS/7eu27AogWpBZ02tbkq8VytCtHHM9nXxLkwfNSPCuCXJWbCTHAXDf6IAp9Kv5K1574HS2Dn9zAOoFzeAU0yG4xXYJ1a2xlsoZ8NqyqDwq/GN+zB3fy9AS1NBrttrziowSIc7P5F2RoJSJEZeaPipWUQNIM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470213733583.9350024603775; Fri, 5 Jan 2024 07:56:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRE-0003qR-MA; Fri, 05 Jan 2024 10:48: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 1rLmQh-0000Zl-MH for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:20 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQZ-00051j-PP for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:15 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40d5b89e2bfso16308585e9.0 for ; Fri, 05 Jan 2024 07:48:04 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id i16-20020a5d5230000000b00333404e9935sm1615796wra.54.2024.01.05.07.48.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469683; x=1705074483; 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=9bo0EnTBB3RSA39/U6I4CQ9tWQh3q7HE8iXyXM+NS6g=; b=zysmM0MzPDmI2w6M74MLyNnQMRZxVdkG59Hhf81CuNJDkx1ELkQ9yqyi4EmGn+AcDc l5W07oKCdBQXI6AHyZ1SPm9rEJhL0BGuDnQCunnNQqvwT+12ml02is3J6rynkarxg8d+ FBJ1EfSqok6ztz5ZKy2NglkCeILhA6JYZq2ueONHmf57iqB+E4cHB3sFnSb/53KvchVS ilOy06iIP0MOf+jU4K13yIDU+vK2ZbJ52rRZEz3+kEDvQNS4Rj+29xolz0noHHlfxKCp opBOVoYf6ms9v4YjtDvUoI1qSqZrahxH9M8UZn98kqGw5KWcAIobDqyuP3vqcQWS2IPM Ha0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469683; x=1705074483; 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=9bo0EnTBB3RSA39/U6I4CQ9tWQh3q7HE8iXyXM+NS6g=; b=KKMBx6pvefCnzkabWgx3WbaXe51Da5lyXioqUsT9h5ZcK+8l8jShBmoh10I3qJh96z 4MDgDjO5mg7L8gR9J0T+R7QFFrZdgU9Ly581QQY+LxktFSAda2rBNRZz+Fi02lEerqYV FMWgrei4QsREmBrTOHCDVWps8a2IiUFNezcHQSc6plmE1B8YF233Nka52dFMSLYMcWLB D2qLq+zBekCAaY5/1qOZifoly1HtZPx8s3v7AtnpD6D7vG0HK49YCZDMc6/uRyQdjrXX Iy31QoIh8HevTiuGwEsTdoJfwNPaJKsgKkKEP+PhLZvdAfLAq8zYI4jtB1if+/ZoANl0 VjXg== X-Gm-Message-State: AOJu0YxEDjEW+lH8tYvLB6AP4SDW1j1V7HaDutjdk6Q68sNYAYgeh6cV Vcd9uPb85VbHv3/T/RomWLAn/C/2YgQB8LvQgd3klqcDAQ4= X-Google-Smtp-Source: AGHT+IGuPlvhP7jxhH421R1GBJlA97HhyOkxxKfAI9qNkDSzT26h/FWxDS0gQQneiyGkph+0VLkwKQ== X-Received: by 2002:a05:600c:181b:b0:40d:3a32:7d51 with SMTP id n27-20020a05600c181b00b0040d3a327d51mr1222446wmp.119.1704469683198; Fri, 05 Jan 2024 07:48:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 46/71] memory: Have memory_region_init_rom_nomigrate() handler return a boolean Date: Fri, 5 Jan 2024 16:42:39 +0100 Message-ID: <20240105154307.21385-47-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=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=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470215725100001 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_rom_nomigrate return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-4-philmd@linaro.org> [PMD: Only update 'readonly' field on success (Manos Pitsidianakis)] Message-Id: --- include/exec/memory.h | 4 +++- system/memory.c | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 413fbda089..f3a4a76817 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1498,8 +1498,10 @@ void memory_region_init_alias(MemoryRegion *mr, * must be unique within any device * @size: size of the region. * @errp: pointer to Error*, to store an error if it happens. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_rom_nomigrate(MemoryRegion *mr, +bool memory_region_init_rom_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index f9e5ae22d5..72c6441e20 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1701,14 +1701,19 @@ void memory_region_init_alias(MemoryRegion *mr, mr->alias_offset =3D offset; } =20 -void memory_region_init_rom_nomigrate(MemoryRegion *mr, +bool memory_region_init_rom_nomigrate(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, Error **errp) { - memory_region_init_ram_flags_nomigrate(mr, owner, name, size, 0, errp); + if (!memory_region_init_ram_flags_nomigrate(mr, owner, name, + size, 0, errp)) { + return false; + } mr->readonly =3D true; + + return true; } =20 void memory_region_init_rom_device_nomigrate(MemoryRegion *mr, --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470129; cv=none; d=zohomail.com; s=zohoarc; b=BQid4xZOn7WL5jhk27CgMKi3Ht7Ml9PlAtOynoO2PxyMr27tVmdNwXCpT5Q0nlqqEFXcPqN+7PiZODyrGQ6/mLQxrwvvsSFdck6WH7ygtoA+Cp+7MtpMT56ZFaLamf0B5N9H5BFF5DYYdL8rgWZVyWObGD7EkhYzgyj/FJUfjDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470129; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rwNOMMIAYzGSLWabz4mQJXWqt1PJzQTuexNMmuOK734=; b=YcRUsx93oakH+Ey2Dhdnag4KoKvx+wLwqwZymFaOf3S+Qr8KTb9j+zZpM6Iuy4rC3zWnjT178BPJKFczNRIYzRSGjsYBVYAGojlRK8JxHD7EhDPRhqtBWkgGLsffSPXk9CMdWDpsRbZychbQv0mIYCGfoOsbAQHdks9Rxx0Y3d8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470128980613.395860628848; Fri, 5 Jan 2024 07:55:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRK-0004Vt-M9; Fri, 05 Jan 2024 10:48:54 -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 1rLmQe-0000WW-NX for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:14 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQc-00052M-EM for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:12 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-336990fb8fbso1224171f8f.1 for ; Fri, 05 Jan 2024 07:48:09 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id o5-20020adfca05000000b00336ee9edbb3sm1605985wrh.94.2024.01.05.07.48.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469688; x=1705074488; 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=rwNOMMIAYzGSLWabz4mQJXWqt1PJzQTuexNMmuOK734=; b=zTpWELjazCjgv0efnlE4zgCZ6HMfKPlhg7nalHCtNUcEufcNlCWuRjuP6LJ9uo75Ur +ULrhv/L//U7gescR667EK9aNhCAPgAS8DWNrKeVSbPTXSLugeLAee/nUj3nl4cEBez/ F331TfRBGXG4m0zMU6p+k6Nh0HmUpU0NP91eJFH1AGeyRcyX2GNwnhPpWO9ksIBaZlps eR+BMefEpXYEBfigksRECRFsDbzf+JDqMOeGJVmHb+MRGf37TATqYwxecIizGM5M+ZD3 7TxuOS9ny3tgcLdMuthxk+SbODKAIGH7osJoZBxrlUBgL/0xxDSVgVPbryjwvtywRgcy kFdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469688; x=1705074488; 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=rwNOMMIAYzGSLWabz4mQJXWqt1PJzQTuexNMmuOK734=; b=ZGca/5HBoc+Q/9fXmWFSsAz3bwFx6DhyuyAz9pITAZRACkH3FuGjGiOpfS057LKHJu 5VrJInZyWjMuN4NhRcrLMefk2ZZkKCHQxnhYSHX3U9R5HIiP/Z3uMyq0jojKf+Gycpae gTqA7/hIUxmpr+E6fvPygt7euOh7nGOoE7KE63BEZJjMKyQ1Kgg+oN3CSQL9JFFUKEP5 z+bL7NG/TwhOB9zF747SMcWVKvDAjeF9iqXsO5wWexxsCmeESpJWNjNC7PPLmGjItnyB obuTpjxXuV58xxcNWxiva5rQiWmEtw4LyWwoWQyDXk7J56j/jvwEB/cwDsf+AUM0hBDk F4+g== X-Gm-Message-State: AOJu0YxjYS25e+9Ps07VuH0N7sUCvB0GKMsTXN87JoLe2LEy7+zR4LyZ VH59wzfiKhrbhDI+U5ESKVUAxmum/5iCMHc6KZYQfN4TRYM= X-Google-Smtp-Source: AGHT+IE3AwHJlxhlvMqgvF8M8h0KfKHRXRjT1nqeu0wbgl9Vs7yTQ8aq+uC0QVut0myi6CcQGNipwQ== X-Received: by 2002:adf:e0d0:0:b0:336:e366:471 with SMTP id m16-20020adfe0d0000000b00336e3660471mr1336264wri.58.1704469688486; Fri, 05 Jan 2024 07:48:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Richard Henderson , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 47/71] memory: Simplify memory_region_init_rom_nomigrate() calls Date: Fri, 5 Jan 2024 16:42:40 +0100 Message-ID: <20240105154307.21385-48-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470129347100001 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_rom_nomigrate(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_rom_nomigrate(mr, owner, arg3, arg4, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-5-philmd@linaro.org> --- system/memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/system/memory.c b/system/memory.c index 72c6441e20..3997ac5928 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3601,11 +3601,8 @@ void memory_region_init_rom(MemoryRegion *mr, Error **errp) { DeviceState *owner_dev; - Error *err =3D NULL; =20 - memory_region_init_rom_nomigrate(mr, owner, name, size, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom_nomigrate(mr, owner, name, size, errp)) { return; } /* This will assert if owner is neither NULL nor a DeviceState. --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469983; cv=none; d=zohomail.com; s=zohoarc; b=SWtRk20klTRqGIQjip9dIctIAe7tZm7Dl0wjCmQqvxJj+7skdofMY3wxuyrlZUGGyMHCPOQSNnQPW5pht/dbQS4rFLGliqn+93E0UAAu30vYLyPY1Si7URPxZr2GnNFilLsy+Fkpj6ZwvI0AYHw65Nuz8DC5S5YqaaODWBw7E+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469983; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6o3ekhlfh/+CPANGecFeiASb4d6bBwdSECTd289TNhk=; b=ESWGaMDnDaRdfgqj/0ZglNkLqWLaYRzSylQ0RnhaFnKm7RT56KgXrHH2zXhEXGVj4F0l/erqGqiq2zGdjLQSQ4k79Q5K4Tzw2aBHiWSyZBszuIbcjUwUXpd1VS86m3XdBX9xKHVyfUOZ4piZx7IBxmSNEM3PgVwPuurcUeU/jvc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469983531107.36668705447278; Fri, 5 Jan 2024 07:53:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRY-0006FX-Hy; Fri, 05 Jan 2024 10:49: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 1rLmQi-0000Zw-Vf for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:19 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQh-0005BX-Ag for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:16 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40d8902da73so12874145e9.2 for ; Fri, 05 Jan 2024 07:48:14 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id fc12-20020a05600c524c00b0040d5a9d6b68sm1952853wmb.6.2024.01.05.07.48.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469694; x=1705074494; 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=6o3ekhlfh/+CPANGecFeiASb4d6bBwdSECTd289TNhk=; b=DQ2QHVerxwTlhr1DqwDw79ObknnhCQxFTaaeZuBVVYMFATrYKkTM5ov94YvUVSbC+s r4OfWgetYJCN0rvRqkwXfpB/GFKjRN2PpVDvO3Jw7lACaRBlcJvahrqNexRnJ4fCcmVy hE6I99OAkXqylZ4Wyuma5VSqAD9t/bQOeOv/6vBLFQeNoIiaPXxFMphm6Bg4ZO3MOPy8 v0gjaVImO96C8xzzUgDHWzZBCZmEdqwgCorsKJ/pDYBQekiuUNtAC2AyqQMS9u84LXtG 7iG6x7g5lESq20caGsdyR4vvdThmeVmraLFKbGkImHhVuar87CANvafTDSgegrtmJTHH cdjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469694; x=1705074494; 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=6o3ekhlfh/+CPANGecFeiASb4d6bBwdSECTd289TNhk=; b=gA9hq1PfHfKPD3sjfNd/a1HuOP91EGiGIvebT2F93n4rD0AsRkblRY8c8C1y99Y2Nu FE1f/WPM9y6Ker7AEz4JsqWySOy/F+PxVdJhKCbHt7jaWA+VvmxKxdVHJYy0OsMpATek FBtGmQcK7BXMoGWnW+Z+hfplQX+hMvlNmDh874xLSVzKJML+D0WSvEumVR8GT6+DB4K/ 5ObVcDATkc81u7g+e3PNxUbXDL+iRZ4l/6Qoze7h/6YSsyWUK9NnIZdmHnHlsWQWui0X seqcGjyzjqHTEM+w27nmfSz5qSJ+sEcSFa1JgZ9SDFdxsKzL5eeyUItZMmNrg0I+Otyr +aJA== X-Gm-Message-State: AOJu0Yz5F9Ii+tLBxYBUud1rJY2RGobrYO9E05GT62vu7Df+x3RwgCm9 BA8sx/G4LBjfBQzGeiUX6lScB4HdedUzqRBpOZ2SJsrg4T0= X-Google-Smtp-Source: AGHT+IEVGT+tdyoug5yxzjTjKQjcUaDiSAs47WQNs2RTCBbWWg2OgCTyf3aQofocalOeLeGM2MPLjg== X-Received: by 2002:a05:600c:4f51:b0:40e:3a6f:9b1e with SMTP id m17-20020a05600c4f5100b0040e3a6f9b1emr370957wmq.109.1704469693840; Fri, 05 Jan 2024 07:48:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , Paolo Bonzini , Peter Xu , David Hildenbrand Subject: [PULL 48/71] memory: Simplify memory_region_init_ram_from_fd() calls Date: Fri, 5 Jan 2024 16:42:41 +0100 Message-ID: <20240105154307.21385-49-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469984634100001 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, arg5, arg6, arg7, errp; @@ - memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7,= &errp); if ( - errp + !memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, = arg7, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-6-philmd@linaro.org> --- system/memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/system/memory.c b/system/memory.c index 3997ac5928..c1374e9968 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3577,11 +3577,8 @@ void memory_region_init_ram(MemoryRegion *mr, Error **errp) { DeviceState *owner_dev; - Error *err =3D NULL; =20 - memory_region_init_ram_nomigrate(mr, owner, name, size, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_ram_nomigrate(mr, owner, name, size, errp)) { return; } /* This will assert if owner is neither NULL nor a DeviceState. --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469989; cv=none; d=zohomail.com; s=zohoarc; b=cmarFGKzdYQh8onm80r5YAvWfSSYgJz7XDrjo64iyqRkfQgzTOBonDqaIRKTQKksJ+uXifpHLr1M0ZOucxk1/9LkV1F4AHi8okcPysDgVK1fibyIenapKL83itDeQRha6DY4tWYICITmym9q4j2WwAfW925bzdEn1HTcL/qdefU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469989; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fJr6Vags3Wq7daq7HscgC4QLRNTQj0/WuTPsCBO9nBw=; b=VGPxBPeW9oj6oiOeTt8LBJxbgzSmPHecZKZaL5jOKarHuHR/WDttwp+EbHO9uFxTO/dwG4P2U8uYr0gsDY/74B4deh4UIGseWaG6QRq0ouOmmDI3xCpGU0S8tiBfjGQt33SSAUxnJHYcxy4OPnCUST5EioTOYdi3YpAlYCvmJ0w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469989575325.8210082025603; Fri, 5 Jan 2024 07:53:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRO-0004tK-Nn; Fri, 05 Jan 2024 10:48:59 -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 1rLmQr-0000qZ-CV for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:26 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQo-0005LP-2U for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:25 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3367f8f8cb0so1469989f8f.2 for ; Fri, 05 Jan 2024 07:48:20 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id h8-20020adfa4c8000000b003375083ff8esm1626753wrb.32.2024.01.05.07.48.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469699; x=1705074499; 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=fJr6Vags3Wq7daq7HscgC4QLRNTQj0/WuTPsCBO9nBw=; b=WoeHDscvOsCNm8ZzhcJciSxyZwtp5X+4nI8BdIL/hVQ2ZWtP89Eb/0JA89zYRHFVJN UJBFOL44qkYyWQnPJR4Q0b41yrsyyzug+6yHw/sSNiH/k2eg5HVict6ApyGL1f7yzf+U hf64CvyjvDNV8vpEfAw0es5IBEt4N1x1jzXxeHpM2anYQmDQYpRXNNwDEuP/jEbQISVw p0C8IlfFH6itkvXhQjb2tzGCEMYRjP5fZWPz4oiQAoTLsN85l9GUXzKumWS3fGYNdj/H gv31cK8mFKsNVlja+Z7ZYKkHTJi/tCiHRJfS5WRd4zkXa1TkOQkBosY8yk4YX6DPZ0p6 pU+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469699; x=1705074499; 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=fJr6Vags3Wq7daq7HscgC4QLRNTQj0/WuTPsCBO9nBw=; b=iTxJgJrE5SrQgiM3xAgPIvohJ5hBe2tZtiprd4NiGoYbgy2aazWDTJOLoYGxM7Syby eACB67dGKFP0IVn+ds0FI3vzRnGwj92tD0HRyhd5dKo++IsgxAsN6KyFrS+5OdyG4g1e ovRJXH2RUHfojTzeiEYQbdpZ0ePMNPwHYCkM56m6+Z2mDi585joYfB9Ftow6jcxVrLQy ZBFY2LSw6qoixA5an+FMN3lfJRDkFHYbP1wcHLDT1y7unXonYT87KKT38COec3yQRegU gRScylX7g+lX/pYKGRWrCJiT67IbxQSxhp0Lel2HVZsrrdWOiTwgyBbMBOo7jFOYcVBN 7gSw== X-Gm-Message-State: AOJu0YwbDdYfOmzjOzXkEbNsbV/UhKNor0Zh2yIdTzzCyHFOLRUlS2Fh EtnRirjJX8YHNWNCfRyTqAPEogiQidhEPRlLltpbif8QdPA= X-Google-Smtp-Source: AGHT+IH7c0vJCsX6VB9nR0Ty+mmpsqszbfiJHyAsBdkZFBLAM8gnBBrceboVk9m+JdOiVe0HbH8hhQ== X-Received: by 2002:a5d:4489:0:b0:337:2b76:30fe with SMTP id j9-20020a5d4489000000b003372b7630femr1274977wrq.37.1704469699264; Fri, 05 Jan 2024 07:48:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 49/71] memory: Have memory_region_init_ram() handler return a boolean Date: Fri, 5 Jan 2024 16:42:42 +0100 Message-ID: <20240105154307.21385-50-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469990744100001 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_ram() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-7-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index f3a4a76817..b2dce73e7f 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1582,8 +1582,10 @@ void memory_region_init_iommu(void *_iommu_mr, * give the RAM block a unique name for migration purposes. * We should lift this restriction and allow arbitrary Objects. * If you pass a non-NULL non-device @owner then we will assert. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_ram(MemoryRegion *mr, +bool memory_region_init_ram(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index c1374e9968..45ce6fd6c1 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3570,7 +3570,7 @@ void mtree_info(bool flatview, bool dispatch_tree, bo= ol owner, bool disabled) } } =20 -void memory_region_init_ram(MemoryRegion *mr, +bool memory_region_init_ram(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, @@ -3579,7 +3579,7 @@ void memory_region_init_ram(MemoryRegion *mr, DeviceState *owner_dev; =20 if (!memory_region_init_ram_nomigrate(mr, owner, name, size, errp)) { - return; + return false; } /* This will assert if owner is neither NULL nor a DeviceState. * We only want the owner here for the purposes of defining a @@ -3589,6 +3589,8 @@ void memory_region_init_ram(MemoryRegion *mr, */ owner_dev =3D DEVICE(owner); vmstate_register_ram(mr, owner_dev); + + return true; } =20 void memory_region_init_rom(MemoryRegion *mr, --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470171; cv=none; d=zohomail.com; s=zohoarc; b=fyEaQGM12vwoJ054ZV375hCPcI5gMEVdAhnEM6pK2b4qyyZhKCwioBGJW6m0TmM+9V4fZ2oJWkwGG30XTFGk51Hwywj+j0yhASiJUe/gXMjgtn8HAr73kMKPy5OJ5QWdPObGCei+0U9isKeRDqHiPkzMxQPB79nCz2ve00N4Ndo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470171; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e8zWpxEGvFP2nXrr978iIGsIcrnYa4bpuJyK2GzP0xE=; b=EaYu3d7z9zyVTk8RwbSAzXxS2S7hyht1KZYHEMSXzIOCyl72aXm1XfXPRjwYzSYpdIqimnsSXcCoBt5CN0oyxcsJyTPiiB+w4SRHJpDqSaPq4v1Oi4fXAOol1kjRrzygj9Hif7+HlFeIo+JBy4Tk07r3b2AOb9Rv8E4kIVxbswQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470171266168.272871608905; Fri, 5 Jan 2024 07:56:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRK-0004V9-1M; Fri, 05 Jan 2024 10:48:54 -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 1rLmQv-0001Qx-N7 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:29 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQs-0005Zz-Er for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:29 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3368b9bbeb4so1499947f8f.2 for ; Fri, 05 Jan 2024 07:48:26 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id x17-20020a5d6511000000b0033743c2d17dsm1612853wru.28.2024.01.05.07.48.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469705; x=1705074505; 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=e8zWpxEGvFP2nXrr978iIGsIcrnYa4bpuJyK2GzP0xE=; b=IAMpRvyxjYt7mxulDGfnO4xq1nBMc2bgamuqFO/XC0qzfPozrQmPnU+eGuOF25jDT6 SZkhNLmfFk+xdjj0Yy4Fz9r2YtXKeFF4+XJKPR+fSqlytfpLpoiFifAz6iTL3YPPH5pN AF1DIPNxlGrJHpAQGe4H1uoZnBPDKCHVcjXl2xf8H4/rq5v5wp3DR6kAMyHi51/EbF1r Gg2e9aqMTrxBw5HNc31UmQhI/95NyGFvqYPKYtTySiTKx0snwKUP11833f6aAlDAHdU+ c8CWQq2KhB5zMGyYYCeO0BO2PdWeNPoNCVbe3zypFlF3MjgDMClFblKPN1JavVmoIgpE 7Hrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469705; x=1705074505; 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=e8zWpxEGvFP2nXrr978iIGsIcrnYa4bpuJyK2GzP0xE=; b=dhrbMinE9F7DBSu3JPaBI68fT7asJzYOV4BvAX3yVbWL130+P6gIRnXYJNWm/TfAF4 kF9duMnUbqxgOgB5lYx5ELLwWsAZO9VB0uk74fSmisZbvnsTTWKrxPt9HoSwWAlxxm68 dNKzvipuvieGkCurI7huv80uzXhEBc0lmri4cvBQOHdOlniGEF3qXau4lknxe9Euf4Gu JyihTq30I1xg9JPgs55wxBe7OmKxoVIujdA6dqxBQDluV8++ctMN5anNSH3dBcFOHV7O akho64W4SgDM+9q21Tn9yZh4n3YQeAZI+hUd6mVgNwwyqxrqvrn5sWteRYIvjAo6tR2p LcWA== X-Gm-Message-State: AOJu0YwTnUHC2yGDPydUtFl1RDuUT2O6ZRICYrhTwUpnfkk+/V9p39fe 40H+4qeGVIO3Ow7jpi4NhaUeS71kmQvG/aBF5B7XinO0Wow= X-Google-Smtp-Source: AGHT+IEsG2+RzKbeLnm9+hPHfWkJwzuEUonwJe8E0JyyvkeHnuAjbA7oIBCZndyife0YayOkNBiRfQ== X-Received: by 2002:adf:ef04:0:b0:336:4b78:f81c with SMTP id e4-20020adfef04000000b003364b78f81cmr590302wro.123.1704469704861; Fri, 05 Jan 2024 07:48:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , Paolo Bonzini , Peter Xu , David Hildenbrand Subject: [PULL 50/71] memory: Have memory_region_init_rom() handler return a boolean Date: Fri, 5 Jan 2024 16:42:43 +0100 Message-ID: <20240105154307.21385-51-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470171503100001 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_rom() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-8-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index b2dce73e7f..9f54bc4af8 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1611,8 +1611,10 @@ bool memory_region_init_ram(MemoryRegion *mr, * must be unique within any device * @size: size of the region. * @errp: pointer to Error*, to store an error if it happens. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_rom(MemoryRegion *mr, +bool memory_region_init_rom(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index 45ce6fd6c1..069aa5ee08 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3593,7 +3593,7 @@ bool memory_region_init_ram(MemoryRegion *mr, return true; } =20 -void memory_region_init_rom(MemoryRegion *mr, +bool memory_region_init_rom(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, @@ -3602,7 +3602,7 @@ void memory_region_init_rom(MemoryRegion *mr, DeviceState *owner_dev; =20 if (!memory_region_init_rom_nomigrate(mr, owner, name, size, errp)) { - return; + return false; } /* This will assert if owner is neither NULL nor a DeviceState. * We only want the owner here for the purposes of defining a @@ -3612,6 +3612,8 @@ void memory_region_init_rom(MemoryRegion *mr, */ owner_dev =3D DEVICE(owner); vmstate_register_ram(mr, owner_dev); + + return true; } =20 void memory_region_init_rom_device(MemoryRegion *mr, --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469916; cv=none; d=zohomail.com; s=zohoarc; b=M14nQbNrjPZ6+YCjqITQVMU3Y3YZ36IWeirnnDU9k9J5td/tpB2yWo2CUeBl/LC808q9YFKDnFD+RBIXaPNNT7+MxfdkbD6JyMag741Xe5c8QXFpcNS2CHuBiJfRirr/VtdC17SsHv7ULFRPkGpNKuia0Q0oxB0E1Otq6VdypY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469916; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pxeB5JHPsloAIkHe9tjmngVFFPhZ7Tzq56PtI31mi5A=; b=L9AABGn7hwm4yz3Wd3Cx5sczEX+Ls7nUxu9BgRVKHXQdnABH+pYHhnta0oMkvIEGSKhZrBC87othtnH8kMdIeoi27jo1dc+y/FOj81Nnhhq83lzZTpp/BFS0oIggcZ6jnU4P/nrc98asK55GIOJQrqEOBI+PNj3PnHhIFlpfl6E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469916110646.1906878701408; Fri, 5 Jan 2024 07:51:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRN-0004cq-F3; Fri, 05 Jan 2024 10:48: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 1rLmR0-0001wL-0R for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:34 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQy-0005lV-5U for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:33 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40d76fefd6bso14855215e9.2 for ; Fri, 05 Jan 2024 07:48:31 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id e9-20020a05600c4e4900b0040e38859c47sm1959505wmq.16.2024.01.05.07.48.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469710; x=1705074510; 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=pxeB5JHPsloAIkHe9tjmngVFFPhZ7Tzq56PtI31mi5A=; b=r/UI2DJI7ZXzSJoq9WxifR9U6Q0kDtzHeIEO4eFalKxCvKsetcZBrrG8C8Xl1PvAxY PkLUOCC9Qxh4DZP5ekaR1OmqNthHK4ujNKtyYYp8SNRJm6e5dtXkgixgO06obNkEXpKt GvdzOvgv8W+O82NNCcKBNI+msaac663by9A/Su3gweaAyWPpWMKSwYCGfpLOQmJ6DSxx g6hJUUm2LbuVn76IuCAC96y2FJ0/bE1qDaJYRQ9w/cBDFxBxF0dAOkUYZe3xEXaFITZa KCSC9j9tQgirrP3mMA8O2shq5PWonkQMgLLKmc4Tj7Thnq3U9UHsiVT9gD1hHd30aUXJ kUPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469710; x=1705074510; 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=pxeB5JHPsloAIkHe9tjmngVFFPhZ7Tzq56PtI31mi5A=; b=imvySgr9gUk3jtIoTMEJ9Tk4lmDYvg0dsM6M1knjsNBoKezAdVEpOLAXcYtEYxfZrk sdtO5cdEi61vK8Y0cWb+DijFQXc5/UqlqZfT6fhAad8rnGMtYDMZQeP39XgOYLH/zQlF adDdKaAKB9Gyvs2jMQRGkYTxOCOCliTH+699HSiZHcShI9hAWVS0kyHusr9TXeCNLikZ 5RAElaqXub/T4CRk+1+7xSejjWexNH8jpxQ6BnMPh8RijTiGNdvkieM/pLPi+T+G5LLS OoCur4LwGm6ZhsXesDR05pBSrcYXUw+V47Q5yITMwZ/IKIWR9M0PIK+qiHPXDeSE72Ct EDTg== X-Gm-Message-State: AOJu0YyPGUQoTVEzEuPaF7Q01UM5NxZyXMsArGfZ4e1fa0UCs+FK0ABh 6F+mz3DoJphTc1ldBh9zVDUtHRg6/oXBj7j8Vb90xNMF5WU= X-Google-Smtp-Source: AGHT+IGGmNlvX+5XEyFN41Jq0pCpjhFubR2VsuO+YfPUoop45ZA6QI8jot/WJJTvWFoNWF4EwwAJAg== X-Received: by 2002:a05:600c:34c1:b0:40d:880f:4876 with SMTP id d1-20020a05600c34c100b0040d880f4876mr630692wmq.152.1704469710540; Fri, 05 Jan 2024 07:48:30 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 51/71] memory: Have memory_region_init_rom_device_nomigrate() return a boolean Date: Fri, 5 Jan 2024 16:42:44 +0100 Message-ID: <20240105154307.21385-52-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469918256100003 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_rom_device_nomigrate() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-9-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 9f54bc4af8..6d7b49b735 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1523,8 +1523,10 @@ bool memory_region_init_rom_nomigrate(MemoryRegion *= mr, * must be unique within any device * @size: size of the region. * @errp: pointer to Error*, to store an error if it happens. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_rom_device_nomigrate(MemoryRegion *mr, +bool memory_region_init_rom_device_nomigrate(MemoryRegion *mr, Object *owner, const MemoryRegionOps *ops, void *opaque, diff --git a/system/memory.c b/system/memory.c index 069aa5ee08..8db271c19e 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1716,7 +1716,7 @@ bool memory_region_init_rom_nomigrate(MemoryRegion *m= r, return true; } =20 -void memory_region_init_rom_device_nomigrate(MemoryRegion *mr, +bool memory_region_init_rom_device_nomigrate(MemoryRegion *mr, Object *owner, const MemoryRegionOps *ops, void *opaque, @@ -1737,7 +1737,9 @@ void memory_region_init_rom_device_nomigrate(MemoryRe= gion *mr, mr->size =3D int128_zero(); object_unparent(OBJECT(mr)); error_propagate(errp, err); + return false; } + return true; } =20 void memory_region_init_iommu(void *_iommu_mr, --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469979; cv=none; d=zohomail.com; s=zohoarc; b=FMfChAYy0C+puuWPIdfKz52Q3XJyk7Kv1w0joCh6Trz6rNfdilTnThxqEdvIK0XyGTD4uW8VKivPpyRthCB0iCNPdpp2oXOdmmtdPTaZcPmJy2AqayPdt8pRAHbLEGOPsuFbFoPP71gh7hqoCBC8EmLqLfrXgc7lLQfrSSngsKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469979; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EqhTmAjxaD/BTNoVLzXvd/YAl4zMVPKwo4ul47FACnE=; b=k+K1z+ulD9TGapG52UuW59QydZ7LX3fgC4JfPcSqZ4GrveI98WNMSBCtEhubXYbE2z0iGu6rujp/oHbSp6u/69BvUy8bAYO1evY87orlRz0w1Rg55btUAym6OEz2eeexrHqifRyBfxHLLHr5JtcfFrky+2rZhnW+AXuRXd3hsOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469979874511.46299335083256; Fri, 5 Jan 2024 07:52:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRR-0005KD-Ba; Fri, 05 Jan 2024 10:49:01 -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 1rLmR8-000316-Fy for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:42 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmR3-0005zE-LI for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:41 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-336c8ab0b20so1479148f8f.1 for ; Fri, 05 Jan 2024 07:48:37 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id t1-20020adfd001000000b0033672971fabsm1602690wrh.115.2024.01.05.07.48.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469716; x=1705074516; 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=EqhTmAjxaD/BTNoVLzXvd/YAl4zMVPKwo4ul47FACnE=; b=hG+QZSF0V851L7X8jojOvd9JZ4d5qjF9niXHq0p9KQj/BkYgySSeSx8M/nvxpE4D19 nXa2lYEQnTb0aATCyaoj6yQzom6DfeFg2LpcysBT1A1ANiXPCknvfHs6tA9SaeYDF/f1 U5g1gehpehK82xs48K3kz6+gZ5qhVFVlsf17Tka5pS4YxESQ9A5YmD55OUijQKeIkd3W n+BFve+c6BVfjZpdnS9aVeFZ8BUdjQcHKJhYQvRFfTJJFW9NeCJtylw/O9QXqkPLD1PS pTqkO/AqkpWGHoRJqxD+a8hRifOEdI83lS7BK27vfGfCFbyvY6iPZRSS59yM9kvI/lCr gN1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469716; x=1705074516; 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=EqhTmAjxaD/BTNoVLzXvd/YAl4zMVPKwo4ul47FACnE=; b=DkwlF2Zczp1iX/QwOCLmur4LL75XiKgHuzlHUzO0LPh5GHHTgN5lNJhIBaRAaavVjG o1prpSycECsFHSQRbbuim9WbqOHdi98WpKl33rHzZp07Sqp4cxBGj4sIheZJEIy/8r0a It9b0YYUr73QSt8XOhbplpXT0yJZvlfWl+NlFvxZXaNOL1NTdXu6wF4PgzF1Eq8LLlhj crgGANfcOXI9qq+w668Gfj3LCr1QaFl9ulS7FGJ9NNGWbOLaC5uy3wiKs8yAaHjH7eTE uXXVxovJseOOOm9kbSKf8REGVTY/+9uLMTSyj+x+ZDIcwa/C0dK1mSPVOPCI9SEKH3h9 es0g== X-Gm-Message-State: AOJu0Yys1tePBXM9FCZJBA1YiK8WrLk03HR+oCRLpIevsB5o0o9H3hRY Di5pMDW3EKsZD7biA+svBMQPiA/spP6QOrqDETonzqetxl0= X-Google-Smtp-Source: AGHT+IHK2kFr48UQS0bqpJVz6a1E49DB73EV3GNpMskug7Jop80bPyFSPeLiiJHWQyevrricJnKzIg== X-Received: by 2002:a5d:6e82:0:b0:336:7d12:caf3 with SMTP id k2-20020a5d6e82000000b003367d12caf3mr1547672wrz.44.1704469715876; Fri, 05 Jan 2024 07:48:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 52/71] memory: Simplify memory_region_init_rom_device_nomigrate() calls Date: Fri, 5 Jan 2024 16:42:45 +0100 Message-ID: <20240105154307.21385-53-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469980829100001 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, arg5, arg6, errp; @@ - memory_region_init_rom_device_nomigrate(mr, owner, arg3, arg4, arg5, ar= g6, &errp); if ( - errp + !memory_region_init_rom_device_nomigrate(mr, owner, arg3, arg4, arg= 5, arg6, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-10-philmd@linaro.org> --- system/memory.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/system/memory.c b/system/memory.c index 8db271c19e..c6562f5e86 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3627,12 +3627,9 @@ void memory_region_init_rom_device(MemoryRegion *mr, Error **errp) { DeviceState *owner_dev; - Error *err =3D NULL; =20 - memory_region_init_rom_device_nomigrate(mr, owner, ops, opaque, - name, size, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom_device_nomigrate(mr, owner, ops, opaque, + name, size, errp)) { return; } /* This will assert if owner is neither NULL nor a DeviceState. --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470333; cv=none; d=zohomail.com; s=zohoarc; b=h893IUec9ACR6Ln5b1t1IAkc9H+ICwH5TeI2UEVSs/SOF0r6PcQcqKEMixu6O1nnM6ILqUiAU+RCrlyxtW7jVwOXYs/HquO1793IUnJrLD9MOMTgx8Qaac+ZnYGZghevVEpL4m2XfvkEaOUHenlOwLtlpx+MRN6u25CZs6OIxxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470333; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p7B3Mf2i+vPlyYoqstgqm0gsIkR8x0JtmN/V8QC/eVg=; b=V9E4rLPmTlmt3d2OP5HNHfCo3Oa8bFnDsxNoBRUzgwA1UDM39As11PQpYHevCHWbY/Dmio6ujk+kufRWEaLl3FhCUL4PpS7EM/vIynvvU4B+low1dz1kGBxtg60SAv/n+JaNvmB0KhhSy3LYnDbZqeOPfpYD4Q2vTrSbVqly8MY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470333905921.2219416023235; Fri, 5 Jan 2024 07:58:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRX-00064g-Fi; Fri, 05 Jan 2024 10:49:07 -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 1rLmRB-0003TT-UF for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:46 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmR8-0006Lo-QA for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:45 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-336c9acec03so1302926f8f.2 for ; Fri, 05 Jan 2024 07:48:42 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id df14-20020a5d5b8e000000b0033677aae2e2sm1601439wrb.107.2024.01.05.07.48.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469721; x=1705074521; 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=p7B3Mf2i+vPlyYoqstgqm0gsIkR8x0JtmN/V8QC/eVg=; b=cdLnvVqlynralpvs1HCYe6v256jrxlMu+z79oOS/fgwnfJMv3D7f38wmCsBG0oSPvW pdCXlhwHrFqZe3RkuEh23fi/jq0gG0zW3ht2225OLehC8oxO4O+ugXUfRkNjyKCpCHRi HjBwxRSOfos1jAoa4TzBFJiE/0poYZiHJ+KwLwebj1zfuPskmDX0oA9Bwvg8zJGoU5Z6 eg+R0EBYynKmiADOH9TBtJ2gYm+UvPOd83eBZXWRp/jDmIcUrJmWpdc4H44HvJ/YRJyM T/MXuEI3Gm2OJNSfJ08vhfI4KOHLk8jjalmesmw3sB/PrD19W8BaBBT9NbbuFaqtDieb NjTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469721; x=1705074521; 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=p7B3Mf2i+vPlyYoqstgqm0gsIkR8x0JtmN/V8QC/eVg=; b=vEs0npBeAqonHmGtdvuQF7V2QAmtx5XZI29JsE+sFk1Mb5xBad11maTQ2jeD5adtHo ywVTL5ICVos7SThb4gSgCaDGMqhyyvInPpIpZlfqAnw8iuKLQK/yQ7xLDgEuEkuxKuyZ zRA6mMx8Kv0+bF6JLiLEO83Hk+dGE5KS7oAILjhD9HI1JtK62BmHwpUuSbSyChvxU/ny A49uEzPiEH7E7juHHZWbSf5xeAlwCoISyihR17p3I10aIWpDMo+pVIPy2zL6QeDG9KQT QHHd7g/TFs0DIrUoIUuAc1DExyTyMyjBYuAQ8hYKr1Tvo82eKtrQ4sSgmLQ/Z8rzTev2 Hujw== X-Gm-Message-State: AOJu0YySzjQAKeZomiQESu0LYyAlbGCcy5BqOfzkCM2jF0WRVMQp9gwF QRd+zPIEHOay9bLvr9ZQXVhVINCNo/zPZfYvM/TZYLIbJDs= X-Google-Smtp-Source: AGHT+IGjsaNn11HIHXu5l/67ymJSXi89A/jUI+cc5iuTHU3kZDHmxbR0YIafbwTnw9lVegrp8MN72w== X-Received: by 2002:adf:ef81:0:b0:336:70ed:4cc with SMTP id d1-20020adfef81000000b0033670ed04ccmr1129456wro.95.1704469721129; Fri, 05 Jan 2024 07:48:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 53/71] memory: Have memory_region_init_rom_device() handler return a boolean Date: Fri, 5 Jan 2024 16:42:46 +0100 Message-ID: <20240105154307.21385-54-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470334383100001 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_rom_device return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-11-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 6d7b49b735..6209458f56 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1646,8 +1646,10 @@ bool memory_region_init_rom(MemoryRegion *mr, * must be unique within any device * @size: size of the region. * @errp: pointer to Error*, to store an error if it happens. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_rom_device(MemoryRegion *mr, +bool memory_region_init_rom_device(MemoryRegion *mr, Object *owner, const MemoryRegionOps *ops, void *opaque, diff --git a/system/memory.c b/system/memory.c index c6562f5e86..e5193d4623 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3618,7 +3618,7 @@ bool memory_region_init_rom(MemoryRegion *mr, return true; } =20 -void memory_region_init_rom_device(MemoryRegion *mr, +bool memory_region_init_rom_device(MemoryRegion *mr, Object *owner, const MemoryRegionOps *ops, void *opaque, @@ -3630,7 +3630,7 @@ void memory_region_init_rom_device(MemoryRegion *mr, =20 if (!memory_region_init_rom_device_nomigrate(mr, owner, ops, opaque, name, size, errp)) { - return; + return false; } /* This will assert if owner is neither NULL nor a DeviceState. * We only want the owner here for the purposes of defining a @@ -3640,6 +3640,8 @@ void memory_region_init_rom_device(MemoryRegion *mr, */ owner_dev =3D DEVICE(owner); vmstate_register_ram(mr, owner_dev); + + return true; } =20 /* --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469813; cv=none; d=zohomail.com; s=zohoarc; b=Ba71kqOkQukStTgOqSDDT3VQ+XYsO5EZTaAauOZh0au9p8cJREp4Cf87lnvcsjngUaSRFEyjF0VzNRZus/YdTMlVwd0pdhmDlvmDaN8yplzbpLMsw/1Vd/nyHRYGwiPzOIJ2M0ALD1SCOGWU/WdCN93dob6VCAcWFoyEk4TfkH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469813; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KS/EWIqcckkOMDkJJEhaku50ApzyYMzhGT/LMkqQfVg=; b=LWEx7666BJnhJ5xcV+clxOIrqMEgyFY6P6BNh6oBr4sdHUi1NhvgZmR19fOzIr15liqvdD5VsX/AmIdy/kAtbqVtNiIsnYi+rBjxPdsckRTcBK/fQrp8HrSmEevzDV8HX+p3JMIbRFj4259pz2+jfsoicn5KICo8fzuzYOjVmH0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469813393380.9037783719632; Fri, 5 Jan 2024 07:50:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRh-00076m-Sl; Fri, 05 Jan 2024 10:49:18 -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 1rLmRI-0004Ko-89 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:52 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRE-0006e3-NY for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:51 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3368ae75082so386061f8f.1 for ; Fri, 05 Jan 2024 07:48:47 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id jb13-20020a05600c54ed00b0040d86e89abfsm1891493wmb.43.2024.01.05.07.48.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469726; x=1705074526; 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=KS/EWIqcckkOMDkJJEhaku50ApzyYMzhGT/LMkqQfVg=; b=TQKmNGjJDide/9Oo07D/i+Oegvwn/RSRSI59Ceub2ho3TaO4cn2Trm+/h85KIULEd1 uDo5PXFPKWCOEzscu1P9ttuVXBZbwVNDAyjazNoxIz6bs9uh5n6L9Wdbk53e0vIKic2f 56NfS7iUqm11yTHxUGYKJUF8SckZo04uXXfIZ4tmhaZw9du/4fhE+RzBZbQHatM/GT/q 1l3E2+VlQ5P/PZBdTbGquBCt56l9XE/7Ec3IarLInKDq7MNcp1TPMIcC/6LOgfgrNhCm inJoRD0PGS3Nbrybxa58hlv+Y5GU2V3V5+8gambOdZszPyG7T+QBcOgIzR1cpMbP2v5K O2kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469726; x=1705074526; 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=KS/EWIqcckkOMDkJJEhaku50ApzyYMzhGT/LMkqQfVg=; b=mlNml2t9fPDrFbwcAP/Y7vAjI2s+lMmqAMnxc3nDvHYwcrpaDVw1bNP79VxPZVS4qX pnYXCXAA7CSFNejF6XbuzIRc0GogqqjjQIoN3WdBws5iEvMGB15hIwxhnSz5IcUVcK90 dHNlCu+plis9wzjxTzolvFtMzH34wGckZv9cu2McisdmSqGjiqokbDlHuVrlwqUjN8jR w9qg5s70H0QzG1yI7uQ07N8DqqE226Yu/SWEwGnUNMdhNlOwpvJFYfrIAvyyH3A8qpFc myNlUgoKfflRfXLMbb9aqsIEcdbw30mT+jiXRyXP0yVnrfG49YGyq4M+cbn5AILZF0uI vbGg== X-Gm-Message-State: AOJu0Yw9WfBDID21mGeRmY3rWjh7acYcKVp/07h2MgBxHfAOvA+vIyMc QinssGrq3jkst5n4SmC9Jkx7nIPmZWUXijpXc2Jm8IzDJWI= X-Google-Smtp-Source: AGHT+IHCMZopN7QkaYjwbRy6R//U2x8WCEhaSSdxcgt4jsVJjXGRov5SRbnQWWKvsRXafcE/p4r2fw== X-Received: by 2002:a05:600c:1ca4:b0:40d:8bc8:3566 with SMTP id k36-20020a05600c1ca400b0040d8bc83566mr1247666wms.145.1704469726365; Fri, 05 Jan 2024 07:48:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 54/71] memory: Have memory_region_init_resizeable_ram() return a boolean Date: Fri, 5 Jan 2024 16:42:47 +0100 Message-ID: <20240105154307.21385-55-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469814623100009 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_resizeable_ram return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-12-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 6209458f56..faddf8f073 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1342,8 +1342,10 @@ bool memory_region_init_ram_flags_nomigrate(MemoryRe= gion *mr, * * Note that this function does not do anything to cause the data in the * RAM memory region to be migrated; that is the responsibility of the cal= ler. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_resizeable_ram(MemoryRegion *mr, +bool memory_region_init_resizeable_ram(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index e5193d4623..75303484e1 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1578,7 +1578,7 @@ bool memory_region_init_ram_flags_nomigrate(MemoryReg= ion *mr, return true; } =20 -void memory_region_init_resizeable_ram(MemoryRegion *mr, +bool memory_region_init_resizeable_ram(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, @@ -1599,7 +1599,9 @@ void memory_region_init_resizeable_ram(MemoryRegion *= mr, mr->size =3D int128_zero(); object_unparent(OBJECT(mr)); error_propagate(errp, err); + return false; } + return true; } =20 #ifdef CONFIG_POSIX --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470013; cv=none; d=zohomail.com; s=zohoarc; b=Rl11ELT7MYwrySS5lbTTfgr0CFOuxUIWMDTDuaP1gfcxc2kVAc8NNspbbBnzE5WZ3Y9IEVh8wMBf78vXWOyOiL20nBy3+6L4lZLrAWzp3v8hU6d0ig6ysIkRGhQL6idUdDCX5tNDrkSaCWH+MYrFzYtnqaYmx8GNhCH1tcKk9CI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470013; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Dn8kXCOFTNbdwpGvjXbfKLmnnB9Pg2Sf7+jbS80Xsv4=; b=EYXujWecjBxPG8IMwHhWXbXH5HWN3QEjc4cEHQAt878U7I59Kfa3JnAd0FDWJ8bHXAgUjcTTFsU6c/7iIGBSW5GvFxV0DoT1xBKZJZqHoAJwU6D3MwYTVg5zWRGRWo3nrTWXTN3fxykcrbJF8rn+BjsYKjBRK+8OrXtTztCojVw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470013445378.45264686395456; Fri, 5 Jan 2024 07:53:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmSB-0007vn-Ny; Fri, 05 Jan 2024 10:49: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 1rLmRN-0004lj-F1 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:57 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRJ-0006pj-IN for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:57 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40d3c4bfe45so14948575e9.1 for ; Fri, 05 Jan 2024 07:48:52 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id s7-20020a5d6a87000000b0033680f7be5fsm1610144wru.87.2024.01.05.07.48.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469731; x=1705074531; 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=Dn8kXCOFTNbdwpGvjXbfKLmnnB9Pg2Sf7+jbS80Xsv4=; b=yNiFcMBIatYGftSM5AGjnqdqSpfEHnDy0FfkdPfkcA3QBAZqmMnGBqeBzlsFTr2uQA IhgxgWfVc9rCH7BBJTfpjlcrVGgw0l64eNy4TFI6L+8I+jpZV06K1GBtBYD98GkLEAXD qGT4HFCkKhvspbG5gm8GeP1CNPhSg9oX84gGMvSZl0n2UpdFYLMSLsMXCBtO0xGQnLut tYxq82Ldsg2P2ZwEwx3Tun/iuoVrz3Jp3iAtvaq4GRvpFtqJOf6FslqMHWfk7owGRQXb yVrdQQ6UKNKEmnCA18hpoqfl0yZKMi8BZCHQApcWUegyXfVju59biFNGDKnT3l6a/Td5 mJbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469731; x=1705074531; 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=Dn8kXCOFTNbdwpGvjXbfKLmnnB9Pg2Sf7+jbS80Xsv4=; b=VE/s0+bCtObAlYZsoMQPINfnCZdVah/KZvIfMpuoXaCDla6G23uAK1yU4MkEbjquKZ A6logmrJONtdx+MGoWUF89gT+paxFnLn7urbNWNHGdoCaJo2Q+uDWhK5H1EhBSRw5sW+ ZEJ2mwDZJaSXtNPBnsm/Y8S3KhhqGi3lhi/TvSEo3NW34fuoC6eyPJVLP30dayaFL8y2 TLmnMJBH219IKSfyESFB4YvvDJHgQXdiItUYhmzVp3WjBHb+R6HUIJwsbO+GMtyEJdoG 8NQq0Kpye8NM7szhmHR3clKxK4AZHRlS0k4LAx96O01YK5Ja85MEVIvd5opYWg8tYg9m 6SRQ== X-Gm-Message-State: AOJu0Ywp9xYd7vTAvta3U0exKBLDWETCKp/JgOxL7IlMUUmHY7MSvV91 XGlkP1sXMIJis02hnRsSOBQlkGTOZdzwKV0wvFd/pj4zvLw= X-Google-Smtp-Source: AGHT+IFD7DyB4xxIwWnwejyKUiMk9ET1/qEMLxKpFrkBYKfHXFKCm93a1wvJdQnG9Qtn/KNLDMdcQg== X-Received: by 2002:a05:600c:5188:b0:40e:375f:6929 with SMTP id fa8-20020a05600c518800b0040e375f6929mr311928wmb.40.1704469731598; Fri, 05 Jan 2024 07:48:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 55/71] memory: Have memory_region_init_ram_from_file() handler return a boolean Date: Fri, 5 Jan 2024 16:42:48 +0100 Message-ID: <20240105154307.21385-56-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470014821100002 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_ram_from_file return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-13-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index faddf8f073..c39819ec75 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1376,8 +1376,10 @@ bool memory_region_init_resizeable_ram(MemoryRegion = *mr, * * Note that this function does not do anything to cause the data in the * RAM memory region to be migrated; that is the responsibility of the cal= ler. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_ram_from_file(MemoryRegion *mr, +bool memory_region_init_ram_from_file(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index 75303484e1..e05d88aa67 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1605,7 +1605,7 @@ bool memory_region_init_resizeable_ram(MemoryRegion *= mr, } =20 #ifdef CONFIG_POSIX -void memory_region_init_ram_from_file(MemoryRegion *mr, +bool memory_region_init_ram_from_file(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, @@ -1628,7 +1628,9 @@ void memory_region_init_ram_from_file(MemoryRegion *m= r, mr->size =3D int128_zero(); object_unparent(OBJECT(mr)); error_propagate(errp, err); + return false; } + return true; } =20 void memory_region_init_ram_from_fd(MemoryRegion *mr, --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469962; cv=none; d=zohomail.com; s=zohoarc; b=UD8h5QDAs0YDnvy21Y3Mxt81pGlDPTZXZToln6mBCg9qL9d0K697uThpKtxU/QrNJBVbBFwKwE8MmWqsWNqHlBSb+70isqqBSldtetiaXklryV24+9nb9bDCIs8sSVUOiJ/skn8Qv5NrmRlPLa74L9Iep7G/LcT5+4fSqW24Ryw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469962; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=c9DCMj7pY2pO17D+FqBvL8kwEDleUW00T3E/JGiYz/k=; b=PFrHP4N72uctcIcWWx2MGtxIHo7QNL03c/oyzWFPEVeczcADSbx5E3FonPPUYv5CKVspOyAfqH942Ft3BiaEPjJ5iFiWxTKgfO+Rd5DLsb3ba2wNWWr9kM7BVxp/NfO18OxDYYmVrr/8ChMUW3WFoBfbewXA5aMk1y6vgh83URI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170446996211093.0097059534553; Fri, 5 Jan 2024 07:52:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmT2-0001mb-3l; Fri, 05 Jan 2024 10:50:44 -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 1rLmRg-00076c-81 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:17 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRO-00075k-OG for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:14 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40d8902da73so12882625e9.2 for ; Fri, 05 Jan 2024 07:48:58 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id az29-20020a05600c601d00b0040d87b5a87csm1965144wmb.48.2024.01.05.07.48.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469737; x=1705074537; 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=c9DCMj7pY2pO17D+FqBvL8kwEDleUW00T3E/JGiYz/k=; b=U54if9m0B4jYXM4rDTogAYwijQfmaWRbyeNV7pFxhFHddn9l0IDHgqC9Cilhz5VgDl bQn7UZX+V4CFJNfZFyhm7isRTf7+aIu9AXB1alsa3icILbPnLv1oyhOXMhzZlLSgi9Z4 BOIBinMngYba1t1jnPZP805CP73T5tad2dPqgWOzkksGNGezv2eUco/wmNgY5R9a5+Uf Mw9BuSBNuYOTc3qGMWOsOFjZwi/mP8UC7zcUgSnJnKoRS9LWQdnr5npbPDzoa6j4EkLG x32opXu7JdXwIg70Uivz7cchEEeQIGslAjeCFyDb0zRXUTRYb6/WZszJ0vKSj10N1atN ouFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469737; x=1705074537; 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=c9DCMj7pY2pO17D+FqBvL8kwEDleUW00T3E/JGiYz/k=; b=l9viSW/ap+y1D8WleuMeROaMG8xcMNKJ6p4BAn/GMO8S5HvS5r2KX4s11WbfMrWe+1 I4hsjBra6G5hmZGszb1Mg8Ye+3802BgakXM45Zx4Xz440sLt77/NBDUY2M9v/0AvBxiF IlKKxZUB33FKoBNVRU4iVvxzYzzuqWtCEwkGYwks8x76uw5201kzluz2dM3RqhSA+gkf dsWgyh1CKQdAVa17bj5/x5Udbql+5ewjPbN3cJvgkzvTEkfk5hvDe0yq10O++7bv9Fzv HF+w0h1TyNyuPGHT32Dnsxe/HDoJUN3KqUw/STvGCdgqGkBc1uTJkPydBFQar7NnSOxJ KEaA== X-Gm-Message-State: AOJu0Yxmyqh6hxQP8cy1GzTgjWVfGpnX82pSH5K+4aPx+QneG0bI7gMm dNu4wU/TPMHWiXtF2FTsRKSU2guukRHIgYTABDWgRtY1pR0= X-Google-Smtp-Source: AGHT+IFr3rjevgUO39MMi9bFJ/ZWecNNIqMe1MrKSODaM+cLKa+lPF7yzj6ex1uolFUngYScxhl9Vw== X-Received: by 2002:a05:600c:4a13:b0:40d:8ddc:b443 with SMTP id c19-20020a05600c4a1300b0040d8ddcb443mr1540873wmp.50.1704469737001; Fri, 05 Jan 2024 07:48:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 56/71] memory: Have memory_region_init_ram_from_fd() handler return a boolean Date: Fri, 5 Jan 2024 16:42:49 +0100 Message-ID: <20240105154307.21385-57-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469962662100009 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_ram_from_fd return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-14-philmd@linaro.org> --- include/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index c39819ec75..48c11ca743 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1406,8 +1406,10 @@ bool memory_region_init_ram_from_file(MemoryRegion *= mr, * * Note that this function does not do anything to cause the data in the * RAM memory region to be migrated; that is the responsibility of the cal= ler. + * + * Return: true on success, else false setting @errp with error. */ -void memory_region_init_ram_from_fd(MemoryRegion *mr, +bool memory_region_init_ram_from_fd(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, diff --git a/system/memory.c b/system/memory.c index e05d88aa67..9ceb229d28 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1633,7 +1633,7 @@ bool memory_region_init_ram_from_file(MemoryRegion *m= r, return true; } =20 -void memory_region_init_ram_from_fd(MemoryRegion *mr, +bool memory_region_init_ram_from_fd(MemoryRegion *mr, Object *owner, const char *name, uint64_t size, @@ -1654,7 +1654,9 @@ void memory_region_init_ram_from_fd(MemoryRegion *mr, mr->size =3D int128_zero(); object_unparent(OBJECT(mr)); error_propagate(errp, err); + return false; } + return true; } #endif =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470019; cv=none; d=zohomail.com; s=zohoarc; b=VF3xBJXl8CgO3di7yJvF5BhzkJf5VddsRy9+9Z1WpcwL6ANaVVHQ8sphMp3uqAwGfdosgxrKdcY9EWVSE0On0kmWnprPtbNbbj+ec5h8mRUeMLd1GHzbq+Gg6KT22XCHRXV3AxG0OFmPHl7+7yteRrDCgv3uH5//DmS69EsCwFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470019; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/MHct3O8aNA/2/UVwnbSfbe+2Bg3uf1okl2NSMgEytw=; b=XiSl5LFMun5uampWptwvkAE/YrQWBeEWZDq6QGbabY3fBPZUPXEHG94hig2t06sOxpPNdO69PBxPQJkkK75rDZH1ZYs826I5USiyr7j6akZfZdM9B9MdW94fa/T1OU+uBe6rqnj39CqbgFEsbIVMPNOqmm5n9dTvNzePzGqOHRk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470019287246.6207140675158; Fri, 5 Jan 2024 07:53:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmRr-0007Uv-Mm; Fri, 05 Jan 2024 10:49:27 -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 1rLmRY-0006Hv-GP for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:08 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRU-0007Ks-3l for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:08 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3366ddd1eddso1512714f8f.0 for ; Fri, 05 Jan 2024 07:49:03 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id z6-20020a5d4c86000000b00337464bf723sm1611623wrs.18.2024.01.05.07.49.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469742; x=1705074542; 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=/MHct3O8aNA/2/UVwnbSfbe+2Bg3uf1okl2NSMgEytw=; b=RDI1RcxaxyKuatpifuVlVk6C8weM19gQADJK+wWa/W8BqYpddrTeT39IE8QJ04aJ1Q o+7WitPm8Qj++IzirnQ1Qa3zC8eMvjp827JfBQbuk7ABH4xnY07Ki71DL51XhtxoDQ3M wgtbbJ7vQVBEL//1D+a6Sy0cy2ewN5LUCs/8akLrgUvb5BCT5R1pxMJ384O6nP1DN6Ds wct+R5/zeElK2Tj693/ZdvdqkNwTtbN/PVKDu3phXgTDvEoBFl8EhiuiLEEgRD100H0G K56bgZ4UaRf8oFvCQ0BUKAwh+oQ8nyGitPySgZZlHE/3rOQnAcQIBSo/TXmEP5pHM7WH oqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469742; x=1705074542; 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=/MHct3O8aNA/2/UVwnbSfbe+2Bg3uf1okl2NSMgEytw=; b=dtqbR7WqRWR0eypXQ5VDlpbH6xoHJBkzgYiQKfwn0NsiQ1/XaQ74wsYrAuZ4yspeON 589t4gSjepkhtBLMLiy72pWmZ9rJoBap8xgiGQUoB34puQruJfJDeTVAxor9uT0Wa071 de7GjwQmkkKGtwLoyqb2c2e03ClUdtZNhANON/Tefxou5oMgzHGo0yiFsIb8PoDaciZO QiMakxMAK8uro+kkobJDdcqQyiGWt5jZ6to2I7nCsxnu0Y6oxE2uG6wvQeFlcIFfSFy1 nDhdfIbYxGC0xQ39JdrQN9VyJJvjg3SZhQai1jP+7rR+fNr0N9DTwslxEvonTYvvocr2 +g6g== X-Gm-Message-State: AOJu0YyFKU8OOkcyRHgNjWoBvXklBCtQIYODWmuOyIxd+cizfm9Uj5Kh RW92EkILihhQgRVS+0GfvTlJhOlIdxapGhVCZTz5El5qmcE= X-Google-Smtp-Source: AGHT+IG35Z/WWepcpJQlDLc8Yz929kiQtEAc/ue2/HLQPw811nDvSsd1ILxh7He87dMaKA/zAJp4YA== X-Received: by 2002:a05:600c:4583:b0:40c:a5b:d28b with SMTP id r3-20020a05600c458300b0040c0a5bd28bmr634654wmo.86.1704469742377; Fri, 05 Jan 2024 07:49:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , David Hildenbrand , Igor Mammedov Subject: [PULL 57/71] backends: Use g_autofree in HostMemoryBackendClass::alloc() handlers Date: Fri, 5 Jan 2024 16:42:50 +0100 Message-ID: <20240105154307.21385-58-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470020856100003 In preparation of having HostMemoryBackendClass::alloc() handlers return a boolean, have them use g_autofree. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-15-philmd@linaro.org> --- backends/hostmem-epc.c | 3 +-- backends/hostmem-file.c | 3 +-- backends/hostmem-memfd.c | 3 +-- backends/hostmem-ram.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/backends/hostmem-epc.c b/backends/hostmem-epc.c index 4e162d6789..3ceb079f9e 100644 --- a/backends/hostmem-epc.c +++ b/backends/hostmem-epc.c @@ -20,8 +20,8 @@ static void sgx_epc_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) { + g_autofree char *name =3D NULL; uint32_t ram_flags; - char *name; int fd; =20 if (!backend->size) { @@ -41,7 +41,6 @@ sgx_epc_backend_memory_alloc(HostMemoryBackend *backend, = Error **errp) memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend), name, backend->size, ram_flags, fd, 0, errp); - g_free(name); } =20 static void sgx_epc_backend_instance_init(Object *obj) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 361d4a8103..fe8c481f8f 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -44,8 +44,8 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Err= or **errp) object_get_typename(OBJECT(backend))); #else HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(backend); + g_autofree gchar *name =3D NULL; uint32_t ram_flags; - gchar *name; =20 if (!backend->size) { error_setg(errp, "can't create backend with size 0"); @@ -89,7 +89,6 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Err= or **errp) memory_region_init_ram_from_file(&backend->mr, OBJECT(backend), name, backend->size, fb->align, ram_flags, fb->mem_path, fb->offset, errp); - g_free(name); #endif } =20 diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 3fc85c3db8..db28ab5a56 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -35,8 +35,8 @@ static void memfd_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) { HostMemoryBackendMemfd *m =3D MEMORY_BACKEND_MEMFD(backend); + g_autofree char *name =3D NULL; uint32_t ram_flags; - char *name; int fd; =20 if (!backend->size) { @@ -57,7 +57,6 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, Er= ror **errp) ram_flags |=3D backend->reserve ? 0 : RAM_NORESERVE; memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend), name, backend->size, ram_flags, fd, 0, errp); - g_free(name); } =20 static bool diff --git a/backends/hostmem-ram.c b/backends/hostmem-ram.c index b8e55cdbd0..0a670fc22a 100644 --- a/backends/hostmem-ram.c +++ b/backends/hostmem-ram.c @@ -19,8 +19,8 @@ static void ram_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) { + g_autofree char *name =3D NULL; uint32_t ram_flags; - char *name; =20 if (!backend->size) { error_setg(errp, "can't create backend with size 0"); @@ -32,7 +32,6 @@ ram_backend_memory_alloc(HostMemoryBackend *backend, Erro= r **errp) ram_flags |=3D backend->reserve ? 0 : RAM_NORESERVE; memory_region_init_ram_flags_nomigrate(&backend->mr, OBJECT(backend), = name, backend->size, ram_flags, errp); - g_free(name); } =20 static void --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469960; cv=none; d=zohomail.com; s=zohoarc; b=KK4SxFE42p6Koj/oLM6sxT9R2rWwC7ZFm/xifjHTlM4Fsuz6qe0lX13YzF1FUIEyKumLUH0PNgmGbc7V8c2reG4bRJnvwTtxakPWC/sksGp7Of7ZlNoywuntBbmQF70QVIv0rCEwdtwcOTNmVkz4q4yNjdWecRfo8Y2b0B3rvuY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469960; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ux8OTSc8Ad9jOVNGlPCxH1dshjQrIfyvWA7mV8zeD70=; b=C7ox4Plb5PAKzMzFLPZQXuuKEnlV5Su79tFJ/4QJH7wLSi8wU3+FyJC8uPuvUZIt+1xaHU29qnsjhTzt0Efd4cwNOQMXHS3fFDDjSEBIIgjw54/uNnn+hcQQrKKW8r5huEwRpsSUpvmKoEupw9wgM9lnKtwYhSqi+PNRc9BgpPg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469960043125.02457261167444; Fri, 5 Jan 2024 07:52:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmSY-0000eJ-Md; Fri, 05 Jan 2024 10:50: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 1rLmRd-00074G-7i for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:16 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRZ-0007fu-LZ for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:12 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-33686649b72so1473637f8f.3 for ; Fri, 05 Jan 2024 07:49:09 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id v11-20020a5d4a4b000000b0033755d8ce7asm1612139wrs.76.2024.01.05.07.49.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469748; x=1705074548; 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=Ux8OTSc8Ad9jOVNGlPCxH1dshjQrIfyvWA7mV8zeD70=; b=KvLiuHotPLFzDY5cGRIYlx7MzPpNJHtlWFKoRlRM92gtTF6gcJZHZFac9pzvl+4OjA 5Y7TUBAgkt91UmhVpooMo3vFLsXkW3/L6pLDFmvOgwc1KiL5P3AntWTx+NUqLz9coDyk mvDzDYMpREBNgkwfKy/w9196OppRfEOwe1TJ6tHtldw9W1wufNkcbzOFzR1HxJfb9bO3 r79ie326Qqf4mbWYFWkRaGuDfFFsrR8E0gf6FqgTAUwZtTaPJCMV3NVcUWdGfNvjwC4o nUVBfbVrHyZ732LbSWFdfHcPw3nXUut+r4dkawPydxjoMBIKh7PiKS5uSu6oV2u0Hto8 s3xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469748; x=1705074548; 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=Ux8OTSc8Ad9jOVNGlPCxH1dshjQrIfyvWA7mV8zeD70=; b=hhCfOeKjAYo6mPFS8hSTFokyUhrM3sKtymZ+azbKwRa5ir6MlO9R9rksbCAULdb6e4 8nKsEF7jkTy5hL4rxTDqOJluJPtgasnx3qDP3RDRcGIDaoSYh8Ew+Dq8mEJ+3t0r0vQt rjlVG9CmjA8ioxHfdJJkvM1g3Dptjc56Tz0OhRlz//sjZUT39KlJ0XdJHIS+VvG3EXk+ qV7gZWe4p4/kjOoqXhyGL4o9oT13hqihOw4j6Je5yEwucvkrSprNG3f/Mjl2gyW7tiyT JRrXay3UjTW8g0zirKNrca4hvvpRGqReDHnnccODRsnqzKQNaVQ+/WMTavGCqZyYp6az 3iYg== X-Gm-Message-State: AOJu0Ywij7XlZHUCJq6hYexSvCNraDs8SSyuE814E7szxuhXKy/+9QIK KOGy05pjc8Y4EbDjCceZ0zvB0fQIaE7kicKxTPQ3bk5j8xA= X-Google-Smtp-Source: AGHT+IGIETFYAoKomZGthhzqwh2WmijwBElGFtT7X9nQ/SVIqNP8h6kcKqDLfl1PV4n8/g7pTRHYdw== X-Received: by 2002:a5d:4a84:0:b0:336:7bd0:47a2 with SMTP id o4-20020a5d4a84000000b003367bd047a2mr1392275wrq.112.1704469747954; Fri, 05 Jan 2024 07:49:07 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , David Hildenbrand , Igor Mammedov Subject: [PULL 58/71] backends: Simplify host_memory_backend_memory_complete() Date: Fri, 5 Jan 2024 16:42:51 +0100 Message-ID: <20240105154307.21385-59-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469960537100002 Return early if bc->alloc is NULL. De-indent the if() ladder. Note, this avoids a pointless call to error_propagate() with errp=3DNULL at the 'out:' label. Change trivial when reviewed with 'git-diff --ignore-all-space'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-16-philmd@linaro.org> --- backends/hostmem.c | 133 +++++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 66 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 747e7838c0..1723c19165 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -328,83 +328,84 @@ host_memory_backend_memory_complete(UserCreatable *uc= , Error **errp) void *ptr; uint64_t sz; =20 - if (bc->alloc) { - bc->alloc(backend, &local_err); - if (local_err) { - goto out; - } + if (!bc->alloc) { + return; + } + bc->alloc(backend, &local_err); + if (local_err) { + goto out; + } =20 - ptr =3D memory_region_get_ram_ptr(&backend->mr); - sz =3D memory_region_size(&backend->mr); + ptr =3D memory_region_get_ram_ptr(&backend->mr); + sz =3D memory_region_size(&backend->mr); =20 - if (backend->merge) { - qemu_madvise(ptr, sz, QEMU_MADV_MERGEABLE); - } - if (!backend->dump) { - qemu_madvise(ptr, sz, QEMU_MADV_DONTDUMP); - } + if (backend->merge) { + qemu_madvise(ptr, sz, QEMU_MADV_MERGEABLE); + } + if (!backend->dump) { + qemu_madvise(ptr, sz, QEMU_MADV_DONTDUMP); + } #ifdef CONFIG_NUMA - unsigned long lastbit =3D find_last_bit(backend->host_nodes, MAX_N= ODES); - /* lastbit =3D=3D MAX_NODES means maxnode =3D 0 */ - unsigned long maxnode =3D (lastbit + 1) % (MAX_NODES + 1); - /* ensure policy won't be ignored in case memory is preallocated - * before mbind(). note: MPOL_MF_STRICT is ignored on hugepages so - * this doesn't catch hugepage case. */ - unsigned flags =3D MPOL_MF_STRICT | MPOL_MF_MOVE; - int mode =3D backend->policy; + unsigned long lastbit =3D find_last_bit(backend->host_nodes, MAX_NODES= ); + /* lastbit =3D=3D MAX_NODES means maxnode =3D 0 */ + unsigned long maxnode =3D (lastbit + 1) % (MAX_NODES + 1); + /* ensure policy won't be ignored in case memory is preallocated + * before mbind(). note: MPOL_MF_STRICT is ignored on hugepages so + * this doesn't catch hugepage case. */ + unsigned flags =3D MPOL_MF_STRICT | MPOL_MF_MOVE; + int mode =3D backend->policy; =20 - /* check for invalid host-nodes and policies and give more verbose - * error messages than mbind(). */ - if (maxnode && backend->policy =3D=3D MPOL_DEFAULT) { - error_setg(errp, "host-nodes must be empty for policy default," - " or you should explicitly specify a policy other" - " than default"); - return; - } else if (maxnode =3D=3D 0 && backend->policy !=3D MPOL_DEFAULT) { - error_setg(errp, "host-nodes must be set for policy %s", - HostMemPolicy_str(backend->policy)); - return; - } + /* check for invalid host-nodes and policies and give more verbose + * error messages than mbind(). */ + if (maxnode && backend->policy =3D=3D MPOL_DEFAULT) { + error_setg(errp, "host-nodes must be empty for policy default," + " or you should explicitly specify a policy other" + " than default"); + return; + } else if (maxnode =3D=3D 0 && backend->policy !=3D MPOL_DEFAULT) { + error_setg(errp, "host-nodes must be set for policy %s", + HostMemPolicy_str(backend->policy)); + return; + } =20 - /* We can have up to MAX_NODES nodes, but we need to pass maxnode+1 - * as argument to mbind() due to an old Linux bug (feature?) which - * cuts off the last specified node. This means backend->host_nodes - * must have MAX_NODES+1 bits available. - */ - assert(sizeof(backend->host_nodes) >=3D - BITS_TO_LONGS(MAX_NODES + 1) * sizeof(unsigned long)); - assert(maxnode <=3D MAX_NODES); + /* We can have up to MAX_NODES nodes, but we need to pass maxnode+1 + * as argument to mbind() due to an old Linux bug (feature?) which + * cuts off the last specified node. This means backend->host_nodes + * must have MAX_NODES+1 bits available. + */ + assert(sizeof(backend->host_nodes) >=3D + BITS_TO_LONGS(MAX_NODES + 1) * sizeof(unsigned long)); + assert(maxnode <=3D MAX_NODES); =20 #ifdef HAVE_NUMA_HAS_PREFERRED_MANY - if (mode =3D=3D MPOL_PREFERRED && numa_has_preferred_many() > 0) { - /* - * Replace with MPOL_PREFERRED_MANY otherwise the mbind() below - * silently picks the first node. - */ - mode =3D MPOL_PREFERRED_MANY; - } + if (mode =3D=3D MPOL_PREFERRED && numa_has_preferred_many() > 0) { + /* + * Replace with MPOL_PREFERRED_MANY otherwise the mbind() below + * silently picks the first node. + */ + mode =3D MPOL_PREFERRED_MANY; + } #endif =20 - if (maxnode && - mbind(ptr, sz, mode, backend->host_nodes, maxnode + 1, flags))= { - if (backend->policy !=3D MPOL_DEFAULT || errno !=3D ENOSYS) { - error_setg_errno(errp, errno, - "cannot bind memory to host NUMA nodes"); - return; - } + if (maxnode && + mbind(ptr, sz, mode, backend->host_nodes, maxnode + 1, flags)) { + if (backend->policy !=3D MPOL_DEFAULT || errno !=3D ENOSYS) { + error_setg_errno(errp, errno, + "cannot bind memory to host NUMA nodes"); + return; } + } #endif - /* Preallocate memory after the NUMA policy has been instantiated. - * This is necessary to guarantee memory is allocated with - * specified NUMA policy in place. - */ - if (backend->prealloc) { - qemu_prealloc_mem(memory_region_get_fd(&backend->mr), ptr, sz, - backend->prealloc_threads, - backend->prealloc_context, &local_err); - if (local_err) { - goto out; - } + /* Preallocate memory after the NUMA policy has been instantiated. + * This is necessary to guarantee memory is allocated with + * specified NUMA policy in place. + */ + if (backend->prealloc) { + qemu_prealloc_mem(memory_region_get_fd(&backend->mr), ptr, sz, + backend->prealloc_threads, + backend->prealloc_context, &local_err); + if (local_err) { + goto out; } } out: --=20 2.41.0 From nobody Tue Nov 26 20:17:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470355; cv=none; d=zohomail.com; s=zohoarc; b=FweF2t+fsJXy2cTmIwwmRzCBnlIMhIHD04je1ry+p5QvsvjE6ZbVjG+2M7HpFACERO7Ae6TrenYc+pY6VLCNsz+vH2oc9h7PdlzbcjQn0JLNgOi8lG193LhvobdUGPNe2k3xwQwSjPb4Ken742qbi7vqVnsWOyvswNFLoKaMXAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470355; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QjTvneZAUBkosxG1nWDJT6FQx8ULASKYfEukRB1XIpY=; b=G3NZcjhWxUiuandZQqpfp7qWs86oWx3nrJiNGrQpok4x0D/uFGYyoJwZ9GuJ53eVEvXMZrRya4WRh0+X3pEiiNPCuWSaqv+h/RlfMn69ULqQt+ekaKqCGM4SylptTC4lzDcBpkxnoDeOpuMN5JOsZOAE8ztLNV++ZEwA7GbX/bA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470355280376.2933368397902; Fri, 5 Jan 2024 07:59:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTK-00027C-40; Fri, 05 Jan 2024 10:50: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 1rLmRj-0007Fm-GE for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:21 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRg-0007rh-0o for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:19 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40d60ad5f0bso19751205e9.0 for ; Fri, 05 Jan 2024 07:49:14 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b0040d6d755c90sm1937955wmq.42.2024.01.05.07.49.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469753; x=1705074553; 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=QjTvneZAUBkosxG1nWDJT6FQx8ULASKYfEukRB1XIpY=; b=bSQdDuDMsgO/iZ7Fv9m7PW1eB1csUPd557FC0hOWYAaQUFFp4CgsNcrld3qtjxo33U 5xl0ooX9IAXb9CkG+vfzsd1r7askWZsZ0TEIfq+cVAZyWJXK3zSAjPCSMihaEgdKdCbq CrzC0L0+LF8+UM6muz9jwO05cZwZBuvfNCMUp4wi4H8sWFL25wfyu25T8gDso1w7m716 /Y4FNurtrXC0vdtBfRHO5+8u+NXAfGDrnIzAOVCBvyMf/NSExPf+ZLflb1DkMtvY3Cn7 SckIjMm2AWqtqtrOcnUfsS3DAl5kYIDKkToDANQWK5+TNOm526/PRjTZgsgOppk2zYRn k+Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469753; x=1705074553; 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=QjTvneZAUBkosxG1nWDJT6FQx8ULASKYfEukRB1XIpY=; b=f1RTneF3tW+BPP+7+XWdbSY11WGbgy7WYDEk/fB4h6xv5+UFE7a+EIK80hhRjmjxLD b3ws6dpoQCKZ9FmJoUmq7el6j2+qjXKuQnAxjGaicNF87J1YYocRIP7SuC/YyRNgmA0n 9lGfM04Sd4XbE7Br7VwsoFkYIgceGZ74cBym4/MFlY2/eRLkTURaiQsyRav1hG1rce5G kcKDWVQwEksto94Rf7rPrRxfG2oNZ+OzLPILFF3eGkkJq4O/6qWry4sOO6h08yCYo248 HB/CX6zcLhSbc2Nu25efxJdM+Paa24oO6ZprgTQarfHYmUj8wOmwurAOWt4q1zmZpR/u m0gw== X-Gm-Message-State: AOJu0Yx9sUDOs9vV7nZoZX5uhNuK/FUQtoqeh27UrJFcr1nvu3WtHqmb r0X2KjYsIQg1DXWeSmNL9WtW/QzaVTYRrV463cEgYV2sT9k= X-Google-Smtp-Source: AGHT+IGG3nrZw0R33ZdCdnMyPFIMVtpJdwa2QHtsYkDw8jf9KUPt1o7tF7B/jmDhhVLe/I1ue141zg== X-Received: by 2002:a05:600c:3b1d:b0:40d:91fd:74e with SMTP id m29-20020a05600c3b1d00b0040d91fd074emr1369672wms.15.1704469753430; Fri, 05 Jan 2024 07:49:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , David Hildenbrand , Igor Mammedov Subject: [PULL 59/71] backends: Have HostMemoryBackendClass::alloc() handler return a boolean Date: Fri, 5 Jan 2024 16:42:52 +0100 Message-ID: <20240105154307.21385-60-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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_FILL_THIS_FORM_SHORT=0.01, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470356634100003 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have HostMemoryBackendClass::alloc return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-17-philmd@linaro.org> --- include/sysemu/hostmem.h | 10 +++++++++- backends/hostmem-epc.c | 11 +++++------ backends/hostmem-file.c | 19 ++++++++++--------- backends/hostmem-memfd.c | 10 +++++----- backends/hostmem-ram.c | 9 +++++---- backends/hostmem.c | 5 ++--- 6 files changed, 36 insertions(+), 28 deletions(-) diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 39326f1d4f..0e411aaa29 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -47,7 +47,15 @@ OBJECT_DECLARE_TYPE(HostMemoryBackend, HostMemoryBackend= Class, struct HostMemoryBackendClass { ObjectClass parent_class; =20 - void (*alloc)(HostMemoryBackend *backend, Error **errp); + /** + * alloc: Allocate memory from backend. + * + * @backend: the #HostMemoryBackend. + * @errp: pointer to Error*, to store an error if it happens. + * + * Return: true on success, else false setting @errp with error. + */ + bool (*alloc)(HostMemoryBackend *backend, Error **errp); }; =20 /** diff --git a/backends/hostmem-epc.c b/backends/hostmem-epc.c index 3ceb079f9e..735e2e1cf8 100644 --- a/backends/hostmem-epc.c +++ b/backends/hostmem-epc.c @@ -17,7 +17,7 @@ #include "sysemu/hostmem.h" #include "hw/i386/hostmem-epc.h" =20 -static void +static bool sgx_epc_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) { g_autofree char *name =3D NULL; @@ -26,21 +26,20 @@ sgx_epc_backend_memory_alloc(HostMemoryBackend *backend= , Error **errp) =20 if (!backend->size) { error_setg(errp, "can't create backend with size 0"); - return; + return false; } =20 fd =3D qemu_open_old("/dev/sgx_vepc", O_RDWR); if (fd < 0) { error_setg_errno(errp, errno, "failed to open /dev/sgx_vepc to alloc SGX EPC"); - return; + return false; } =20 name =3D object_get_canonical_path(OBJECT(backend)); ram_flags =3D (backend->share ? RAM_SHARED : 0) | RAM_PROTECTED; - memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend), - name, backend->size, ram_flags, - fd, 0, errp); + return memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend), n= ame, + backend->size, ram_flags, fd, 0,= errp); } =20 static void sgx_epc_backend_instance_init(Object *obj) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index fe8c481f8f..ac3e433cbd 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -36,12 +36,13 @@ struct HostMemoryBackendFile { OnOffAuto rom; }; =20 -static void +static bool file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) { #ifndef CONFIG_POSIX error_setg(errp, "backend '%s' not supported on this host", object_get_typename(OBJECT(backend))); + return false; #else HostMemoryBackendFile *fb =3D MEMORY_BACKEND_FILE(backend); g_autofree gchar *name =3D NULL; @@ -49,11 +50,11 @@ file_backend_memory_alloc(HostMemoryBackend *backend, E= rror **errp) =20 if (!backend->size) { error_setg(errp, "can't create backend with size 0"); - return; + return false; } if (!fb->mem_path) { error_setg(errp, "mem-path property not set"); - return; + return false; } =20 switch (fb->rom) { @@ -65,18 +66,18 @@ file_backend_memory_alloc(HostMemoryBackend *backend, E= rror **errp) if (!fb->readonly) { error_setg(errp, "property 'rom' =3D 'on' is not supported wit= h" " 'readonly' =3D 'off'"); - return; + return false; } break; case ON_OFF_AUTO_OFF: if (fb->readonly && backend->share) { error_setg(errp, "property 'rom' =3D 'off' is incompatible wit= h" " 'readonly' =3D 'on' and 'share' =3D 'on'"); - return; + return false; } break; default: - assert(false); + g_assert_not_reached(); } =20 name =3D host_memory_backend_get_name(backend); @@ -86,9 +87,9 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Err= or **errp) ram_flags |=3D backend->reserve ? 0 : RAM_NORESERVE; ram_flags |=3D fb->is_pmem ? RAM_PMEM : 0; ram_flags |=3D RAM_NAMED_FILE; - memory_region_init_ram_from_file(&backend->mr, OBJECT(backend), name, - backend->size, fb->align, ram_flags, - fb->mem_path, fb->offset, errp); + return memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),= name, + backend->size, fb->align, ram_= flags, + fb->mem_path, fb->offset, errp= ); #endif } =20 diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index db28ab5a56..3923ea9364 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -31,7 +31,7 @@ struct HostMemoryBackendMemfd { bool seal; }; =20 -static void +static bool memfd_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) { HostMemoryBackendMemfd *m =3D MEMORY_BACKEND_MEMFD(backend); @@ -41,7 +41,7 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, Er= ror **errp) =20 if (!backend->size) { error_setg(errp, "can't create backend with size 0"); - return; + return false; } =20 fd =3D qemu_memfd_create(TYPE_MEMORY_BACKEND_MEMFD, backend->size, @@ -49,14 +49,14 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, = Error **errp) F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL : 0, errp); if (fd =3D=3D -1) { - return; + return false; } =20 name =3D host_memory_backend_get_name(backend); ram_flags =3D backend->share ? RAM_SHARED : 0; ram_flags |=3D backend->reserve ? 0 : RAM_NORESERVE; - memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend), name, - backend->size, ram_flags, fd, 0, errp); + return memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend), n= ame, + backend->size, ram_flags, fd, 0,= errp); } =20 static bool diff --git a/backends/hostmem-ram.c b/backends/hostmem-ram.c index 0a670fc22a..d121249f0f 100644 --- a/backends/hostmem-ram.c +++ b/backends/hostmem-ram.c @@ -16,7 +16,7 @@ #include "qemu/module.h" #include "qom/object_interfaces.h" =20 -static void +static bool ram_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) { g_autofree char *name =3D NULL; @@ -24,14 +24,15 @@ ram_backend_memory_alloc(HostMemoryBackend *backend, Er= ror **errp) =20 if (!backend->size) { error_setg(errp, "can't create backend with size 0"); - return; + return false; } =20 name =3D host_memory_backend_get_name(backend); ram_flags =3D backend->share ? RAM_SHARED : 0; ram_flags |=3D backend->reserve ? 0 : RAM_NORESERVE; - memory_region_init_ram_flags_nomigrate(&backend->mr, OBJECT(backend), = name, - backend->size, ram_flags, errp); + return memory_region_init_ram_flags_nomigrate(&backend->mr, OBJECT(bac= kend), + name, backend->size, + ram_flags, errp); } =20 static void diff --git a/backends/hostmem.c b/backends/hostmem.c index 1723c19165..3f8eb936d7 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -331,9 +331,8 @@ host_memory_backend_memory_complete(UserCreatable *uc, = Error **errp) if (!bc->alloc) { return; } - bc->alloc(backend, &local_err); - if (local_err) { - goto out; + if (!bc->alloc(backend, errp)) { + return; } =20 ptr =3D memory_region_get_ram_ptr(&backend->mr); --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470243; cv=none; d=zohomail.com; s=zohoarc; b=c2phrkDXCfxSd2sxOXV7fsI1miIXoxAWZU7G3QH95Uaxy7QEpjqszj8kJEsKury3NbMbmlqw9PrbLnQsVHf2PkP6kMMzxZg+Evqqux6LnLk6Buh3yj+Y/zR0q5otFyx8kWqhK6N3BdLF4ewxzpOw7m/eCxZKEvC02sTR1ph++4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470243; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3HnuyTIxGYsWykQsG+bF/A0ZdepEt+u1/qeWfQkxoXY=; b=SRbZZ56v8bbtuz1ZfWrV1hDmQJgaPuaP3eZsG3+gBNc3dzfkrW4oUzrkiTooK8dF0wcYXDIyonE84ZHx/y33QDxn+RafYrP7kCjMgtDr6KLvQ3RrcJxZwoBbzqmKkyFX6rFmZh6ndqjcqHUTdDt6jzxypS1sIpoPxVinrY+So+Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170447024395855.30265583730795; Fri, 5 Jan 2024 07:57:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTR-00036j-QB; Fri, 05 Jan 2024 10:51: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 1rLmRo-0007aX-48 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:27 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRl-00089l-If for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:23 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-336990fb8fbso1225269f8f.1 for ; Fri, 05 Jan 2024 07:49:19 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id k4-20020a5d6284000000b00336c43b366fsm1618203wru.12.2024.01.05.07.49.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469759; x=1705074559; 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=3HnuyTIxGYsWykQsG+bF/A0ZdepEt+u1/qeWfQkxoXY=; b=W5IRGN+q6DxEAK7IZ142Yb6IQ7SyaNnnL42Zi3OjH8BHb3APSAzo3/QcBLKwzXUKdk e6Mkz9HGBxDx8rVeGuNK2jOtNrjL0jAVeMGBY7b2XLo4Tayr6136TGASp/O5c0jggpU4 gZaycS75NjgbR9dsRwT2ir3octbXCuBd6/nG9ecY2wsaqg7GDDwoLKApGOfJpkBNCV6x A5cGl5zFNSDisVBRiwrszNVn2k9W4dhBq4kh1W+odEl5du13AmPIQ/NQPdH31CABblza SeIxHR2/ZEjEu18tLg62ds9RFn9qD3EXRiZvHn6uNqoXJJiYpqdBUWfmT7aBx2ZiZKg2 EBUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469759; x=1705074559; 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=3HnuyTIxGYsWykQsG+bF/A0ZdepEt+u1/qeWfQkxoXY=; b=N8iBysN30TQDDqWQAItx/QTNI2zbR0RFGZKCI7vn/adUuHaLoSLIQOQOBsYDy7fRZW Flb1FINRwJkd1RFqQlJ2Z1hyFF0pnxE64skORu4l+ZJmr858j/p0sCTquHtnZLk48K3i +AhernaE8pCoOVGgf8Mrx/rINjGJiX6KzDAt/K5mv5U1nSC7k28m2h5Jlq+E344bisft Hh7BisJOWL+lgdARr3Yz7QwYnaThX0MB3/MRKPOS5vArO9WD4QXaw3XfGfAsxLYrI9/o lz2ZH1r3XMCQgv44hoIKYqbhkULF9kM8+FXRnbOTMLGtTbBxGW7SkQMlSu9yRKiwzb5A O16Q== X-Gm-Message-State: AOJu0Yz7hufI6i0Wpe00aRRrRDtpYcNt2LzCx5GKJzY48rarW/hnwb9L sk04k6P7TB/CONUtVPSJkThFIOvp8CEIx7maku576/P/XYk= X-Google-Smtp-Source: AGHT+IF0Pyylu6bX+CfbQ1+REdITz6wqERsRZV89jAdI+Yqci0wvAbIS9//YMrS8A8aLBTnEpv3jBA== X-Received: by 2002:a5d:5cc3:0:b0:336:e399:6fc7 with SMTP id cg3-20020a5d5cc3000000b00336e3996fc7mr1040828wrb.59.1704469758884; Fri, 05 Jan 2024 07:49:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , David Hildenbrand , Igor Mammedov Subject: [PULL 60/71] backends: Reduce variable scope in host_memory_backend_memory_complete Date: Fri, 5 Jan 2024 16:42:53 +0100 Message-ID: <20240105154307.21385-61-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470245882100001 Reduce the &local_err variable use and remove the 'out:' label. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-18-philmd@linaro.org> --- backends/hostmem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 3f8eb936d7..1b0043a0d9 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -324,7 +324,6 @@ host_memory_backend_memory_complete(UserCreatable *uc, = Error **errp) { HostMemoryBackend *backend =3D MEMORY_BACKEND(uc); HostMemoryBackendClass *bc =3D MEMORY_BACKEND_GET_CLASS(uc); - Error *local_err =3D NULL; void *ptr; uint64_t sz; =20 @@ -400,15 +399,16 @@ host_memory_backend_memory_complete(UserCreatable *uc= , Error **errp) * specified NUMA policy in place. */ if (backend->prealloc) { + Error *local_err =3D NULL; + qemu_prealloc_mem(memory_region_get_fd(&backend->mr), ptr, sz, backend->prealloc_threads, backend->prealloc_context, &local_err); if (local_err) { - goto out; + error_propagate(errp, local_err); + return; } } -out: - error_propagate(errp, local_err); } =20 static bool --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470349; cv=none; d=zohomail.com; s=zohoarc; b=mM9aFNLpBX5MqlmLbd0xxoPWj0mJ+Z+/WTod+xsjEMo+iGJl7N3kjkZ6EWqMO3Hk3xpINM4KgbPArFYpoCBQGzCcxqqI0OQQ7qYs9XSbrHhc1hM4ZMVUK9wm39pnam0VQ4Lj6HotUOZwUtmsoNRBdKL9tteSwBYUzlsuViDSwWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470349; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=X1UceGM9JMyf+mvn5Vqfm2bFDJfnlw6Hthf90m+0+RM=; b=bYrgXKlwazUvo3dMOR/7Njhb1mC9UATLbXFf5XWtqm/QNob3UxVeviNCMQuOohTqvvtCKijdYRlqbLDFBaBlgQFfiv2HwRCvmxJz8GOGRnOTCzmctHSi0WL9hpLkHRGApneGsQwdV8kzfEhets62lyRItIyiUwM7RfmM0KkFlFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470349893449.5885182408954; Fri, 5 Jan 2024 07:59:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTO-0002oc-TC; Fri, 05 Jan 2024 10:51: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 1rLmRt-0007kW-3w for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:30 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRq-0008ME-2U for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:28 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40d2376db79so13010785e9.0 for ; Fri, 05 Jan 2024 07:49:25 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id d10-20020a056000114a00b00336710ddea0sm1618390wrx.59.2024.01.05.07.49.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469764; x=1705074564; 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=X1UceGM9JMyf+mvn5Vqfm2bFDJfnlw6Hthf90m+0+RM=; b=uz3+Keveir5GfCNNPI4bKaz/IJviY0QjaiHfbycrEa3nNitGKCHtXLcEG7wGWqhwWN jWYM/6Ziz+NElFCvid4OHeIU70L0VL9A3JHaSiCBE7DXXVC3DmWwJhWf5GCpnj9D3dwO BBL/L1aRVNdR6wvDbbHxpFg42BY4BbiUFdQWg+irIS9J/fuMW3kv5DxSxkTegPANxkq9 +9ofRqjBB4gwTuMFk20jSoXKMZT1dJ28zm0WtVsW8Ku8oaDcNnEGz69xmjn2DJrNXnaG /8SsBr2w/p8mxe+lqUP5t3oMs4nEOhUD9DHpNyADmyEybbRJWkThlqOvgDFFYtO98Zu2 2thA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469764; x=1705074564; 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=X1UceGM9JMyf+mvn5Vqfm2bFDJfnlw6Hthf90m+0+RM=; b=G3g+9malKF6cKP179piJxGw6ZxtYREoYtkxnCM5BmV+FWgmc7xFXnKYe+Bv4W4beTQ SfFus5Q7yj8CnZeyIQsxW35aKUoAueHlerDyUBilnL5bZ0sE4x9BZCq/QRVIUKHp9x7R S2tRvGL6v+yJk7ZS70qQLwp5+A4+9YgS0n+ouneRWA8ZfK09zw2ecim+FGCNOmE0Mntd Ca8GkDkD3+0DsU8Cq3swuCF/hpG3jzSXNHXEDGVGezwFkYhP8D1AhAqBeOpvAOHCF440 9CLywyx8Sih9wLh7fmdoJ+NAwjoxMMWdUJia0C9tQc18+CDFZ85CEPJGHal7ddEUaBfC iCvg== X-Gm-Message-State: AOJu0YygvahTLq+2UpKmA4U1s8JuOBenp+hyUmemz+Va0lqtzeBGM5nl nLt67cB/CK4ZZ8elSi9TvMbt4JB5IKAYSEM8AQQyuqIGsRQ= X-Google-Smtp-Source: AGHT+IHccUNpKVVjTXlW0mJxNGaQ6Af5HH0OlIBwUtFVNZbg5nXxb16dddyAiKNMmNcnjXOoYKYcLQ== X-Received: by 2002:adf:e9d2:0:b0:337:39c7:48 with SMTP id l18-20020adfe9d2000000b0033739c70048mr1522360wrn.1.1704469764364; Fri, 05 Jan 2024 07:49:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Gavin Shan , Paolo Bonzini , Stefan Weil Subject: [PULL 61/71] util/oslib: Have qemu_prealloc_mem() handler return a boolean Date: Fri, 5 Jan 2024 16:42:54 +0100 Message-ID: <20240105154307.21385-62-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470350817100005 Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have qemu_prealloc_mem() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-19-philmd@linaro.org> --- include/qemu/osdep.h | 4 +++- util/oslib-posix.c | 7 +++++-- util/oslib-win32.c | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index d30ba73eda..db366d6796 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -678,8 +678,10 @@ typedef struct ThreadContext ThreadContext; * memory area starting at @area with the size of @sz. After a successful = call, * each page in the area was faulted in writable at least once, for exampl= e, * after allocating file blocks for mapped files. + * + * Return: true on success, else false setting @errp with error. */ -void qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads, +bool qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads, ThreadContext *tc, Error **errp); =20 /** diff --git a/util/oslib-posix.c b/util/oslib-posix.c index e86fd64e09..7c297003b9 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -497,7 +497,7 @@ static bool madv_populate_write_possible(char *area, si= ze_t pagesize) errno !=3D EINVAL; } =20 -void qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads, +bool qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads, ThreadContext *tc, Error **errp) { static gsize initialized; @@ -506,6 +506,7 @@ void qemu_prealloc_mem(int fd, char *area, size_t sz, i= nt max_threads, size_t numpages =3D DIV_ROUND_UP(sz, hpagesize); bool use_madv_populate_write; struct sigaction act; + bool rv =3D true; =20 /* * Sense on every invocation, as MADV_POPULATE_WRITE cannot be used for @@ -534,7 +535,7 @@ void qemu_prealloc_mem(int fd, char *area, size_t sz, i= nt max_threads, qemu_mutex_unlock(&sigbus_mutex); error_setg_errno(errp, errno, "qemu_prealloc_mem: failed to install signal handler"); - return; + return false; } } =20 @@ -544,6 +545,7 @@ void qemu_prealloc_mem(int fd, char *area, size_t sz, i= nt max_threads, if (ret) { error_setg_errno(errp, -ret, "qemu_prealloc_mem: preallocating memory failed"); + rv =3D false; } =20 if (!use_madv_populate_write) { @@ -555,6 +557,7 @@ void qemu_prealloc_mem(int fd, char *area, size_t sz, i= nt max_threads, } qemu_mutex_unlock(&sigbus_mutex); } + return rv; } =20 char *qemu_get_pid_name(pid_t pid) diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 55b0189dc3..c4a5f05a49 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -264,7 +264,7 @@ int getpagesize(void) return system_info.dwPageSize; } =20 -void qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads, +bool qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads, ThreadContext *tc, Error **errp) { int i; @@ -274,6 +274,8 @@ void qemu_prealloc_mem(int fd, char *area, size_t sz, i= nt max_threads, for (i =3D 0; i < sz / pagesize; i++) { memset(area + pagesize * i, 0, 1); } + + return true; } =20 char *qemu_get_pid_name(pid_t pid) --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704469964; cv=none; d=zohomail.com; s=zohoarc; b=kBha6JfVoJg7mGmo7h/VNt0ecLOtjiV7QL7+QZKZsKwJlqTKp3+HXR1xmQSNRPEsd8DR69Udogf2ZKbZ8Up9++1NTa5a+V40fhf+EzyjDIr4phWb7PdHrCkeOQrlGOV/4YOvnyr+2mM6TzgcvZM1AG6g+zUD2P/ay7at5bFnMuo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704469964; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Woygxb5I84iWcYNaobFk5BQd3UxVH0KFWr0IJtclL9o=; b=dP1+AZwZ/e8DllvIrxa3yGC3ZNVf1l3xwtwRqVUbCJf2TRQncWMf7qOL62EqEroRVV78LNfFjn7E3DBxQiKjExVEhsvMWc+varvKvm8dNjB+/zLFccynb6dmPAqNacHkEsyKb/39lGxZksKmAjE7PX0m1RzxRKBHYwxPR004KKI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704469964289568.0671085593883; Fri, 5 Jan 2024 07:52:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmSh-00017W-5a; Fri, 05 Jan 2024 10:50: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 1rLmRy-0007o3-VX for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:41 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmRw-0000I0-GL for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:34 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40d5f40ce04so17306865e9.2 for ; Fri, 05 Jan 2024 07:49:30 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id t1-20020adfd001000000b0033672971fabsm1603944wrh.115.2024.01.05.07.49.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469770; x=1705074570; 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=Woygxb5I84iWcYNaobFk5BQd3UxVH0KFWr0IJtclL9o=; b=Ckxd5aEW30HBEabc+kyoDNBFSBgsK9nVKTqm+JR4jlJZiGUiEzLETvaGonHR/xPErY v4JYS+DhetyLJ5Lp9XuaeV69NgP/UrjbUjesSPq5e+d1CirGxcH0QFC+NONjtlZp4lU1 ATEOfPaph8R3nl+29iPXEIWBcJWYnPmQtmHxLaDjnssMb172xzIT/aJauGT9+u9FSJro +ajmymCY8Lb4hMG80nG5M/qYaeIPGgT/KlqqVqfEHHmYFRmP+/40vFOEao9aA8SPG0xQ addq9KrNO2PuhJfkA7SOpU3qV6pBzvQqRgVMXsiVUYtnJb99S/qtEncycLulbYrkCocW 6wrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469770; x=1705074570; 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=Woygxb5I84iWcYNaobFk5BQd3UxVH0KFWr0IJtclL9o=; b=MHRtK8UFl563qUnOnMi1scnHC2AjT9iIuWibDepqe4FIIxzp+hF0M4X7Hm84kzZ/e3 i05GW7L8DDObeLCpVgfMMaXI/wb+KOFmc2n2Lwg7LlV2pC549A0MMW9/cV2+ozbxMotP uh1oYEtcgey8D9GVb3iJyigOsoDhBvHwIOfRQLSzMCFzdabB6R6o7+cnj0S1k5Cwk5fd 0crBK3P5CZpANTG0Xndo6mvsOR7NllC+8fDQeCVrQNu9VAytNtsqDJlPZvvtyJUx9u4q 6vuM6HmgRbxtHJzyuA3RtXiHpOy8xUAbPofVh6NsyawnCHgRhQceYk1Wpca32LVUeAr/ +s1Q== X-Gm-Message-State: AOJu0Yxa/4iYpikvhy3ibeX05ZCaijGAUY6SgHA735h9AgGuspaKFaTq JilbeHPmPZflnuqanU3VzYymFwz0eUk6FzwkafyBOS/+U/Y= X-Google-Smtp-Source: AGHT+IFj7g+Jiz/gUa6sy6goPKZ431YyH55zl8uNAkLJs6GWTCq2clGafVgdd1ErZrmHAKEqnxbUWg== X-Received: by 2002:a05:600c:4fc1:b0:40d:fc98:b88f with SMTP id o1-20020a05600c4fc100b0040dfc98b88fmr1258706wmq.49.1704469769865; Fri, 05 Jan 2024 07:49:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , David Hildenbrand , Igor Mammedov , "Michael S. Tsirkin" Subject: [PULL 62/71] misc: Simplify qemu_prealloc_mem() calls Date: Fri, 5 Jan 2024 16:42:55 +0100 Message-ID: <20240105154307.21385-63-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704469966869100015 Since qemu_prealloc_mem() returns whether or not an error occured, we don't need to check the @errp pointer. Remove local_err uses when we can return directly. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-20-philmd@linaro.org> --- backends/hostmem.c | 22 +++++++--------------- hw/virtio/virtio-mem.c | 6 ++---- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 1b0043a0d9..30f69b2cb5 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -219,7 +219,6 @@ static bool host_memory_backend_get_prealloc(Object *ob= j, Error **errp) static void host_memory_backend_set_prealloc(Object *obj, bool value, Error **errp) { - Error *local_err =3D NULL; HostMemoryBackend *backend =3D MEMORY_BACKEND(obj); =20 if (!backend->reserve && value) { @@ -237,10 +236,8 @@ static void host_memory_backend_set_prealloc(Object *o= bj, bool value, void *ptr =3D memory_region_get_ram_ptr(&backend->mr); uint64_t sz =3D memory_region_size(&backend->mr); =20 - qemu_prealloc_mem(fd, ptr, sz, backend->prealloc_threads, - backend->prealloc_context, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!qemu_prealloc_mem(fd, ptr, sz, backend->prealloc_threads, + backend->prealloc_context, errp)) { return; } backend->prealloc =3D true; @@ -398,16 +395,11 @@ host_memory_backend_memory_complete(UserCreatable *uc= , Error **errp) * This is necessary to guarantee memory is allocated with * specified NUMA policy in place. */ - if (backend->prealloc) { - Error *local_err =3D NULL; - - qemu_prealloc_mem(memory_region_get_fd(&backend->mr), ptr, sz, - backend->prealloc_threads, - backend->prealloc_context, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } + if (backend->prealloc && !qemu_prealloc_mem(memory_region_get_fd(&back= end->mr), + ptr, sz, + backend->prealloc_threads, + backend->prealloc_context,= errp)) { + return; } } =20 diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index dc4709790f..99ab989852 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -605,8 +605,7 @@ static int virtio_mem_set_block_state(VirtIOMEM *vmem, = uint64_t start_gpa, int fd =3D memory_region_get_fd(&vmem->memdev->mr); Error *local_err =3D NULL; =20 - qemu_prealloc_mem(fd, area, size, 1, NULL, &local_err); - if (local_err) { + if (!qemu_prealloc_mem(fd, area, size, 1, NULL, &local_err)) { static bool warned; =20 /* @@ -1249,8 +1248,7 @@ static int virtio_mem_prealloc_range_cb(VirtIOMEM *vm= em, void *arg, int fd =3D memory_region_get_fd(&vmem->memdev->mr); Error *local_err =3D NULL; =20 - qemu_prealloc_mem(fd, area, size, 1, NULL, &local_err); - if (local_err) { + if (!qemu_prealloc_mem(fd, area, size, 1, NULL, &local_err)) { error_report_err(local_err); return -ENOMEM; } --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470183; cv=none; d=zohomail.com; s=zohoarc; b=iY83zaxO2hnrw2RMV4KUHyvkIEOIRUZ79/moH7pOZqUGPeE+TcV3NffTZ+EHmRpq1pHLFgsPyPBrqIQG1I77K6gbOVdQbuez99qdA95vJLEDmEeh7Nem+WqF/PhaUUFHLmaQ+fKc47iGAZccUkZNBK+xkhjc6kcUIZKILkn9G/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470183; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/qHj/5uAdYCvRnDozLLxG4HVXbbh9wIM2eiBwuzcy8E=; b=kFiKppXHP4tjunuGgx+UZpvB9FAmnLIADIid3RM1lODMYqQkjE8J3QCobZQ+Ks2+hgAEjnjdZVJGaJzsu7HbmT9IfotxsVCTHGaJXwzTvM0rnkevZQ7Bf4/wDTpPpVlvDVI+yjZuHwyVe8WpSPQ8Veb/GnzmDAW1LkxzKRqXmVE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470183628774.1107183300035; Fri, 5 Jan 2024 07:56:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTR-00034u-4i; Fri, 05 Jan 2024 10:51: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 1rLmS7-0007pc-HB for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:44 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmS4-0000au-TP for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:42 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-336746a545fso411337f8f.0 for ; Fri, 05 Jan 2024 07:49:36 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id cs18-20020a056000089200b00333359b522dsm1615912wrb.77.2024.01.05.07.49.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469775; x=1705074575; 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=/qHj/5uAdYCvRnDozLLxG4HVXbbh9wIM2eiBwuzcy8E=; b=O6thLAWUIs+mpGnt3fcHUY2d+6DiM5HlAlAv/iQ7Fr0KqxtaYdnmgujwU5LX4cOHnI TRBPVsIdGacvsdSE4JULGcXZ37MXJyoZMGi2J97hGoOGpnNnppIJbVsShplKGBxtE7K2 Ro+YfmT04YRZ5Oo4QY4PsWJ8Kxm+KywzbePWYvGxTzFUfJGTqeNtoHhiSg4pJqjGlK7r 7nTpn/8XYky0sGBDkaOBw2PjzQZUNNgxrcJt5UbWbUrHP6P2MKL0oypX11k2hMpg/VZP Z1pOnAzb9gCSA1gVhgFS8HM3IkswqKhqFwK4A7P7Fea/yRPYwZDmcjq2SV8bxaOym+io 5kFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469775; x=1705074575; 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=/qHj/5uAdYCvRnDozLLxG4HVXbbh9wIM2eiBwuzcy8E=; b=QOwx7zbq9vj8smNJq0aXfB70+K+RYGNxmr25byXQzme0RPpWAFqXkyaMJLEGRsirhF FUBHv1irj60PzT+Q34+ITdIhB682nXH0GtpGI/PdtG+k2Sc4a2xtqcW4ccLpzCsNce6n SxPSUbBuKLdIpW+6rcmfpEuASF0FgO0hBHpQZabqobliaarE57ttmWEUL2g7rwpWb57X Znq333g/KDoWh1EM5hN0jN9WJHiBis9x/0M/bIlQlfMNjflnfMHIBcgv2siIt1bZYOhQ wWcXJ03VJCclx+D1DSITYP4g/v/T7SjpLri4atSdDzYvMkcNDSsxHqg213dCDG7K7W0h Fsuw== X-Gm-Message-State: AOJu0YybH2z+GqTm9FMBDNeJmVKR81heU/SxB+nYC0G9NsV0FgLm7HGq VOfd/m1UV/4LdkL35oRfTiymlOs+h5KjPk9oK6Yz8g7jjOo= X-Google-Smtp-Source: AGHT+IE/O2rz6N1tj24/myPE2K2KIstpMZKWm+MxMoFdRGNI2tf3Htgb1gzG1cc6OxiRjPIzmrR1PQ== X-Received: by 2002:a5d:42cc:0:b0:337:5c9c:2a52 with SMTP id t12-20020a5d42cc000000b003375c9c2a52mr361625wrr.20.1704469775442; Fri, 05 Jan 2024 07:49:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Andrew Jeffery , Gavin Shan , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Joel Stanley , Jean-Christophe Dubois , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Subject: [PULL 63/71] hw: Simplify memory_region_init_ram() calls Date: Fri, 5 Jan 2024 16:42:56 +0100 Message-ID: <20240105154307.21385-64-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470185641100003 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_ram(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_ram(mr, owner, arg3, arg4, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Andrew Jeffery # aspeed Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-21-philmd@linaro.org> --- hw/arm/aspeed_ast2400.c | 6 ++---- hw/arm/aspeed_ast2600.c | 6 ++---- hw/arm/fsl-imx25.c | 6 ++---- hw/arm/fsl-imx31.c | 6 ++---- hw/arm/fsl-imx6.c | 6 ++---- hw/arm/integratorcp.c | 7 ++----- hw/arm/nrf51_soc.c | 7 ++----- hw/ppc/rs6000_mc.c | 7 ++----- 8 files changed, 16 insertions(+), 35 deletions(-) diff --git a/hw/arm/aspeed_ast2400.c b/hw/arm/aspeed_ast2400.c index a4334c81b8..0baa2ff96e 100644 --- a/hw/arm/aspeed_ast2400.c +++ b/hw/arm/aspeed_ast2400.c @@ -247,7 +247,6 @@ static void aspeed_ast2400_soc_realize(DeviceState *dev= , Error **errp) Aspeed2400SoCState *a =3D ASPEED2400_SOC(dev); AspeedSoCState *s =3D ASPEED_SOC(dev); AspeedSoCClass *sc =3D ASPEED_SOC_GET_CLASS(s); - Error *err =3D NULL; g_autofree char *sram_name =3D NULL; =20 /* Default boot region (SPI memory or ROMs) */ @@ -276,9 +275,8 @@ static void aspeed_ast2400_soc_realize(DeviceState *dev= , Error **errp) =20 /* SRAM */ sram_name =3D g_strdup_printf("aspeed.sram.%d", CPU(&a->cpu[0])->cpu_i= ndex); - memory_region_init_ram(&s->sram, OBJECT(s), sram_name, sc->sram_size, = &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_ram(&s->sram, OBJECT(s), sram_name, sc->sram_s= ize, + errp)) { return; } memory_region_add_subregion(s->memory, diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index b965fbab5e..3a9a303ab8 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -282,7 +282,6 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev= , Error **errp) Aspeed2600SoCState *a =3D ASPEED2600_SOC(dev); AspeedSoCState *s =3D ASPEED_SOC(dev); AspeedSoCClass *sc =3D ASPEED_SOC_GET_CLASS(s); - Error *err =3D NULL; qemu_irq irq; g_autofree char *sram_name =3D NULL; =20 @@ -355,9 +354,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev= , Error **errp) =20 /* SRAM */ sram_name =3D g_strdup_printf("aspeed.sram.%d", CPU(&a->cpu[0])->cpu_i= ndex); - memory_region_init_ram(&s->sram, OBJECT(s), sram_name, sc->sram_size, = &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_ram(&s->sram, OBJECT(s), sram_name, sc->sram_s= ize, + errp)) { return; } memory_region_add_subregion(s->memory, diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index 9aabbf7f58..b15435ccaf 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -299,10 +299,8 @@ static void fsl_imx25_realize(DeviceState *dev, Error = **errp) &s->rom[1]); =20 /* initialize internal RAM (128 KB) */ - memory_region_init_ram(&s->iram, NULL, "imx25.iram", FSL_IMX25_IRAM_SI= ZE, - &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_ram(&s->iram, NULL, "imx25.iram", + FSL_IMX25_IRAM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX25_IRAM_ADDR, diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c index def27bb913..1d5dcd51e8 100644 --- a/hw/arm/fsl-imx31.c +++ b/hw/arm/fsl-imx31.c @@ -208,10 +208,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error = **errp) &s->rom); =20 /* initialize internal RAM (16 KB) */ - memory_region_init_ram(&s->iram, NULL, "imx31.iram", FSL_IMX31_IRAM_SI= ZE, - &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_ram(&s->iram, NULL, "imx31.iram", + FSL_IMX31_IRAM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX31_IRAM_ADDR, diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 7dc42cbfe6..58f37e7c11 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -443,10 +443,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error *= *errp) &s->caam); =20 /* OCRAM memory */ - memory_region_init_ram(&s->ocram, NULL, "imx6.ocram", FSL_IMX6_OCRAM_S= IZE, - &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_ram(&s->ocram, NULL, "imx6.ocram", + FSL_IMX6_OCRAM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX6_OCRAM_ADDR, diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index e602ca5e14..1830e1d785 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -291,12 +291,9 @@ static void integratorcm_realize(DeviceState *d, Error= **errp) { IntegratorCMState *s =3D INTEGRATOR_CM(d); SysBusDevice *dev =3D SYS_BUS_DEVICE(d); - Error *local_err =3D NULL; =20 - memory_region_init_ram(&s->flash, OBJECT(d), "integrator.flash", 0x100= 000, - &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!memory_region_init_ram(&s->flash, OBJECT(d), "integrator.flash", + 0x100000, errp)) { return; } =20 diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index 34da0d62f0..ac53441630 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -58,7 +58,6 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error= **errp) { NRF51State *s =3D NRF51_SOC(dev_soc); MemoryRegion *mr; - Error *err =3D NULL; uint8_t i =3D 0; hwaddr base_addr =3D 0; =20 @@ -92,10 +91,8 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Erro= r **errp) =20 memory_region_add_subregion_overlap(&s->container, 0, s->board_memory,= -1); =20 - memory_region_init_ram(&s->sram, OBJECT(s), "nrf51.sram", s->sram_size, - &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_ram(&s->sram, OBJECT(s), "nrf51.sram", s->sram= _size, + errp)) { return; } memory_region_add_subregion(&s->container, NRF51_SRAM_BASE, &s->sram); diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c index b35f8ba112..e6ec4b4c40 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -143,7 +143,6 @@ static void rs6000mc_realize(DeviceState *dev, Error **= errp) RS6000MCState *s =3D RS6000MC(dev); int socket =3D 0; unsigned int ram_size =3D s->ram_size / MiB; - Error *local_err =3D NULL; =20 while (socket < 6) { if (ram_size >=3D 64) { @@ -165,10 +164,8 @@ static void rs6000mc_realize(DeviceState *dev, Error *= *errp) if (s->simm_size[socket]) { char name[] =3D "simm.?"; name[5] =3D socket + '0'; - memory_region_init_ram(&s->simm[socket], OBJECT(dev), name, - s->simm_size[socket] * MiB, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!memory_region_init_ram(&s->simm[socket], OBJECT(dev), nam= e, + s->simm_size[socket] * MiB, errp))= { return; } memory_region_add_subregion_overlap(get_system_memory(), 0, --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470062; cv=none; d=zohomail.com; s=zohoarc; b=FzO6Gus+/iwBUqx6dgqO9WB5a0jfsKppzn6XJXTJSAI7H1BRodB8UiNIvF+WUM8hm2xSQ9W7b/08eRjhlLtAmQRAJOgFUQjUhFS3uLEV6mz79xBh5wO9jgKrheC9gwfxhgrfJquniZbLT/tj2vh8+3AFhSxLd3kvRgDBHSx9h7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470062; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WY1HVSmMqBvEYUJRh+Ffc8mXYkbCc4MclKwdMWfHMLU=; b=CgZAD6GkiAMMSbdXygG1OQLZSGbj196NgFvZaQZHtS2JXsufPjAaSo+I4wMx6WHmuRVDnupXTrxQsdMDHAxemP0es4GsUnMbYKzoDI+JdQX9KInalUQdYbc4O+qyr9Byw9VLUPQ+TpBWM+KUCb2YTpa9jNfEeBSxPy0P3UTGrDs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17044700629349.206797379570503; Fri, 5 Jan 2024 07:54:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTT-0003LH-Gg; Fri, 05 Jan 2024 10:51:07 -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 1rLmS9-0007vo-L1 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:46 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmS7-0000pY-9I for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:45 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3373a30af67so1326527f8f.0 for ; Fri, 05 Jan 2024 07:49:41 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id q16-20020adfea10000000b003365fcc1846sm1607957wrm.52.2024.01.05.07.49.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469780; x=1705074580; 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=WY1HVSmMqBvEYUJRh+Ffc8mXYkbCc4MclKwdMWfHMLU=; b=mXagiHF54kfdUzGSesLI76REo2QBZplxlc1aW1qLhPd8wePZSbyZ39zD7DLoFUtIYt jVuOToy6dQy681AXlDMqJDrRBXTrczgiy6uxzZL6IylVyQyYBUuLn8ZJVNy0riAkrN3M BeJNEIj2SA94/Nqsct2y3fcoOVwznwK9JVOUHMooqNLgNRHgtjWERpZLrq+qXgL+q8Sz Rv3ORrBQjlLZKmLYwZcvHN8tf6YvXJpB2xBAJH0qC9i9wOnmn7mPgB08i48O7KfoL3dr kZSYZBzFoc84yiGT36iUbs/I57/IcUqwe4W0YbLDzGg6oauLsmVUgxKwAYY/TVGuUbXx W1LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469780; x=1705074580; 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=WY1HVSmMqBvEYUJRh+Ffc8mXYkbCc4MclKwdMWfHMLU=; b=DNPbRqoyo9d7M7pPn/ReTZBXBa3O+ZAB3/dyLCR67xRzMnUvCyCLXsdt0zw5v3ve1W dIvSQ0rycX6ySADNTGvUXcCDUn2TymLuaPN3PxLMD5p/ASC+7L0rJieHoK0KDqWPDDkH HS1ED/LXJO+XvoCHSAi1xFqHMwwZCDQcUuIjpHniapyFTyK+HbHd/FEiU+GDls2ggFwE rMfr5qrV9HLrsX60jl9iAYl48uE0fFLgWNL2jpGqNl0LQApugfX/3ajHufbq/RRb6tWq 6RpJ+MFW19JSjJ085AVc+6iNnFCp/Z7NXvmj0rYZGZqYDe76q9pDlUVQ71Y0rMg6eFHP 6YkA== X-Gm-Message-State: AOJu0YyEJv+wHl+RU9JjXBBjAWR6pM8XYedcokcUN7KDX/4bt9B7g2wc p8FKxpAsTMPOX2j+8LpQG7Frv2LArjvTXskQhxfpp6ZJctg= X-Google-Smtp-Source: AGHT+IEkMn4lig3/xSwctERMb9JqfN0t33SzjP+XpjfyOru6RJDfaXV1dK3xbGJJqN/PY15TOOWL8g== X-Received: by 2002:a05:6000:1286:b0:337:39d7:3e16 with SMTP id f6-20020a056000128600b0033739d73e16mr810103wrx.76.1704469780660; Fri, 05 Jan 2024 07:49:40 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , Peter Maydell , Jean-Christophe Dubois Subject: [PULL 64/71] hw/arm: Simplify memory_region_init_rom() calls Date: Fri, 5 Jan 2024 16:42:57 +0100 Message-ID: <20240105154307.21385-65-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470065040100010 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_rom(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_rom(mr, owner, arg3, arg4, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-22-philmd@linaro.org> --- hw/arm/fsl-imx25.c | 13 ++++--------- hw/arm/fsl-imx31.c | 13 ++++--------- hw/arm/fsl-imx6.c | 13 ++++--------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index b15435ccaf..9d2fb75a68 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -81,7 +81,6 @@ static void fsl_imx25_realize(DeviceState *dev, Error **e= rrp) { FslIMX25State *s =3D FSL_IMX25(dev); uint8_t i; - Error *err =3D NULL; =20 if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) { return; @@ -281,18 +280,14 @@ static void fsl_imx25_realize(DeviceState *dev, Error= **errp) FSL_IMX25_WDT_IRQ)); =20 /* initialize 2 x 16 KB ROM */ - memory_region_init_rom(&s->rom[0], OBJECT(dev), "imx25.rom0", - FSL_IMX25_ROM0_SIZE, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom(&s->rom[0], OBJECT(dev), "imx25.rom0", + FSL_IMX25_ROM0_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX25_ROM0_ADDR, &s->rom[0]); - memory_region_init_rom(&s->rom[1], OBJECT(dev), "imx25.rom1", - FSL_IMX25_ROM1_SIZE, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom(&s->rom[1], OBJECT(dev), "imx25.rom1", + FSL_IMX25_ROM1_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX25_ROM1_ADDR, diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c index 1d5dcd51e8..c0584e4dfc 100644 --- a/hw/arm/fsl-imx31.c +++ b/hw/arm/fsl-imx31.c @@ -63,7 +63,6 @@ static void fsl_imx31_realize(DeviceState *dev, Error **e= rrp) { FslIMX31State *s =3D FSL_IMX31(dev); uint16_t i; - Error *err =3D NULL; =20 if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) { return; @@ -188,20 +187,16 @@ static void fsl_imx31_realize(DeviceState *dev, Error= **errp) sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, FSL_IMX31_WDT_ADDR); =20 /* On a real system, the first 16k is a `secure boot rom' */ - memory_region_init_rom(&s->secure_rom, OBJECT(dev), "imx31.secure_rom", - FSL_IMX31_SECURE_ROM_SIZE, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom(&s->secure_rom, OBJECT(dev), "imx31.secure= _rom", + FSL_IMX31_SECURE_ROM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX31_SECURE_ROM_= ADDR, &s->secure_rom); =20 /* There is also a 16k ROM */ - memory_region_init_rom(&s->rom, OBJECT(dev), "imx31.rom", - FSL_IMX31_ROM_SIZE, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom(&s->rom, OBJECT(dev), "imx31.rom", + FSL_IMX31_ROM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX31_ROM_ADDR, diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 58f37e7c11..b2153022c0 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -109,7 +109,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **= errp) MachineState *ms =3D MACHINE(qdev_get_machine()); FslIMX6State *s =3D FSL_IMX6(dev); uint16_t i; - Error *err =3D NULL; unsigned int smp_cpus =3D ms->smp.cpus; =20 if (smp_cpus > FSL_IMX6_NUM_CPUS) { @@ -423,20 +422,16 @@ static void fsl_imx6_realize(DeviceState *dev, Error = **errp) } =20 /* ROM memory */ - memory_region_init_rom(&s->rom, OBJECT(dev), "imx6.rom", - FSL_IMX6_ROM_SIZE, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom(&s->rom, OBJECT(dev), "imx6.rom", + FSL_IMX6_ROM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX6_ROM_ADDR, &s->rom); =20 /* CAAM memory */ - memory_region_init_rom(&s->caam, OBJECT(dev), "imx6.caam", - FSL_IMX6_CAAM_MEM_SIZE, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom(&s->caam, OBJECT(dev), "imx6.caam", + FSL_IMX6_CAAM_MEM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX6_CAAM_MEM_ADD= R, --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470061; cv=none; d=zohomail.com; s=zohoarc; b=lLzvLXBxAqsivYvCtdnltRhlSlFmXLfviCdVI83i3kySLOWW1ZU5grkA433+nmNJsm+hLHPfTGGB2CJr1SZfZzUbH2KTl5a7u3pH1woYLxiFM77SHrCCnlmAhIM4177iAgNhZRsDpvMhG3H1p/xtAm4S18wCp6fWoRNRBf/V9/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470061; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PoxGR8z2iD4/dV7vlDevdlyqaz6yGMvGSLHUDaB/+Ko=; b=WPjiuiy9GzurkGukIBbAPz8ZUxyL8SVLYAN9O1wB6zdHYRq0rH7QSsoezkQHuEp6jaDBvTwgvVW8X+VlsgjAyDuLaLfHGM/BEA+5sRUGJv7QgngKTAr9x2zhdAy8aZS5HFm72jtrZLveH1M8MWehehW6SHI4WrRpi5WD22OJ14o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470061409955.936532866066; Fri, 5 Jan 2024 07:54:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTP-0002rg-DU; Fri, 05 Jan 2024 10:51: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 1rLmSI-0008MD-Fu for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:56 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSB-0000xb-Ce for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:53 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40d6b4e2945so18127645e9.0 for ; Fri, 05 Jan 2024 07:49:46 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id b14-20020adff90e000000b003375c072fbcsm896486wrr.100.2024.01.05.07.49.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469786; x=1705074586; 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=PoxGR8z2iD4/dV7vlDevdlyqaz6yGMvGSLHUDaB/+Ko=; b=lS7mHqvQydw9G3Y95Kh+xSnAHmZcPK6Yh8lO6Q5C9+RCv/1NWXRQ4A55nbW9oDf4oQ 9aSJuVas4MVrsgWiIyEyzqfq+nyNySZfOtIC5N9GM+HXAHyfV/1Lho4v7IPKzpQkYaqr egKqoEs5pBlK1/60ZWAnVsBN2S0ysVpzIxlnweC/UHHMq7PIPpCNsERY2FDaavfUtJtP 4fTGLJ+fesB/gcydoGNKFrRiX3rH8XYdKuDJUZWh43hwFe66wwqDN7QzUPVMpt3zpFZ2 2kIM3RYtJYkES9osuoVYSZzPSHx2XaQg0UtO6rJ4wRa1uL157YP0fxCdqjJ2TwPoMP1L PcSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469786; x=1705074586; 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=PoxGR8z2iD4/dV7vlDevdlyqaz6yGMvGSLHUDaB/+Ko=; b=DhOhgTlhNaCvlWcyaSdzQ6R5HDbxlgvXKE9y9FDlVjgk0QDQ0ey2Bw1kKnz1C1s/TB PZqTi/U+w87xkMncPIOlHVhuRp5wxmiFHW1btmQQUoWllRHLdvHl+bh0P5Gf2wMBQbIF D/Gm74UTANVHGzxe44MnN8oQRnU/9aCnkLuI67ipoZZU8fP+ohNYG7vpfqmZygczukau Xz6LLUWHiJg1HOXZlx6T37/8+onBDS58+INxolkIHOLc57Ts9IMzJcuE+CyrojPFEzBC aO7EKwFz5xtliv9nYRQeuQbCcCxAQ2x6LWMrPLYZ6CAifpIcnrJsNCb8Rmqsz/ImfZEY TFEQ== X-Gm-Message-State: AOJu0YwmJG/UnpkKyPxCHsPULCvg3EuE/burt+n+95O4P6LdXGjt1LHo I4PmMKIC/ikH4j/h+bw+Xjt/ExG2dNOp0VE6snxOsPcm4vg= X-Google-Smtp-Source: AGHT+IFwrMeMDJP4oO+XGA1BUGpUIY1yT52Wd8pHgBQFLKSV3AS0DpLDcrNG8K6y3OFW3EgRTkVmXA== X-Received: by 2002:a05:600c:22d6:b0:40d:5d07:55d3 with SMTP id 22-20020a05600c22d600b0040d5d0755d3mr819881wmg.177.1704469785886; Fri, 05 Jan 2024 07:49:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gavin Shan , Mark Cave-Ayland , Artyom Tarasenko Subject: [PULL 65/71] hw/sparc: Simplify memory_region_init_ram_nomigrate() calls Date: Fri, 5 Jan 2024 16:42:58 +0100 Message-ID: <20240105154307.21385-66-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470063072100001 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_ram_nomigrate(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_ram_nomigrate(mr, owner, arg3, arg4, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-23-philmd@linaro.org> --- hw/sparc/sun4m.c | 21 ++++++--------------- hw/sparc64/sun4u.c | 7 ++----- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 64895aebe3..550af01690 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -577,12 +577,9 @@ static void idreg_realize(DeviceState *ds, Error **err= p) { IDRegState *s =3D MACIO_ID_REGISTER(ds); SysBusDevice *dev =3D SYS_BUS_DEVICE(ds); - Error *local_err =3D NULL; =20 - memory_region_init_ram_nomigrate(&s->mem, OBJECT(ds), "sun4m.idreg", - sizeof(idreg_data), &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!memory_region_init_ram_nomigrate(&s->mem, OBJECT(ds), "sun4m.idre= g", + sizeof(idreg_data), errp)) { return; } =20 @@ -631,12 +628,9 @@ static void afx_realize(DeviceState *ds, Error **errp) { AFXState *s =3D TCX_AFX(ds); SysBusDevice *dev =3D SYS_BUS_DEVICE(ds); - Error *local_err =3D NULL; =20 - memory_region_init_ram_nomigrate(&s->mem, OBJECT(ds), "sun4m.afx", 4, - &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!memory_region_init_ram_nomigrate(&s->mem, OBJECT(ds), "sun4m.afx", + 4, errp)) { return; } =20 @@ -715,12 +709,9 @@ static void prom_realize(DeviceState *ds, Error **errp) { PROMState *s =3D OPENPROM(ds); SysBusDevice *dev =3D SYS_BUS_DEVICE(ds); - Error *local_err =3D NULL; =20 - memory_region_init_ram_nomigrate(&s->prom, OBJECT(ds), "sun4m.prom", - PROM_SIZE_MAX, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!memory_region_init_ram_nomigrate(&s->prom, OBJECT(ds), "sun4m.pro= m", + PROM_SIZE_MAX, errp)) { return; } =20 diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index c871170378..24d53bf5fd 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -454,12 +454,9 @@ static void prom_realize(DeviceState *ds, Error **errp) { PROMState *s =3D OPENPROM(ds); SysBusDevice *dev =3D SYS_BUS_DEVICE(ds); - Error *local_err =3D NULL; =20 - memory_region_init_ram_nomigrate(&s->prom, OBJECT(ds), "sun4u.prom", - PROM_SIZE_MAX, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!memory_region_init_ram_nomigrate(&s->prom, OBJECT(ds), "sun4u.pro= m", + PROM_SIZE_MAX, errp)) { return; } =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470014; cv=none; d=zohomail.com; s=zohoarc; b=MGzOtPKe/UKdJZWhnUnmI0uBjoesJhjPZ6dbuyWMrSoe6ncolFmI4ay8ILa+/utDjo7TLFGglu0uAdyEti2kaOakvN27DawDaHnrjzPnJzJlmAcHbjwVYGYDmexo5GvciP2EaFmkgPU4DxpSKjOxQb2AyoEmJ99MURis86VThvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470014; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z5/v+dvKjgkiKWiEWELJXJdh6CxKEAYCa0IE+244Hh8=; b=M4k5bhtC1Ii3l5pyShPoIAynEpTvS+k9lmOltn8Fa9bhruzZonvSiLE3k/fdUly8y1+R4CJmDS2gbaPsv4H25j0W3N7b32LedJ94wl1NoKHUN3tE662L6Nwgj3x3fvgls9g3N0yppYS8FicO089WHEVr2DqKDVa+O4GEALGvuQA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470014362975.1556269026273; Fri, 5 Jan 2024 07:53:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmU6-0004x5-Rn; Fri, 05 Jan 2024 10:51:47 -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 1rLmSL-0008RA-P7 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:59 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSI-0000zP-7t for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:49:57 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-33677fb38a3so1538914f8f.0 for ; Fri, 05 Jan 2024 07:49:52 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id hn3-20020a05600ca38300b0040e398f8cafsm1647488wmb.31.2024.01.05.07.49.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469791; x=1705074591; 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=Z5/v+dvKjgkiKWiEWELJXJdh6CxKEAYCa0IE+244Hh8=; b=QGmMTmsPzG09YP9RTv3wX7hL7BH1ePk48LweT5ro7lTtu1EO15dnbc0Z7nwii5Uxlv gAW8H1cVZTlXlUlS+OxOd+rST3K69Lolv8+WWSp2MLaik+gKY0wkGMOaSnad4wKvOwaY wbSeFAQWo/UyO2VJ0uxalm2g6PT1ouLlhmkAdqCjMfVnxOq8wODyPkFXzSUNMSEWhuzG C9NYGv5GTiIkFuNPID2YoDeML53hhQRqvubhLYm5Es18EQyRCbEUR8bcbSDT014IfI4V HvbV6s43a0bbTa/59PAjyk8xD3Nn0gw0cbe58Nf0eksTU3spwYiD0joNdjXsVmIMmveD rDSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469791; x=1705074591; 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=Z5/v+dvKjgkiKWiEWELJXJdh6CxKEAYCa0IE+244Hh8=; b=Gn9DNmQi0E2P6w6pqRlxC/RV7osT9Uy4mNJwFpUkzf8cKIX/jBPtNy7r9/3CwzqFdM v6Uxeui2mQnos3UHXp/5qA5StQJVGhWHya3ZAbhzOMpe374OB7WAwcGmIjA7RftpIZbj 0tOAt86mNXaxeo1mcVgDnJOh97cydJDsIRJkF7Tfr6XuudOF2xCMrRKuyDMAe+9CAtEg fjN/njGMTNdNphAF7alhlZhCfEqHY9kRfOGbq93LVMW23mBZHF9DHSvHwjP/4WDBpqiK wwd13nD4SMopZPWA95rJq2GF3zWOAEsKtCzEofTRvhgB0XQqlRvn5yUKxdSmSmJkGvuh gegw== X-Gm-Message-State: AOJu0Yynx37I+d8y5BIywQtZIvX1CTJy4inzdNNEppn7mD2lKif/Z2Q1 eHbqv0zsxlO/YQaRSmm7Cnnv5HFZ2KrHWn8otM/7fbkM7HA= X-Google-Smtp-Source: AGHT+IEC9VUr/PXB0Hf7LPxeqrhHmLHyX3P5rGzjminRYbjRgLPZ92Ef9i/1SP3FQVsoFVvgOjt4pA== X-Received: by 2002:a05:600c:3488:b0:40d:8514:fb5 with SMTP id a8-20020a05600c348800b0040d85140fb5mr1225021wmq.21.1704469791170; Fri, 05 Jan 2024 07:49:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan Subject: [PULL 66/71] hw/misc: Simplify memory_region_init_ram_from_fd() calls Date: Fri, 5 Jan 2024 16:42:59 +0100 Message-ID: <20240105154307.21385-67-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470014820100001 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, arg5, arg6, arg7, errp; @@ - memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7,= &errp); if ( - errp + !memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, = arg7, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-24-philmd@linaro.org> --- hw/misc/ivshmem.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 62af75e862..a2fd0bc365 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -476,7 +476,6 @@ static void setup_interrupt(IVShmemState *s, int vector= , Error **errp) =20 static void process_msg_shmem(IVShmemState *s, int fd, Error **errp) { - Error *local_err =3D NULL; struct stat buf; size_t size; =20 @@ -496,10 +495,9 @@ static void process_msg_shmem(IVShmemState *s, int fd,= Error **errp) size =3D buf.st_size; =20 /* mmap the region and map into the BAR2 */ - memory_region_init_ram_from_fd(&s->server_bar2, OBJECT(s), "ivshmem.ba= r2", - size, RAM_SHARED, fd, 0, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!memory_region_init_ram_from_fd(&s->server_bar2, OBJECT(s), + "ivshmem.bar2", size, RAM_SHARED, + fd, 0, errp)) { return; } =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470520; cv=none; d=zohomail.com; s=zohoarc; b=B5Qn3GqiYb8B8wbTP74swXD4UYKAFbkPvOmUkWDW1J4IFdwCHQzp5VGgnQ1WgSsZIFqowg7VScz3Vk5i85hINF+HdHMdjQsaeMQJGlu960M/SrcgCLvUxeFvReAaETwZ96Ac1KoL10WHlVnuiT7z8lmEH1WU6pT/FXgwAM7n6SM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470520; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h8Y9INkkzpXAHIBaDV6X4EdXcLZoAOfyToK+IgBwRCs=; b=XaXahyxM5rpxUCpOpIPYP8FxgHGmW28Q4joAz9VzGPGk3oh6eGSspFU96omBlgmg8vOnY1xD5vBvwSmJUpYmFwD2rkW4Se6qtyUiR0Q6WUgHQcpYu4mmw6q9VhO6JXIzSiDneCn4z7DftExohtQUFQA1EjkvOTUeYD2LfXIcbxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470520384481.556963791254; Fri, 5 Jan 2024 08:02:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTW-0003fz-E1; Fri, 05 Jan 2024 10:51:10 -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 1rLmSO-0008WF-Ub for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:03 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSM-00010K-69 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:00 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40d5f402571so19120245e9.0 for ; Fri, 05 Jan 2024 07:49:57 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id g11-20020a05600c310b00b0040d94b65342sm1927739wmo.48.2024.01.05.07.49.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469796; x=1705074596; 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=h8Y9INkkzpXAHIBaDV6X4EdXcLZoAOfyToK+IgBwRCs=; b=trG9EbVhTGYocEygqSoykHHDkh1JoR0PUhzxazvHz7oZ+PleHicBzuXNFOjxTqEdDK 8By/C6OFTFxt2LuM7D35vPSxPo5QBx5ucQfRiq4Z5tiBTgUDo/1P2XckLZAGMtk4LQ/l 2Keu9fXhHLFt+ix/xtuFH/axA4ea7Ne4l9ybsrDQU/mbkD8y3vIuS+eFtm+7MzX6zad1 vR9ZifAi9/DdS8gdg56M0j/w/alidI2k/fsSif4vcdnbGqB1ZlhHqUMF1h2LwRMzawVi UOYQs7Dogxrk8Lq4RoqKbjkyP4HscJ4Np4DT561c6jjxMWMM9I0ZFYUGyzODoK/yfwKE gitQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469796; x=1705074596; 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=h8Y9INkkzpXAHIBaDV6X4EdXcLZoAOfyToK+IgBwRCs=; b=ObkRZNGhexxhkhmbOZgpnuyrdqjYw64+8DMui/RN6M8MVIK+/GPr7jursLGBn2mqiY lnzeiHov8FC1CMoplFmGfU8oGjJYbnzfXgPMRZu9bRzMFMq44m/tfEK2NoqafgUMQi2T EaSkgmQs5EyelbsZtJOxh4Gor277hcbUvOeCnbos/vydDx9iDqctc6TxjVUGRhJ8NArB 8Yt0iFTFXR+jKjSSnp5djuawXkR+4qUCvoRQMuVPzfPn6CaxrCx7DF/DQenLz66TnDlI EhLdZkQot+ECh7tmF+P/cXB57SfMLUj2V9uOyhWJn7FqDGK/Ll05P0FgKZGobE7zBBd3 7SWA== X-Gm-Message-State: AOJu0YyiJShQLi0zkWFzwrNNEQ+oUbWNNLZ37KQCXSBeDoZPB3EJsWC4 6qlmQlbhdFugdbcnW0XL0xLv4FUtHkOI6TlJ78RsAvPJ+DI= X-Google-Smtp-Source: AGHT+IHw0jYoJSp6nOLr/q7TJz51rOTiU2htIhCuA9C4AKWA0eKPJWeM8l6XSCJiD5tt4EEsS5RiJg== X-Received: by 2002:a05:600c:a02:b0:40c:45e:f89a with SMTP id z2-20020a05600c0a0200b0040c045ef89amr1280111wmp.50.1704469796358; Fri, 05 Jan 2024 07:49:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , Joel Stanley , Peter Maydell Subject: [PULL 67/71] hw/nvram: Simplify memory_region_init_rom_device() calls Date: Fri, 5 Jan 2024 16:43:00 +0100 Message-ID: <20240105154307.21385-68-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470521375100001 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, arg5, arg6, errp; @@ - memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &errp); if ( - errp + !memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &= errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-25-philmd@linaro.org> --- hw/nvram/nrf51_nvm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c index ed8b836074..73564f7e6e 100644 --- a/hw/nvram/nrf51_nvm.c +++ b/hw/nvram/nrf51_nvm.c @@ -336,12 +336,9 @@ static void nrf51_nvm_init(Object *obj) static void nrf51_nvm_realize(DeviceState *dev, Error **errp) { NRF51NVMState *s =3D NRF51_NVM(dev); - Error *err =3D NULL; =20 - memory_region_init_rom_device(&s->flash, OBJECT(dev), &flash_ops, s, - "nrf51_soc.flash", s->flash_size, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom_device(&s->flash, OBJECT(dev), &flash_ops,= s, + "nrf51_soc.flash", s->flash_size, e= rrp)) { return; } =20 --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470036; cv=none; d=zohomail.com; s=zohoarc; b=GQRIg9cw068ZxsVfL6TfCnn9QoL9H8VApSQMLgyB4Ha+PgyAwVd51CpEz79jFbqjtLC1iFWcwLXq6xRZQuCsyfYCbB5wymzJXVfHr25cUD2Aj/4OfLY9V1vHBWgQWJYZ4UDBq4yIa4fzQbgR94Di7O5danMt5Zg05hr4eZTV7pY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470036; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SDwxzH3vS9V/d1nX5dyRUP+IK7/Bx5gX/AEs8zKaqSE=; b=Tm2hMIf1h7W2tFWOhXCdITRZ9i3aGYTK1mGDasXoKFMhXu2sPDWP9jKuEdmVUXPTfEtewMwXXM56b4mv2AVt4P8g/hhbk4XmazjfmVTlDvDzb3ijocDvCWfr0KyQT57iDbfidEWnbIcYFwxMMF3BQ1ttyWd6mOy+6+xJlzbeG64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170447003651660.324227210950994; Fri, 5 Jan 2024 07:53:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTZ-0003wr-QM; Fri, 05 Jan 2024 10:51: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 1rLmSU-0000A7-JZ for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:06 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSR-00011a-MZ for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:06 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e3b43173eso2095825e9.1 for ; Fri, 05 Jan 2024 07:50:02 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id b1-20020a5d4d81000000b00337405c06a6sm1621048wru.48.2024.01.05.07.50.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:50:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469801; x=1705074601; 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=SDwxzH3vS9V/d1nX5dyRUP+IK7/Bx5gX/AEs8zKaqSE=; b=serQmlLIe01mZ/Q4/bElvfh9EQf7ZBvIKcZy4qmSldLsvUS859MG0lwpZ6amaLkSp3 uDJIkL+28oYOdcbODmN9PVgUBfF1NFIJ0Pr8yr4HOODW3jDzAI5hbQx/ZhGn1LPXtHDN Y7X0uuVB0zmqSs1qOoMWZOff5Y2sQqgKu3IQTwYs6HSVIAmc+Pfr2wrA/KaI4jcqOqO3 t8TbqnqowaqijPSJDiZOrg7B9XHEENzZT+JjBvWjrnpCabOBrAkiO+DVEQhoXS7q22/O 6PdULmvbzC5lG13RZEK7cYrqfnAlnzG/iQ2nBEXaCaJ84PpcomS+B7Bl6jR6UYLXMiar Vjig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469801; x=1705074601; 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=SDwxzH3vS9V/d1nX5dyRUP+IK7/Bx5gX/AEs8zKaqSE=; b=DUOOgbMMe3OgBnMi+cyrBOMGy1UDQk3UFDzweBXT4Piba4cr6mkJaZCKnEVGyBm6Ib 0Q9Eh02sMV/z5dzJRaOXsagX2dEjFTJ3k8mA808FYV8gm8amLgPhaMMqD1dZLz51NY+e LWDPeBvqCx0gR5zE6ISNKeg/CVx7FlzZkvoJATs3eNBQaYjkH0kJJmtoEatamr6kSK2Z ayux8bZySfkkI+u4GsyEuRTdnYauW5GESTHUkihdAiIskBgWiUyhoqfMdBkIjdT1rX3v 1mVFRCaRHjg96ePNDM/ZU33PKg3FuYBTCoJr4Nk/dK/1EQiM/r9vmNoZqRkseaP81JKe nmMg== X-Gm-Message-State: AOJu0Yyk2kyammQrOLJwOdMo2JIOA4Anx+ah1nVIOwFam68fYDc6cpex 2uPhkubWzjYgUTgiq384lAHxlhhFQHDZJoELL9nnf/7S/ys= X-Google-Smtp-Source: AGHT+IHZhgpsMlbsYpnIF6g74vkVM44Ykg89QYw29B5DlHtEOAZm73Uhln07VdUJ0jn4/p0BBuuaKQ== X-Received: by 2002:a7b:cd96:0:b0:40d:5821:5148 with SMTP id y22-20020a7bcd96000000b0040d58215148mr934968wmj.67.1704469801572; Fri, 05 Jan 2024 07:50:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Gavin Shan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Subject: [PULL 68/71] hw/pci-host/raven: Propagate error in raven_realize() Date: Fri, 5 Jan 2024 16:43:01 +0100 Message-ID: <20240105154307.21385-69-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470037119100001 When an Error** reference is available, it is better to propagate local errors, rather then using generic ones, which might terminate the whole QEMU process. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-26-philmd@linaro.org> --- hw/pci-host/raven.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index f71d4872c8..c7a0a2878a 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -345,8 +345,10 @@ static void raven_realize(PCIDevice *d, Error **errp) d->config[PCI_LATENCY_TIMER] =3D 0x10; d->config[PCI_CAPABILITY_LIST] =3D 0x00; =20 - memory_region_init_rom_nomigrate(&s->bios, OBJECT(s), "bios", BIOS_SIZ= E, - &error_fatal); + if (!memory_region_init_rom_nomigrate(&s->bios, OBJECT(s), "bios", + BIOS_SIZE, errp)) { + return; + } memory_region_add_subregion(get_system_memory(), (uint32_t)(-BIOS_SIZE= ), &s->bios); if (s->bios_name) { --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470076; cv=none; d=zohomail.com; s=zohoarc; b=K0sgOnQsEKAWoCkTC3kBBRqq2nJmChqWuXY24n6rScEBOm2T9dp0wPesiQrfRY24tL+N8qAvjxUc92sWaxno+A0nS114jsrVFO2NBeozXXXegwksjc6vxuesrocZ4ZY+G6pcjZlKYQ/VsF5J86KGaY/IHB2g0O3Gh4E7F9MTLPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470076; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Nno3VTCeo04e35HOY3p6uYOV1tAtecR5ZW2yhenY0Bs=; b=Yv1vki02AeSKij+41Qlqep03gR4b2l6AqGC+2O4beyy7NVEkzz7BUJ/OnPjDSbb523T40mKRcgFkfpIg2zodaprIB6lHLQjd+HA0Exp9XHRILRe4rqDeC7pG6HA/UV2p9bRQI1/QbhFEUEakqFxTZEdEcYUTWMkPaVvuuzQSJdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470076592345.40221745763563; Fri, 5 Jan 2024 07:54:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTT-0003NK-Qk; Fri, 05 Jan 2024 10:51:07 -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 1rLmSZ-0000of-EJ for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:13 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSW-0001ES-F3 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:10 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-336897b6bd6so1525530f8f.2 for ; Fri, 05 Jan 2024 07:50:07 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id q9-20020a05600000c900b003367eae8e18sm1623623wrx.57.2024.01.05.07.50.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:50:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469806; x=1705074606; 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=Nno3VTCeo04e35HOY3p6uYOV1tAtecR5ZW2yhenY0Bs=; b=WincsaJJFH6/ydoWKzmDqEwadD24rT25SUPVLUTA2MOp2iyLtBxtrbgYvSnA+4cWEf C0LfAd4J2UhnX2wfrrTp3z7weXamxReN5VujcADpZJ5LYhwVJV1LPWRH77nwU1WtMOkf 7FtdzEcLWsNhbkBG6FNJ0ogpHrSl7LxL8mLhbqy29U0UZDgjvsqAqQ4N35PoqlODXJ1d CIbgnFXKKvnAA4FgZNwrJkd2ahJPqsZVWt8VCSUXS0ryZ6KnXhz8/4yANRdiw7SiUTNZ N2sZQni3D46JyI4hDbjUMpBpR4YoqyN34KLbp3D3kTbw5gc8Dd3xaygryrcbPS1ZNMQv 0mlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469806; x=1705074606; 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=Nno3VTCeo04e35HOY3p6uYOV1tAtecR5ZW2yhenY0Bs=; b=cuBSLQwnitoxvuw36mG7IYKD6w1pcNkOha2r7E54gy9c8iIMpMXeQJlzbiGhlcNDrX Ttx2LHyk1+yWjTf833fwQ+BZcgqOY5hhvdU2uH8+Fk+WbOR3qKkITZ4gUBryKR+ocML4 ObIJSIXwrdxeDO/UCBgJcq3kKC71fC+WiCYrQgT0HIozto/WmauAmGbZB9I1rfaMDtaW 5kMaSLomt+W+FUEurdq7eLvYJbdPoT3I6N0F334cRn1a+3Vq8h+BKRWMwAEtpq9oyle2 kmgBlqYjPT9w/E5TBZG3IxOwMKoviJad9HVohpImQBuqSznUIbmjh7ZMQ73ucTpaNjPQ BoLg== X-Gm-Message-State: AOJu0Ywd+BKF80kGaseEX9fz1+v5mf7s+mnaOOw4f8gtFBVUiayW1YoA wraZrLigdycM7E7ITvM3XtDnuWjaSVQw9Z1Wkx+tk33YLp8= X-Google-Smtp-Source: AGHT+IEDuBvHeDIQ6nmVzWRN2hi01IK23e06MHcHgOCGbKhDhedlo9shD8BOBcquIQOvAU/u1hsECw== X-Received: by 2002:a5d:62d0:0:b0:337:5cf8:b12a with SMTP id o16-20020a5d62d0000000b003375cf8b12amr235231wrv.135.1704469806693; Fri, 05 Jan 2024 07:50:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Thomas Huth , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 69/71] hw/m68k/mcf5206: Embed m5206_timer_state in m5206_mbar_state Date: Fri, 5 Jan 2024 16:43:02 +0100 Message-ID: <20240105154307.21385-70-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470077415100001 From: Thomas Huth There's no need to explicitely allocate the memory here, we can simply embed it into the m5206_mbar_state instead. Signed-off-by: Thomas Huth Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231221122939.11001-1-huth@tuxfamily.org> --- hw/m68k/mcf5206.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index a46a23538d..183fd3cc08 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -148,15 +148,11 @@ static void m5206_timer_write(m5206_timer_state *s, u= int32_t addr, uint32_t val) m5206_timer_update(s); } =20 -static m5206_timer_state *m5206_timer_init(qemu_irq irq) +static void m5206_timer_init(m5206_timer_state *s, qemu_irq irq) { - m5206_timer_state *s; - - s =3D g_new0(m5206_timer_state, 1); s->timer =3D ptimer_init(m5206_timer_trigger, s, PTIMER_POLICY_LEGACY); s->irq =3D irq; m5206_timer_reset(s); - return s; } =20 /* System Integration Module. */ @@ -167,7 +163,7 @@ typedef struct { M68kCPU *cpu; MemoryRegion iomem; qemu_irq *pic; - m5206_timer_state *timer[2]; + m5206_timer_state timer[2]; DeviceState *uart[2]; uint8_t scr; uint8_t icr[14]; @@ -293,9 +289,9 @@ static uint64_t m5206_mbar_read(m5206_mbar_state *s, uint16_t offset, unsigned size) { if (offset >=3D 0x100 && offset < 0x120) { - return m5206_timer_read(s->timer[0], offset - 0x100); + return m5206_timer_read(&s->timer[0], offset - 0x100); } else if (offset >=3D 0x120 && offset < 0x140) { - return m5206_timer_read(s->timer[1], offset - 0x120); + return m5206_timer_read(&s->timer[1], offset - 0x120); } else if (offset >=3D 0x140 && offset < 0x160) { return mcf_uart_read(s->uart[0], offset - 0x140, size); } else if (offset >=3D 0x180 && offset < 0x1a0) { @@ -333,10 +329,10 @@ static void m5206_mbar_write(m5206_mbar_state *s, uin= t16_t offset, uint64_t value, unsigned size) { if (offset >=3D 0x100 && offset < 0x120) { - m5206_timer_write(s->timer[0], offset - 0x100, value); + m5206_timer_write(&s->timer[0], offset - 0x100, value); return; } else if (offset >=3D 0x120 && offset < 0x140) { - m5206_timer_write(s->timer[1], offset - 0x120, value); + m5206_timer_write(&s->timer[1], offset - 0x120, value); return; } else if (offset >=3D 0x140 && offset < 0x160) { mcf_uart_write(s->uart[0], offset - 0x140, value, size); @@ -598,8 +594,8 @@ static void mcf5206_mbar_realize(DeviceState *dev, Erro= r **errp) sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); =20 s->pic =3D qemu_allocate_irqs(m5206_mbar_set_irq, s, 14); - s->timer[0] =3D m5206_timer_init(s->pic[9]); - s->timer[1] =3D m5206_timer_init(s->pic[10]); + m5206_timer_init(&s->timer[0], s->pic[9]); + m5206_timer_init(&s->timer[1], s->pic[10]); s->uart[0] =3D mcf_uart_create(s->pic[12], serial_hd(0)); s->uart[1] =3D mcf_uart_create(s->pic[13], serial_hd(1)); } --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470148; cv=none; d=zohomail.com; s=zohoarc; b=QffUpltEHa7XWMLSdiMJKwiDMdej5BNh347T9N+KODkWhNqZ63XirAfdXIfYLS1+buirTd1APf7F+W3Ej8O+wIqXt1HjaMjGvcL0wSozrPDjFdn1zPbdlfCM9TZorO1qEIzbYv7npepvVdRK0tAe9u1e3gNv0/QhDygvDuglgWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470148; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sJhN/WyzxWMOOPIeTap61yRQUoY0YL+ZGCT3kZkMZNQ=; b=QBM372W/zQxJhbvPpNk7mv2WwH2ROicLPyTqfpjn7H8Dvh1aKeIqq+5ZDs2tbq+sFEfk8uDkWcxQeBgV12slf5c5tpFoMCoSGRodanudrQL1/8KDZB29lLCj7H4tOEalr+QdXTgtVbB/1bg5LU/2GhRzWEv0XuIZZqT5TOOfzYs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17044701479441014.0510311117018; Fri, 5 Jan 2024 07:55:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmU6-0004vY-L0; Fri, 05 Jan 2024 10:51:46 -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 1rLmSm-0001n3-NF for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:33 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSk-0001HA-L3 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:24 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3374eb61cbcso1485578f8f.0 for ; Fri, 05 Jan 2024 07:50:13 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id a22-20020a5d4576000000b0033671314440sm1629463wrc.3.2024.01.05.07.50.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:50:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469812; x=1705074612; 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=sJhN/WyzxWMOOPIeTap61yRQUoY0YL+ZGCT3kZkMZNQ=; b=kbhIsb5G5wAWcU8WA6XlQi/6lKGxmbGxrqPEcemqnUAJHAWx5hQHKlqoOe50A3ShTl 1VjKZw6HJZXRVq0Qkdp3/7TWZnZqz/0Zm6Hvitg5mfr38q44rrsFhW4TCZ2kdOVEZF4w RiGv8yqiwQJ0qh9gznbkrTMAXZuJ0/qlbqeG7B/SxZKotvHVMF19VFSsRvVTp+rYcejd k17URYeJuZmVmQklH/D1WUAfYQu2xiYwuf7NAfsNDt0yHchKrtVurmB1PKsfNg0CYRV9 zxWKlhmZVkFLu4szNRvLhGnHKIQL8emVwUpOXYMi0QeF9SBpw2psC7u0feUG1OcLX6jm hKHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469812; x=1705074612; 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=sJhN/WyzxWMOOPIeTap61yRQUoY0YL+ZGCT3kZkMZNQ=; b=byKGFfuaUTi4bmbo3eacBYl0VcEabCYJY8r0suLDJhtAKWAHrWzHQDM1BTDHRcRPpZ QlRGY7Ryaq3np7RYIqWPZLvI73lBK4uSZZ015OHw4e6+2f4/lfJU7R51tC1Ab2eheI0Y Vl1X1R0adJ4WWDQMIigsk0oFIdB9G9Cr5bRtXcp9ZpECKHNdx2tPHnetbK57rXuJeaIY o+D5jPZc9hVlZRvDDZVAmtt5zHbu5WjBsUv4guRVPF5OYvw092Qs/AFO9/yhu7tWwY1h 7CgEruM7qt3eeqU6tzsKKnvBJUjme2eGlyMcRnLTY5d4KClVg5wbLcJdLXuffB34Oonm Y4uA== X-Gm-Message-State: AOJu0Yzv08YkC3tX/BsfZ0x5+Kk2FuPzpbtFkhnww/SePgAZObl+6+e9 AhdarBEfHjQJ+GplK5Qso0PDlbAMnUvVV0v8jvinCQplXYk= X-Google-Smtp-Source: AGHT+IFgZoIHxDMrAT6W2pvOHEZRM/nIAoxIFWwT/z/A34AmtOLLTFbNPuahflw3qXI8Zju35p8bsQ== X-Received: by 2002:a5d:6d50:0:b0:336:808d:95e5 with SMTP id k16-20020a5d6d50000000b00336808d95e5mr1497119wri.67.1704469812164; Fri, 05 Jan 2024 07:50:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Pavel Pisa , Grant Ramsay , Vikram Garhwal , Jason Wang Subject: [PULL 70/71] hw/net/can/sja1000: fix bug for single acceptance filter and standard frame Date: Fri, 5 Jan 2024 16:43:03 +0100 Message-ID: <20240105154307.21385-71-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470149937100001 Content-Type: text/plain; charset="utf-8" From: Pavel Pisa A CAN sja1000 standard frame filter mask has been computed and applied incorrectly for standard frames when single Acceptance Filter Mode (MOD_AFM =3D 1) has been selected. The problem has not been found by Linux kernel testing because it uses dual filter mode (MOD_AFM =3D 0) and leaves falters fully open. The problem has been noticed by Grant Ramsay when testing with Zephyr RTOS which uses single filter mode. Signed-off-by: Pavel Pisa Reported-by: Grant Ramsay Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2028 Fixes: 733210e754 ("hw/net/can: SJA1000 chip register level emulation") Message-ID: <20240103231426.5685-1-pisa@fel.cvut.cz> --- hw/net/can/can_sja1000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/can/can_sja1000.c b/hw/net/can/can_sja1000.c index 1165d59824..6694d7bfd8 100644 --- a/hw/net/can/can_sja1000.c +++ b/hw/net/can/can_sja1000.c @@ -108,7 +108,7 @@ void can_sja_single_filter(struct qemu_can_filter *filt= er, } =20 filter->can_mask =3D (uint32_t)amr[0] << 3; - filter->can_mask |=3D (uint32_t)amr[1] << 5; + filter->can_mask |=3D (uint32_t)amr[1] >> 5; filter->can_mask =3D ~filter->can_mask & QEMU_CAN_SFF_MASK; if (!(amr[1] & 0x10)) { filter->can_mask |=3D QEMU_CAN_RTR_FLAG; --=20 2.41.0 From nobody Tue Nov 26 20:17:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704470261; cv=none; d=zohomail.com; s=zohoarc; b=dpqrFyUeLcyO8kLcaoxy+wvCU5ZJxiIRGa8HbjrlI0lRl8UPXjFGf4T4a4Z50qafuFqwTYxHmXtCaiwt5uNiLjnAetgyh7r+JQxYRdrJEzN2aFa/03bO+VaGJLf4hfNkF57ElqyPDJVySXQbQD2gwgYjYN96wWWbz8/AQZluGyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704470261; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7GKplYO/5yXOUvt6X4002htySDt5oqr2bCk1Sg6HTjA=; b=cZArMTKOBmsjkvfG2CAFMopSZd7axW7eLuR+/PMNuV+m5cj8H/PHkCYUEisn0mM4OUxcQlH0O0nmUBB81eCi+cttKNAUzxM8AQkc6Ja+9rJ4xP01JsuGN0nkeOQKo+ylqY+6W8He0icKO7bazdWbpibEYSp9x7s7F7Qsy8sHmgs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704470261422839.6610823663598; Fri, 5 Jan 2024 07:57:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmTX-0003jg-Jl; Fri, 05 Jan 2024 10:51: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 1rLmSl-0001mu-8i for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:31 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSi-0001I7-Db for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:22 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40d858c56cbso19623095e9.2 for ; Fri, 05 Jan 2024 07:50:19 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id w5-20020a05600c474500b0040e34835a58sm1933611wmo.22.2024.01.05.07.50.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469818; x=1705074618; 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=7GKplYO/5yXOUvt6X4002htySDt5oqr2bCk1Sg6HTjA=; b=dO5G6zc+IJBx5gVHi6xy/48X3lWQopv8xi+eAd78hQdyPLLRWNO5prpvnWCUjPImjA hfgcgtmqGuSqxTwDFqsRGq/jnmDFmwZDOQplgeKz/a6SrCb5ItgN/JCjeDMd8P8U6feG 4TVls0yAnhvpBwEkNP4bcT2Kx+Gb5mz58rli0gJE66gyHlpSp+ksQahDI267jZuHPUZd v8CbUnqcRIfa7KRS3DeU8FDsXxtwkx/p0SwDzEPusr/QKLQulZdOwrgP5HztC3OICm1H kTnPlMTrb5VEko3e4eUm9SS/nBXzQTykq5ezDqeyfI2cHSml1C6Qub7TsdvXg86CWIcP 2n5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469818; x=1705074618; 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=7GKplYO/5yXOUvt6X4002htySDt5oqr2bCk1Sg6HTjA=; b=T6Wr6ugOTSWwnMwnRYFnBzmC6XGP2kpzh5jJYTwAl2bOTkt6VmxAcr3DMNmq1UenSR qIxJGzSOXIkZ6Nc7XYTPnQIU1tz7kBR9XwT1rVKoY0/KFsSzLifg8M28BFauToJBhywA JlcoGF5Ghut4n0wXYkK8AXzsqX/u/g/xpyELlMo0kHYN+weK9nxw7gxdA10Xx/r31y2p vPWk1zDPwhd91cGqAx0CZcLPZfaoX29IAGoaWz3gsYYI4MzuOeXPX6xVUNLbkvMjC2Pn raemRMXNoD0LYVrcIwttdx6cAxcS/v0E4TppQILCqIomu9Ncw6eo7BkbHOTyoh1wJnmG As6Q== X-Gm-Message-State: AOJu0YyZ+ZV4GMxtZ7+MCZ9uDsyPDTWlsqO7X6LTx3JgV969GzNQCA64 H3o363gyC0SYCOVl4QOYg8Nn2zmLDDDo048uOj7eGx+iC7M= X-Google-Smtp-Source: AGHT+IH8UJYSR/lIhiCcHQA6HiNCMXVAShe4Y4YBQ49ltwPzGBu/udU/l8S6x0L26MAEn2kIIua62A== X-Received: by 2002:a7b:c8cd:0:b0:40d:6c48:a1b4 with SMTP id f13-20020a7bc8cd000000b0040d6c48a1b4mr1359736wml.29.1704469817815; Fri, 05 Jan 2024 07:50:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Cl=C3=A9ment=20Chigot?= , Frederic Konrad , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fabien Chouteau , Mark Cave-Ayland , Artyom Tarasenko Subject: [PULL 71/71] target/sparc: Simplify qemu_irq_ack Date: Fri, 5 Jan 2024 16:43:04 +0100 Message-ID: <20240105154307.21385-72-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704470261977100001 From: Cl=C3=A9ment Chigot This is a simple cleanup, since env is passed to qemu_irq_ack it can be accessed from inside qemu_irq_ack. Just drop this parameter. Co-developed-by: Frederic Konrad Signed-off-by: Cl=C3=A9ment Chigot Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240105102421.163554-7-chigot@adacore.com> --- target/sparc/cpu.h | 2 +- hw/sparc/leon3.c | 8 ++++---- target/sparc/int32_helper.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 6999a10a40..12a11ecb26 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -549,7 +549,7 @@ struct CPUArchState { sparc_def_t def; =20 void *irq_manager; - void (*qemu_irq_ack)(CPUSPARCState *env, void *irq_manager, int intno); + void (*qemu_irq_ack)(CPUSPARCState *env, int intno); =20 /* Leon3 cache control */ uint32_t cache_control; diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 1e39d2e2d0..2dfb742566 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -164,9 +164,9 @@ static void leon3_cache_control_int(CPUSPARCState *env) } } =20 -static void leon3_irq_ack(void *irq_manager, int intno) +static void leon3_irq_ack(CPUSPARCState *env, int intno) { - grlib_irqmp_ack((DeviceState *)irq_manager, intno); + grlib_irqmp_ack(env->irq_manager, intno); } =20 /* @@ -208,9 +208,9 @@ static void leon3_set_pil_in(void *opaque, int n, int l= evel) } } =20 -static void leon3_irq_manager(CPUSPARCState *env, void *irq_manager, int i= ntno) +static void leon3_irq_manager(CPUSPARCState *env, int intno) { - leon3_irq_ack(irq_manager, intno); + leon3_irq_ack(env, intno); leon3_cache_control_int(env); } =20 diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c index 1563613582..8f4e08ed09 100644 --- a/target/sparc/int32_helper.c +++ b/target/sparc/int32_helper.c @@ -160,7 +160,7 @@ void sparc_cpu_do_interrupt(CPUState *cs) #if !defined(CONFIG_USER_ONLY) /* IRQ acknowledgment */ if ((intno & ~15) =3D=3D TT_EXTINT && env->qemu_irq_ack !=3D NULL) { - env->qemu_irq_ack(env, env->irq_manager, intno); + env->qemu_irq_ack(env, intno); } #endif } --=20 2.41.0