Re: [PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-18 Thread Paolo Bonzini
On 18/06/20 10:57, Andrew Jones wrote: >> If it's a test that the feature is enabled (e.g. via -cpu) then I agree. >> For something that ends up as a KVM_CHECK_EXTENSION or KVM_ENABLE_CAP on >> the KVM fd, however, I think passing an AccelState is better. > I can live with that justification as

Re: [PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-18 Thread Paolo Bonzini
On 18/06/20 12:17, Philippe Mathieu-Daudé wrote: >>> cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_SVE; >>> } >>> >>> -- >>> 2.21.3 >>> >>> >> At all callsites we pass current_accel() to the kvm_arm__supported() >> functions. Is there any reason not to drop their input parameter

Re: [PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-18 Thread Philippe Mathieu-Daudé
On 6/18/20 11:22 AM, Andrew Jones wrote: > On Wed, Jun 17, 2020 at 03:08:00PM +0200, Philippe Mathieu-Daudé wrote: >> Since commit d70c996df23f, when enabling the PMU we get: >> >> $ qemu-system-aarch64 -cpu host,pmu=on -M virt,accel=kvm,gic-version=3 >> Segmentation fault (core dumped) >> >>

Re: [PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-18 Thread Andrew Jones
On Wed, Jun 17, 2020 at 03:08:00PM +0200, Philippe Mathieu-Daudé wrote: > Since commit d70c996df23f, when enabling the PMU we get: > > $ qemu-system-aarch64 -cpu host,pmu=on -M virt,accel=kvm,gic-version=3 > Segmentation fault (core dumped) > > Thread 1 "qemu-system-aar" received signal

Re: [PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-18 Thread Andrew Jones
On Wed, Jun 17, 2020 at 07:37:42PM +0200, Paolo Bonzini wrote: > On 17/06/20 17:23, Andrew Jones wrote: > >> > >> Fix by kvm_arm__supported() functions take a AccelState > >> argument (already realized/valid at this point) instead of a > >> CPUState argument. > > I'd rather not do that. IMO, a CPU

Re: [PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-17 Thread Paolo Bonzini
On 17/06/20 17:23, Andrew Jones wrote: >> >> Fix by kvm_arm__supported() functions take a AccelState >> argument (already realized/valid at this point) instead of a >> CPUState argument. > I'd rather not do that. IMO, a CPU feature test should operate on CPU, > not an "accelerator". If it's a

Re: [PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-17 Thread Andrew Jones
On Wed, Jun 17, 2020 at 03:08:00PM +0200, Philippe Mathieu-Daudé wrote: > Since commit d70c996df23f, when enabling the PMU we get: > > $ qemu-system-aarch64 -cpu host,pmu=on -M virt,accel=kvm,gic-version=3 > Segmentation fault (core dumped) > > Thread 1 "qemu-system-aar" received signal

Re: [PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200617130800.26355-1-phi...@redhat.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!/bin/bash

[PATCH] target/arm/kvm: Check supported feature per accelerator (not per vCPU)

2020-06-17 Thread Philippe Mathieu-Daudé
Since commit d70c996df23f, when enabling the PMU we get: $ qemu-system-aarch64 -cpu host,pmu=on -M virt,accel=kvm,gic-version=3 Segmentation fault (core dumped) Thread 1 "qemu-system-aar" received signal SIGSEGV, Segmentation fault. 0xaae356d0 in kvm_ioctl (s=0x0, type=44547) at