From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Eric Blake" <eblake@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
qemu-arm@nongnu.org, "Luc Michel" <luc.michel@amd.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Frederic Konrad" <fkonrad@amd.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [RFC PATCH 3/5] hw/arm/armv7m: Convert ARMv7MState::vfp from bool to OptionalBool
Date: Tue, 2 Jan 2024 17:04:52 +0100 [thread overview]
Message-ID: <20240102160455.68612-4-philmd@linaro.org> (raw)
In-Reply-To: <20240102160455.68612-1-philmd@linaro.org>
We want to know if the 'vfp' property has been initialized.
Convert it from boolean to OptionalBool (which contain the
'unset' enum).
Note the monitor output is changed as:
(qemu) info qtree
...
dev: armv7m, id ""
gpio-in "NMI" 1
gpio-out "SYSRESETREQ" 1
gpio-in "" 96
clock-in "cpuclk" freq_hz=40 MHz
clock-in "refclk" freq_hz=0 Hz
cpu-type = "cortex-m33-arm-cpu"
init-svtor = 270532608 (0x10200000)
init-nsvtor = 0 (0x0)
enable-bitband = false
start-powered-off = false
- vfp = false
+ vfp = "false"
dsp = false
mpu-ns-regions = 8 (0x8)
mpu-s-regions = 8 (0x8)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/arm/armv7m.h | 2 +-
hw/arm/armsse.c | 2 +-
hw/arm/armv7m.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h
index e2cebbd15c..6c9e65b644 100644
--- a/include/hw/arm/armv7m.h
+++ b/include/hw/arm/armv7m.h
@@ -105,7 +105,7 @@ struct ARMv7MState {
uint32_t mpu_s_regions;
bool enable_bitband;
bool start_powered_off;
- bool vfp;
+ OptionalBool vfp;
bool dsp;
};
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 31acbf7347..472b16fc30 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -1028,7 +1028,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
}
}
if (!s->cpu_fpu[i]) {
- if (!object_property_set_bool(cpuobj, "vfp", false, errp)) {
+ if (!object_property_set_str(cpuobj, "vfp", "false", errp)) {
return;
}
}
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index d10abb36a8..3610f6f4a1 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -548,7 +548,7 @@ static Property armv7m_properties[] = {
DEFINE_PROP_BOOL("enable-bitband", ARMv7MState, enable_bitband, false),
DEFINE_PROP_BOOL("start-powered-off", ARMv7MState, start_powered_off,
false),
- DEFINE_PROP_BOOL("vfp", ARMv7MState, vfp, true),
+ DEFINE_PROP_BOOL_NODEFAULT("vfp", ARMv7MState, vfp),
DEFINE_PROP_BOOL("dsp", ARMv7MState, dsp, true),
DEFINE_PROP_UINT32("mpu-ns-regions", ARMv7MState, mpu_ns_regions, UINT_MAX),
DEFINE_PROP_UINT32("mpu-s-regions", ARMv7MState, mpu_s_regions, UINT_MAX),
--
2.41.0
next prev parent reply other threads:[~2024-01-02 16:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-02 16:04 [RFC PATCH 0/5] qdev-properties: Try to improve use of dynamic property introspection Philippe Mathieu-Daudé
2024-01-02 16:04 ` [RFC PATCH 1/5] qdev-properties: Add qdev_property_del_static() Philippe Mathieu-Daudé
2024-01-02 16:04 ` [RFC PATCH 2/5] qdev-properties: Add OptionalBool QAPI type Philippe Mathieu-Daudé
2024-01-02 22:44 ` Richard Henderson
2024-01-03 9:12 ` Philippe Mathieu-Daudé
2024-01-02 16:04 ` Philippe Mathieu-Daudé [this message]
2024-01-02 16:04 ` [RFC PATCH 4/5] hw/arm/armv7m: Error if trying to set unavailable ARMCPU::vfp property Philippe Mathieu-Daudé
2024-01-12 16:41 ` Peter Maydell
2024-01-02 16:04 ` [RFC PATCH 5/5] hw/arm/armv7m: Do not expose 'vfp' property if ARM CPU doesn't have it Philippe Mathieu-Daudé
2024-01-09 10:47 ` [RFC PATCH 0/5] qdev-properties: Try to improve use of dynamic property introspection Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240102160455.68612-4-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=fkonrad@amd.com \
--cc=kwolf@redhat.com \
--cc=luc.michel@amd.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).