Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework

2020-11-26 Thread Eduardo Habkost
vms->highmem = false; > +} Direct checks for *_enabled() are a pain to clean up later when we add support to new accelerators. Can't this be implemented as (e.g.) a AccelClass::max_physical_address_bits field? > + > /* > * In accelerated mode, the memory map is computed earlier in kvm_type() > * to create a VM with the right number of IPA bits. > -- > 2.24.3 (Apple Git-128) > -- Eduardo

Re: [PATCH 0/8] hvf: Implement Apple Silicon Support

2020-11-26 Thread Eduardo Habkost
> create mode 100644 target/arm/hvf/meson.build > delete mode 100644 target/i386/hvf/hvf-cpus.c > delete mode 100644 target/i386/hvf/hvf-cpus.h > > -- > 2.24.3 (Apple Git-128) > -- Eduardo

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

2020-11-26 Thread Eduardo Habkost
inary" is not something you need after > > startup (or if querying the monitor). > > > > Paolo > > > > > > A script that repeatedly uses the QMP interface to query for > the status could generate fragmentation this way I think. Is this a problem? Today, execution of a "query-kvm" command calls g_malloc() 37 times. -- Eduardo

Re: [PATCH-for-6.0 v4 15/17] gitlab-ci: Add test for Xen (on CentOS 7)

2020-11-26 Thread Eduardo Habkost
never been in CentOS 8, I'm working on it, slowly. > > > Signed-off-by: Philippe Mathieu-Daudé > > --- > > Cc: Eduardo Habkost > > Cc: Stefano Stabellini > > Cc: Anthony Perard > > Cc: Paul Durrant > > Cc: xen-de...@lists.xenproject.org > >

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

2020-11-26 Thread Eduardo Habkost
On Thu, Nov 26, 2020 at 04:34:17PM +0100, Claudio Fontana wrote: > On 11/26/20 4:14 PM, Eduardo Habkost wrote: > > On Thu, Nov 26, 2020 at 03:55:37PM +0100, Claudio Fontana wrote: > >> On 11/26/20 3:49 PM, Eduardo Habkost wrote: > >>> On Thu, Nov 26, 2020 at 03:33:17P

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

2020-11-26 Thread Eduardo Habkost
On Thu, Nov 26, 2020 at 03:55:37PM +0100, Claudio Fontana wrote: > On 11/26/20 3:49 PM, Eduardo Habkost wrote: > > On Thu, Nov 26, 2020 at 03:33:17PM +0100, Claudio Fontana wrote: > >> On 11/26/20 2:44 PM, Eduardo Habkost wrote: > >>> On Thu, Nov 26, 2020 at 11:57:28A

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

2020-11-26 Thread Eduardo Habkost
On Thu, Nov 26, 2020 at 03:33:17PM +0100, Claudio Fontana wrote: > On 11/26/20 2:44 PM, Eduardo Habkost wrote: > > On Thu, Nov 26, 2020 at 11:57:28AM +0100, Claudio Fontana wrote: > >> On 11/24/20 10:31 PM, Eduardo Habkost wrote: > >>> On Tue, Nov 24, 2020 at 09:13:1

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

2020-11-26 Thread Eduardo Habkost
On Thu, Nov 26, 2020 at 11:57:28AM +0100, Claudio Fontana wrote: > On 11/24/20 10:31 PM, Eduardo Habkost wrote: > > On Tue, Nov 24, 2020 at 09:13:13PM +0100, Paolo Bonzini wrote: > >> On 24/11/20 17:22, Claudio Fontana wrote: > >>> +stati

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
-x86. accel.c can't use cpu.h, correct? We can add a: CPUClass *arch_base_cpu_type(void) { return object_class_by_name(CPU_RESOLVING_TYPE); } function to arch_init.c, to allow target-independent code call target-specific code. -- Eduardo

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
2 additional lines of code: - the cpus_register_accel() call - the x86_cpu_accel_init() call What makes those 2 lines of code so special, to make them deserve a completely new mechanism to trigger them, instead of using trivial function calls inside a accel_init() function? -- Eduardo

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
el_init(AccelState*) function and a void (*init)(AccelState*) method in AccelClass. Then the whole code block above would be as trivial as: accel_init(current_accel()); > +} [...] > -- Eduardo

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

2020-11-24 Thread Eduardo Habkost
ize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm, > +ops->create_vcpu_thread = whpx_start_vcpu_thread; > +ops->kick_vcpu_thread = whpx_kick_vcpu_thread; > + > +ops->synchronize_post_reset = whpx_cpu_synchronize_post_reset; > +ops->synchronize_post_init = whpx_cpu_synchronize_post_init; > +ops->synchronize_state = whpx_cpu_synchronize_state; > +ops->synchronize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm; > +}; > +static const TypeInfo whpx_cpus_type_info = { > +.name = CPUS_ACCEL_TYPE_NAME("whpx"), > + > +.parent = TYPE_CPUS_ACCEL_OPS, > +.class_init = whpx_cpus_class_init, > +.abstract = true, > }; > +static void whpx_cpus_register_types(void) > +{ > +type_register_static(_cpus_type_info); > +} > +type_init(whpx_cpus_register_types); > diff --git a/target/i386/whpx/whpx-cpus.h b/target/i386/whpx/whpx-cpus.h > index bdb367d1d0..2dee6d61ea 100644 > --- a/target/i386/whpx/whpx-cpus.h > +++ b/target/i386/whpx/whpx-cpus.h > @@ -12,8 +12,6 @@ > > #include "sysemu/cpus.h" > > -extern const CpusAccel whpx_cpus; > - > int whpx_init_vcpu(CPUState *cpu); > int whpx_vcpu_exec(CPUState *cpu); > void whpx_destroy_vcpu(CPUState *cpu); > -- > 2.26.2 > -- Eduardo

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

