Re: [PATCH 1/2] numa: Set default distance map if needed

2021-10-06 Thread Andrew Jones
On Wed, Oct 06, 2021 at 06:22:08PM +0800, Gavin Shan wrote: > The following option is used to specify the distance map. It's > possible the option isn't provided by user. In this case, the > distance map isn't populated and exposed to platform. On the > other hand, the empty NUMA node, where no

Re: [PATCH v3 2/3] hw/arm/virt_acpi_build: Generate DBG2 table

2021-10-06 Thread Andrew Jones
On Mon, Sep 27, 2021 at 03:17:31PM +0200, Eric Auger wrote: > ARM SBBR specification mandates DBG2 table (Debug Port Table 2) > since v1.0 (ARM DEN0044F 8.3.1.7 DBG2). > > The DBG2 table allows to describe one or more debug ports. > > Generate an DBG2 table featuring a single debug port, the

Re: [PATCH v2 4/5] hw/arm/virt: Use the PA range to compute the memory map

2021-10-04 Thread Andrew Jones
On Sun, Oct 03, 2021 at 05:46:04PM +0100, Marc Zyngier wrote: > The highmem attribute is nothing but another way to express the > PA range of a VM. To support HW that has a smaller PA range then > what QEMU assumes, pass this PA range to the virt_set_memmap() > function, allowing it to correctly

Re: [PATCH v2 4/5] hw/arm/virt: Use the PA range to compute the memory map

