Re: [PATCH v2 2/6] accel: accel_available() function

2020-11-26 Thread Eduardo Habkost
On Thu, Nov 26, 2020 at 10:14:31AM +0100, Claudio Fontana wrote: > Hi Eduardo, > > On 11/25/20 9:56 PM, Eduardo Habkost wrote: > > This function will be used to replace the xen_available() and > > kvm_available() functions from arch_init.c. > > > > Signed-off-by

[PATCH v2 5/6] Remove unnecessary usage of arch_init.h

2020-11-25 Thread Eduardo Habkost
;(git grep -l arch_init.h | sort) \ <((git grep -l -w 'arch_type'; g grep -l QEMU_ARCH;) | sort -u)) Signed-off-by: Eduardo Habkost --- Cc: Richard Henderson Cc: Paolo Bonzini Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Cc: "Hervé Poussineau"

[PATCH v2 4/6] xen: Delete xen_available() function

2020-11-25 Thread Eduardo Habkost
The function can be replaced with accel_available("xen"). Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: qemu-devel@nongnu.org Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: xen-de...@lists.xenproject.org Cc: Richard Henderson Cc: Claudio Fontana

[PATCH v2 3/6] kvm: Remove kvm_available() function

2020-11-25 Thread Eduardo Habkost
The only caller can use accel_available("kvm") instead. Signed-off-by: Eduardo Habkost --- Cc: Markus Armbruster Cc: qemu-devel@nongnu.org Cc: Paolo Bonzini Cc: k...@vger.kernel.org Cc: Richard Henderson Cc: Paolo Bonzini Cc: Claudio Fontana Cc: Roman Bolshakov --- incl

[PATCH v2 6/6] Rename arch_init.h to arch_type.h

2020-11-25 Thread Eduardo Habkost
The only declarations in arch_init.h are related to the arch_type variable (which is a useful feature that allows us to simplify command line option handling). Rename the header to reflect its purpose. Signed-off-by: Eduardo Habkost --- Cc: Markus Armbruster Cc: Kevin Wolf Cc: Max Reitz Cc

[PATCH v2 2/6] accel: accel_available() function

2020-11-25 Thread Eduardo Habkost
This function will be used to replace the xen_available() and kvm_available() functions from arch_init.c. Signed-off-by: Eduardo Habkost --- Cc: Richard Henderson Cc: Paolo Bonzini Cc: Claudio Fontana Cc: Roman Bolshakov --- include/sysemu/accel.h | 1 + accel/accel.c | 5 + 2

[PATCH v2 0/6] arch_init.c cleanup

2020-11-25 Thread Eduardo Habkost
...@redhat.com Eduardo Habkost (6): arch_init: Move QEMU_ARCH definitions to cpu.h accel: accel_available() function kvm: Remove kvm_available() function xen: Delete xen_available() function Remove unnecessary usage of arch_init.h Rename arch_init.h to arch_type.h include/sysemu/accel.h

[PATCH v2 1/6] arch_init: Move QEMU_ARCH definitions to cpu.h

2020-11-25 Thread Eduardo Habkost
Instead of a collection of #ifdefs on arch_init.c, define QEMU_ARCH inside each cpu.h file. Signed-off-by: Eduardo Habkost --- Cc: Richard Henderson Cc: Peter Maydell Cc: Michael Rolnik Cc: Sarah Harris Cc: "Edgar E. Iglesias" Cc: Paolo Bonzini Cc: Eduardo Habkost Cc: Michael

Re: [PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-25 Thread Eduardo Habkost
On Wed, Nov 25, 2020 at 07:40:48AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Tue, Nov 24, 2020 at 04:20:37PM +0100, Markus Armbruster wrote: > >> Eduardo Habkost writes: > >> > >> > On Tue, Nov 24, 2020 at 09:49:30AM +0100

Re: [RFC v5 12/12] accel: centralize initialization of CpusAccelOps

2020-11-25 Thread Eduardo Habkost
On Wed, Nov 25, 2020 at 12:48:22PM +0100, Claudio Fontana wrote: > On 11/25/20 10:32 AM, Claudio Fontana wrote: > > On 11/24/20 9:34 PM, Eduardo Habkost wrote: > >> On Tue, Nov 24, 2020 at 08:39:33PM +0100, Claudio Fontana wrote: > >>> On 11/24/20 8:27 PM, Eduardo Hab

Re: [RFC v5 11/12] i386: centralize initialization of cpu accel interfaces

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 09:13:13PM +0100, Paolo Bonzini wrote: > On 24/11/20 17:22, Claudio Fontana wrote: > > +static void x86_cpu_accel_init(void) > > { > > -X86CPUAccelClass *acc; > > +const char *ac_name; > > +ObjectClass *ac; > > +char *xac_name; > > +ObjectClass *xac; >

Re: [RFC v5 12/12] accel: centralize initialization of CpusAccelOps

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 08:39:33PM +0100, Claudio Fontana wrote: > On 11/24/20 8:27 PM, Eduardo Habkost wrote: > > On Tue, Nov 24, 2020 at 07:52:15PM +0100, Claudio Fontana wrote: > > [...] > >>>> +} > >>> > >>> Additionally, if you

Re: [RFC v5 12/12] accel: centralize initialization of CpusAccelOps

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 07:52:15PM +0100, Claudio Fontana wrote: [...] > >> +} > > > > Additionally, if you call arch_cpu_accel_init() here, you won't > > need MODULE_INIT_ACCEL_CPU anymore. The > > > > module_call_init(MODULE_INIT_ACCEL_CPU) > > > > call with implicit dependencies on

Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 07:29:50PM +0100, Claudio Fontana wrote: > On 11/24/20 6:08 PM, Eduardo Habkost wrote: > > On Tue, Nov 24, 2020 at 05:22:07PM +0100, Claudio Fontana wrote: > >> apply this to the registration of the cpus accel interfaces, > >> > >>

