[PATCH 3/3] tests/acpi: Add expected ACPI SRAT AML file for RISC-V

2024-08-08 Thread Haibo Xu
added. Signed-off-by: Haibo Xu --- tests/data/acpi/riscv64/virt/SRAT.numamem | Bin 0 -> 108 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/riscv64/virt/SRAT.numamem b/tests/data/acpi/riscv64/virt/SRAT.numamem in

[PATCH 1/3] tests/acpi: Add empty ACPI SRAT data file for RISC-V

2024-08-08 Thread Haibo Xu
As per process documented (steps 1-3) in bios-tables-test.c, add empty AML data file for RISC-V ACPI SRAT table and add the entry in bios-tables-test-allowed-diff.h. Signed-off-by: Haibo Xu --- tests/data/acpi/riscv64/virt/SRAT.numamem | 0 tests/qtest/bios-tables-test-allowed-diff.h | 1 + 2

[PATCH 2/3] tests/qtest/bios-tables-test.c: Enable numamem testing for RISC-V

2024-08-08 Thread Haibo Xu
Add ACPI SRAT table test case for RISC-V when NUMA was enabled. Signed-off-by: Haibo Xu --- tests/qtest/bios-tables-test.c | 28 1 file changed, 28 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 36e5c0adde

Re: [PATCH] hw/riscv/virt-acpi-build.c: Add SRAT and SLIT ACPI tables

2024-02-19 Thread Haibo Xu
++Alistair. Sorry for that! It seems some typo or paste issue occurred when pushing the patch. Hi Alistair, Could you help review this patch? Thanks, Haibo On Mon, Jan 29, 2024 at 7:37 PM Haibo Xu wrote: > > On Mon, Jan 29, 2024 at 5:47 PM Andrew Jones wrote: > > > > On Mo

Re: [PATCH] hw/riscv/virt-acpi-build.c: Add SRAT and SLIT ACPI tables

2024-01-29 Thread Haibo Xu
On Mon, Jan 29, 2024 at 5:47 PM Andrew Jones wrote: > > On Mon, Jan 29, 2024 at 05:42:00PM +0800, Haibo Xu wrote: > > Enable ACPI NUMA support by adding the following 2 ACPI tables: > > SRAT: provides the association for memory/Harts and Proximity Domains > > SLIT: provid

[PATCH] hw/riscv/virt-acpi-build.c: Add SRAT and SLIT ACPI tables

2024-01-29 Thread Haibo Xu
ECR[2]. [1] https://github.com/riscv-non-isa/riscv-acpi/issues/25 [2] https://mantis.uefi.org/mantis/view.php?id=2433 Signed-off-by: Haibo Xu --- hw/riscv/virt-acpi-build.c | 60 ++ 1 file changed, 60 insertions(+) diff --git a/hw/riscv/virt-acpi-build.c b/hw

Re: [RFC PATCH v2 4/5] Add migration support for KVM guest with MTE

2021-04-01 Thread Haibo Xu
On Fri, 26 Mar 2021 at 03:38, Dr. David Alan Gilbert wrote: > > * Haibo Xu (haibo...@linaro.org) wrote: > > On Thu, 18 Mar 2021 at 04:11, Dr. David Alan Gilbert > > wrote: > > > > > > * Haibo Xu (haibo...@linaro.org) wrote: > > > > To make it ea

Re: [RFC PATCH v2 4/5] Add migration support for KVM guest with MTE

2021-04-01 Thread Haibo Xu
On Thu, 25 Mar 2021 at 23:37, Juan Quintela wrote: > > Haibo Xu wrote: > > To make it easier to keep the page tags sync with > > the page data, tags for one page are appended to > > the data during ram save iteration. > > > > This patch only add the pre-copy

Re: [RFC PATCH v2 3/5] Add APIs to get/set MTE tags

2021-04-01 Thread Haibo Xu
On Thu, 25 Mar 2021 at 20:18, Juan Quintela wrote: > > Haibo Xu wrote: > > MTE spec provide instructions to retrieve the memory tags: > > (1) LDG, at 16 bytes granularity, and available in both user > > and kernel space; > > (2) LDGM, at 256 bytes gr

[PATCH RESEND v2 4/6] hw/intc/arm_gicv3: Enable support for setting vGIC maintenance IRQ

2021-04-01 Thread Haibo Xu
Using the new VGIC KVM device attribute to set the maintenance IRQ. This is fixed to use IRQ 25(PPI 9), as a platform decision matching the arm64 SBSA recommendation. Signed-off-by: Haibo Xu --- hw/arm/virt.c | 5 + hw/intc/arm_gicv3_common.c | 1 + hw/intc

[PATCH RESEND v2 6/6] target/arm: Add vCPU feature 'el2' test.

2021-04-01 Thread Haibo Xu
Signed-off-by: Haibo Xu --- target/arm/monitor.c | 2 +- tests/qtest/arm-cpu-features.c | 9 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/target/arm/monitor.c b/target/arm/monitor.c index 80c64fa355..6c39238925 100644 --- a/target/arm/monitor.c +++ b/target

[PATCH RESEND v2 3/6] target/arm/kvm: Add an option to turn on/off el2 support