2021-10-04 Thread Andrew Jones
On Sun, Oct 03, 2021 at 05:46:04PM +0100, Marc Zyngier wrote: ... > @@ -1662,9 +1665,17 @@ static void virt_set_memmap(VirtMachineState *vms) > vms->memmap[i].size = size; > base += size; > } > -vms->highest_gpa = (vms->highmem ? > -base : > -

Re: [PATCH v2 2/5] hw/arm/virt: Add a control for the the highmem redistributors

2021-10-04 Thread Andrew Jones
On Mon, Oct 04, 2021 at 11:44:08AM +0200, Andrew Jones wrote: > On Sun, Oct 03, 2021 at 05:46:02PM +0100, Marc Zyngier wrote: ... > > > > -return MACHINE(vms)->smp.cpus > redist0_capacity ? 2 : 1; > > +return (MACHINE(vms)->smp.cpus > redist0

Re: [PATCH v2 3/5] hw/arm/virt: Honor highmem setting when computing the memory map

2021-10-04 Thread Andrew Jones
vms->memmap[VIRT_MEM].base + ms->maxram_size) - 1; > if (device_memory_size > 0) { > ms->device_memory = g_malloc0(sizeof(*ms->device_memory)); > ms->device_memory->base = device_memory_base; > -- > 2.30.2 > Reviewed-by: Andrew Jones

Re: [PATCH v2 5/5] hw/arm/virt: Disable highmem devices that don't fit in the PA range

2021-10-04 Thread Andrew Jones
vms->highest_gpa = base -1; > } else { > +/* Advertise that we have disabled the highmem devices */ > +vms->highmem_ecam = false; > +vms->highmem_redists = false; > vms->highest_gpa = memtop - 1; > } > > -- > 2.30.2 > Reviewed-by: Andrew Jones

Re: [PATCH v2 2/5] hw/arm/virt: Add a control for the the highmem redistributors

2021-10-04 Thread Andrew Jones
On Sun, Oct 03, 2021 at 05:46:02PM +0100, Marc Zyngier wrote: > Just like we can control the enablement of the highmem PCIe region > using highmem_ecam, let's add a control for the highmem GICv3 > redistributor region. > > Similarily to highmem_ecam, these redistributors are disabled when >

Re: [PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam

2021-10-04 Thread Andrew Jones
op_sized_cells(ms->fdt, nodename, "reg", > 2, base_ecam, 2, size_ecam); > > -if (vms->highmem) { > +if (vms->highmem_ecam) { > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", > 1, FDT_PCI_RANGE_IOPORT, 2, 0, > 2, base_pio, 2, size_pio, > -- > 2.30.2 > Reviewed-by: Andrew Jones Thanks, drew

Re: [PATCH] hw/arm/virt: Allow additions to the generated device tree

2021-09-29 Thread Andrew Jones
On Wed, Sep 29, 2021 at 09:09:59AM -0600, Simon Glass wrote: > Hi Peter, > > On Wed, 29 Sept 2021 at 03:10, Peter Maydell wrote: > > > > On Wed, 29 Sept 2021 at 04:01, Simon Glass wrote: > > > On Tue, 28 Sept 2021 at 03:21, Peter Maydell > > > wrote: > > > > So what *is* this patch doing? The

Re: [PATCH v2 2/2] qemu-options: Add missing "sockets=2,maxcpus=2" to CLI "-smp 2"

2021-09-29 Thread Andrew Jones
0 \ > -numa node,nodeid=1,memdev=m1,initiator=0 \ > -numa cpu,node-id=0,socket-id=0 \ > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH v2 1/2] qemu-options: Tweak [,maxcpus=cpus] to [,maxcpus=maxcpus]

2021-09-29 Thread Andrew Jones
ts=sockets][,dies=dies][,cores=cores][,threads=threads]\n" > "set the number of CPUs to 'n' [default=1]\n" > "maxcpus= maximum number of total CPUs, including\n" > "offline CPUs for hotplug, etc\n" > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH v9 07/16] qtest/numa-test: Use detailed -smp CLI in test_def_cpu_split

2021-09-10 Thread Andrew Jones
node"); > +cli = make_cli(data, "-machine smp.cpus=8,smp.sockets=8 " > + "-numa node,memdev=ram -numa node"); > qts = qtest_init(cli); > > s = qtest_hmp(qts, "info numa"); > -- > 2.23.0 > Reviewed-by: Andrew Jones

Re: [PATCH v9 06/16] qtest/numa-test: Use detailed -smp CLIs in pc_dynamic_cpu_cfg

2021-09-10 Thread Andrew Jones
= NULL; > > -cli = make_cli(data, "-nodefaults --preconfig -machine smp.cpus=2"); > +cli = make_cli(data, "-nodefaults --preconfig " > + "-machine smp.cpus=2,smp.sockets=2"); > qs = qtest_init(cli); > > /* create 2 numa nodes */ > -- > 2.23.0 > Reviewed-by: Andrew Jones

Re: Questions on setting guest CPU models with ARM kvm enabled

2021-09-10 Thread Andrew Jones
On Fri, Sep 10, 2021 at 10:40:30AM +0800, Jingyi Wang wrote: > Hi all, > On ARM hardware, as qemu docs describes, "Named CPU models generally > do not work with KVM." May I ask what is the main obstacle to setting a > guest CPU model on later host hardware? Currently KVM does not give the

Re: [PATCH v2 0/3] hw/arm/virt_acpi_build: Generate DBG2 table

2021-09-08 Thread Andrew Jones
On Mon, Sep 06, 2021 at 02:31:36PM +0200, Eric Auger wrote: > This series generates the ACPI DBG2 table along with machvirt. > It applies on top of Igor's > [PATCH v2 00/35] acpi: refactor error prone build_header() and > packed structures usage in ACPI tables > > The DBG2 specification can be

Re: [PATCH v6 0/5] hw/arm/virt: Introduce cpu topology support

2021-09-06 Thread Andrew Jones
On Fri, Sep 03, 2021 at 03:38:13PM +0800, wangyanan (Y) wrote: > > On 2021/9/3 15:25, Peter Maydell wrote: > > On Fri, 3 Sept 2021 at 08:05, wangyanan (Y) wrote: > > > > > > On 2021/9/2 23:56, Peter Maydell wrote: > > > > On Tue, 24 Aug 2021 at 13:20, Yanan Wang wrote: > > > > > This new

Re: [PATCH v6 1/3] target-arm: Add support for Fujitsu A64FX

2021-08-31 Thread Andrew Jones
+ > 1 file changed, 48 insertions(+) > I already gave my r-b on the last posting, but here it is again Reviewed-by: Andrew Jones

Re: [PATCH v5 2/3] hw/arm/virt: target-arm: Add A64FX processor support to virt machine

2021-08-30 Thread Andrew Jones
, > ARM_CPU_TYPE_NAME("cortex-a72"), > +ARM_CPU_TYPE_NAME("a64fx"), > ARM_CPU_TYPE_NAME("host"), > ARM_CPU_TYPE_NAME("max"), > }; > -- > 2.27.0 > Reviewed-by: Andrew Jones

Re: [PATCH v5 3/3] tests/arm-cpu-features: Add A64FX processor related

2021-08-30 Thread Andrew Jones
e_enabled(qts, "a64fx", "sve"); > +assert_sve_vls(qts, "a64fx", 0xb, NULL); > +assert_error(qts, "a64fx", "cannot enable sve384", > + "{ 'sve384': true }"); > +assert_error(qts, "a64fx", "cannot enable sve640", > + "{ 'sve640': true }"); > + > sve_tests_default(qts, "max"); > pauth_tests_default(qts, "max"); > > -- > 2.27.0 > Reviewed-by: Andrew Jones

Re: [PATCH v5 1/3] target-arm: Add support for Fujitsu A64FX

2021-08-30 Thread Andrew Jones
; + > +/* TODO: Add A64FX specific HPC extension registers */ > +} > + > static const ARMCPUInfo aarch64_cpus[] = { > { .name = "cortex-a57", .initfn = aarch64_a57_initfn }, > { .name = "cortex-a53", .initfn = aarch64_a53_initfn },

Re: [PATCH v2 0/4] target/arm/cpu: Introduce sve_vq_supported bitmap

2021-08-27 Thread Andrew Jones
says to enable all vector lengths smaller and including sve-max-vq and to disable all the rest, but if the CPU doesn't support non-power-of-2 vector lengths, then sve-max-vq will not work for anything other than max-vq=1 and max-vq=2. For this reason, I didn't even bring this property over to the '

Re: [PATCH v6 1/5] hw/arm/virt: Only describe cpu topology since virt-6.2

2021-08-24 Thread Andrew Jones
secure_gpio; > +/* Machines < 6.2 have no support for describing cpu topology to guest */ > +bool no_cpu_topology; > }; > > struct VirtMachineState { > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH v2 3/4] target/arm/cpu64: Replace kvm_supported with sve_vq_supported

2021-08-24 Thread Andrew Jones
On Tue, Aug 24, 2021 at 08:28:55AM +0200, Andrew Jones wrote: > On Mon, Aug 23, 2021 at 10:53:48AM -0700, Richard Henderson wrote: > > On 8/23/21 9:06 AM, Andrew Jones wrote: > > > Now that we have an ARMCPU member sve_vq_supported we no longer > > > need the local kvm

Re: [PATCH v2 3/4] target/arm/cpu64: Replace kvm_supported with sve_vq_supported

2021-08-24 Thread Andrew Jones
On Mon, Aug 23, 2021 at 10:53:48AM -0700, Richard Henderson wrote: > On 8/23/21 9:06 AM, Andrew Jones wrote: > > Now that we have an ARMCPU member sve_vq_supported we no longer > > need the local kvm_supported bitmap for KVM's supported vector > > lengths. > > >

Re: [PATCH v2 4/4] target/arm/cpu64: Validate sve vector lengths are supported