Re: [RFC v5 08/12] accel: extend AccelState and AccelClass to user-mode

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 05:22:06PM +0100, Claudio Fontana wrote: > Signed-off-by: Claudio Fontana > --- [...] > @@ -908,8 +909,12 @@ int main(int argc, char **argv) > } > > /* init tcg before creating CPUs and to get qemu_host_page_size */ > -tcg_exec_init(0); > +{ > +

Re: [RFC v5 12/12] accel: centralize initialization of CpusAccelOps

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 05:22:10PM +0100, Claudio Fontana wrote: > Signed-off-by: Claudio Fontana > --- > accel/kvm/kvm-all.c | 9 --- > accel/kvm/kvm-cpus.c | 26 +- > accel/kvm/kvm-cpus.h | 2 -- > accel/qtest/qtest.c | 31

Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 05:22:07PM +0100, Claudio Fontana wrote: > apply this to the registration of the cpus accel interfaces, > > but this will be also in preparation for later use of this > new module init step to also register per-accel x86 cpu type > interfaces. > > Signed-off-by: Claudio

Re: [RFC v5 11/12] i386: centralize initialization of cpu accel interfaces

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 05:22:09PM +0100, Claudio Fontana wrote: > Signed-off-by: Claudio Fontana Probably this can be squashed into patch 10/12. > --- > target/i386/cpu-qom.h | 2 -- > target/i386/cpu.c | 27 --- > target/i386/hvf/cpu.c | 9 - >

Re: [PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 04:20:37PM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Tue, Nov 24, 2020 at 09:49:30AM +0100, Markus Armbruster wrote: > >> Eduardo Habkost writes: > >> > >> > On Mon, Nov 23, 2020 at 08:51:27AM +0100

[PULL 1/1] Revert "hw/core/qdev-properties: Use qemu_strtoul() in set_pci_host_devaddr()"

2020-11-24 Thread Eduardo Habkost
Klaus Herman Reported-by: Geoffrey McRae Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Cc: "Philippe Mathieu-Daudé" Message-Id: <20201120130409.956956-1-...@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-properties-system.c | 25 ++

[PULL 0/1] PCI host devaddr property fix for 5.2

2020-11-24 Thread Eduardo Habkost
The following changes since commit d536d9578ec3ac5029a70b8126cb84bb6f2124a4: Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2020-11-24 10:59:12 +) are available in the Git repository at: git://github.com/ehabkost/qemu.git

Re: [PATCH for-5.2] Revert "hw/core/qdev-properties: Use qemu_strtoul() in set_pci_host_devaddr()"

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 03:13:14PM +0100, Philippe Mathieu-Daudé wrote: > On 11/20/20 2:10 PM, Paolo Bonzini wrote: > > On 20/11/20 14:04, Michael S. Tsirkin wrote: > >> This reverts commit bccb20c49df1bd683248a366021973901c11982f as it > >> introduced a regression blocking bus addresses > 0x1f or

Re: [PATCH v3 10/19] qlit: Support all types of QNums

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 01:22:02PM +0100, Markus Armbruster wrote: > Paolo Bonzini writes: > > > On 24/11/20 10:55, Markus Armbruster wrote: > >>> +/* Larger than UINT64_MAX: */ > >>> +QLIT_QNUM_DOUBLE(18446744073709552e3), > >>> +/* Smaller than INT64_MIN: */ > >>> +

Re: [PATCH v3 08/19] qlit: Move qlit_equal_qobject() reference values to array

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 10:51:34AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > Add an array of values to qlit_equal_qobject_test(), so we can > > extend the test case to compare multiple literals, not just the > > ones at the existing `qlit`

Re: [PATCH v3 11/19] qom: field_prop_set_default_value() helper

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 10:58:27AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > Move code that sets the property default value to a separate > > function, to reduce duplication and make refactoring easier. > > > > Signed-off-by: Eduardo Habkost &

Re: [PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-24 Thread Eduardo Habkost
On Tue, Nov 24, 2020 at 09:49:30AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Mon, Nov 23, 2020 at 08:51:27AM +0100, Markus Armbruster wrote: > >> Eduardo Habkost writes: > >> > >> > On Fri, Nov 20, 2020 at

[PATCH v3 16/19] qom: Make PropertyInfo.set_default_value optional

2020-11-23 Thread Eduardo Habkost
If .set_default_value is not set, call object_property_set_default(). This will let us delete most of the .set_default_value functions later. Signed-off-by: Eduardo Habkost --- This is a new patch in v3 of this series. In v2 of the series, equivalent functionality was implemented by "qom

[PATCH v3 15/19] qom: Make object_property_set_default() public

2020-11-23 Thread Eduardo Habkost
The function will be used outside qom/object.c, to simplify the field property code that sets the property default value. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- include/qom/object.h | 11 +++ qom/object.c | 2 +- 2 files changed, 12 insertions(+), 1

[PATCH v3 13/19] qom: Fix documentation of UUID property type

2020-11-23 Thread Eduardo Habkost
On some cases, the documentation for UUID properties is lying: properties defined using DEFINE_PROP_UUID_NODEFAULT are not set to "auto" by default. It's better to omit this instead of providing incorrect information. Signed-off-by: Eduardo Habkost --- This is a new patch ad

[PATCH v3 11/19] qom: field_prop_set_default_value() helper

2020-11-23 Thread Eduardo Habkost
Move code that sets the property default value to a separate function, to reduce duplication and make refactoring easier. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. Hopefully, this will make the series easier to review. The field_prop_set_default_value

[PATCH v3 17/19] qom: Delete field_prop_set_default_value_*int()

2020-11-23 Thread Eduardo Habkost
The field_prop_set_default_value_*int() functions can be completely replaced by object_propert_set_default(), we don't need them anymore. Signed-off-by: Eduardo Habkost --- This is a new patch in v3 of this series. In v2 of the series, equivalent changes were part of "qom: Use qlit to repr

[PATCH v3 14/19] qom: Don't ignore defval on UUID property

2020-11-23 Thread Eduardo Habkost
UUID properties were weird because the value of .defval was completely ignored. Fix this by setting the default value to QLIT_QSTR("auto") on the default case, and actually using .defval inside .set_default_value. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of t

[PATCH v3 03/19] qnum: QNumValue type for QNum value literals

2020-11-23 Thread Eduardo Habkost
Provide a separate QNumValue type that can be used for QNum value literals without the referencing counting and memory allocation features provided by QObject. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Fixed copy-pasta at qnum_from_value() documentation * Removed qnum_get_va

[PATCH v3 04/19] qnum: qnum_value_is_equal() function

2020-11-23 Thread Eduardo Habkost
Extract the QNum value comparison logic to a function that takes QNumValue* as argument. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Rename function parameters to val_x/val_y * Insert blank line after variable declarations at qnum_is_equal() --- include/qapi/qmp/qnum.h |

[PATCH v3 19/19] qom: Delete set_default_value_bool()

2020-11-23 Thread Eduardo Habkost
set_default_value_bool() can be completely replaced by object_property_set_default(), we don't need that function anymore. Signed-off-by: Eduardo Habkost --- This is a new patch in v3 of this series. In v2 of the series, equivalent changes were part of "qom: Use qlit to represent pro

[PATCH v3 12/19] qom: Replace defval value in Property with QLitObject

2020-11-23 Thread Eduardo Habkost
al type of .defval is validated before it is used. Also note that set_default_uuid_auto() is a bit weird: it ignores .defval completely. This patch keeps the existing behavior, and set_default_uuid_auto() weirdness will be addressed later. Signed-off-by: Eduardo Habkost --- This is a new

[PATCH v3 09/19] qlit: Add more test literals to qlit_equal_qobject() test case

2020-11-23 Thread Eduardo Habkost
Add a few examples of each qlit type, to make sure each one compare as equal to itself, but not equal to the other values. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. --- tests/check-qlit.c | 16 1 file changed, 16 insertions(+) diff

[PATCH v3 02/19] qnum: Make num_x/num_y variables at qnum_is_equal() const

2020-11-23 Thread Eduardo Habkost
qobject_to() drops const-ness by accident, but our function arguments (x, y) are const. Make num_x/num_y const too. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of the series. --- qobject/qnum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v3 18/19] qom: Delete set_default_uuid()

2020-11-23 Thread Eduardo Habkost
The function can be completely replaced by object_property_set_default(), we don't need it anymore. Signed-off-by: Eduardo Habkost --- This is a new patch in v3 of this series. In v2 of the series, equivalent changes were part of "qom: Use qlit to represent property defaults". --- hw

[PATCH v3 06/19] qlit: Rename QLIT_QNUM to QLIT_QNUM_INT

2020-11-23 Thread Eduardo Habkost
Rename the existing QLIT_QNUM macro to indicate it only supports signed int values. We're going to add support to other types of QNums later. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. In v2, the existing QLIT_QNUM() macro was being kept, now

[PATCH v3 08/19] qlit: Move qlit_equal_qobject() reference values to array

2020-11-23 Thread Eduardo Habkost
Add an array of values to qlit_equal_qobject_test(), so we can extend the test case to compare multiple literals, not just the ones at the existing `qlit` and `qlit_foo` variables. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. --- tests/check-qlit.c | 26

[PATCH v3 10/19] qlit: Support all types of QNums

2020-11-23 Thread Eduardo Habkost
Add two new macros to support other types of QNums: QLIT_QNUM_UINT, and QLIT_QNUM_DOUBLE, and include them in the qlit_equal_qobject_test() test case. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * QLIT_QNUM macro doesn't exist anymore * Addition of the QNumValue field to QLitObj

[PATCH v3 01/19] qnum: Make qnum_get_double() get const pointer

2020-11-23 Thread Eduardo Habkost
qnum_get_double() won't change the object, the argument can be const. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- include/qapi/qmp/qnum.h | 2 +- qobject/qnum.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qapi/qmp/qnum.h b

[PATCH v3 05/19] qlit: Use qnum_value_is_equal() when comparing QNums

2020-11-23 Thread Eduardo Habkost
Currently, qlit_equal_qobject() crashes if getting a QNum that can't be represented as int64. Fix this by using qnum_value_is_equal(). Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of the series. --- qobject/qlit.c | 3 ++- tests/check-qlit.c | 19

[PATCH v3 07/19] qlit: Use QNumValue to represent QNums

2020-11-23 Thread Eduardo Habkost
Replace the existing int64_t field in QLitObject with QNumValue, so we can get support for other QNum types for free. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of the series. It includes portions of a previous patch from v2: "qlit: Support all types of

[PATCH v3 00/19] qom: Use qlit to represent property defaults

2020-11-23 Thread Eduardo Habkost
review easier * Small changes in UUID property code (See "qom: Don't ignore defval on UUID property" and "qom: Fix documentation of UUID property type") Changes v1 -> v2: * Rebase to latest version of field properties series * Fix unit test failure * Coding sty

Re: [PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-23 Thread Eduardo Habkost
On Mon, Nov 23, 2020 at 08:51:27AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Fri, Nov 20, 2020 at 06:29:16AM +0100, Markus Armbruster wrote: > [...] > >> When the structure of a data type is to be kept away from its users, I > >> pr

Re: [RFC v3 9/9] i386: split cpu accelerators from cpu.c

2020-11-23 Thread Eduardo Habkost
On Fri, Nov 20, 2020 at 10:08:46AM +0100, Claudio Fontana wrote: > On 11/19/20 8:23 PM, Eduardo Habkost wrote: > > On Thu, Nov 19, 2020 at 09:53:09AM +0100, Claudio Fontana wrote: > >> Hi, > >> > >> On 11/18/20 7:28 PM, Eduardo Habkost wrote: > >>> O

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-23 Thread Eduardo Habkost
On Mon, Nov 23, 2020 at 04:02:24PM +0100, Claudio Fontana wrote: > On 11/23/20 2:18 PM, Paolo Bonzini wrote: > > On 23/11/20 10:55, Claudio Fontana wrote: > >> One idea that came to mind is, why not extend accel.h to user mode? > >> > >> It already contains > >> > >> #ifndef CONFIG_USER_ONLY > >>

Re: [RFC v4 9/9] i386: split cpu accelerators from cpu.c

2020-11-20 Thread Eduardo Habkost
On Fri, Nov 20, 2020 at 07:47:11PM +0100, Claudio Fontana wrote: > On 11/20/20 6:44 PM, Eduardo Habkost wrote: > > On Fri, Nov 20, 2020 at 03:49:09PM +0100, Claudio Fontana wrote: > >> split cpu.c into: > >> > >> cpu.ccpuid and common x86 cpu func

Re: [PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-20 Thread Eduardo Habkost
On Fri, Nov 20, 2020 at 06:29:16AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Thu, Nov 19, 2020 at 11:24:52AM +0100, Markus Armbruster wrote: > >> Marc-André Lureau writes: > >> > >> > On Tue, Nov 17, 2020 at 6:42 PM Eduardo Hab

Re: [PATCH v2 4/8] qnum: qnum_value_is_equal() function

2020-11-20 Thread Eduardo Habkost
On Fri, Nov 20, 2020 at 07:52:31AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Thu, Nov 19, 2020 at 11:27:40AM +0100, Markus Armbruster wrote: > > [...] > >> > +bool qnum_is_equal(const QObject *x, const QObject *y) > >> > +{ &

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-20 Thread Eduardo Habkost
On Fri, Nov 20, 2020 at 06:41:35PM +0100, Claudio Fontana wrote: > On 11/20/20 6:19 PM, Eduardo Habkost wrote: > > On Fri, Nov 20, 2020 at 01:13:33PM +0100, Claudio Fontana wrote: > >> On 11/18/20 11:07 PM, Eduardo Habkost wrote: > >>> On Wed, Nov 18, 2020 at 08:13:1

Re: [RFC v4 9/9] i386: split cpu accelerators from cpu.c

2020-11-20 Thread Eduardo Habkost
On Fri, Nov 20, 2020 at 03:49:09PM +0100, Claudio Fontana wrote: > split cpu.c into: > > cpu.ccpuid and common x86 cpu functionality > host-cpu.c host x86 cpu functions and "host" cpu type > kvm/cpu.cKVM x86 cpu type > hvf/cpu.cHVF x86 cpu type > tcg/cpu.c

Re: [RFC v4 9/9] i386: split cpu accelerators from cpu.c

2020-11-20 Thread Eduardo Habkost
On Fri, Nov 20, 2020 at 04:34:47PM +0100, Claudio Fontana wrote: > On 11/20/20 3:49 PM, Claudio Fontana wrote: > > split cpu.c into: > > > > cpu.ccpuid and common x86 cpu functionality > > host-cpu.c host x86 cpu functions and "host" cpu type > > kvm/cpu.cKVM x86 cpu

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-20 Thread Eduardo Habkost
On Fri, Nov 20, 2020 at 01:13:33PM +0100, Claudio Fontana wrote: > On 11/18/20 11:07 PM, Eduardo Habkost wrote: > > On Wed, Nov 18, 2020 at 08:13:18PM +0100, Paolo Bonzini wrote: > >> On 18/11/20 18:30, Eduardo Habkost wrote: > >>>> Adding a layer of indirect

Re: [PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 01:21:58PM -0500, Eduardo Habkost wrote: > On Thu, Nov 19, 2020 at 11:24:52AM +0100, Markus Armbruster wrote: [...] > > >> > > +return qnum_from_value((QNumValue) QNUM_VAL_INT(value)); > > > > No space between between (type) and its o

Re: [RFC v3 9/9] i386: split cpu accelerators from cpu.c

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 09:53:09AM +0100, Claudio Fontana wrote: > Hi, > > On 11/18/20 7:28 PM, Eduardo Habkost wrote: > > On Wed, Nov 18, 2020 at 11:29:36AM +0100, Claudio Fontana wrote: > >> split cpu.c into: > >> > >> cpu.ccpuid and co

Re: [PATCH v2 0/8] qom: Use qlit to represent property defaults

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 07:25:15PM +0100, Paolo Bonzini wrote: > On 19/11/20 18:55, Eduardo Habkost wrote: > > On Thu, Nov 19, 2020 at 06:23:30PM +0100, Paolo Bonzini wrote: > > > On 19/11/20 18:13, Eduardo Habkost wrote: > > > > > What's left? > >

Re: [PATCH v2 5/8] qlit: Support all types of QNums

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 11:39:14AM +0100, Markus Armbruster wrote: > Marc-André Lureau writes: > > > On Tue, Nov 17, 2020 at 2:48 AM Eduardo Habkost wrote: > > > >> Use QNumValue to represent QNums, so we can also support uint64_t > >> and double QNum values.

Re: [PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 11:24:52AM +0100, Markus Armbruster wrote: > Marc-André Lureau writes: > > > On Tue, Nov 17, 2020 at 6:42 PM Eduardo Habkost wrote: > > > >> On Tue, Nov 17, 2020 at 12:37:56PM +0400, Marc-André Lureau wrote: > >> > On Tue,

Re: [PATCH v2 4/8] qnum: qnum_value_is_equal() function

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 11:27:40AM +0100, Markus Armbruster wrote: [...] > > +bool qnum_is_equal(const QObject *x, const QObject *y) > > +{ > > +const QNum *qnum_x = qobject_to(QNum, x); > > +const QNum *qnum_y = qobject_to(QNum, y); > > Humor me: blank line between declarations and

Re: [PATCH v2 1/8] qobject: Include API docs in docs/devel/qobject.html

2020-11-19 Thread Eduardo Habkost
CCing Peter, Sphinx documentation machinery maintainer. On Thu, Nov 19, 2020 at 10:37:22AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > Render existing doc comments at docs/devel/qobject.html. > > > > Signed

Re: [PATCH v2 6/8] qlit: qlit_type() function

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 11:41:05AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > Useful function where we need to check for the qlit type before > > converting it to an actual QObject. > > > > Signed-off-by: Eduardo Habkost > > --- > >

Re: [PATCH v2 0/8] qom: Use qlit to represent property defaults

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 06:23:30PM +0100, Paolo Bonzini wrote: > On 19/11/20 18:13, Eduardo Habkost wrote: > > > What's left? > > Enums. Enums properties are a mess to implement, and I plan to > > tackle them later. > > > > On all other cases, the ext

Re: [PATCH v2 0/8] qom: Use qlit to represent property defaults

2020-11-19 Thread Eduardo Habkost
On Thu, Nov 19, 2020 at 01:39:50PM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > Based-on: 20201104160021.2342108-1-ehabk...@redhat.com > > Git branch: > > https://gitlab.com/ehabkost/qemu/-/commits/work/qdev-qlit-defaults > > > > This ext

Re: [PATCH RFC v3 23/23] i386: provide simple 'hyperv=on' option to x86 machine types

2020-11-18 Thread Eduardo Habkost
dering that the KVM changes might take a while to be merged. Would you be able to submit this independently from the rest of the series? You can add my: Reviewed-by: Eduardo Habkost My only (minor) suggestion is to rename X86MachineClass.hyperv_features to X86MachineClass.default_hyperv_features. >

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 08:13:18PM +0100, Paolo Bonzini wrote: > On 18/11/20 18:30, Eduardo Habkost wrote: > > > Adding a layer of indirect calls is not very different from monkey > > > patching > > > though. > > > > I'm a little bothered by monkey pat

Re: [RFC v3 9/9] i386: split cpu accelerators from cpu.c

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 11:29:36AM +0100, Claudio Fontana wrote: > split cpu.c into: > > cpu.ccpuid and common x86 cpu functionality > host-cpu.c host x86 cpu functions and "host" cpu type > kvm/cpu.cKVM x86 cpu type > hvf/cpu.cHVF x86 cpu type > tcg/cpu.c

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 05:22:46PM +0100, Paolo Bonzini wrote: > Il mer 18 nov 2020, 17:11 Eduardo Habkost ha scritto: > > > On Wed, Nov 18, 2020 at 04:43:19PM +0100, Paolo Bonzini wrote: > > > Il mer 18 nov 2020, 16:26 Eduardo Habkost ha > > scritto: > > &g

Re: [PATCH for-6.0 1/6] qapi: Add query-accel command

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 09:56:28AM -0600, Eric Blake wrote: > On 11/18/20 9:45 AM, Eduardo Habkost wrote: > > On Wed, Nov 18, 2020 at 02:53:26PM +0100, Markus Armbruster wrote: > > [...] > >> Another way to skin this cat: > >> > >>

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 04:43:19PM +0100, Paolo Bonzini wrote: > Il mer 18 nov 2020, 16:26 Eduardo Habkost ha scritto: > > > > > > The alternative is to store the (type, function) tuple directly, with the > > > type as a string. Then you can just use type_ini

Re: [PATCH for-6.0 1/6] qapi: Add query-accel command

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 02:53:26PM +0100, Markus Armbruster wrote: [...] > Another way to skin this cat: > > {"available": {"kvm": { extra properties... }, > "tcg": ..., > "xen": ...}, >"active": "kvm"} How would this structure be

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 03:51:44PM +0100, Paolo Bonzini wrote: > On 18/11/20 15:36, Eduardo Habkost wrote: > > On Wed, Nov 18, 2020 at 03:05:42PM +0100, Paolo Bonzini wrote: > > > On 18/11/20 14:48, Claudio Fontana wrote: > > > > On 11/18/20 1:48 PM, Eduardo Habkos

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 03:05:42PM +0100, Paolo Bonzini wrote: > On 18/11/20 14:48, Claudio Fontana wrote: > > On 11/18/20 1:48 PM, Eduardo Habkost wrote: > > > On Wed, Nov 18, 2020 at 11:29:35AM +0100, Claudio Fontana wrote: > > > > apply this to the registratio

Re: [RFC v3 8/9] module: introduce MODULE_INIT_ACCEL_CPU

2020-11-18 Thread Eduardo Habkost
On Wed, Nov 18, 2020 at 11:29:35AM +0100, Claudio Fontana wrote: > apply this to the registration of the cpus accel interfaces, > > but this will be also in preparation for later use of this > new module init step to also defer the registration of the cpu models, > in order to make them

Re: Property '.hmat' not found

2020-11-18 Thread Eduardo Habkost
re are not many CPU cache configuration options in qemu-system-x86_64 today, except for "l3-cache" and "host-cache-info" -cpu options. > > Thank you very much, really help me a lot. No problem! > > Sincerely, > Jack > > Eduardo Habkost 於 2020年11月17日 週

Re: [PATCH v2 02/16] qapi/expr.py: Check for dict instead of OrderedDict

2020-11-17 Thread Eduardo Habkost
On Tue, Nov 17, 2020 at 05:30:04PM +0100, Markus Armbruster wrote: > John Snow writes: > > > OrderedDict is a subtype of dict, so we can check for a more general form. > > > > Signed-off-by: John Snow > > Reviewed-by: Eduardo Habkost > > Reviewed-by: Cl

Re: [PATCH v2 4/8] qnum: qnum_value_is_equal() function

2020-11-17 Thread Eduardo Habkost
On Tue, Nov 17, 2020 at 08:53:19PM +0400, Marc-André Lureau wrote: > On Tue, Nov 17, 2020 at 7:49 PM Eduardo Habkost wrote: > > > On Tue, Nov 17, 2020 at 12:42:47PM +0400, Marc-André Lureau wrote: > > > On Tue, Nov 17, 2020 at 2:42 AM Eduardo Habkost > > wrote: >

Re: [PATCH v2 4/8] qnum: qnum_value_is_equal() function

2020-11-17 Thread Eduardo Habkost
On Tue, Nov 17, 2020 at 12:42:47PM +0400, Marc-André Lureau wrote: > On Tue, Nov 17, 2020 at 2:42 AM Eduardo Habkost wrote: > > > Extract the QNum value comparison logic to a function that takes > > QNumValue* as argument. > > > > Signed-off-by: Eduardo Habkost

Re: Property '.hmat' not found

2020-11-17 Thread Eduardo Habkost
e usb) > pc-i440fx-4.2.kernel-irqchip=on|off|split (Configure KVM in-kernel irqchip) > pc-i440fx-4.2.graphics=bool (Set on/off to enable/disable graphics > emulation) > pc-i440fx-4.2.initrd=string (Linux initial ramdisk file) > pc-i440fx-4.2.dt-compatible=string (Overrides the &quo

Re: [PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-17 Thread Eduardo Habkost
On Tue, Nov 17, 2020 at 12:37:56PM +0400, Marc-André Lureau wrote: > On Tue, Nov 17, 2020 at 2:43 AM Eduardo Habkost wrote: > > > Provide a separate QNumValue type that can be used for QNum value > > literals without the referencing counting and memory allocation > > feat

[PATCH v2 6/8] qlit: qlit_type() function

2020-11-16 Thread Eduardo Habkost
Useful function where we need to check for the qlit type before converting it to an actual QObject. Signed-off-by: Eduardo Habkost --- include/qapi/qmp/qlit.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h index f9e356d31e..acddb80831

[PATCH v2 5/8] qlit: Support all types of QNums

2020-11-16 Thread Eduardo Habkost
Use QNumValue to represent QNums, so we can also support uint64_t and double QNum values. Add new QLIT_QNUM_(INT|UINT|DOUBLE) macros for each case. The QLIT_QNUM() macro is being kept for compatibility with existing code, but becomes just a wrapper for QLIT_QNUM_INT(). Signed-off-by: Eduardo

[PATCH v2 8/8] qom: Use qlit to represent property defaults

2020-11-16 Thread Eduardo Habkost
Using QLitObject lets us get rid of most of the .set_default_value functions, and just use object_property_set_default() directly. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Instead of initializing defval to QLIT_QNULL by default, just check for QTYPE_NONE, to find out if .def

[PATCH v2 0/8] qom: Use qlit to represent property defaults

2020-11-16 Thread Eduardo Habkost
rid of most type-specific .set_default_value functions for QOM property types. Changes v1 -> v2: * Rebase to latest version of field properties series * Fix unit test failure * Coding style changes Eduardo Habkost (8): qobject: Include API docs in docs/devel/qobject.html qnum: M

[PATCH v2 7/8] qom: Make object_property_set_default() public

2020-11-16 Thread Eduardo Habkost
The function will be used outside qom/object.c, to simplify the field property code that sets the property default value. Signed-off-by: Eduardo Habkost --- include/qom/object.h | 11 +++ qom/object.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git

[PATCH v2 1/8] qobject: Include API docs in docs/devel/qobject.html

2020-11-16 Thread Eduardo Habkost
Render existing doc comments at docs/devel/qobject.html. Signed-off-by: Eduardo Habkost --- docs/devel/index.rst | 1 + docs/devel/qobject.rst | 11 + include/qapi/qmp/qnum.h| 4 +++- include/qapi/qmp/qobject.h | 48 +- qobject/qnum.c

[PATCH v2 2/8] qnum: Make qnum_get_double() get const pointer

2020-11-16 Thread Eduardo Habkost
qnum_get_double() won't change the object, the argument can be const. Signed-off-by: Eduardo Habkost --- include/qapi/qmp/qnum.h | 2 +- qobject/qnum.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qapi/qmp/qnum.h b/include/qapi/qmp/qnum.h index

[PATCH v2 3/8] qnum: QNumValue type for QNum value literals

2020-11-16 Thread Eduardo Habkost
Provide a separate QNumValue type that can be used for QNum value literals without the referencing counting and memory allocation features provided by QObject. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Fix "make check" failure, by updating check-qnum unit test to

[PATCH v2 4/8] qnum: qnum_value_is_equal() function

2020-11-16 Thread Eduardo Habkost
Extract the QNum value comparison logic to a function that takes QNumValue* as argument. Signed-off-by: Eduardo Habkost --- include/qapi/qmp/qnum.h | 1 + qobject/qnum.c | 29 +++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/qapi

Re: [PATCH for-6.0 1/6] qapi: Add query-accel command

2020-11-16 Thread Eduardo Habkost
On Mon, Nov 16, 2020 at 10:20:04AM -0600, Eric Blake wrote: > On 11/16/20 7:10 AM, Roman Bolshakov wrote: > > There's a problem for management applications to determine if certain > > accelerators available. Generic QMP command should help with that. > > > > Signed-off-by: Roman Bolshakov > >

Re: Property '.hmat' not found

2020-11-16 Thread Eduardo Habkost
On Mon, Nov 16, 2020 at 01:51:37PM +0100, Philippe Mathieu-Daudé wrote: > Cc'ing Igor & Eduardo. Thanks! > > On 11/13/20 10:17 AM, Jack wrote: > > Hi all, > > > > As I follow the document[1] to enable hmat, it fails and shows the message: > >   qemu-system-x86_64: Property '.hmat' not found >

[PATCH v3 53/53] sev: Use class properties

2020-11-12 Thread Eduardo Habkost
Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. There was another version of this patch inside series: Subject: [PATCH 00/12]

[PATCH v3 51/53] qom: PROP_* macros

2020-11-12 Thread Eduardo Habkost
The new helper macros are similar to the old DEFINE_PROP_* macros, but don't take a name argument. They can be used directly as argument to object_class_property_add_field(). The DEFINE_PROP_* macros were redefined to just be wrappers to PROP_*. Signed-off-by: Eduardo Habkost --- Changes v2

[PATCH v3 50/53] qom: Delete DEFINE_PROP_*SIGNED_NODEFAULT macro

2020-11-12 Thread Eduardo Habkost
Those macros are exactly the same as DEFINE_PROP, we can use DEFINE_PROP directly. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of this series. --- Cc: Alex Williamson Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: Peter Maydell Cc:

[PATCH v3 46/53] qdev: Move base property types to qom/property-types.c

2020-11-12 Thread Eduardo Habkost
Move all property types from qdev-properties.c to qom/property-types.c. Declarations are moved from hw/qdev-properties.h to qom/property-types.h. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Redone after changes in previous patches in this series * Reordered patch, tried to

[PATCH v3 52/53] tests: Use field property at check-qom-proplist test case

2020-11-12 Thread Eduardo Habkost
Use the field property system for the "sv" property used at check-qom-proplist. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Don't register a instance field property, as object_property_add_field() is an internal API Changes v1 -> v2: * Use PROP_* and object_class_pr

[PATCH v3 44/53] qom: Add new qom.h header

2020-11-12 Thread Eduardo Habkost
Multiple QOM features will be provided by different headers. Add a qom/qom.h header to make it easier to include all of them at once. Signed-off-by: Eduardo Habkost --- This is a new patch added in v3 of the series. --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost

[PATCH v3 42/53] qdev: Reuse object_property_add_field() when adding array elements

2020-11-12 Thread Eduardo Habkost
Now that we call object_property_add() with exactly the same arguments as object_property_add_field() does, we can just reuse the function. We can now use a stack variable for the new Property struct, because object_property_add_field() will copy the struct. Signed-off-by: Eduardo Habkost

<    2   3   4   5   6   7   8   9   10   11   >