From nobody Tue Feb 10 00:59:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) client-ip=209.85.128.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1621248748; cv=none; d=zohomail.com; s=zohoarc; b=Ap0uNV2gzLYNiDh3Z9tuggTRJfFP6lFrk51DhGSxM9DrtbklyoTzvCH7NYZz6FD5MlymXFixyHdCX1QifbPh1g2p49jfacJnZxSeQTrjMSQBekjn3f7QtRE4wz7p0rFcLU/y9MhKN6EP4NSd/4ueIqZmN6tA0raugdhzJyvMl2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621248748; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=numJYWQfN9cjP4y3FBe1McH7f7YrqdT6BscR7duwZVs=; b=IRmF4e85WKi+LzlcL+4+S/4I9ueXStqkNjEz6pxXa/Y7ED0UZhSB6gxFnhwJhFjSGowBXN5vMGsVEG8YVaSFrwUJSQXFkd88YmA48r2hD0HeyExO5bnJ71ctL/FHmbbFeKAhICgBCrn92ufd32IK6DrWw38MVhqSURL35VvhbVk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.zohomail.com with SMTPS id 1621248748020323.16977167313735; Mon, 17 May 2021 03:52:28 -0700 (PDT) Received: by mail-wm1-f52.google.com with SMTP id k5-20020a05600c4785b0290174b7945d7eso2895760wmo.2 for ; Mon, 17 May 2021 03:52:27 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (31.red-83-51-215.dynamicip.rima-tde.net. [83.51.215.31]) by smtp.gmail.com with ESMTPSA id c15sm17019645wrd.49.2021.05.17.03.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 03:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=numJYWQfN9cjP4y3FBe1McH7f7YrqdT6BscR7duwZVs=; b=PjPIsEmrl335FJg+p+NxwQla9zW8A5KcKXnlX0P1PCNzYPtTQOTNAltDsuUQ+UATZ6 GWNhnGQY3iCRH0E3fSh5VcxfGfdikuMZfyoovt7O2NODXr5ZzV2/UfQVLeEehANfLgGo yN5EceicQeG3ghsmcB/fwMLa/4zSmvFAsu4u64/mS3a0uzwAmCTtuxoCOU1egTRdv9aP QQAs4Jw7OkwmbxSL4UZV8zFgKaBD4J26div+p/ddz8P68LVFttmIHcl7LL6eVCH94KkN Y3sGMJB6NxxW6Lv75q6F/+5+W57Wt1fPGTBOMWFORxLgg/JZifflZHvZ6WlgxOu5A3/D qWLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=numJYWQfN9cjP4y3FBe1McH7f7YrqdT6BscR7duwZVs=; b=LuZVZ9l0MDSNk8Y+HG5KwaCLeIDjVAj/HpR465ZDUYK17Wr5FoaAGSj/I5+15doEtx UHQEYNl6TidEa4GOdUYyiKq//06Vz79DGxEp6J4OaOqMXsV/5GhY+cEIuhz0DahduXG+ UTDR1Jytvkm7l4qf8KjWOdSl/nuKV415WIfjESji62hbrgMUsKjCCjpDirLL1W3p4WU+ ENrRsXgX1sUjJbX48Xy225pOS0O1cyoSpQzbYe1DQC3RU/9RqVYVwMp/EgP1T7rCF6Ll fobGVt95N3QiTTF0XhWh2tn2vdB4ncU82KKe/xI1gLB+JXfGcNff8FHsrzOOFa7vZRkE I/rQ== X-Gm-Message-State: AOAM533xi6wRYGU8Rud08iDxvgejwQ8AdUACeef5FFFpHhBHi89oMqU5 jLGStFRNVXTXe+uUHky1Cls= X-Google-Smtp-Source: ABdhPJy3zXW8JzQyPPM0JT0plWT+oXbAu0+OlSmfl+DZ6r9raOTZPH9wTTipZrhs42HF9vg4dfzVDA== X-Received: by 2002:a1c:a7c2:: with SMTP id q185mr32839778wme.112.1621248746260; Mon, 17 May 2021 03:52:26 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-arm@nongnu.org, Laurent Vivier , Paolo Bonzini , qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v7 09/23] cpu: Directly use get_paging_enabled() fallback handlers in place Date: Mon, 17 May 2021 12:51:26 +0200 Message-Id: <20210517105140.1062037-10-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210517105140.1062037-1-f4bug@amsat.org> References: <20210517105140.1062037-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) No code uses CPUClass::get_paging_enabled() outside of hw/core/cpu.c: $ git grep -F -- '->get_paging_enabled' hw/core/cpu.c:74: return cc->get_paging_enabled(cpu); hw/core/cpu.c:438: k->get_paging_enabled =3D cpu_common_get_paging_ena= bled; target/i386/cpu.c:7418: cc->get_paging_enabled =3D x86_cpu_get_paging_= enabled; Check the handler presence in place and remove the common fallback code. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/cpu-common.c | 13 ------------- hw/core/cpu-sysemu.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5913ffe22be..2aa6b8cffca 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -66,18 +66,6 @@ CPUState *cpu_create(const char *typename) return cpu; } =20 -bool cpu_paging_enabled(const CPUState *cpu) -{ - CPUClass *cc =3D CPU_GET_CLASS(cpu); - - return cc->get_paging_enabled(cpu); -} - -static bool cpu_common_get_paging_enabled(const CPUState *cpu) -{ - return false; -} - void cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list, Error **errp) { @@ -316,7 +304,6 @@ static void cpu_class_init(ObjectClass *klass, void *da= ta) k->parse_features =3D cpu_common_parse_features; k->get_arch_id =3D cpu_common_get_arch_id; k->has_work =3D cpu_common_has_work; - k->get_paging_enabled =3D cpu_common_get_paging_enabled; k->get_memory_mapping =3D cpu_common_get_memory_mapping; k->gdb_read_register =3D cpu_common_gdb_read_register; k->gdb_write_register =3D cpu_common_gdb_write_register; diff --git a/hw/core/cpu-sysemu.c b/hw/core/cpu-sysemu.c index 7f3a3574943..931ba46354d 100644 --- a/hw/core/cpu-sysemu.c +++ b/hw/core/cpu-sysemu.c @@ -22,6 +22,17 @@ #include "qapi/error.h" #include "hw/core/cpu.h" =20 +bool cpu_paging_enabled(const CPUState *cpu) +{ + CPUClass *cc =3D CPU_GET_CLASS(cpu); + + if (cc->get_paging_enabled) { + return cc->get_paging_enabled(cpu); + } + + return false; +} + hwaddr cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs) { --=20 2.26.3