2021-08-24 Thread Andrew Jones
On Mon, Aug 23, 2021 at 11:04:49AM -0700, Richard Henderson wrote: > On 8/23/21 9:06 AM, Andrew Jones wrote: > > Future CPU types may specify which vector lengths are supported. > > We can apply nearly the same logic to validate those lengths > > as we do for KVM's support

[PATCH v2 4/4] target/arm/cpu64: Validate sve vector lengths are supported

2021-08-23 Thread Andrew Jones
-of-two or not, smaller than the maximum enabled length to also be enabled. The architecture only requires all the power-of-two lengths, though, so TCG will only enforce that. Signed-off-by: Andrew Jones --- target/arm/cpu64.c | 101 - 1 file changed, 45

[PATCH v2 2/4] target/arm/kvm64: Ensure sve vls map is completely clear

2021-08-23 Thread Andrew Jones
bitmap_clear() only clears the given range. While the given range should be sufficient in this case we might as well be 100% sure all bits are zeroed by using bitmap_zero(). Signed-off-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daudé --- target/arm/kvm64.c | 2 +- 1 file changed, 1

[PATCH v2 3/4] target/arm/cpu64: Replace kvm_supported with sve_vq_supported

2021-08-23 Thread Andrew Jones
Now that we have an ARMCPU member sve_vq_supported we no longer need the local kvm_supported bitmap for KVM's supported vector lengths. Signed-off-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daudé --- target/arm/cpu64.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions

[PATCH v2 0/4] target/arm/cpu: Introduce sve_vq_supported bitmap

2021-08-23 Thread Andrew Jones
with something that could be shared with TCG. Thanks, drew Andrew Jones (4): target/arm/cpu: Introduce sve_vq_supported bitmap target/arm/kvm64: Ensure sve vls map is completely clear target/arm/cpu64: Replace kvm_supported with sve_vq_supported target/arm/cpu64: Validate sve vector

[PATCH v2 1/4] target/arm/cpu: Introduce sve_vq_supported bitmap

2021-08-23 Thread Andrew Jones
' with TCG. And, since 'max' should support all SVE vector lengths we simply fill the bitmap. Future CPU types may have less trivial maps though. Signed-off-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daudé --- target/arm/cpu.h | 4 target/arm/cpu64.c | 2 ++ 2 files changed, 6 insertions

Re: [PATCH 0/4] target/arm/cpu: Introduce sve_vq_supported bitmap

2021-08-23 Thread Andrew Jones
On Thu, Aug 19, 2021 at 09:37:54PM +0200, Andrew Jones wrote: > While reviewing the new A64FX CPU type it became clear that CPU > types should be able to specify which SVE vector lengths are > supported. This series adds a new bitmap member to ARMCPU and > modifies arm_cpu_

Re: [PATCH 4/4] target/arm/cpu64: Validate sve vector lengths are supported

2021-08-23 Thread Andrew Jones
On Thu, Aug 19, 2021 at 09:37:58PM +0200, Andrew Jones wrote: > Future CPU types may specify which vector lengths are supported. > We can apply nearly the same logic to validate those lengths > as we do for KVM's supported vector lengths. We merge the code > where we can, but unfortu

Re: [PATCH 1/3] hw/arm/virt: KVM: Probe for KVM_CAP_ARM_VM_IPA_SIZE when creating scratch VM

2021-08-23 Thread Andrew Jones
> On systems that are severely IPA challenged (such as the Apple M1), > this results in a failure as KVM cannot use the default 40bit that > '0' represents. > > Instead, probe for the extension and use the reported IPA limit > if available. > > Cc: Andrew Jones > Cc: Eric Auger >

Re: [PATCH v2 3/3] docs/about: Add the missing release record in the subject

2021-08-23 Thread Andrew Jones
t; > The "tls-creds" option should be used instead to point to a "tls-creds-x509" > object created using "-object". > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH v2 2/3] docs/about: Unify the subject format

2021-08-23 Thread Andrew Jones
subject format in removed-features.rst to "removed in X.Y". > > Signed-off-by: Yanan Wang > Reviewed-by: Cornelia Huck > --- > docs/about/deprecated.rst | 56 - > docs/about/removed-features.rst | 28 ++++----- > 2 files changed, 42 insertions(+), 42 deletions(-) > Reviewed-by: Andrew Jones

Re: [PATCH v2 1/3] docs/about: Remove the duplicated doc

2021-08-23 Thread Andrew Jones
ets* * *cores* * *threads* = *maxcpus*. > - > ``-machine enforce-config-section=on|off`` (removed 5.2) > > > -- > 2.19.1 > Reviewed-by: Andrew Jones

[PATCH 3/4] target/arm/cpu64: Replace kvm_supported with sve_vq_supported

2021-08-19 Thread Andrew Jones
Now that we have an ARMCPU member sve_vq_supported we no longer need the local kvm_supported bitmap for KVM's supported vector lengths. Signed-off-by: Andrew Jones --- target/arm/cpu64.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu64.c

[PATCH 4/4] target/arm/cpu64: Validate sve vector lengths are supported

2021-08-19 Thread Andrew Jones
-of-two or not, smaller than the maximum enabled length to also be enabled. The architecture only requires all the power-of-two lengths, though, so TCG will only enforce that. Signed-off-by: Andrew Jones --- target/arm/cpu64.c | 101 - 1 file changed, 45

[PATCH 1/4] target/arm/cpu: Introduce sve_vq_supported bitmap

2021-08-19 Thread Andrew Jones
' with TCG. And, since 'max' should support all SVE vector lengths we simply fill the bitmap. Future CPU types may have less trivial maps though. Signed-off-by: Andrew Jones --- target/arm/cpu.h | 4 target/arm/cpu64.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/target/arm/cpu.h b

[PATCH 2/4] target/arm/kvm64: Ensure sve vls map is completely clear