2021-04-01 Thread Haibo Xu
Adds an el2=[on/off] option to enable/disable el2(nested virtualization) support in KVM guest vCPU. Signed-off-by: Haibo Xu --- target/arm/cpu.c | 11 ++ target/arm/cpu.h | 4 target/arm/cpu64.c | 52 ++ 3 files changed, 67

[PATCH RESEND v2 5/6] target/arm/cpu: Enable 'el2' to work with host/max cpu

2021-04-01 Thread Haibo Xu
Turn off the 'el2' cpu property by default to keep in line with that in TCG mode, i.e. we can now use '-cpu max|host,el2=on' to enable the nested virtualization. Signed-off-by: Haibo Xu --- hw/arm/virt.c | 14 ++ target/arm/cpu.c | 3 ++- target/arm/cp

[PATCH RESEND v2 2/6] target/arm/kvm: Add helper to detect el2 when using KVM

2021-04-01 Thread Haibo Xu
Signed-off-by: Haibo Xu --- target/arm/kvm64.c | 5 + target/arm/kvm_arm.h | 13 + 2 files changed, 18 insertions(+) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index dff85f6db9..9cacaf2eb8 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -721,6 +721,11

[PATCH RESEND v2 0/6] target/arm: Add nested virtualization support

2021-04-01 Thread Haibo Xu
KVM patches[1], and has been tested on a FVP model to run a L2 guest with Qemu. Now the feature can be enabled by "-M virt,accel=kvm -cpu host,el2=on" when starting a VM. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/nv-5.12-WIP Haibo Xu (

[PATCH RESEND v2 1/6] Update linux header with new arm64 NV macro

2021-04-01 Thread Haibo Xu
Signed-off-by: Haibo Xu --- linux-headers/asm-arm64/kvm.h | 2 ++ linux-headers/linux/kvm.h | 1 + 2 files changed, 3 insertions(+) diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index b6a0eaa32a..77b995a26c 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b/linux

[PATCH v2 3/6] target/arm/kvm: Add an option to turn on/off el2 support

2021-04-01 Thread Haibo Xu
Adds an el2=[on/off] option to enable/disable el2(nested virtualization) support in KVM guest vCPU. Signed-off-by: Haibo Xu --- target/arm/cpu.c | 11 ++ target/arm/cpu.h | 4 target/arm/cpu64.c | 52 ++ 3 files changed, 67

[PATCH v2 6/6] target/arm: Add vCPU feature 'el2' test.

2021-04-01 Thread Haibo Xu
Signed-off-by: Haibo Xu --- target/arm/monitor.c | 2 +- tests/qtest/arm-cpu-features.c | 9 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/target/arm/monitor.c b/target/arm/monitor.c index 80c64fa355..6c39238925 100644 --- a/target/arm/monitor.c +++ b/target

[PATCH v2 5/6] target/arm/cpu: Enable 'el2' to work with host/max cpu

2021-04-01 Thread Haibo Xu
Turn off the 'el2' cpu property by default to keep in line with that in TCG mode, i.e. we can now use '-cpu max|host,el2=on' to enable the nested virtualization. Signed-off-by: Haibo Xu --- hw/arm/virt.c | 14 ++ target/arm/cpu.c | 3 ++- target/arm/cp

[PATCH v2 2/6] target/arm/kvm: Add helper to detect el2 when using KVM

2021-04-01 Thread Haibo Xu
Signed-off-by: Haibo Xu --- target/arm/kvm64.c | 5 + target/arm/kvm_arm.h | 13 + 2 files changed, 18 insertions(+) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index dff85f6db9..9cacaf2eb8 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -721,6 +721,11

[PATCH v2 4/6] hw/intc/arm_gicv3: Enable support for setting vGIC maintenance IRQ

2021-04-01 Thread Haibo Xu
Using the new VGIC KVM device attribute to set the maintenance IRQ. This is fixed to use IRQ 25(PPI 9), as a platform decision matching the arm64 SBSA recommendation. Signed-off-by: Haibo Xu --- hw/arm/virt.c | 5 + hw/intc/arm_gicv3_common.c | 1 + hw/intc

[PATCH v2 0/6] target/arm: Add nested virtualization support

2021-04-01 Thread Haibo Xu
KVM patches[1], and has been tested on a FVP model to run a L2 guest with Qemu. Now the feature can be enabled by "-M virt,accel=kvm,virtualization=on" when starting a VM. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/nv-5.12-WIP Haibo Xu (

[PATCH v2 1/6] Update linux header with new arm64 NV macro

2021-04-01 Thread Haibo Xu
Signed-off-by: Haibo Xu --- linux-headers/asm-arm64/kvm.h | 2 ++ linux-headers/linux/kvm.h | 1 + 2 files changed, 3 insertions(+) diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index b6a0eaa32a..77b995a26c 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b/linux

Re: [PATCH 3/3] Enable nested virtualization support in arm64 KVM mode

2021-03-23 Thread Haibo Xu
On Mon, 22 Mar 2021 at 18:49, Andrew Jones wrote: > > On Mon, Mar 22, 2021 at 10:07:26AM +, Haibo Xu wrote: > > Add support for arm64 el2 in qemu KVM mode(nested virtualization). > > This feature is disabled by default, just as that in TCG mode, and > > can be enabl

Re: [PATCH 0/3] target/arm: Add nested virtualization support

2021-03-23 Thread Haibo Xu
On Tue, 23 Mar 2021 at 00:32, Andrew Jones wrote: > > On Mon, Mar 22, 2021 at 04:42:23PM +0100, Andrea Bolognani wrote: > > On Mon, 2021-03-22 at 10:07 +0000, Haibo Xu wrote: > > > This series add support for ARMv8.3/8.4 nested virtualization support > > > i

[PATCH 1/3] Update linux header with new arm64 NV macro.

2021-03-22 Thread Haibo Xu
Signed-off-by: Haibo Xu --- linux-headers/asm-arm64/kvm.h | 2 ++ linux-headers/linux/kvm.h | 1 + 2 files changed, 3 insertions(+) diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index b6a0eaa32a..77b995a26c 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b/linux

[PATCH 3/3] Enable nested virtualization support in arm64 KVM mode

2021-03-22 Thread Haibo Xu
Add support for arm64 el2 in qemu KVM mode(nested virtualization). This feature is disabled by default, just as that in TCG mode, and can be enabled by "-M virt,accel=kvm,virtualization=on" when starting a VM. Signed-off-by: Haibo Xu --- hw/arm/virt.c| 11 --- target

[PATCH 0/3] target/arm: Add nested virtualization support

2021-03-22 Thread Haibo Xu
n starting a VM. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/nv-5.12-WIP Haibo Xu (3): Update linux header with new arm64 NV macro. Enable support for setting KVM vGIC maintenance IRQ Enable nested virtualization support in arm64 KVM

[PATCH 2/3] Enable support for setting KVM vGIC maintenance IRQ

2021-03-22 Thread Haibo Xu
Uses the new VGIC KVM device attribute to set the maintenance IRQ. This is fixed to use IRQ 25(PPI 9), as a platform decision matching the arm64 SBSA recommendation. Signed-off-by: Haibo Xu --- hw/intc/arm_gicv3_common.c | 1 + hw/intc/arm_gicv3_kvm.c| 16

Re: [RFC PATCH v2 4/5] Add migration support for KVM guest with MTE

2021-03-17 Thread Haibo Xu
On Thu, 18 Mar 2021 at 04:11, Dr. David Alan Gilbert wrote: > > * Haibo Xu (haibo...@linaro.org) wrote: > > To make it easier to keep the page tags sync with > > the page data, tags for one page are appended to > > the data during ram save iteration. > > > &

[RFC PATCH v2 3/5] Add APIs to get/set MTE tags

2021-03-17 Thread Haibo Xu
user space by providing a new APIs. This patch is just a wrapper for the KVM APIs. Signed-off-by: Haibo Xu --- target/arm/kvm64.c | 24 target/arm/kvm_arm.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 73a191f8e1

[RFC PATCH v2 5/5] Enable the MTE support for KVM guest

2021-03-17 Thread Haibo Xu
Signed-off-by: Haibo Xu --- hw/arm/virt.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 76658b93a3..36cfdb29e9 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -79,6 +79,7 @@ #include "hw/virtio/virtio-io

[RFC PATCH v2 4/5] Add migration support for KVM guest with MTE

2021-03-17 Thread Haibo Xu
To make it easier to keep the page tags sync with the page data, tags for one page are appended to the data during ram save iteration. This patch only add the pre-copy migration support. Post-copy and compress as well as zero page saving are not supported yet. Signed-off-by: Haibo Xu

[RFC PATCH v2 2/5] Add basic MTE support to KVM guest

2021-03-17 Thread Haibo Xu
Enable the virt machine feature "mte" to work with KVM guest. This feature is still hiden from the user in this patch, and will be available in a later patch. Signed-off-by: Haibo Xu --- hw/arm/virt.c | 22 +++--- target/arm/cpu.c | 2 +- target/arm/kv

[RFC PATCH v2 1/5] Update Linux headers with new MTE support

2021-03-17 Thread Haibo Xu
Signed-off-by: Haibo Xu --- linux-headers/linux/kvm.h | 16 1 file changed, 16 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 020b62a619..941743b3a7 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -1056,6 +1056,7

[RFC PATCH v2 0/5] target/arm: Add MTE support to KVM guest

2021-03-17 Thread Haibo Xu
w.org/QEMU/20210312151902.17853-1-steven.pr...@arm.com/ [4] https://elixir.bootlin.com/linux/latest/source/Documentation/ arm64/memory-tagging-extension.rst Haibo Xu (5): Update Linux headers with new MTE support Add basic MTE support to KVM guest Add APIs to get/set MTE tags Add migration support for

Re: [RFC PATCH 4/5] Add migration support for KVM guest with MTE

2021-03-11 Thread Haibo Xu
++ more migration experts! On Tue, 23 Feb 2021 at 06:47, Richard Henderson wrote: > > On 2/22/21 1:46 AM, Haibo Xu wrote: > > As I mentioned in the cover later, the reason to let the tag go with the > > memory data together is to make it easier to sync with each other. I think

Re: [RFC PATCH 3/5] Add APIs to get/set MTE tags

2021-03-11 Thread Haibo Xu
++ more migration experts! On Mon, 8 Feb 2021 at 11:20, Haibo Xu wrote: > > MTE spec provide instructions to retrieve the memory tags: > (1) LDG, at 16 bytes granularity, and available in both user > and kernel space; > (2) LDGM, at 256 bytes granularity in maximum, and only

Re: [RFC PATCH 5/5] Enable the MTE support for KVM guest

2021-03-11 Thread Haibo Xu
++ more migration experts! On Mon, 8 Feb 2021 at 11:20, Haibo Xu wrote: > > Signed-off-by: Haibo Xu > --- > hw/arm/virt.c | 22 +++--- > 1 file changed, 19 insertions(+), 3 deletions(-) > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 623d5e9397..c

Re: [RFC PATCH 2/5] Add basic MTE support to KVM guest

2021-03-11 Thread Haibo Xu
++ more migration experts! On Mon, 8 Feb 2021 at 11:20, Haibo Xu wrote: > > Enable the virt machine feature "mte" to work with > KVM guest. This feature is still hiden from the user > in this patch, and will be available in a later patch. > > Signed-off-by: Haib

Re: [RFC PATCH 1/5] Update Linux headers with new MTE support

2021-03-11 Thread Haibo Xu
++ more migration experts! On Mon, 8 Feb 2021 at 11:20, Haibo Xu wrote: > > Signed-off-by: Haibo Xu > --- > linux-headers/linux/kvm.h | 15 +++ > 1 file changed, 15 insertions(+) > > diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h > inde

Re: [RFC PATCH 4/5] Add migration support for KVM guest with MTE

2021-02-22 Thread Haibo Xu
On Tue, 16 Feb 2021 at 23:31, Richard Henderson wrote: > > On 2/7/21 7:20 PM, Haibo Xu wrote: > > +if (kvm_physical_memory_addr_from_host(kvm_state, addr, &ipa)) { > > +/* Buffer for the page tags(one byte per tag) */ > > +tag_buf = g_try_ma

Re: [RFC PATCH 0/5] target/arm: Add MTE support to KVM guest

2021-02-21 Thread Haibo Xu
t of my area of expertise... > > thanks > -- PMM > Hi Peter, Thanks for cc-ing to the related maintainers! Regards, Haibo > On Mon, 8 Feb 2021 at 03:20, Haibo Xu wrote: > > > > This series add support for MTE(Memory Tagging Extension)[1] > > in KVM guest. It's bas

[RFC PATCH 5/5] Enable the MTE support for KVM guest

2021-02-07 Thread Haibo Xu
Signed-off-by: Haibo Xu --- hw/arm/virt.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 623d5e9397..c2358cf4c5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -79,6 +79,7 @@ #include "hw/virtio/virtio-io

[RFC PATCH 2/5] Add basic MTE support to KVM guest

2021-02-07 Thread Haibo Xu
Enable the virt machine feature "mte" to work with KVM guest. This feature is still hiden from the user in this patch, and will be available in a later patch. Signed-off-by: Haibo Xu --- hw/arm/virt.c | 22 +++--- target/arm/cpu.c | 2 +- target/arm/kv

[RFC PATCH 3/5] Add APIs to get/set MTE tags

2021-02-07 Thread Haibo Xu
user space by providing a new APIs. This patch is just a wrapper for the KVM APIs. Signed-off-by: Haibo Xu --- target/arm/kvm64.c | 24 target/arm/kvm_arm.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 23f34034db

[RFC PATCH 1/5] Update Linux headers with new MTE support

2021-02-07 Thread Haibo Xu
Signed-off-by: Haibo Xu --- linux-headers/linux/kvm.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 020b62a619..6a291a9a35 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -1056,6 +1056,7

[RFC PATCH 0/5] target/arm: Add MTE support to KVM guest

2021-02-07 Thread Haibo Xu
veloper/ip-products/processors/b/ processors-ip-blog/posts/enhancing-memory-safety [2] https://lwn.net/Articles/842827/ [3] https://elixir.bootlin.com/linux/latest/source/Documentation/ arm64/memory-tagging-extension.rst Haibo Xu (5): Update Linux headers with new MTE support Add basic MTE

[RFC PATCH 4/5] Add migration support for KVM guest with MTE

2021-02-07 Thread Haibo Xu
To make it easier to keep the page tags sync with the page data, tags for one page are appended to the data during ram save iteration. This patch only add the pre-copy migration support. Post-copy and compress as well as zero page saving are not supported yet. Signed-off-by: Haibo Xu

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-12-16 Thread Haibo Xu
On Wed, 16 Dec 2020 at 18:23, Steven Price wrote: > > On 16/12/2020 07:31, Haibo Xu wrote: > [...] > > Hi Steve, > > Hi Haibo > > > I have finished verifying the POC on a FVP setup, and the MTE test case can > > be migrated from one VM to another succe

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-12-15 Thread Haibo Xu
On Mon, 7 Dec 2020 at 22:48, Steven Price wrote: > > On 04/12/2020 08:25, Haibo Xu wrote: > > On Fri, 20 Nov 2020 at 17:51, Steven Price wrote: > >> > >> On 19/11/2020 19:11, Marc Zyngier wrote: > >>> On 2020-11-19 18:42, Andrew Jones wrote: > >>

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-12-08 Thread Haibo Xu
On Tue, 8 Dec 2020 at 18:01, Marc Zyngier wrote: > > On 2020-12-08 09:51, Haibo Xu wrote: > > On Mon, 7 Dec 2020 at 22:48, Steven Price wrote: > >> > > [...] > > >> Sounds like you are making good progress - thanks for the update. Have > >> you th

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-12-08 Thread Haibo Xu
On Tue, 8 Dec 2020 at 00:44, Dr. David Alan Gilbert wrote: > > * Steven Price (steven.pr...@arm.com) wrote: > > On 07/12/2020 15:27, Peter Maydell wrote: > > > On Mon, 7 Dec 2020 at 14:48, Steven Price wrote: > > > > Sounds like you are making good progress - thanks for the update. Have > > > > y

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-12-08 Thread Haibo Xu
On Mon, 7 Dec 2020 at 22:48, Steven Price wrote: > > On 04/12/2020 08:25, Haibo Xu wrote: > > On Fri, 20 Nov 2020 at 17:51, Steven Price wrote: > >> > >> On 19/11/2020 19:11, Marc Zyngier wrote: > >>> On 2020-11-19 18:42, Andrew Jones wrote: > >>

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-12-04 Thread Haibo Xu
On Fri, 20 Nov 2020 at 17:51, Steven Price wrote: > > On 19/11/2020 19:11, Marc Zyngier wrote: > > On 2020-11-19 18:42, Andrew Jones wrote: > >> On Thu, Nov 19, 2020 at 03:45:40PM +, Peter Maydell wrote: > >>> On Thu, 19 Nov 2020 at 15:39, Steven Price wrote: > >>> > This series adds support

Re: [PATCH v3 07/12] hw/arm/virt: Move post cpu realize check into its own function

2020-09-15 Thread Haibo Xu
On Tue, 15 Sep 2020 at 15:31, Andrew Jones wrote: > > On Tue, Sep 15, 2020 at 03:03:49PM +0800, Haibo Xu wrote: > > On Tue, 15 Sep 2020 at 14:22, Andrew Jones wrote: > > > > > > On Tue, Sep 15, 2020 at 03:11:43AM +, Haibo Xu wrote: > > > > From: An

Re: [PATCH v3 03/12] target/arm/cpu: spe: Add an option to turn on/off vSPE support

2020-09-15 Thread Haibo Xu
On Tue, 15 Sep 2020 at 14:11, Andrew Jones wrote: > > On Tue, Sep 15, 2020 at 03:11:39AM +, Haibo Xu wrote: > > Adds a spe=[on/off] option to enable/disable vSPE support in > > guest vCPU. > > > > Reviewed-by: Andrew Jones > > Signed-off-by: Haibo Xu

Re: [PATCH v3 07/12] hw/arm/virt: Move post cpu realize check into its own function

2020-09-15 Thread Haibo Xu
On Tue, 15 Sep 2020 at 14:22, Andrew Jones wrote: > > On Tue, Sep 15, 2020 at 03:11:43AM +, Haibo Xu wrote: > > From: Andrew Jones > > > > We'll add more to this new function in coming patches so we also > > state the gic must be created and call it below

[PATCH v3 10/12] target/arm/cpu: spe: Enable spe to work with host cpu

2020-09-14 Thread Haibo Xu
Turn on the spe cpu property by default if host cpu support it, i.e. we can now do '-cpu max|host' to add the vSPE, and '-cpu max|host,spe=off' to remove it. Signed-off-by: Haibo Xu --- target/arm/cpu.c | 1 + target/arm/cpu.h | 2 ++ target/arm/cpu64.c | 10 +++---

[PATCH v3 09/12] hw/arm/virt: spe: Add vSPE device and corresponding interrupt support

2020-09-14 Thread Haibo Xu
Add a virtual SPE device for virt machine while using PPI 5 for SPE overflow interrupt number which has already selected in kvmtool for the in-kernel irqchip support. Reviewed-by: Andrew Jones Signed-off-by: Haibo Xu --- hw/arm/virt-acpi-build.c| 3 +++ hw/arm/virt.c | 43

[PATCH v3 08/12] hw/arm/virt: Move kvm pmu setup to virt_cpu_post_init

2020-09-14 Thread Haibo Xu
From: Andrew Jones Move the KVM PMU setup part of fdt_add_pmu_nodes() to virt_cpu_post_init(), which is a more appropriate location. Now fdt_add_pmu_nodes() is also named more appropriately, because it no longer does anything but fdt node creation. No functional change intended. Signed-off-by:

[PATCH v3 07/12] hw/arm/virt: Move post cpu realize check into its own function

2020-09-14 Thread Haibo Xu
From: Andrew Jones We'll add more to this new function in coming patches so we also state the gic must be created and call it below create_gic(). No functional change intended. Signed-off-by: Andrew Jones Reviewed-by: Peter Maydell --- hw/arm/virt.c | 38 ++---

[PATCH v3 04/12] target/arm: spe: Only enable SPE from 5.2 compat machines.

2020-09-14 Thread Haibo Xu
Reviewed-by: Andrew Jones Signed-off-by: Haibo Xu --- hw/arm/virt.c | 7 +++ include/hw/arm/virt.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index acf9bfbece..3f6d26c531 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1830,6 +1830,10

[PATCH v3 05/12] target/arm/kvm: spe: Unify device attr operation helper

2020-09-14 Thread Haibo Xu
From: Andrew Jones Rename kvm_arm_pmu_set_attr() to kvm_arm_set_device_attr(), So both the vPMU and vSPE device can share the same API. Signed-off-by: Andrew Jones Signed-off-by: Haibo Xu --- target/arm/kvm64.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a

[PATCH v3 06/12] target/arm/kvm: spe: Add device init and set_irq operations

2020-09-14 Thread Haibo Xu
Reviewed-by: Andrew Jones Signed-off-by: Haibo Xu --- target/arm/kvm64.c | 33 + target/arm/kvm_arm.h | 5 + 2 files changed, 38 insertions(+) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 8ffd31ffdf..5a2032fc9e 100644 --- a/target/arm/kvm64

[PATCH v3 12/12] target/arm: spe: Add corresponding test.

2020-09-14 Thread Haibo Xu
Reviewed-by: Andrew Jones Signed-off-by: Haibo Xu --- target/arm/monitor.c | 2 +- tests/qtest/arm-cpu-features.c | 9 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/target/arm/monitor.c b/target/arm/monitor.c index ba6e01abd0..1b8f08988a 100644 --- a/target

[PATCH v3 02/12] target/arm/kvm: spe: Add helper to detect SPE when using KVM

2020-09-14 Thread Haibo Xu
Reviewed-by: Andrew Jones Reviewed-by: Richard Henderson Signed-off-by: Haibo Xu --- target/arm/kvm.c | 5 + target/arm/kvm_arm.h | 13 + 2 files changed, 18 insertions(+) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 8bb7318378..58f991e890 100644 --- a/target

[PATCH v3 11/12] target/arm/kvm: spe: Enable userspace irqchip support.

2020-09-14 Thread Haibo Xu
Since the current kernel patches haven't enabled the userspace irqchip support, this patch is not verified yet! Reviewed-by: Andrew Jones Signed-off-by: Haibo Xu --- hw/arm/virt.c| 2 +- target/arm/kvm.c | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/arm/v

[PATCH v3 03/12] target/arm/cpu: spe: Add an option to turn on/off vSPE support

2020-09-14 Thread Haibo Xu
Adds a spe=[on/off] option to enable/disable vSPE support in guest vCPU. Reviewed-by: Andrew Jones Signed-off-by: Haibo Xu --- target/arm/cpu.c | 6 ++ target/arm/cpu.h | 13 target/arm/cpu64.c | 52 ++ 3 files changed, 71

[PATCH v3 01/12] update Linux headers with new vSPE macros

2020-09-14 Thread Haibo Xu
Signed-off-by: Haibo Xu --- linux-headers/asm-arm64/kvm.h | 4 linux-headers/linux/kvm.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index 9e34f0f875..802319ee02 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b

[PATCH v3 00/12] target/arm: Add vSPE support to KVM guest

2020-09-14 Thread Haibo Xu
/arm-kernel/msg776228.html [3]https://www.mail-archive.com/qemu-devel@nongnu.org/msg727588.html Haibo Xu (12): update Linux headers with new vSPE macros target/arm/kvm: spe: Add helper to detect SPE when using KVM target/arm/cpu: spe: Add an option to turn on/off vSPE support target/arm: s

Re: [PATCH v2 09/12] hw/arm/virt: spe: Add SPE fdt binding for virt machine

2020-09-09 Thread Haibo Xu
On Wed, 9 Sep 2020 at 17:34, Andrew Jones wrote: > > On Wed, Sep 09, 2020 at 03:51:14PM +0800, Haibo Xu wrote: > > > > + > > > > +if (spe) { > > > > +assert(ARM_CPU(cpu)->has_spe == ON_OFF_AUTO_ON); >

Re: [PATCH v2 10/12] target/arm/cpu: spe: Enable spe to work with host cpu

2020-09-09 Thread Haibo Xu
On Tue, 8 Sep 2020 at 19:33, Andrew Jones wrote: > > On Tue, Sep 08, 2020 at 08:13:28AM +, Haibo Xu wrote: > > Turn on the spe cpu property by default if host cpu > > support it, i.e. we can now do '-cpu max|host' to add > > the vSPE, and '-cpu max|hos

Re: [PATCH v2 09/12] hw/arm/virt: spe: Add SPE fdt binding for virt machine

2020-09-09 Thread Haibo Xu
On Tue, 8 Sep 2020 at 19:16, Andrew Jones wrote: > > > This patch does much more than the summary "hw/arm/virt: spe: Add SPE fdt > binding for virt machine" says it does. Please revise the summary. > Will revise it in v3. Thanks, Haibo > On Tue, Sep 08, 2020 at 08:1

Re: [PATCH v2 07/12] hw/arm/virt: Move post cpu realize check into its own function

2020-09-08 Thread Haibo Xu
On Tue, 8 Sep 2020 at 19:03, Andrew Jones wrote: > > On Tue, Sep 08, 2020 at 08:13:25AM +, Haibo Xu wrote: > > From: Andrew Jones > > > > We'll add more to this new function in coming patches so we also > > state the gic must be created and call it below

Re: [PATCH v2 12/12] target/arm: spe: Add corresponding doc and test.

2020-09-08 Thread Haibo Xu
On Tue, 8 Sep 2020 at 19:41, Andrew Jones wrote: > > On Tue, Sep 08, 2020 at 08:13:30AM +, Haibo Xu wrote: > > Signed-off-by: Haibo Xu > > --- > > docs/system/arm/cpu-features.rst | 20 > > target/arm/monitor.c | 2 +- >

Re: [PATCH v2 11/12] target/arm/kvm: spe: Enable userspace irqchip support.

2020-09-08 Thread Haibo Xu
On Tue, 8 Sep 2020 at 19:35, Andrew Jones wrote: > > On Tue, Sep 08, 2020 at 08:13:29AM +, Haibo Xu wrote: > > Since the current kernel patches haven't enabled the > > userspace irqchip support, this patch is not verified yet! > > > > Signed-off-by: Haibo X

Re: [PATCH v2 05/12] target/arm/kvm: spe: Unify device attr operation helper

2020-09-08 Thread Haibo Xu
On Tue, 8 Sep 2020 at 18:56, Andrew Jones wrote: > > On Tue, Sep 08, 2020 at 08:13:23AM +, Haibo Xu wrote: > > From: Andrew Jones > > > > Rename kvm_arm_pmu_set_attr() to kvm_arm_set_device_attr(), > > So both the vPMU and vSPE device can share the same API.

[PATCH v2 06/12] target/arm/kvm: spe: Add device init and set_irq operations

2020-09-08 Thread Haibo Xu
Signed-off-by: Haibo Xu --- target/arm/kvm64.c | 33 + target/arm/kvm_arm.h | 5 + 2 files changed, 38 insertions(+) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 8ffd31ffdf..5a2032fc9e 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c

[PATCH v2 11/12] target/arm/kvm: spe: Enable userspace irqchip support.

2020-09-08 Thread Haibo Xu
Since the current kernel patches haven't enabled the userspace irqchip support, this patch is not verified yet! Signed-off-by: Haibo Xu --- linux-headers/linux/kvm.h | 1 + target/arm/kvm.c | 5 + 2 files changed, 6 insertions(+) diff --git a/linux-headers/linux/kvm.h b/

[PATCH v2 04/12] target/arm: spe: Only enable SPE from 5.2 compat machines.

2020-09-08 Thread Haibo Xu
Signed-off-by: Haibo Xu --- hw/arm/virt.c | 7 +++ include/hw/arm/virt.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index acf9bfbece..3f6d26c531 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1830,6 +1830,10 @@ static void machvirt_init

[PATCH v2 08/12] hw/arm/virt: Move kvm pmu setup to virt_cpu_post_init

2020-09-08 Thread Haibo Xu
From: Andrew Jones Move the KVM PMU setup part of fdt_add_pmu_nodes() to virt_cpu_post_init(), which is a more appropriate location. Now fdt_add_pmu_nodes() is also named more appropriately, because it no longer does anything but fdt node creation. No functional change intended. Signed-off-by:

[PATCH v2 12/12] target/arm: spe: Add corresponding doc and test.

2020-09-08 Thread Haibo Xu
Signed-off-by: Haibo Xu --- docs/system/arm/cpu-features.rst | 20 target/arm/monitor.c | 2 +- tests/qtest/arm-cpu-features.c | 9 + 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu

[PATCH v2 02/12] target/arm/kvm: spe: Add helper to detect SPE when using KVM

2020-09-08 Thread Haibo Xu
Reviewed-by: Richard Henderson Signed-off-by: Haibo Xu --- target/arm/kvm.c | 5 + target/arm/kvm_arm.h | 13 + 2 files changed, 18 insertions(+) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 8bb7318378..58f991e890 100644 --- a/target/arm/kvm.c +++ b/target/arm

[PATCH v2 03/12] target/arm/cpu: spe: Add an option to turn on/off vSPE support

2020-09-08 Thread Haibo Xu
Adds a spe=[on/off] option to enable/disable vSPE support in guest vCPU. Signed-off-by: Haibo Xu --- target/arm/cpu.c | 6 ++ target/arm/cpu.h | 13 target/arm/cpu64.c | 52 ++ 3 files changed, 71 insertions(+) diff --git a

[PATCH v2 00/12] target/arm: Add vSPE support to KVM guest

2020-09-08 Thread Haibo Xu
rofiling-extension-for-armv8-a [2]https://www.spinics.net/lists/arm-kernel/msg776228.html [3]https://www.mail-archive.com/qemu-devel@nongnu.org/msg727588.html Haibo Xu (12): update Linux headers with new vSPE macros target/arm/kvm: spe: Add helper to detect SPE when using KVM target/arm/c

[PATCH v2 10/12] target/arm/cpu: spe: Enable spe to work with host cpu

2020-09-08 Thread Haibo Xu
Turn on the spe cpu property by default if host cpu support it, i.e. we can now do '-cpu max|host' to add the vSPE, and '-cpu max|host,spe=off' to remove it. Signed-off-by: Haibo Xu --- target/arm/cpu.c | 3 +++ target/arm/cpu.h | 2 ++ target/arm/cpu64.c | 7 ++-

[PATCH v2 07/12] hw/arm/virt: Move post cpu realize check into its own function

2020-09-08 Thread Haibo Xu
From: Andrew Jones We'll add more to this new function in coming patches so we also state the gic must be created and call it below create_gic(). No functional change intended. Signed-off-by: Andrew Jones --- hw/arm/virt.c | 38 ++ 1 file changed, 22 insert

[PATCH v2 09/12] hw/arm/virt: spe: Add SPE fdt binding for virt machine

2020-09-08 Thread Haibo Xu
Add a virtual SPE device for virt machine while using PPI 5 for SPE overflow interrupt number which has already selected in kvmtool. Signed-off-by: Haibo Xu --- hw/arm/virt-acpi-build.c| 3 +++ hw/arm/virt.c | 43 - include/hw/acpi/acpi

[PATCH v2 05/12] target/arm/kvm: spe: Unify device attr operation helper

2020-09-08 Thread Haibo Xu
From: Andrew Jones Rename kvm_arm_pmu_set_attr() to kvm_arm_set_device_attr(), So both the vPMU and vSPE device can share the same API. Signed-off-by: Andrew Jones --- target/arm/kvm64.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/arm/kvm64.c b/target

[PATCH v2 01/12] update Linux headers with new vSPE macros

2020-09-08 Thread Haibo Xu
Signed-off-by: Haibo Xu --- linux-headers/asm-arm64/kvm.h | 4 linux-headers/linux/kvm.h | 1 + 2 files changed, 5 insertions(+) diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index 9e34f0f875..802319ee02 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b

Re: [PATCH 0/7] target/arm: Add vSPE support to KVM guest

2020-08-31 Thread Haibo Xu
On Mon, 31 Aug 2020 at 15:56, Auger Eric wrote: > > Hi Haibo, > > On 8/7/20 10:10 AM, Haibo Xu wrote: > > This series add support for SPE(Statistical Profiling Extension)[1] > > in KVM guest. It's based on Andrew Murray's kernel KVM patches V2[2], > > and

Re: [PATCH 6/7] hw/arm/virt: spe: Add SPE fdt binding for virt machine

2020-08-30 Thread Haibo Xu
On Sat, 29 Aug 2020 at 23:22, Auger Eric wrote: > > Hi Haibo, > > On 8/7/20 10:10 AM, Haibo Xu wrote: > > Add a virtual SPE device for virt machine while using PPI > > 5 for SPE overflow interrupt number. > > > > Signed-off-by: Haibo Xu > > --- > &g

Re: [PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu

2020-08-11 Thread Haibo Xu
On Wed, 12 Aug 2020 at 00:50, Andrew Jones wrote: > > On Tue, Aug 11, 2020 at 11:15:42AM +0800, Haibo Xu wrote: > > > > +if (!cpu->has_spe || !kvm_enabled()) { > > > > +unset_feature(env, ARM_FEATURE_SPE); > > > > +} >

Re: [PATCH 6/7] hw/arm/virt: spe: Add SPE fdt binding for virt machine

2020-08-11 Thread Haibo Xu
On Wed, 12 Aug 2020 at 00:40, Andrew Jones wrote: > On Tue, Aug 11, 2020 at 10:38:02AM +0800, Haibo Xu wrote: > > On Mon, 10 Aug 2020 at 19:05, Andrew Jones wrote: > > > > > > On Fri, Aug 07, 2020 at 08:10:36AM +, Haibo Xu wrote: > > > > Add a virtual

Re: [PATCH 7/7] target/arm/cpu: spe: Enable spe to work with host cpu

2020-08-10 Thread Haibo Xu
On Mon, 10 Aug 2020 at 19:16, Andrew Jones wrote: > > On Fri, Aug 07, 2020 at 08:10:37AM +, Haibo Xu wrote: > > Turn on the spe cpu property by default when working with host > > cpu type in KVM mode, i.e. we can now do '-cpu host' to add the > > vSPE, an

Re: [PATCH 6/7] hw/arm/virt: spe: Add SPE fdt binding for virt machine

2020-08-10 Thread Haibo Xu
On Mon, 10 Aug 2020 at 19:05, Andrew Jones wrote: > > On Fri, Aug 07, 2020 at 08:10:36AM +, Haibo Xu wrote: > > Add a virtual SPE device for virt machine while using PPI > > 5 for SPE overflow interrupt number. > > Any reason PPI 5 was selected? > No special reas

Re: [PATCH 4/7] target/arm/kvm: spe: Unify device attr operatioin helper

2020-08-10 Thread Haibo Xu
On Mon, 10 Aug 2020 at 18:29, Andrew Jones wrote: > > On Mon, Aug 10, 2020 at 10:48:41AM +0800, Haibo Xu wrote: > > On Fri, 7 Aug 2020 at 16:19, Philippe Mathieu-Daudé wrote: > > > > > > On 8/7/20 10:10 AM, Haibo Xu wrote: > > > > Rename kvm_

Re: [PATCH 3/7] target/arm/cpu: spe: Add an option to turn on/off vSPE support

2020-08-09 Thread Haibo Xu
On Fri, 7 Aug 2020 at 16:28, Philippe Mathieu-Daudé wrote: > > Hi Haibo, > > On 8/7/20 10:10 AM, Haibo Xu wrote: > > Adds a spe=[on/off] option to enable/disable vSPE support in > > guest vCPU. Note this option is only available for "-cpu host" > >

Re: [PATCH 4/7] target/arm/kvm: spe: Unify device attr operatioin helper

2020-08-09 Thread Haibo Xu
On Fri, 7 Aug 2020 at 16:19, Philippe Mathieu-Daudé wrote: > > On 8/7/20 10:10 AM, Haibo Xu wrote: > > Rename kvm_arm_pmu_set_attr() to kvm_arm_dev_set_attr(), > > Maybe rename kvm_arm_device_set_attr() to match the structure > name? > Thanks for the review! I will updat

  1   2   >