2020-11-24 Thread Eduardo Habkost
bled()) { > +cpus_register_accel(_cpus); > +} > +} > + > +accel_cpu_init(qtest_accel_cpu_init); I don't understand why this (and the similar changes on other accelerators) is an improvement. You are replacing a trivial AccelClass-specific init method with a module_init() function that has a hidden dependency on runtime state. -- Eduardo

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

2020-11-24 Thread Eduardo Habkost
; index e7d4effdd0..00166c36e9 100644 > --- a/target/i386/tcg/cpu.c > +++ b/target/i386/tcg/cpu.c > @@ -170,12 +170,3 @@ static void tcg_cpu_accel_register_types(void) > type_register_static(_cpu_accel_type_info); > } > type_init(tcg_cpu_accel_register_types); > - > -static void tcg_cpu_accel_init(void) > -{ > -if (tcg_enabled()) { > -x86_cpu_accel_init(X86_CPU_ACCEL_TYPE_NAME("tcg")); > -} > -} > - > -accel_cpu_init(tcg_cpu_accel_init); > -- > 2.26.2 > -- Eduardo

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
> > Paolo > > Which tree is going to merge this patch? Sorry, I was expecting Michael to merge it, as it's PCI-specific but it looks like people were waiting for me to merge it. I'll merge it and submit a pull request ASAP. -- Eduardo

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

2020-11-24 Thread Eduardo Habkost
int(0), qnum_from_double(0.0)) was undefined. However, if we really care about test coverage of qnum_is_equal(), we probably should be extending check-qnum.c, not check-qlit.c. -- Eduardo

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
atm). > > static void tcg_accel_cpu_init(void) > { > if (tcg_enabled()) { > TCGState *s = TCG_STATE(current_accel()); > > if (s->mttcg_enabled) { > cpus_register_accel(_cpus_mttcg); > } else if (icount_enabled()) { > cpus_register_accel(_cpus_icount); > } else { > cpus_register_accel(_cpus_rr); > } > } > } Probably what we are missing here is a non-softmmu-specific AccelClass.init() method? -- Eduardo

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
6_cpu_accel_init(X86_CPU_ACCEL_TYPE_NAME(chosen_accel_name)); call somewhere in the initialization path. A good place for the x86_cpu_accel_init() call would be do_configure_accelerator(), but the function is arch-specific. That's why I suggested a cpu_accel_arch_init() function at https://lore.kernel.org/qemu-devel/20201118220750.gp1509...@habkost.net -- Eduardo

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

2020-11-20 Thread Eduardo Habkost
EL) Yes, and this way we get rid of the only difference between OBJECT_DECLARE_TYPE and OBJECT_DECLARE_INTERFACE: the instance type cast macro is a bit different (it uses INTERFACE_CHECK). -- Eduardo

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
lank line between declarations and statements, please. I can do it. But why do you prefer it that way? > > > +return qnum_value_is_equal(_x->value, _y->value); > > +} > > + > > /** > > * qnum_destroy_obj(): Free all memory allocated by a QNum object > > * -- Eduardo

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
vf_cpu_common_class_init(X86CPUClass *xcc) > +{ > +host_cpu_class_init(xcc); Why are you calling host_cpu_class_init() for all CPU types? > +} [...] > +static void kvm_cpu_common_class_init(X86CPUClass *xcc) > +{ > +host_cpu_class_init(xcc); > +} Same question as above. -- Eduardo

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
n be extended with a union to report extra props for the > > accelerator, discriminated on the 'active' field eg > > > > { 'available': [ 'kvm', 'tcg', 'xen' ], > >'active': 'kvm', > >'data': { > >"allow-nested": true, > >} > > } > > Correct. -- Eduardo

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
ster_accel(current_machine->accelerator->cpu_accel_ops); -- Eduardo

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
:4.2-3ubuntu6.8)* This one isn't expect to have "hmat", as the feature was introduced in v5.0.0. > - use apt install qemu > - E5-2670 * 2, Ubuntu 20.04.1 LTS, kernel: 5.4.0-53-generic, Dell > PowerEdge-R720 > > I can't reproduce it here. I've tested both qe

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
e want to duplicate the list of accelerators in the QAPI schema, or should we wait for a generic solution that works for any QOM type? > [...] Even better would be > returning an array of KvmInfo with information on all supported > accelerators at once, rather than making the user call this command once > per name. Maybe. It would save us the work of answering the question above, but is this (querying information for all accelerators at once) going to be a common use case? -- Eduardo

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