2021-08-19 Thread Andrew Jones
bitmap_clear() only clears the given range. While the given range should be sufficient in this case we might as well be 100% sure all bits are zeroed by using bitmap_zero(). Signed-off-by: Andrew Jones --- target/arm/kvm64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 0/4] target/arm/cpu: Introduce sve_vq_supported bitmap

2021-08-19 Thread Andrew Jones
more testing and report back later. I'd also be happy to get test results from others. Thanks, drew Andrew Jones (4): target/arm/cpu: Introduce sve_vq_supported bitmap target/arm/kvm64: Ensure sve vls map is completely clear target/arm/cpu64: Replace kvm_supported with sve_vq_supported

Re: [PATCH v4 1/3] target-arm: Add support for Fujitsu A64FX

2021-08-18 Thread Andrew Jones
e 'max' cpu type will have the trivial all-set supported bitmap, but the a64fx will have a specific one. I plan to do this "supported" bitmap generalization and apply it to the TCG max cpu type. You'll need to rebase this series on those patches and provide the a64fx supported bitmap. I th

Re: [PATCH v4 1/3] target-arm: Add support for Fujitsu A64FX

2021-08-17 Thread Andrew Jones
On Tue, Aug 17, 2021 at 05:53:34AM -1000, Richard Henderson wrote: > On 8/17/21 5:36 AM, Andrew Jones wrote: > > On Tue, Aug 17, 2021 at 05:23:17AM -1000, Richard Henderson wrote: > > > On 8/17/21 1:56 AM, Andrew Jones wrote: > > > > I guess it's fine.

Re: [PATCH v4 1/3] target-arm: Add support for Fujitsu A64FX

2021-08-17 Thread Andrew Jones
On Tue, Aug 17, 2021 at 05:23:17AM -1000, Richard Henderson wrote: > On 8/17/21 1:56 AM, Andrew Jones wrote: > > I guess it's fine. You could easily create a new cpu_arm_set_sve_vq() > > which would forbid changing the properties if you wanted to, but then > > we need to an

Re: [PULL 1/1] machine: Disallow specifying topology parameters as zero

2021-08-17 Thread Andrew Jones
On Tue, Aug 17, 2021 at 01:37:15PM +0100, Peter Maydell wrote: > On Tue, 17 Aug 2021 at 13:22, Andrew Jones wrote: > > > > On Tue, Aug 17, 2021 at 01:06:19PM +0100, Peter Maydell wrote: > > > On Tue, 17 Aug 2021 at 13:02, Andrew Jones wrote: > > > > > &

[PATCH] qapi/machine.json: Remove zero value reference from SMPConfiguration documentation

2021-08-17 Thread Andrew Jones
d documenting behaviors we want to leave undefined for the time being, giving us freedom to change it later. Fixes: 1e63fe685804 ("machine: pass QAPI struct to mc->smp_parse") Signed-off-by: Andrew Jones --- qapi/machine.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

Re: [PULL 1/1] machine: Disallow specifying topology parameters as zero

2021-08-17 Thread Andrew Jones
On Tue, Aug 17, 2021 at 01:06:19PM +0100, Peter Maydell wrote: > On Tue, 17 Aug 2021 at 13:02, Andrew Jones wrote: > > > > On Mon, Aug 16, 2021 at 11:37:21PM +0200, Paolo Bonzini wrote: > > > How do we know that no one has ever used such configuration? The > >

Re: [PULL 1/1] machine: Disallow specifying topology parameters as zero

2021-08-17 Thread Andrew Jones
meaningless configurations possibly introduced by users > > in the future and consequently a necessary deprecation process, > > fix the doc and also add the corresponding sanity check. > > > > Fixes: 1e63fe68580 (machine: pass QAPI struct to mc->smp_parse) > > Suggeste

Re: [PATCH v4 1/3] target-arm: Add support for Fujitsu A64FX

2021-08-17 Thread Andrew Jones
On Tue, Aug 17, 2021 at 06:43:58AM +, ishii.shuuic...@fujitsu.com wrote: > > > On Thu, 12 Aug 2021 at 10:25, Andrew Jones wrote: > > > On second thought, do we want the QMP CPU model expansion query to > > > show that this CPU type has sve,sve128,sve256,sve512? If

Re: [PATCH for-6.2 v5 3/5] hw/arm/virt: Add cpu-map to device tree

2021-08-17 Thread Andrew Jones
On Tue, Aug 17, 2021 at 10:10:44AM +0800, wangyanan (Y) wrote: > Hi, > On 2021/8/5 20:39, Yanan Wang wrote: > > From: Andrew Jones > > > > Support device tree CPU topology descriptions. > > > > In accordance with the Devicetree Specification, the Linux Doc &g

Re: [PATCH v4 1/3] target-arm: Add support for Fujitsu A64FX

2021-08-12 Thread Andrew Jones
On Thu, Aug 12, 2021 at 11:16:50AM +0200, Andrew Jones wrote: > On Thu, Aug 12, 2021 at 03:04:38PM +0900, Shuuichirou Ishii wrote: > > Add a definition for the Fujitsu A64FX processor. > > > > The A64FX processor does not implement the AArch32 Execution state, > >

Re: [PATCH v4 1/3] target-arm: Add support for Fujitsu A64FX

2021-08-12 Thread Andrew Jones
= 6; /* 256 bytes */ > +cpu->gic_num_lrs = 4; > +cpu->gic_vpribits = 5; > +cpu->gic_vprebits = 5; > + > +/* TODO: Add A64FX specific HPC extension registers */ > +} > + > static const ARMCPUInfo aarch64_cpus[] = { > { .name = "cortex-a57", .initfn = aarch64_a57_initfn }, > { .name = "cortex-a53", .initfn = aarch64_a53_initfn }, > { .name = "cortex-a72", .initfn = aarch64_a72_initfn }, > +{ .name = "a64fx", .initfn = aarch64_a64fx_initfn }, > { .name = "max",.initfn = aarch64_max_initfn }, > }; > > -- > 2.27.0 > For the SVE related bits Reviewed-by: Andrew Jones

