[PATCH v7 9/9] target/arm/kvm: host cpu: Add support for sve properties

2019-10-24 Thread Andrew Jones
fic when enabling vector lengths. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger Reviewed-by: Richard Henderson Tested-by: Masayoshi Mizuma --- docs/arm-cpu-features.rst | 19 --- target/arm/cpu.c | 3 +++ target/arm/cpu.h

[PATCH v7 8/9] target/arm/cpu64: max cpu: Support sve properties with KVM

2019-10-24 Thread Andrew Jones
with Richard Henderson, who reworked the target/arm/cpu64.c changes in order to push all the validation and auto-enabling/disabling steps into the finalizer, resulting in a nice LOC reduction. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger Reviewed-by: Richard Henderson Tested-by: Masayoshi M

[PATCH v7 7/9] target/arm/kvm: scratch vcpu: Preserve input kvm_vcpu_init features

2019-10-24 Thread Andrew Jones
doesn't want to select a target they can pass -1 for the target which indicates they want to use the preferred target and have it passed back like before. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Tested-by: Masayoshi Mizuma Reviewed-by: Beata Mich

[PATCH v7 6/9] target/arm/kvm64: max cpu: Enable SVE when available

2019-10-24 Thread Andrew Jones
e other SVE CPU properties in later patches. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Tested-by: Masayoshi Mizuma Reviewed-by: Beata Michalska --- target/arm/cpu64.c | 17 ++--- target/arm/kvm.c | 5 + target/arm/kvm

[PATCH v7 2/9] tests: arm: Introduce cpu feature tests

2019-10-24 Thread Andrew Jones
Now that Arm CPUs have advertised features lets add tests to ensure we maintain their expected availability with and without KVM. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger --- tests/Makefile.include | 5 +- tests/arm-cpu-features.c | 240 +++ 2

