qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Allow int props with no default, use them in ARM
@ 2017-07-11 15:53 Peter Maydell
  2017-07-11 15:53 ` [Qemu-devel] [PATCH 1/3] qdev-properties.h: Explicitly set the default value for arraylen properties Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Peter Maydell @ 2017-07-11 15:53 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: patches, Markus Armbruster, Marc-André Lureau

This patchset follows up on a suggestion by Markus for
allowing devices to implement integer properties which
don't have a default value specified in their Property
struct.

My use case for this is ARM, where we have a property
pmsav7-dregion whose correct default value depends on
which exact ARM CPU this is. That means we can't have
a single constant default value specified in the
DEFINE_PROP_UINT32(), but on the other hand if we just
prevent the qdev prop system from setting a default itself
we can naturally get the right default value by having
the structure field be correctly set to the default for
the CPU in the first place.

Patch 1 cleans up a corner case where we had just one
Property struct which was using the default value
(because it has a PropertyInfo with a non-NULL set_default_value
field) but not explicitly setting .defval.[ui].

Patch 2 adds .set_default to Property, uses it as the gate
on calling .set_default_value rather than just whether
.set_default_value is non-NULL, and adds some macros
so that devices can use the new no-default-value int props.

Patch 3 uses this so M3 and M4 have the right default
for the number of PMSA regions rather than getting the
different R7 default.

thanks
-- PMM

Peter Maydell (3):
  qdev-properties.h: Explicitly set the default value for arraylen
    properties
  qdev: support properties which don't set a default value
  target/arm: Make Cortex-M3 and M4 default to 8 PMSA regions

 include/hw/qdev-core.h       |  1 +
 include/hw/qdev-properties.h | 21 +++++++++++++++++++++
 hw/core/qdev.c               |  2 +-
 target/arm/cpu.c             | 12 +++++++++++-
 4 files changed, 34 insertions(+), 2 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-07-13 18:25 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-11 15:53 [Qemu-devel] [PATCH 0/3] Allow int props with no default, use them in ARM Peter Maydell
2017-07-11 15:53 ` [Qemu-devel] [PATCH 1/3] qdev-properties.h: Explicitly set the default value for arraylen properties Peter Maydell
2017-07-11 16:46   ` Marc-André Lureau
2017-07-13 14:11   ` Markus Armbruster
2017-07-13 14:26     ` Peter Maydell
2017-07-13 16:21       ` Markus Armbruster
2017-07-11 15:53 ` [Qemu-devel] [PATCH 2/3] qdev: support properties which don't set a default value Peter Maydell
2017-07-11 17:15   ` Marc-André Lureau
2017-07-11 17:25     ` Peter Maydell
2017-07-12 11:22   ` Markus Armbruster
2017-07-12 12:27     ` Peter Maydell
2017-07-13 15:38     ` Peter Maydell
2017-07-13 17:10       ` Markus Armbruster
2017-07-13 17:18         ` Peter Maydell
2017-07-13 18:25           ` Markus Armbruster
2017-07-11 15:53 ` [Qemu-devel] [PATCH 3/3] target/arm: Make Cortex-M3 and M4 default to 8 PMSA regions Peter Maydell
2017-07-11 17:18   ` Marc-André Lureau
2017-07-11 17:27     ` Peter Maydell
2017-07-11 17:30       ` Marc-André Lureau

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).