Re: [PATCH for-6.2] hw/arm/virt_acpi_build: Generate DBG2 table

2021-08-10 Thread Andrew Jones
On Tue, Aug 10, 2021 at 12:25:07PM +0200, Eric Auger wrote: > Hello Ard, > On 8/10/21 11:36 AM, Ard Biesheuvel wrote: > > On Tue, 10 Aug 2021 at 10:31, Eric Auger wrote: > >> ARM SBBR specification mandates DBG2 table (Debug Port Table 2). > >> this latter allows to describe one or more debug

Re: [PATCH v3 1/3] target-arm: cpu64: Add support for Fujitsu A64FX

2021-08-10 Thread Andrew Jones
erty_add(obj, "sve-max-vq", "uint32", cpu_max_get_sve_max_vq, > -cpu_max_set_sve_max_vq, NULL, NULL); > } > > static const ARMCPUInfo aarch64_cpus[] = { Otherwise looks OK to me. Thanks, drew > > --- > > Best regards.

Re: [PATCH v3 1/3] target-arm: cpu64: Add support for Fujitsu A64FX

2021-08-05 Thread Andrew Jones
On Thu, Aug 05, 2021 at 04:30:43PM +0900, Shuuichirou Ishii wrote: > Add a definition for the Fujitsu A64FX processor. > > The A64FX processor does not implement the AArch32 Execution state, > so there are no associated AArch32 Identification registers. > > Signed-off-by: Shuuichirou Ishii >

Re: [PATCH for-6.2 v4 14/14] tests/unit: Add a unit test for smp parsing

2021-08-03 Thread Andrew Jones
s(+) > create mode 100644 tests/unit/test-smp-parse.c > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v4 13/14] machine: Split out the smp parsing code

2021-08-03 Thread Andrew Jones
++ > hw/core/machine.c | 177 - > hw/core/meson.build | 1 + > include/hw/boards.h | 1 + > 5 files changed, 202 insertions(+), 177 deletions(-) > create mode 100644 hw/core/machine-smp.c > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v4 12/14] machine: Put all sanity-check in the generic SMP parser

2021-08-03 Thread Andrew Jones
tested only by calling the parser. > > Signed-off-by: Yanan Wang > --- > hw/core/machine.c | 63 +++ > 1 file changed, 31 insertions(+), 32 deletions(-) > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v4 01/14] machine: Minor refactor/cleanup for the smp parsers