[PATCH v7 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-10-24 Thread Andrew Jones
d the target/arm/cpu64.c changes in order to push all the validation and auto-enabling/disabling steps into the finalizer, resulting in a nice LOC reduction. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Tested-by: Masayoshi Mizuma Reviewed-by: Beata Mich

[PATCH v7 3/9] target/arm: Allow SVE to be disabled via a CPU property

2019-10-24 Thread Andrew Jones
me cpu_max_get/set_sve_vq to cpu_max_get/set_sve_max_vq in order for them to follow the typical *_get/set_ pattern. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Tested-by: Masayoshi Mizuma Reviewed-by: Beata Michalska --- target/arm/cpu.c

[PATCH v7 0/9] target/arm/kvm: enable SVE in guests

2019-10-24 Thread Andrew Jones
e KVM SVE qtest - Renamed sve to sve everywhere - Renamed power-of-2 to power-of-two everywhere - Picked up some more tags from Richard Thanks! drew Andrew Jones (9): target/arm/monitor: Introduce qmp_query_cpu_model_expansion tests: arm: Introduce cpu feature tests target/a

[PATCH v7 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-10-24 Thread Andrew Jones
These are the SVE equivalents to kvm_arch_get/put_fpsimd. Note, the swabbing is different than it is for fpsmid because the vector format is a little-endian stream of words. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Tested-by: Masayoshi Mizuma

[PATCH v7 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-10-24 Thread Andrew Jones
e list of advertised features, e.g. 'vfp' and 'neon'. The only requirement is that we can detect invalid configurations and emit failures at QMP query time. For 'vfp' and 'neon' this will require some refactoring to share a validation function between the QM

Re: [PATCH v6 0/9] target/arm/kvm: enable SVE in guests

2019-10-24 Thread Andrew Jones
On Tue, Oct 22, 2019 at 03:49:51PM +0200, Andrew Jones wrote: > On Tue, Oct 22, 2019 at 11:29:05AM +0100, Peter Maydell wrote: > > On Mon, 21 Oct 2019 at 17:18, Peter Maydell > > wrote: > > > > > > On Mon, 21 Oct 2019 at 17:12, Andrew Jones wrote: > > &g

Re: [PATCH v5 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-10-22 Thread Andrew Jones
On Mon, Oct 21, 2019 at 04:07:14PM +0100, Beata Michalska wrote: > Indeed, the patch got bit messed-up. Apologies for that as well. > I have been testing manually but I did try the test you have provided > and yes it fails - there is a slight problem with the case when qdict_in > is empty,but this

Re: [PATCH v6 0/9] target/arm/kvm: enable SVE in guests

2019-10-22 Thread Andrew Jones
On Tue, Oct 22, 2019 at 11:29:05AM +0100, Peter Maydell wrote: > On Mon, 21 Oct 2019 at 17:18, Peter Maydell wrote: > > > > On Mon, 21 Oct 2019 at 17:12, Andrew Jones wrote: > > > > > > On Mon, Oct 21, 2019 at 04:43:22PM +0100, Peter Maydell wrote: > > &

Re: [PATCH v6 0/9] target/arm/kvm: enable SVE in guests

2019-10-21 Thread Andrew Jones
On Mon, Oct 21, 2019 at 04:43:22PM +0100, Peter Maydell wrote: > On Mon, 21 Oct 2019 at 15:23, Andrew Jones wrote: > > Peter, would you mind running your test on the kvm32 machine with this > > change before I send a v7? > > Still fails: > > pm215@pm-ct:~/qemu/build/a

Re: [PATCH v6 0/9] target/arm/kvm: enable SVE in guests

2019-10-21 Thread Andrew Jones
On Mon, Oct 21, 2019 at 02:54:30PM +0200, Philippe Mathieu-Daudé wrote: > On 10/21/19 2:36 PM, Peter Maydell wrote: > > On Wed, 16 Oct 2019 at 09:54, Andrew Jones wrote: > > > > > > Since Linux kernel v5.2-rc1 KVM has support for enabling SVE in guests. > > >

Re: [PATCH v1 0/5] target/arm/kvm: Provide an option to adjust virtual time

2019-10-18 Thread Andrew Jones
On Thu, Oct 17, 2019 at 05:17:59PM -0400, Masayoshi Mizuma wrote: > Hi Drew, > > Thank you for posting the patches, they seems to work well > because the softlockup is gone and the timestamp jump of > dmesg and ftrace record also disappeared after the guest > is virsh resume'ed. > > Let me add co

[PATCH v3] target/arm/arch_dump: Add SVE notes

2019-10-16 Thread Andrew Jones
When dumping a guest with dump-guest-memory also dump the SVE registers if they are in use. Signed-off-by: Andrew Jones --- v3: - Pulled sve_bswap64 out of kvm64.c and reused it here - Changed fpsr_offset and sve_size to only align to a 16 byte boundary from the note payload offset, not

Re: [PATCH v5 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-10-16 Thread Andrew Jones
On Wed, Oct 16, 2019 at 04:16:57PM +0100, Beata Michalska wrote: > On Wed, 16 Oct 2019 at 14:50, Andrew Jones wrote: > > > > On Wed, Oct 16, 2019 at 02:24:50PM +0100, Beata Michalska wrote: > > > On Tue, 15 Oct 2019 at 12:56, Beata Michalska > > > wrote: > >

[PATCH] s390x/cpumodel: Add missing visit_free

2019-10-16 Thread Andrew Jones
Beata Michalska noticed this missing visit_free() while reviewing arm's implementation of qmp_query_cpu_model_expansion(), which is modeled off this s390x implementation. Signed-off-by: Andrew Jones --- target/s390x/cpu_models.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/

[PATCH v1 5/5] target/arm/cpu: Add the kvm-adjvtime CPU property

2019-10-16 Thread Andrew Jones
kvm-adjvtime is a KVM specific CPU property and a first of its kind. To accommodate it we also add kvm_arm_add_vcpu_properties() and a KVM specific CPU properties description to the CPU features document. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson --- docs/arm-cpu-features.rst

[PATCH v1 4/5] tests/arm-cpu-features: Check feature default values

2019-10-16 Thread Andrew Jones
If we know what the default value should be then we can test for that as well as the feature existence. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson --- tests/arm-cpu-features.c | 44 1 file changed, 35 insertions(+), 9 deletions(-) diff

[PATCH v1 2/5] timer: arm: Introduce functions to get the host cntfrq

2019-10-16 Thread Andrew Jones
When acceleration like KVM is in use it's necessary to use the host's counter frequency when converting ticks to or from time units. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson --- include/qemu/timer.h | 16 1 file changed, 16 insertions(+) diff --git

[PATCH v1 1/5] target/arm/kvm64: kvm64 cpus have timer registers

2019-10-16 Thread Andrew Jones
even though we don't use those registers either. This change was originally posted as a hunk of a different, never merged patch from Bijan Mottahedeh. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson --- target/arm/kvm64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/

[PATCH v1 3/5] target/arm/kvm: Implement cpu feature kvm-adjvtime

2019-10-16 Thread Andrew Jones
patch only provides the implementation. A subsequent patch will provide the CPU property allowing the feature to be enabled. Reported-by: Bijan Mottahedeh Suggested-by: Bijan Mottahedeh Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson --- target/arm/cpu.h | 3 +++ target/arm/kvm.

[PATCH v1 0/5] target/arm/kvm: Provide an option to adjust virtual time

2019-10-16 Thread Andrew Jones
same as kvm64.c. So what could go wrong? Test results would be appreciated. [1] https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg05713.html [2] https://patchew.org/QEMU/20191001125845.8793-1-drjo...@redhat.com/ Thanks, drew Andrew Jones (5): target/arm/kvm64: kvm64 cpus have timer

Re: [PATCH v5 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-10-16 Thread Andrew Jones
On Wed, Oct 16, 2019 at 02:24:50PM +0100, Beata Michalska wrote: > On Tue, 15 Oct 2019 at 12:56, Beata Michalska > wrote: > > > > On Tue, 15 Oct 2019 at 11:56, Andrew Jones wrote: > > > > > > On Tue, Oct 15, 2019 at 10:59:16AM +0100, Beata Michalska wrote:

Re: [PATCH v6 2/9] tests: arm: Introduce cpu feature tests

2019-10-16 Thread Andrew Jones
On Wed, Oct 16, 2019 at 02:26:05PM +0200, Philippe Mathieu-Daudé wrote: > On 10/16/19 2:21 PM, Andrew Jones wrote: > > On Wed, Oct 16, 2019 at 02:05:24PM +0200, Philippe Mathieu-Daudé wrote: > > > > +static void test_query_cpu_model_expansion

Re: [PATCH v6 2/9] tests: arm: Introduce cpu feature tests

2019-10-16 Thread Andrew Jones
On Wed, Oct 16, 2019 at 02:05:24PM +0200, Philippe Mathieu-Daudé wrote: > > +static void test_query_cpu_model_expansion_kvm(const void *data) > > +{ > > +QTestState *qts; > > + > > +qts = qtest_init(MACHINE "-accel kvm -cpu host"); > > + > > +assert_has_feature(qts, "host", "pmu"); > >

Re: [PATCH v2] target/arm/arch_dump: Add SVE notes

2019-10-16 Thread Andrew Jones
On Thu, Oct 10, 2019 at 01:33:02PM -0400, Richard Henderson wrote: > On 10/10/19 2:16 AM, Andrew Jones wrote: > >> It might be best to avoid the ifdef altogether: > >> > >> for (i = 0; i < 32; ++i) { > >> uint64_t *d = (uint64_t *)&buf[sv

[PATCH v6 9/9] target/arm/kvm: host cpu: Add support for sve properties

2019-10-16 Thread Andrew Jones
fic when enabling vector lengths. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger Reviewed-by: Richard Henderson --- docs/arm-cpu-features.rst | 19 --- target/arm/cpu.c | 3 +++ target/arm/cpu.h | 2 ++ target/arm/cpu64.c| 33 +---

[PATCH v6 8/9] target/arm/cpu64: max cpu: Support sve properties with KVM

2019-10-16 Thread Andrew Jones
with Richard Henderson, who reworked the target/arm/cpu64.c changes in order to push all the validation and auto-enabling/disabling steps into the finalizer, resulting in a nice LOC reduction. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger Reviewed-by: Richard Henderson --- docs/ar

[PATCH v6 6/9] target/arm/kvm64: max cpu: Enable SVE when available

2019-10-16 Thread Andrew Jones
e other SVE CPU properties in later patches. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/cpu64.c | 17 ++--- target/arm/kvm.c | 5 + target/arm/kvm64.c | 20 +++- target/arm/kvm

[PATCH v6 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-10-16 Thread Andrew Jones
d the target/arm/cpu64.c changes in order to push all the validation and auto-enabling/disabling steps into the finalizer, resulting in a nice LOC reduction. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- docs/arm-cpu-features.rst

[PATCH v6 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-10-16 Thread Andrew Jones
These are the SVE equivalents to kvm_arch_get/put_fpsimd. Note, the swabbing is different than it is for fpsmid because the vector format is a little-endian stream of words. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/kvm64.c | 183

[PATCH v6 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-10-16 Thread Andrew Jones
e list of advertised features, e.g. 'vfp' and 'neon'. The only requirement is that we can detect invalid configurations and emit failures at QMP query time. For 'vfp' and 'neon' this will require some refactoring to share a validation function between the QM

[PATCH v6 3/9] target/arm: Allow SVE to be disabled via a CPU property

2019-10-16 Thread Andrew Jones
me cpu_max_get/set_sve_vq to cpu_max_get/set_sve_max_vq in order for them to follow the typical *_get/set_ pattern. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/cpu.c | 3 ++- target/arm/cpu64.c | 52 ++

[PATCH v6 7/9] target/arm/kvm: scratch vcpu: Preserve input kvm_vcpu_init features

2019-10-16 Thread Andrew Jones
doesn't want to select a target they can pass -1 for the target which indicates they want to use the preferred target and have it passed back like before. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/kvm.c | 20 +++- t

[PATCH v6 2/9] tests: arm: Introduce cpu feature tests

2019-10-16 Thread Andrew Jones
Now that Arm CPUs have advertised features lets add tests to ensure we maintain their expected availability with and without KVM. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger --- tests/Makefile.include | 5 +- tests/arm-cpu-features.c | 242 +++ 2

[PATCH v6 0/9] target/arm/kvm: enable SVE in guests

2019-10-16 Thread Andrew Jones
7; cpu SVE default. It was still off by default. - Cleaned up #ifdef's for sve_bswap64() - Removed redundant KVM_CAP_ARM_SVE extension check in kvm_arm_sve_get_vls() - Improved the KVM SVE qtest - Renamed sve to sve everywhere - Renamed power-of-2 to power-of-two everywhere - P

Re: [PATCH v5 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-10-16 Thread Andrew Jones
On Wed, Oct 09, 2019 at 03:01:15PM +0100, Beata Michalska wrote: > On Tue, 1 Oct 2019 at 14:04, Andrew Jones wrote: > > > > Introduce cpu properties to give fine control over SVE vector lengths. > > We introduce a property for each valid length up to the current > >

Re: [PATCH v5 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-10-15 Thread Andrew Jones
On Tue, Oct 15, 2019 at 10:59:16AM +0100, Beata Michalska wrote: > On Tue, 1 Oct 2019 at 14:04, Andrew Jones wrote: > > + > > +obj = object_new(object_class_get_name(oc)); > > + > > +if (qdict_in) { > > +Visitor *visitor; > > +Error

Re: [RFC PATCH 3/5] target/arm/kvm: Implement cpu feature kvm-adjvtime

2019-10-09 Thread Andrew Jones
On Wed, Oct 09, 2019 at 08:50:02PM -0400, Richard Henderson wrote: > On 10/7/19 1:06 PM, Andrew Jones wrote: > > +static void kvm_arm_vm_state_change(void *opaque, int running, RunState > > state) > > +{ > > +CPUState *cs = opaque; > > +ARMCPU *cpu

Re: [PATCH v2] target/arm/arch_dump: Add SVE notes

2019-10-09 Thread Andrew Jones
On Wed, Oct 09, 2019 at 08:39:21PM -0400, Richard Henderson wrote: > On 10/4/19 8:03 AM, Andrew Jones wrote: > > +#ifdef TARGET_AARCH64 > > +static off_t sve_zreg_offset(uint32_t vq, int n) > > +{ > > +off_t off = sizeof(struct aarch64_user_sve_header); > > +

[RFC PATCH 5/5] target/arm/cpu: Add the kvm-adjvtime CPU property

2019-10-07 Thread Andrew Jones
kvm-adjvtime is a KVM specific CPU property and a first of its kind. To accommodate it we also add kvm_arm_add_vcpu_properties() and a KVM specific CPU properties description to the CPU features document. Signed-off-by: Andrew Jones --- docs/arm-cpu-features.rst | 27

[RFC PATCH 3/5] target/arm/kvm: Implement cpu feature kvm-adjvtime

2019-10-07 Thread Andrew Jones
patch only provides the implementation. A subsequent patch will provide the CPU property allowing the feature to be enabled. Reported-by: Bijan Mottahedeh Suggested-by: Bijan Mottahedeh Signed-off-by: Andrew Jones --- target/arm/cpu.h | 3 +++ target/arm/kvm.c | 20

[RFC PATCH 4/5] tests/arm-cpu-features: Check feature default values

2019-10-07 Thread Andrew Jones
If we know what the default value should be then we can test for that as well as the feature existence. Signed-off-by: Andrew Jones --- tests/arm-cpu-features.c | 44 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/tests/arm-cpu-features.c

[RFC PATCH 2/5] timer: arm: Introduce functions to get the host cntfrq

2019-10-07 Thread Andrew Jones
When acceleration like KVM is in use it's necessary to use the host's counter frequency when converting ticks to or from time units. Signed-off-by: Andrew Jones --- include/qemu/timer.h | 16 1 file changed, 16 insertions(+) diff --git a/include/qemu/timer.h b/in

[RFC PATCH 1/5] target/arm/kvm64: kvm64 cpus have timer registers

2019-10-07 Thread Andrew Jones
even though we don't use those registers either. This change was originally posted as a hunk of a different, never merged patch from Bijan Mottahedeh. Signed-off-by: Andrew Jones --- target/arm/kvm64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.

[RFC PATCH 0/5] target/arm/kvm: Provide an option to adjust virtual time

2019-10-07 Thread Andrew Jones
3.html [2] https://patchew.org/QEMU/20191001125845.8793-1-drjo...@redhat.com/ Thanks, drew Andrew Jones (5): target/arm/kvm64: kvm64 cpus have timer registers timer: arm: Introduce functions to get the host cntfrq target/arm/kvm: Implement cpu feature kvm-adjvtime tests/arm-cpu-features:

Re: [PATCH v5 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-10-07 Thread Andrew Jones
On Mon, Oct 07, 2019 at 09:35:35AM +0100, Alex Bennée wrote: > > Andrew Jones writes: > > > Introduce cpu properties to give fine control over SVE vector lengths. > > We introduce a property for each valid length up to the current > > maximum supported, which is 20

[PATCH v2] target/arm/arch_dump: Add SVE notes

2019-10-04 Thread Andrew Jones
When dumping a guest with dump-guest-memory also dump the SVE registers if they are in use. Signed-off-by: Andrew Jones --- include/elf.h | 2 + target/arm/arch_dump.c | 135 - 2 files changed, 135 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH] target/arm/arch_dump: Add SVE notes

2019-10-04 Thread Andrew Jones
On Fri, Oct 04, 2019 at 11:46:09AM +0200, Andrew Jones wrote: > When dumping a guest with dump-guest-memory also dump the SVE > registers if they are in use. > > Signed-off-by: Andrew Jones > --- > include/elf.h | 2 + > target/

[PATCH] target/arm/arch_dump: Add SVE notes

2019-10-04 Thread Andrew Jones
When dumping a guest with dump-guest-memory also dump the SVE registers if they are in use. Signed-off-by: Andrew Jones --- include/elf.h | 2 + target/arm/arch_dump.c | 133 - 2 files changed, 133 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v5 0/9] target/arm/kvm: enable SVE in guests

2019-10-03 Thread Andrew Jones
On Thu, Oct 03, 2019 at 11:55:36PM +, Zhang, Lei wrote: > Hi Jones, > > Thanks for your patch. > > I have tested the v5 patch. > > All the test is passed, except one problem. > The problem was reported > in [[Qemu-devel] [RFC QEMU v2 0/2] arm/virt: Account for guest pause time] > https://lis

Re: [PATCH v5 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-10-01 Thread Andrew Jones
On Tue, Oct 01, 2019 at 03:52:46PM +0200, Andrew Jones wrote: > On Tue, Oct 01, 2019 at 02:58:41PM +0200, Andrew Jones wrote: > > These are the SVE equivalents to kvm_arch_get/put_fpsimd. Note, the > > swabbing is different than it is for fpsmid because the vector format > &g

Re: [PATCH v5 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-10-01 Thread Andrew Jones
On Tue, Oct 01, 2019 at 02:58:41PM +0200, Andrew Jones wrote: > These are the SVE equivalents to kvm_arch_get/put_fpsimd. Note, the > swabbing is different than it is for fpsmid because the vector format > is a little-endian stream of words. > > Signed-off-by: Andrew Jones Hi E

[PATCH v5 6/9] target/arm/kvm64: max cpu: Enable SVE when available

2019-10-01 Thread Andrew Jones
e other SVE CPU properties in later patches. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/cpu64.c | 17 ++--- target/arm/kvm.c | 5 + target/arm/kvm64.c | 20 +++- target/arm/kvm

[PATCH v5 8/9] target/arm/cpu64: max cpu: Support sve properties with KVM

2019-10-01 Thread Andrew Jones
with Richard Henderson, who reworked the target/arm/cpu64.c changes in order to push all the validation and auto-enabling/disabling steps into the finalizer, resulting in a nice LOC reduction. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger --- docs/arm-cpu-features.rst | 45 +++--- targe

[PATCH v5 7/9] target/arm/kvm: scratch vcpu: Preserve input kvm_vcpu_init features

2019-10-01 Thread Andrew Jones
doesn't want to select a target they can pass -1 for the target which indicates they want to use the preferred target and have it passed back like before. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/kvm.c | 20 +++- t

[PATCH v5 9/9] target/arm/kvm: host cpu: Add support for sve properties

2019-10-01 Thread Andrew Jones
fic when enabling vector lengths. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger --- docs/arm-cpu-features.rst | 19 --- target/arm/cpu.c | 3 +++ target/arm/cpu.h | 2 ++ target/arm/cpu64.c| 33 + target/arm/kvm6

[PATCH v5 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-10-01 Thread Andrew Jones
These are the SVE equivalents to kvm_arch_get/put_fpsimd. Note, the swabbing is different than it is for fpsmid because the vector format is a little-endian stream of words. Signed-off-by: Andrew Jones --- target/arm/kvm64.c | 183 ++--- 1 file changed

[PATCH v5 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-10-01 Thread Andrew Jones
e list of advertised features, e.g. 'vfp' and 'neon'. The only requirement is that we can detect invalid configurations and emit failures at QMP query time. For 'vfp' and 'neon' this will require some refactoring to share a validation function between the QM

[PATCH v5 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-10-01 Thread Andrew Jones
d the target/arm/cpu64.c changes in order to push all the validation and auto-enabling/disabling steps into the finalizer, resulting in a nice LOC reduction. Signed-off-by: Andrew Jones --- docs/arm-cpu-features.rst | 168 +++-- include/qemu/bitops.h | 1 + targe

[PATCH v5 3/9] target/arm: Allow SVE to be disabled via a CPU property

2019-10-01 Thread Andrew Jones
me cpu_max_get/set_sve_vq to cpu_max_get/set_sve_max_vq in order for them to follow the typical *_get/set_ pattern. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/cpu.c | 3 ++- target/arm/cpu64.c | 52 ++

[PATCH v5 2/9] tests: arm: Introduce cpu feature tests

2019-10-01 Thread Andrew Jones
Now that Arm CPUs have advertised features lets add tests to ensure we maintain their expected availability with and without KVM. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger --- tests/Makefile.include | 5 +- tests/arm-cpu-features.c | 242 +++ 2

[PATCH v5 0/9] target/arm/kvm: enable SVE in guests

2019-10-01 Thread Andrew Jones
VE qtest - Renamed sve to sve everywhere - Renamed power-of-2 to power-of-two everywhere - Picked up some more tags from Richard Thanks! drew Andrew Jones (9): target/arm/monitor: Introduce qmp_query_cpu_model_expansion tests: arm: Introduce cpu feature tests target/arm: Allow SVE t

Re: [PATCH v4 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-09-30 Thread Andrew Jones
On Tue, Sep 24, 2019 at 01:31:01PM +0200, Andrew Jones wrote: > These are the SVE equivalents to kvm_arch_get/put_fpsimd. Note, the > swabbing is different than it is for fpsmid because the vector format > is a little-endian stream of words. > > Signed-off-by: Andrew Jones > Re

Re: [PATCH v4 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-09-27 Thread Andrew Jones
On Tue, Sep 24, 2019 at 01:31:01PM +0200, Andrew Jones wrote: > These are the SVE equivalents to kvm_arch_get/put_fpsimd. Note, the > swabbing is different than it is for fpsmid because the vector format > is a little-endian stream of words. > > Signed-off-by: Andrew Jones > Re

Re: [PATCH v4 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-09-27 Thread Andrew Jones
On Fri, Sep 27, 2019 at 12:50:55AM +0100, Alex Bennée wrote: > > Richard Henderson writes: > > > On 9/24/19 4:31 AM, Andrew Jones wrote: > > > > >> +#if __SIZEOF_LONG__ == 8 > >> +#define BIT(n) (1UL << (n)) > >> +#else > >> +#

Re: [PATCH v4 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-09-26 Thread Andrew Jones
On Thu, Sep 26, 2019 at 12:07:54PM -0700, Richard Henderson wrote: > On 9/24/19 4:31 AM, Andrew Jones wrote: > > +static uint32_t sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len) > > +{ > > +uint32_t start_vq = (start_len & 0xf) + 1; > > + > > +r

Re: [PATCH v4 8/9] target/arm/cpu64: max cpu: Support sve properties with KVM

2019-09-26 Thread Andrew Jones
On Thu, Sep 26, 2019 at 12:01:36PM +0200, Auger Eric wrote: > > > On 9/26/19 10:41 AM, Andrew Jones wrote: > > On Thu, Sep 26, 2019 at 08:52:55AM +0200, Auger Eric wrote: > >> Hi Drew, > >> > >> On 9/24/19 1:31 PM, Andrew Jones wrote: > >>&g

Re: [PATCH v4 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-09-26 Thread Andrew Jones
On Thu, Sep 26, 2019 at 11:34:45AM +0200, Auger Eric wrote: > > > On 9/26/19 10:21 AM, Andrew Jones wrote: > > On Wed, Sep 25, 2019 at 03:53:42PM +0200, Auger Eric wrote: > >> Hi Drew, > >> > >> On 9/24/19 1:31 PM, Andrew Jones wrote: > >>>

Re: [PATCH v4 9/9] target/arm/kvm: host cpu: Add support for sve properties

2019-09-26 Thread Andrew Jones
On Thu, Sep 26, 2019 at 09:07:36AM +0200, Auger Eric wrote: > Hi Drew, > > On 9/24/19 1:31 PM, Andrew Jones wrote: > > Allow cpu 'host' to enable SVE when it's available, unless the > > user chooses to disable it with the added 'sve=off' cpu property

Re: [PATCH v4 8/9] target/arm/cpu64: max cpu: Support sve properties with KVM

2019-09-26 Thread Andrew Jones
On Thu, Sep 26, 2019 at 08:52:55AM +0200, Auger Eric wrote: > Hi Drew, > > On 9/24/19 1:31 PM, Andrew Jones wrote: > > Extend the SVE vq map initialization and validation with KVM's > > supported vector lengths when KVM is enabled. In order to determine > > and sel

Re: [PATCH v4 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-09-26 Thread Andrew Jones
On Wed, Sep 25, 2019 at 03:53:42PM +0200, Auger Eric wrote: > Hi Drew, > > On 9/24/19 1:31 PM, Andrew Jones wrote: > > Introduce cpu properties to give fine control over SVE vector lengths. > > We introduce a property for each valid length up to the current > > maxim

Re: [PATCH v4 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-09-24 Thread Andrew Jones
On Tue, Sep 24, 2019 at 01:31:00PM +0200, Andrew Jones wrote: > +SVE CPU Property Parsing Semantics > +-- > + > + 1) If SVE is disabled (`sve=off`), then which SVE vector lengths > + are enabled or disabled is irrelevant to the guest, as the ent

[PATCH v4 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-09-24 Thread Andrew Jones
These are the SVE equivalents to kvm_arch_get/put_fpsimd. Note, the swabbing is different than it is for fpsmid because the vector format is a little-endian stream of words. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson --- target/arm/kvm64.c | 137

[PATCH v4 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-09-24 Thread Andrew Jones
e list of advertised features, e.g. 'vfp' and 'neon'. The only requirement is that we can detect invalid configurations and emit failures at QMP query time. For 'vfp' and 'neon' this will require some refactoring to share a validation function between the QM

[PATCH v4 8/9] target/arm/cpu64: max cpu: Support sve properties with KVM

2019-09-24 Thread Andrew Jones
with Richard Henderson, who reworked the target/arm/cpu64.c changes in order to push all the validation and auto-enabling/disabling steps into the finalizer, resulting in a nice LOC reduction. Signed-off-by: Andrew Jones --- docs/arm-cpu-features.rst | 36 +--- target/arm/cpu64.c

[PATCH v4 2/9] tests: arm: Introduce cpu feature tests

2019-09-24 Thread Andrew Jones
Now that Arm CPUs have advertised features lets add tests to ensure we maintain their expected availability with and without KVM. Signed-off-by: Andrew Jones Reviewed-by: Eric Auger --- tests/Makefile.include | 5 +- tests/arm-cpu-features.c | 242 +++ 2

[PATCH v4 9/9] target/arm/kvm: host cpu: Add support for sve properties

2019-09-24 Thread Andrew Jones
fic when enabling vector lengths. Signed-off-by: Andrew Jones --- docs/arm-cpu-features.rst | 19 --- target/arm/cpu.c | 3 +++ target/arm/cpu.h | 2 ++ target/arm/cpu64.c| 33 + target/arm/kvm64.c| 14 +

[PATCH v4 7/9] target/arm/kvm: scratch vcpu: Preserve input kvm_vcpu_init features

2019-09-24 Thread Andrew Jones
doesn't want to select a target they can pass -1 for the target which indicates they want to use the preferred target and have it passed back like before. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/kvm.c | 20 +++- t

[PATCH v4 6/9] target/arm/kvm64: max cpu: Enable SVE when available

2019-09-24 Thread Andrew Jones
e other SVE CPU properties in later patches. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson --- target/arm/cpu64.c | 17 ++--- target/arm/kvm.c | 5 + target/arm/kvm64.c | 20 +++- target/arm/kvm_arm.h | 27 +++

[PATCH v4 4/9] target/arm/cpu64: max cpu: Introduce sve properties

2019-09-24 Thread Andrew Jones
d the target/arm/cpu64.c changes in order to push all the validation and auto-enabling/disabling steps into the finalizer, resulting in a nice LOC reduction. Signed-off-by: Andrew Jones --- docs/arm-cpu-features.rst | 157 +-- target/arm/cpu.c | 19 targe

[PATCH v4 0/9] target/arm/kvm: enable SVE in guests

2019-09-24 Thread Andrew Jones
sion check in kvm_arm_sve_get_vls() - Improved the KVM SVE qtest - Renamed sve to sve everywhere - Renamed power-of-2 to power-of-two everywhere - Picked up some more tags from Richard Thanks! drew Andrew Jones (9): target/arm/monitor: Introduce qmp_query_cpu_model_expansion tes

[PATCH v4 3/9] target/arm: Allow SVE to be disabled via a CPU property

2019-09-24 Thread Andrew Jones
me cpu_max_get/set_sve_vq to cpu_max_get/set_sve_max_vq in order for them to follow the typical *_get/set_ pattern. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson --- target/arm/cpu.c | 3 ++- target/arm/cpu64.c | 42 ++-- target/

Re: [Qemu-devel] [RFC v3 3/3] ARM: KVM: Check KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 for smp_cpus > 256

2019-09-16 Thread Andrew Jones
!kvm_check_extension(s, KVM_CAP_ARM_IRQ_LINE_LAYOUT_2)) { > +error_report("Using more than 256 vcpus requires a host kernel " > + "with KVM_CAP_ARM_IRQ_LINE_LAYOUT_2"); > +ret = -EINVAL; > +} > + > +return ret; > } > > unsigned long kvm_arch_vcpu_id(CPUState *cpu) > -- > 2.20.1 > > Reviewed-by: Andrew Jones

Re: [Qemu-devel] [RFC v3 2/3] intc/arm_gic: Support IRQ injection for more than 256 vpus

2019-09-16 Thread Andrew Jones
uint64_t address, uint32_t data, PCIDevice *dev) > { > diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h > index b3106c8600..b4e19457a0 100644 > --- a/target/arm/kvm_arm.h > +++ b/target/arm/kvm_arm.h > @@ -253,6 +253,7 @@ int kvm_arm_vgic_probe(void); > > void kvm_arm_pmu_set_irq(CPUState *cs, int irq); > void kvm_arm_pmu_init(CPUState *cs); > +int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); > > #else > > -- > 2.20.1 > > Reviewed-by: Andrew Jones

Re: [Qemu-devel] [PATCH v1 3/6] exec: assert on memory_region_register_iommu_notifier() failure

2019-09-13 Thread Andrew Jones
On Fri, Sep 13, 2019 at 10:36:12AM +0200, Eric Auger wrote: > memory_region_register_iommu_notifier now returns an error > in case of failure. Assert in such a case. > > Signed-off-by: Eric Auger > --- > exec.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/exec.c b/

Re: [Qemu-devel] [RFC v2 3/3] virt: Check KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 for smp_cpus > 256

2019-09-12 Thread Andrew Jones
q_line_layout_mismatch(MachineState *ms, int vcpus); > + > /** > * kvm_arm_sync_mpstate_to_kvm > * @cpu: ARMCPU > @@ -281,6 +291,11 @@ static inline int > kvm_arm_get_max_vm_ipa_size(MachineState *ms) > return -ENOENT; > } > > +static inline bool kvm_arm_irq_line_layout_mismatch(MachineState *ms, int > vcpus) > +{ > +return false; > +} > + > static inline int kvm_arm_vgic_probe(void) > { > return 0; > -- > 2.20.1 > > Reviewed-by: Andrew Jones

Re: [Qemu-devel] [RFC v2 2/3] intc/arm_gic: Support IRQ injection for more than 256 vpus

2019-09-12 Thread Andrew Jones
On Wed, Sep 11, 2019 at 05:51:24PM +0200, Eric Auger wrote: > Host kernels that expose the KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 capability > allow injection of interrupts along with vcpu ids larger than 255. > Let's encode the vpcu id on 12 bits according to the upgraded KVM_IRQ_LINE > ABI when needed. >

Re: [Qemu-devel] [PATCH] HACK: Centralize sve property checks

2019-09-04 Thread Andrew Jones
On Fri, Aug 09, 2019 at 06:31:12PM -0700, Richard Henderson wrote: > As promised, an experiment in unifying the checks. > > I believe that I've tested for all of the same conditions, modulo the > timing at which they are emitted. As before, only one error is reported, > so if multiple errors exis

Re: [Qemu-devel] [PATCH v3 00/15] target/arm/kvm: enable SVE in guests

2019-08-20 Thread Andrew Jones
On Tue, Aug 20, 2019 at 06:08:04AM +, Zhang, Lei wrote: > Hi Andrew, > > I have tested your patch on kernel- 5.2.7 + QEMU (4.0.94 + patch). Thanks for the testing! I guess it's time for me to get back to this series and spin a v4 (so we can test some more :-) > > This patch series works fin

Re: [Qemu-devel] [PATCH v3 00/15] target/arm/kvm: enable SVE in guests

2019-08-15 Thread Andrew Jones
On Thu, Aug 15, 2019 at 09:31:35AM +0100, Peter Maydell wrote: > On Fri, 2 Aug 2019 at 13:25, Andrew Jones wrote: > > > > Since Linux kernel v5.2-rc1 KVM has support for enabling SVE in guests. > > This series provides the QEMU bits for that enablement. First, we &g

Re: [Qemu-devel] [PATCH v3 03/15] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-08-09 Thread Andrew Jones
On Thu, Aug 08, 2019 at 11:37:01AM -0700, Richard Henderson wrote: > On 8/8/19 1:50 AM, Andrew Jones wrote: > > I'm not sure. Of course I'd need to experiment with it to be sure, but > > I'm reluctant to go through that exercise, because I believe that a > > def

Re: [Qemu-devel] [PATCH v3 03/15] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-08-08 Thread Andrew Jones
On Wed, Aug 07, 2019 at 08:22:07AM -0700, Richard Henderson wrote: > On 8/6/19 5:21 AM, Andrew Jones wrote: > > That's a reasonable suggestion. I do like having self-contained > > validation, self-contained, but when cross-dependencies arise, then > > it does make sense t

Re: [Qemu-devel] [PATCH v3 11/15] target/arm/kvm64: Add kvm_arch_get/put_sve

2019-08-06 Thread Andrew Jones
On Fri, Aug 02, 2019 at 11:07:54AM -0700, Richard Henderson wrote: > On 8/2/19 5:25 AM, Andrew Jones wrote: > > +/* > > + * SVE registers are encoded in KVM's memory in an endianness-invariant > > format. > > + * The byte at offset i from the start of the in-mem

Re: [Qemu-devel] [PATCH v3 03/15] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-08-06 Thread Andrew Jones
On Fri, Aug 02, 2019 at 06:28:51PM -0700, Richard Henderson wrote: > On 8/2/19 9:27 AM, Richard Henderson wrote: > > On 8/2/19 5:25 AM, Andrew Jones wrote: > >> Note, certainly more features may be added to the list of > >> advertised features, e.g. 'vfp' and

[Qemu-devel] [PATCH v3 12/15] target/arm/kvm64: max cpu: Enable SVE when available

2019-08-02 Thread Andrew Jones
e other SVE CPU properties in later patches. Signed-off-by: Andrew Jones --- target/arm/cpu64.c | 17 ++--- target/arm/kvm.c | 5 + target/arm/kvm64.c | 20 +++- target/arm/kvm_arm.h | 27 +++ tests/arm-cpu-features.c

[Qemu-devel] [PATCH v3 13/15] target/arm/kvm: scratch vcpu: Preserve input kvm_vcpu_init features

2019-08-02 Thread Andrew Jones
doesn't want to select a target they can pass -1 for the target which indicates they want to use the preferred target and have it passed back like before. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- target/arm/kvm.c | 20 +++- t

<    7   8   9   10   11   12   13   14   15   16   >