2021-08-03 Thread Andrew Jones
initially like other members, cleanup the > sanity check for dies. > > No functional change intended. > > Signed-off-by: Yanan Wang > --- > hw/core/machine.c | 19 +++ > hw/i386/pc.c | 23 ++- > 2 files changed, 25 insertions(

Re: [PATCH for-6.2 v3 11/11] machine: Move smp_prefer_sockets to struct SMPCompatProps

2021-07-28 Thread Andrew Jones
3671a0f8f 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -110,9 +110,11 @@ typedef struct { > > /** > * SMPCompatProps: > + * @prefer_sockets - whether sockets is preferred over cores in smp parsing > * @dies_supported - whether dies is supported by the machine > */ > typedef struct { > +bool prefer_sockets; > bool dies_supported; > } SMPCompatProps; > > @@ -250,7 +252,6 @@ struct MachineClass { > bool nvdimm_supported; > bool numa_mem_supported; > bool auto_enable_numa; > -bool smp_prefer_sockets; > SMPCompatProps smp_props; > const char *default_ram_id; > > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v3 09/11] machine: Make smp_parse generic enough for all arches

2021-07-28 Thread Andrew Jones
On Wed, Jul 28, 2021 at 10:38:57PM +0200, Andrew Jones wrote: > On Wed, Jul 28, 2021 at 11:48:46AM +0800, Yanan Wang wrote: > > @@ -248,6 +256,7 @@ struct MachineClass { > > bool numa_mem_supported; > > bool auto_enable_numa; > > bool smp_prefer_socke

Re: [PATCH for-6.2 v3 10/11] machine: Remove smp_parse callback from MachineClass

2021-07-28 Thread Andrew Jones
owed. Return > @@ -217,7 +213,6 @@ struct MachineClass { > void (*reset)(MachineState *state); > void (*wakeup)(MachineState *state); > int (*kvm_type)(MachineState *machine, const char *arg); > -void (*smp_parse)(MachineState *ms, SMPConfiguration *config, Error > **errp); > > BlockInterfaceType block_default_type; > int units_per_default_bus; > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v3 09/11] machine: Make smp_parse generic enough for all arches

2021-07-28 Thread Andrew Jones
p_parse generic enough for all arches and the PC specific > one can be removed. > > Making smp_parse() generic enough can reduce code duplication and > ease the code maintenance, and also allows extending the topology > with more arch specific members (e.g., clusters) in the fu

Re: [PATCH for-6.2 v3 06/11] machine: Prefer cores over sockets in smp parsing since 6.2

2021-07-28 Thread Andrew Jones
"6.1", false); > > diff --git a/include/hw/boards.h b/include/hw/boards.h > index 463a5514f9..2ae039b74f 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -247,6 +247,7 @@ struct MachineClass { > bool nvdimm_supported; > bool numa_mem_supported; > bool auto_enable_numa; > +bool smp_prefer_sockets; > const char *default_ram_id; > > HotplugHandler *(*get_hotplug_handler)(MachineState *machine, > diff --git a/qemu-options.hx b/qemu-options.hx > index 0912236b4b..450f511ca7 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -234,7 +234,8 @@ SRST > Historically preference was given to the coarsest topology parameters > when computing missing values (ie sockets preferred over cores, which > were preferred over threads), however, this behaviour is considered > -liable to change. > +liable to change. Prior to 6.2 the preference was sockets over cores > +over threads. Since 6.2 the preference is cores over sockets over > threads. > ERST > > DEF("numa", HAS_ARG, QEMU_OPTION_numa, > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v3 04/11] machine: Improve the error reporting of smp parsing

2021-07-28 Thread Andrew Jones
eads != maxcpus) { > -error_setg(errp, "Invalid CPU topology deprecated: " > +error_setg(errp, "Invalid CPU topology: " > + "maxcpus must be equal to or greater than smp: " > "sockets (%u) * dies (%u) * cores (%u) * threads (%u) " > - "!= maxcpus (%u)", > - sockets, dies, cores, threads, > - maxcpus); > + "== maxcpus (%u) < smp_cpus (%u)", > + sockets, dies, cores, threads, maxcpus, cpus); > return; > } > > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v3 03/11] machine: Set the value of cpus to match maxcpus if it's omitted

2021-07-28 Thread Andrew Jones
ill match the maximum number. When only one of them > +is given then the omitted one will be set to its counterpart's value. > +Both parameters may be specified, but the maximum number of CPUs must > +equal to or greater than the initial CPU count. Both parameters are be equal to > +subject to an upper limit that is determined by the specific machine > +type chosen. > > To control reporting of CPU topology information, the number of sockets, > dies per socket, cores per die, and threads per core can be specified. > -- > 2.19.1 > Otherwise Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v3 01/11] machine: Minor refactor/cleanup for the smp parsers

2021-07-28 Thread Andrew Jones
On Wed, Jul 28, 2021 at 11:48:38AM +0800, Yanan Wang wrote: > To pave the way for the functional improvement in later patches, > make some refactor/cleanup for the smp parsers, including using > local maxcpus instead of ms->smp.max_cpus in the calculation, > defaulting dies to 0 initially like

Re: [PATCH v2 3/3] target/arm: Add sve-default-vector-length cpu property

2021-07-26 Thread Andrew Jones
On Mon, Jul 26, 2021 at 08:33:52AM -1000, Richard Henderson wrote: > On 7/26/21 4:59 AM, Andrew Jones wrote: > > > +SVE User-mode Default Vector Length Property > > > + > > > + > > > +For qemu-aarch64, the cp

Re: [PATCH v2 0/3] target/arm: Add sve-default-vector-length cpu property

2021-07-26 Thread Andrew Jones
On Mon, Jul 26, 2021 at 01:42:45PM +0100, Peter Maydell wrote: > On Fri, 23 Jul 2021 at 21:34, Richard Henderson > wrote: > > > > This is intended to resolve #482. > > > > Changes for v2: > > * Split out length bounding fix to new patch. > > * Use byte units for sve-default-vector-length. > >

Re: [PATCH v2 3/3] target/arm: Add sve-default-vector-length cpu property

2021-07-26 Thread Andrew Jones
On Fri, Jul 23, 2021 at 10:33:44AM -1000, Richard Henderson wrote: > Mirror the behavour of /proc/sys/abi/sve_default_vector_length > under the real linux kernel. We have no way of passing along > a real default across exec like the kernel can, but this is a > decent way of adjusting the startup

Re: [PATCH for-6.1 v2] machine: Disallow specifying topology parameters as zero

2021-07-22 Thread Andrew Jones
comment for SMPConfiguration. So this patch fixes the doc and > also adds the corresponding sanity check in the smp parsers. > > Suggested-by: Andrew Jones > Signed-off-by: Yanan Wang > --- > hw/core/machine.c | 14 ++ > qapi/machine.json | 6 +++--- > qemu-opt

Re: [PATCH for-6.2 v2 04/11] machine: Use the computed parameters to calculate omitted cpus

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 10:59:11PM +0800, wangyanan (Y) wrote: > Ok. If we remove the rounding, then the calculation code has to be modified > to be like the following. We have to separately consider the case that cpus > and maxcpus are both omitted (e.g. -smp sockets=16). > > maxcpus = maxcpus >

Re: [PATCH for-6.1 0/1] machine: Disallow specifying topology parameters as zero

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 08:02:16AM +0200, Cornelia Huck wrote: > On Thu, Jul 22 2021, Yanan Wang wrote: > > > In the SMP configuration, we should either specify a topology > > parameter with a reasonable value (equal to or greater than 1) > > or just leave it omitted and QEMU will calculate its

Re: [PATCH for-6.2 v2 11/11] tests/unit: Add a unit test for smp parsing

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 02:15:18PM +0800, wangyanan (Y) wrote: > On 2021/7/20 2:57, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:43AM +0800, Yanan Wang wrote: > > > Add a QEMU unit test for the parsing of given SMP configuration. > > > Since all the parsing l

Re: [PATCH for-6.2 v2 10/11] machine: Split out the smp parsing code

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 02:24:03PM +0800, wangyanan (Y) wrote: > On 2021/7/20 1:20, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:42AM +0800, Yanan Wang wrote: > > > We are going to introduce an unit test for the parser smp_parse() > > > in hw/core/machine.c

Re: [PATCH for-6.2 v2 05/11] machine: Improve the error reporting of smp parsing

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 04:10:32PM +0800, wangyanan (Y) wrote: > On 2021/7/20 0:53, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:37AM +0800, Yanan Wang wrote: > > > We totally have two requirements for a valid SMP configuration: > > s/totally// > > &g

Re: [PATCH for-6.2 v2 04/11] machine: Use the computed parameters to calculate omitted cpus

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 12:42:55PM +0800, wangyanan (Y) wrote: > On 2021/7/20 0:42, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:36AM +0800, Yanan Wang wrote: > > > Currently we directly calculate the omitted cpus based on the already > > > provided parameter

Re: [PATCH for-6.2 v2 11/11] tests/unit: Add a unit test for smp parsing

2021-07-19 Thread Andrew Jones
On Mon, Jul 19, 2021 at 11:20:43AM +0800, Yanan Wang wrote: > Add a QEMU unit test for the parsing of given SMP configuration. > Since all the parsing logic is in generic function smp_parse(), > this test passes diffenent SMP configurations to the function > and compare the parsing result with

Re: [PATCH for-6.2 v2 10/11] machine: Split out the smp parsing code

2021-07-19 Thread Andrew Jones
lt; " > - "smp_cpus (%u)", > - sockets, dies_msg, cores, threads, cpus); > -return; > -} > - > -ms->smp.cpus = cpus; > -ms->smp.sockets = sockets; > -ms->smp.dies = dies; > -ms->smp.cores = cores; > -ms->smp.threads = threads; > -ms->smp.max_cpus = maxcpus; > -} > - > static void machine_get_smp(Object *obj, Visitor *v, const char *name, > void *opaque, Error **errp) > { > diff --git a/hw/core/meson.build b/hw/core/meson.build > index 18f44fb7c2..6d727c7742 100644 > --- a/hw/core/meson.build > +++ b/hw/core/meson.build > @@ -14,6 +14,7 @@ hwcore_files = files( > ) > > common_ss.add(files('cpu-common.c')) > +common_ss.add(files('machine-smp.c')) > common_ss.add(when: 'CONFIG_FITLOADER', if_true: files('loader-fit.c')) > common_ss.add(when: 'CONFIG_GENERIC_LOADER', if_true: > files('generic-loader.c')) > common_ss.add(when: ['CONFIG_GUEST_LOADER', fdt], if_true: > files('guest-loader.c')) > diff --git a/include/hw/boards.h b/include/hw/boards.h > index 12ab0f5968..071eec1e74 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -34,6 +34,7 @@ HotpluggableCPUList > *machine_query_hotpluggable_cpus(MachineState *machine); > void machine_set_cpu_numa_node(MachineState *machine, > const CpuInstanceProperties *props, > Error **errp); > +void smp_parse(MachineState *ms, SMPConfiguration *config, Error **errp); > > /** > * machine_class_allow_dynamic_sysbus_dev: Add type to list of valid devices > -- > 2.19.1 > Otherwise Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v2 08/11] machine: Use ms instead of global current_machine in sanity-check

2021-07-19 Thread Andrew Jones
t;supported by machine '%s' is %d", > - current_machine->smp.max_cpus, > + ms->smp.max_cpus, > mc->name, mc->max_cpus); > } > > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v2 07/11] machine: Prefer cores over sockets in smp parsing since 6.2

2021-07-19 Thread Andrew Jones
On Mon, Jul 19, 2021 at 11:20:39AM +0800, Yanan Wang wrote: > In the real SMP hardware topology world, it's much more likely that > we have high cores-per-socket counts and few sockets totally. While > the current preference of sockets over cores in smp parsing results > in a virtual cpu topology

Re: [PATCH for-6.2 v2 06/11] hw: Add compat machines for 6.2

2021-07-19 Thread Andrew Jones
32f0f8aa 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -354,6 +354,9 @@ struct MachineState { > } \ > type_init(machine_initfn##_register_types) > > +extern GlobalProperty hw_compat_6_1[]; > +extern const size_t hw_compat_6_1_len; > + > extern GlobalProperty hw_compat_6_0[]; > extern const size_t hw_compat_6_0_len; > Arm and general parts look good to me Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v2 05/11] machine: Improve the error reporting of smp parsing

2021-07-19 Thread Andrew Jones
On Mon, Jul 19, 2021 at 11:20:37AM +0800, Yanan Wang wrote: > We totally have two requirements for a valid SMP configuration: s/totally// > the sum of "sockets * dies * cores * threads" must represent all the product > the possible cpus, i.e., max_cpus, and must include the initial > present

Re: [PATCH for-6.2 v2 02/11] machine: Make smp_parse generic enough for all arches

2021-07-19 Thread Andrew Jones
On Mon, Jul 19, 2021 at 05:36:39PM +0100, Daniel P. Berrangé wrote: > On Mon, Jul 19, 2021 at 06:28:46PM +0200, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:34AM +0800, Yanan Wang wrote: > > > Currently the only difference between smp_parse and pc_smp_parse > > &

Re: [PATCH for-6.2 v2 04/11] machine: Use the computed parameters to calculate omitted cpus

2021-07-19 Thread Andrew Jones
On Mon, Jul 19, 2021 at 11:20:36AM +0800, Yanan Wang wrote: > Currently we directly calculate the omitted cpus based on the already > provided parameters. This makes some cmdlines like: > -smp maxcpus=16 > -smp sockets=2,maxcpus=16 > -smp sockets=2,dies=2,maxcpus=16 > -smp

Re: [PATCH for-6.2 v2 03/11] machine: Uniformly use maxcpus to calculate the omitted parameters

2021-07-19 Thread Andrew Jones
_dies_supported ? " * dies (%u)" : "", dies); > error_setg(errp, "cpu topology: " > @@ -795,8 +797,6 @@ static void smp_parse(MachineState *ms, SMPConfiguration > *config, Error **errp) > return; > } > > -maxcpus = maxcpus > 0 ? maxcpus : cpus; > - > if (maxcpus < cpus) { > error_setg(errp, "maxcpus must be equal to or greater than smp"); > return; > -- > 2.19.1 > Reviewed-by: Andrew Jones

Re: [PATCH for-6.2 v2 02/11] machine: Make smp_parse generic enough for all arches

2021-07-19 Thread Andrew Jones
e. > > No functional change intended. > > Suggested-by: Andrew Jones > Signed-off-by: Yanan Wang > --- > hw/core/machine.c | 28 ++--- > hw/i386/pc.c| 76 + > include/hw/boards.h | 1 + > 3 files c

Re: [PATCH for-6.2 v2 01/11] machine: Disallow specifying topology parameters as zero

2021-07-19 Thread Andrew Jones
licitly specify the topology parameters > as zero like "sockets=0" are meaningless, so disallow them. > > Suggested-by: Andrew Jones > Signed-off-by: Yanan Wang > --- > hw/core/machine.c | 31 +++ > hw/i386/pc.c | 29 +

Re: [PATCH] qtest/hyperv: Introduce a simple hyper-v test

2021-07-19 Thread Andrew Jones
On Mon, Jul 19, 2021 at 11:30:41AM +0200, Vitaly Kuznetsov wrote: > Andrew Jones writes: > > > On Fri, Jul 16, 2021 at 02:55:28PM +0200, Vitaly Kuznetsov wrote: > >> For the beginning, just test 'hv-passthrough' and a couple of custom > >> Hyper-V enlightenme

Re: [PATCH] qtest/hyperv: Introduce a simple hyper-v test

2021-07-16 Thread Andrew Jones
On Fri, Jul 16, 2021 at 02:55:28PM +0200, Vitaly Kuznetsov wrote: > For the beginning, just test 'hv-passthrough' and a couple of custom > Hyper-V enlightenments configurations through QMP. Later, it would > be great to complement this by checking CPUID values from within the > guest. > >

Re: [RFC PATCH 6/6] machine: Tweak the order of topology members in struct CpuTopology

2021-07-12 Thread Andrew Jones
> tweak the comment by adding explanation of dies parameter. > > Signed-off-by: Yanan Wang > --- > hw/core/machine.c | 4 ++-- > include/hw/boards.h | 7 --- > 2 files changed, 6 insertions(+), 5 deletions(-) Reviewed-by: Andrew Jones

Re: [RFC PATCH 3/6] pc/machine: Perform zero-check for the value of -smp dies

2021-07-12 Thread Andrew Jones
On Mon, Jul 12, 2021 at 05:05:43PM +0200, Andrew Jones wrote: > On Mon, Jul 12, 2021 at 05:04:04PM +0200, Andrew Jones wrote: > > On Fri, Jul 02, 2021 at 06:07:36PM +0800, Yanan Wang wrote: > > > It's possible that dies parameter is explicitly specified as "dies=0" &g

Re: [RFC PATCH 4/6] machine: Uniformly use maxcpus to calculate the missing values

2021-07-12 Thread Andrew Jones
On Fri, Jul 02, 2021 at 06:07:37PM +0800, Yanan Wang wrote: > We are currently using maxcpus to calculate value of sockets but using > cpus to calculate value of cores/threads. This makes cmdlines like > "-smp 8,maxcpus=12,cores=4" work while "-smp 8,maxcpus=12,sockets=3" > break the invalid cpu

Re: [RFC PATCH 3/6] pc/machine: Perform zero-check for the value of -smp dies

2021-07-12 Thread Andrew Jones
On Mon, Jul 12, 2021 at 05:04:04PM +0200, Andrew Jones wrote: > On Fri, Jul 02, 2021 at 06:07:36PM +0800, Yanan Wang wrote: > > It's possible that dies parameter is explicitly specified as "dies=0" > > in the cmdline, if so we will wrongly calculate the oth

Re: [RFC PATCH 3/6] pc/machine: Perform zero-check for the value of -smp dies

2021-07-12 Thread Andrew Jones
t; > with a zeroed dies value. > > So perform zero-check (default the value to 1 if zeroed) for -smp dies > before using it to calculate other parameters. OK, dies=0 may make some sense for a user that doesn't want to describe dies. Reviewed-by: Andrew Jones > > Fixes: 1b4

Re: [RFC PATCH 1/6] machine: Set the value of maxcpus to match cpus if specified as zero

2021-07-12 Thread Andrew Jones
On Fri, Jul 02, 2021 at 06:07:34PM +0800, Yanan Wang wrote: > It is currently allowed to explicitly specified the topology parameters > as 0 in the -smp cmdlines, such as -smp cpus=8,maxcpus=0,sockets=0. And > for the values of cpus/sockets/cores/threads, we always determine that > they are

Re: [RFC PATCH 2/6] machine: Perform zero-check for the computed value of sockets

2021-07-12 Thread Andrew Jones
On Fri, Jul 02, 2021 at 06:07:35PM +0800, Yanan Wang wrote: > We currently perform zero-check (default the value to 1 if zeroed) > for the computed values of cores/threads, to make sure they are at > least 1. For consistency, we probably should also default sockets > to 1 if the computed value is

Re: [RFC PATCH v4 0/7] hw/arm/virt: Introduce cpu topology support

2021-06-30 Thread Andrew Jones
On Wed, Jun 30, 2021 at 05:37:42PM +0800, wangyanan (Y) wrote: > On 2021/6/30 16:30, Andrew Jones wrote: > > On Wed, Jun 30, 2021 at 02:36:31PM +0800, wangyanan (Y) wrote: > > > Hi Drew, Igor, > > > > > > I have a question below, hope for some expla

Re: [RFC PATCH v4 0/7] hw/arm/virt: Introduce cpu topology support

2021-06-30 Thread Andrew Jones
use the machine compat stuff to switch to it. And also properly document it with something like "Since 6.2..." Thanks, drew > > Regards, > Yanan > . > > On 2021/6/28 16:58, Andrew Jones wrote: > > On Mon, Jun 28, 2021 at 04:43:05PM +0800, wangyanan (Y) wrote: >

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