Re: [PATCH] i386/hvf: Integrates x2APIC support with hvf accel

2024-06-24 Thread Bui Quang Minh
int index = (uint32_t)env->regs[R_ECX] - MSR_APIC_START; + +ret = apic_msr_write(index, data); +if (ret < 0) { +raise_exception(env, EXCP0D_GPF, 0); +} + +break; +} case MSR_FSBASE: wvmcs(cs->accel->fd, VMCS_GUEST_FS_BASE, data); break; Acked-by: Bui Quang Minh

Re: [PATCH] hw/intc/apic: fix memory leak

2024-03-05 Thread Bui Quang Minh
ommonState *s) Reviewed-by: Bui Quang Minh Thanks, Quang Minh.

[PATCH v12 4/7] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2024-01-11 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Suggested-by: Joao Martins Acked-by: Peter Xu Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions

[PATCH v12 7/7] test: bios-tables-test: add IVRS changed binary

2024-01-11 Thread Bui Quang Minh
00 00 // +0080: D3 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // .).. +0090: 02 00 00 00 02 08 00 00 02 10 00 00 02 F8 00 00 // +00A0: 02 FA 00 00 02 FB 00 00 48 00 00 00 00 A0 00 01 // ....H... Signed-off-by: Bui Quang

[PATCH v12 5/7] test: bios-tables-test: prepare IVRS change in ACPI table

2024-01-11 Thread Bui Quang Minh
Following the instructions in bios-tables-test, this lists that IVRS.ivrs in ACPI table will be changed to add new IVHD type 0x11. Signed-off-by: Bui Quang Minh --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test

[PATCH v12 1/7] i386/tcg: implement x2APIC registers MSR access

2024-01-11 Thread Bui Quang Minh
This commit creates apic_register_read/write which are used by both apic_mem_read/write for MMIO access and apic_msr_read/write for MSR access. The apic_msr_read/write returns -1 on error, accelerator can use this to raise the appropriate exception. Signed-off-by: Bui Quang Minh --- hw/intc

[PATCH v12 3/7] apic, i386/tcg: add x2apic transitions

2024-01-11 Thread Bui Quang Minh
, accelerator can use this to raise appropriate exception. Signed-off-by: Bui Quang Minh --- hw/i386/kvm/apic.c | 3 +- hw/i386/xen/xen_apic.c | 3 +- hw/intc/apic.c | 62 +++- hw/intc/apic_common.c| 13

[PATCH v12 0/7] Support x2APIC mode with TCG accelerator

2024-01-11 Thread Bui Quang Minh
nded_log_dest to store APIC_LDR information in x2APIC instead of extending log_dest for backward compatibility in vmstate Version 2 changes, - Add support for APIC ID larger than 255 - Adjust AMD iommu for x2APIC support - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh.

[PATCH v12 6/7] amd_iommu: report x2APIC support to the operating system

2024-01-11 Thread Bui Quang Minh
in amd_iommu.c. Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 129 --- hw/i386/amd_iommu-stub.c | 26 hw/i386/amd_iommu.c | 29 - hw/i386/amd_iommu.h | 16 +++-- hw/i386/meson.build | 3 +- 5 files changed, 145

[PATCH v12 2/7] apic: add support for x2APIC mode

2024-01-11 Thread Bui Quang Minh
register access are supported. Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 6 +- hw/intc/apic.c | 289 hw/intc/apic_common.c | 9 + include/hw/i386/apic.h | 3 +- include/hw/i386/apic_internal.h | 7

Re: CI "pages" job failing with incomprehensible error message from htags

2024-01-08 Thread Bui Quang Minh
On 1/8/24 18:03, Thomas Huth wrote: On 05/01/2024 20.11, Peter Maydell wrote: https://gitlab.com/qemu-project/qemu/-/jobs/5871592479 failed with $ htags -anT --tree-view=filetree -m qemu_init -t "Welcome to the QEMU sourcecode" htags: Negative exec line limit = -371 Does anybody have any

Re: [PATCH v11 0/7] Support x2APIC mode with TCG accelerator

2024-01-06 Thread Bui Quang Minh
On 12/28/23 22:44, Bui Quang Minh wrote: On 12/26/23 16:21, Michael S. Tsirkin wrote: On Mon, Dec 25, 2023 at 11:40:54PM +0700, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode

Re: [PATCH v11 0/7] Support x2APIC mode with TCG accelerator

2023-12-28 Thread Bui Quang Minh
On 12/26/23 16:21, Michael S. Tsirkin wrote: On Mon, Dec 25, 2023 at 11:40:54PM +0700, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted

Re: [PATCH v11 0/7] Support x2APIC mode with TCG accelerator

2023-12-27 Thread Bui Quang Minh
On 12/26/23 16:21, Michael S. Tsirkin wrote: On Mon, Dec 25, 2023 at 11:40:54PM +0700, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted

[PATCH v11 7/7] test: bios-tables-test: add IVRS changed binary

2023-12-25 Thread Bui Quang Minh
00 00 // +0080: D3 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // .).. +0090: 02 00 00 00 02 08 00 00 02 10 00 00 02 F8 00 00 // +00A0: 02 FA 00 00 02 FB 00 00 48 00 00 00 00 A0 00 01 // ....H... Signed-off-by: Bui Quang

[PATCH v11 1/7] i386/tcg: implement x2APIC registers MSR access

2023-12-25 Thread Bui Quang Minh
This commit creates apic_register_read/write which are used by both apic_mem_read/write for MMIO access and apic_msr_read/write for MSR access. The apic_msr_read/write returns -1 on error, accelerator can use this to raise the appropriate exception. Signed-off-by: Bui Quang Minh --- hw/intc

[PATCH v11 3/7] apic, i386/tcg: add x2apic transitions

2023-12-25 Thread Bui Quang Minh
, accelerator can use this to raise appropriate exception. Signed-off-by: Bui Quang Minh --- hw/i386/kvm/apic.c | 3 +- hw/i386/xen/xen_apic.c | 3 +- hw/intc/apic.c | 62 +++- hw/intc/apic_common.c| 13

[PATCH v11 5/7] test: bios-tables-test: prepare IVRS change in ACPI table

2023-12-25 Thread Bui Quang Minh
Following the instructions in bios-tables-test, this lists that IVRS.ivrs in ACPI table will be changed to add new IVHD type 0x11. Signed-off-by: Bui Quang Minh --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test

[PATCH v11 6/7] amd_iommu: report x2APIC support to the operating system

2023-12-25 Thread Bui Quang Minh
device. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 129 +++ hw/i386/amd_iommu.c | 29 +- hw/i386/amd_iommu.h | 16 -- 3 files changed, 117 insertions(+), 57 deletions(-) diff --git a/hw/i386/acpi

[PATCH v11 4/7] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-12-25 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Suggested-by: Joao Martins Acked-by: Peter Xu Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions

[PATCH v11 0/7] Support x2APIC mode with TCG accelerator

2023-12-25 Thread Bui Quang Minh
nformation in x2APIC instead of extending log_dest for backward compatibility in vmstate Version 2 changes, - Add support for APIC ID larger than 255 - Adjust AMD iommu for x2APIC support - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (7): i386

[PATCH v11 2/7] apic: add support for x2APIC mode

2023-12-25 Thread Bui Quang Minh
register access are supported. Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 6 +- hw/intc/apic.c | 289 hw/intc/apic_common.c | 9 + include/hw/i386/apic.h | 3 +- include/hw/i386/apic_internal.h | 7

[PATCH v10 5/7] test: bios-tables-test: prepare IVRS change in ACPI table

2023-11-09 Thread Bui Quang Minh
Following the instructions in bios-tables-test, this lists that IVRS.ivrs in ACPI table will be changed to add new IVHD type 0x11. Signed-off-by: Bui Quang Minh --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test

[PATCH v10 6/7] amd_iommu: report x2APIC support to the operating system

2023-11-09 Thread Bui Quang Minh
device. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 129 +++ hw/i386/amd_iommu.c | 29 +- hw/i386/amd_iommu.h | 16 -- 3 files changed, 117 insertions(+), 57 deletions(-) diff --git a/hw/i386/acpi

[PATCH v10 3/7] apic, i386/tcg: add x2apic transitions

2023-11-09 Thread Bui Quang Minh
, accelerator can use this to raise appropriate exception. Signed-off-by: Bui Quang Minh --- hw/i386/kvm/apic.c | 3 +- hw/i386/xen/xen_apic.c | 3 +- hw/intc/apic.c | 62 +++- hw/intc/apic_common.c| 13

[PATCH v10 7/7] test: bios-tables-test: add IVRS changed binary

2023-11-09 Thread Bui Quang Minh
00 00 // +0080: D3 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // .).. +0090: 02 00 00 00 02 08 00 00 02 10 00 00 02 F8 00 00 // +00A0: 02 FA 00 00 02 FB 00 00 48 00 00 00 00 A0 00 01 // ....H... Signed-off-by: Bui Quang

[PATCH v10 4/7] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-11-09 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Suggested-by: Joao Martins Acked-by: Peter Xu Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions

[PATCH v10 2/7] apic: add support for x2APIC mode

2023-11-09 Thread Bui Quang Minh
register access are supported. Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 6 +- hw/intc/apic.c | 289 hw/intc/apic_common.c | 9 + include/hw/i386/apic.h | 3 +- include/hw/i386/apic_internal.h | 7

[PATCH v10 1/7] i386/tcg: implement x2APIC registers MSR access

2023-11-09 Thread Bui Quang Minh
This commit creates apic_register_read/write which are used by both apic_mem_read/write for MMIO access and apic_msr_read/write for MSR access. The apic_msr_read/write returns -1 on error, accelerator can use this to raise the appropriate exception. Signed-off-by: Bui Quang Minh --- hw/intc

[PATCH v10 0/7] Support x2APIC mode with TCG accelerator

2023-11-09 Thread Bui Quang Minh
t AMD iommu for x2APIC suuport - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (7): i386/tcg: implement x2APIC registers MSR access apic: add support for x2APIC mode apic, i386/tcg: add x2apic transitions intel_iommu: allow Extended Interrupt

Re: [PATCH v9 0/5] Support x2APIC mode with TCG accelerator

2023-11-09 Thread Bui Quang Minh
On 11/9/23 21:32, Joao Martins wrote: On 09/11/2023 14:10, Bui Quang Minh wrote: On 11/9/23 17:11, Santosh Shukla wrote: On 10/24/2023 8:51 PM, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers

Re: [PATCH v9 5/5] amd_iommu: report x2APIC support to the operating system

2023-11-09 Thread Bui Quang Minh
On 11/9/23 02:44, Michael S. Tsirkin wrote: On Wed, Nov 08, 2023 at 09:22:18PM +0700, Bui Quang Minh wrote: On 11/7/23 07:39, Michael S. Tsirkin wrote: On Tue, Oct 24, 2023 at 10:21:05PM +0700, Bui Quang Minh wrote: This commit adds XTSup configuration to let user choose to whether enable

Re: [PATCH v9 0/5] Support x2APIC mode with TCG accelerator

2023-11-09 Thread Bui Quang Minh
On 11/9/23 17:11, Santosh Shukla wrote: On 10/24/2023 8:51 PM, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC interrupt

Re: [PATCH v9 5/5] amd_iommu: report x2APIC support to the operating system

2023-11-08 Thread Bui Quang Minh
On 11/7/23 07:39, Michael S. Tsirkin wrote: On Tue, Oct 24, 2023 at 10:21:05PM +0700, Bui Quang Minh wrote: This commit adds XTSup configuration to let user choose to whether enable this feature or not. When XTSup is enabled, additional bytes in IRTE with enabled guest virtual VAPIC are used

Re: [PATCH v8 1/5] i386/tcg: implement x2APIC registers MSR access

2023-10-24 Thread Bui Quang Minh
at 18:08, Bui Quang Minh wrote: @@ -455,6 +469,19 @@ void helper_rdmsr(CPUX86State *env) val = (cs->nr_threads * cs->nr_cores) | (cs->nr_cores << 16); break; } +case MSR_APIC_START ... MSR_APIC_END: { +int index = (uint32_t)env->regs[R_ECX

[PATCH v9 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-10-24 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Suggested-by: Joao Martins Acked-by: Peter Xu Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions

[PATCH v9 5/5] amd_iommu: report x2APIC support to the operating system

2023-10-24 Thread Bui Quang Minh
device. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 129 +++ hw/i386/amd_iommu.c | 29 +- hw/i386/amd_iommu.h | 16 -- 3 files changed, 117 insertions(+), 57 deletions(-) diff --git a/hw/i386/acpi

[PATCH v9 1/5] i386/tcg: implement x2APIC registers MSR access

2023-10-24 Thread Bui Quang Minh
This commit creates apic_register_read/write which are used by both apic_mem_read/write for MMIO access and apic_msr_read/write for MSR access. The apic_msr_read/write returns -1 on error, accelerator can use this to raise the appropriate exception. Signed-off-by: Bui Quang Minh --- hw/intc

[PATCH v9 3/5] apic, i386/tcg: add x2apic transitions

2023-10-24 Thread Bui Quang Minh
, accelerator can use this to raise appropriate exception. Signed-off-by: Bui Quang Minh --- hw/i386/kvm/apic.c | 3 +- hw/i386/xen/xen_apic.c | 3 +- hw/intc/apic.c | 62 +++- hw/intc/apic_common.c| 13

[PATCH v9 2/5] apic: add support for x2APIC mode

2023-10-24 Thread Bui Quang Minh
register access are supported. Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 6 +- hw/intc/apic.c | 280 hw/intc/apic_common.c | 9 + include/hw/i386/apic.h | 3 +- include/hw/i386/apic_internal.h | 7

[PATCH v9 0/5] Support x2APIC mode with TCG accelerator

2023-10-24 Thread Bui Quang Minh
rt for APIC ID larger than 255 - Adjust AMD iommu for x2APIC suuport - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (5): i386/tcg: implement x2APIC registers MSR access apic: add support for x2APIC mode apic, i386/tcg: add x2apic transitions

[RFC PATCH] tcg, apic: create a separate root memory region for each CPU

2023-10-05 Thread Bui Quang Minh
@system - fee0-feef (prio 4096, i/o): apic-msi Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 24 ++-- hw/intc/ioapic.c | 32 +++- hw/pci/pci.c

Re: [PATCH v8 0/5] Support x2APIC mode with TCG accelerator

2023-10-05 Thread Bui Quang Minh
On 9/26/23 23:06, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC interrupt remapping. With this series, we can now boot

Re: [PATCH v8 0/5] Support x2APIC mode with TCG accelerator

2023-10-04 Thread Bui Quang Minh
On 10/4/23 13:51, Michael S. Tsirkin wrote: On Tue, Sep 26, 2023 at 11:23:53PM +0700, Bui Quang Minh wrote: On 9/26/23 23:06, Bui Quang Minh wrote: Version 8 changes, - Patch 2, 4: + Rebase to master and resolve conflicts in these 2 patches The conflicts when rebasing is due

Re: [PATCH v8 0/5] Support x2APIC mode with TCG accelerator

2023-09-26 Thread Bui Quang Minh
On 9/26/23 23:06, Bui Quang Minh wrote: Version 8 changes, - Patch 2, 4: + Rebase to master and resolve conflicts in these 2 patches The conflicts when rebasing is due to the commit 9926cf34de5fa15da ("target/i386: Allow elision of kvm_enable_x2apic()"). AFAIK, this c

[PATCH v8 5/5] amd_iommu: report x2APIC support to the operating system

2023-09-26 Thread Bui Quang Minh
device. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 129 +++ hw/i386/amd_iommu.c | 29 +- hw/i386/amd_iommu.h | 16 -- 3 files changed, 117 insertions(+), 57 deletions(-) diff --git a/hw/i386/acpi

[PATCH v8 1/5] i386/tcg: implement x2APIC registers MSR access

2023-09-26 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4

[PATCH v8 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-09-26 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Suggested-by: Joao Martins Acked-by: Peter Xu Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions

[PATCH v8 3/5] apic, i386/tcg: add x2apic transitions

2023-09-26 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc

[PATCH v8 0/5] Support x2APIC mode with TCG accelerator

2023-09-26 Thread Bui Quang Minh
nded_log_dest to store APIC_LDR information in x2APIC instead of extending log_dest for backward compatibility in vmstate Version 2 changes, - Add support for APIC ID larger than 255 - Adjust AMD iommu for x2APIC suuport - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks,

[PATCH v8 2/5] apic: add support for x2APIC mode

2023-09-26 Thread Bui Quang Minh
register access are supported. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 6 +- hw/intc/apic.c | 266 hw/intc/apic_common.c | 9 ++ include/hw/i386/apic.h | 3

[PATCH v7 0/5] Support x2APIC mode with TCG accelerator

2023-07-28 Thread Bui Quang Minh
ackward compatibility in vmstate Version 2 changes, - Add support for APIC ID larger than 255 - Adjust AMD iommu for x2APIC suuport - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (5): i386/tcg: implement x2APIC registers MSR access apic: add su

[PATCH v7 2/5] apic: add support for x2APIC mode

2023-07-28 Thread Bui Quang Minh
register access are supported. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 8 +- hw/intc/apic.c | 266 hw/intc/apic_common.c | 9 ++ include/hw/i386/apic.h | 3

[PATCH v7 5/5] amd_iommu: report x2APIC support to the operating system

2023-07-28 Thread Bui Quang Minh
device. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 129 +++ hw/i386/amd_iommu.c | 29 +- hw/i386/amd_iommu.h | 16 -- 3 files changed, 117 insertions(+), 57 deletions(-) diff --git a/hw/i386/acpi

[PATCH v7 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-28 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Suggested-by: Joao Martins Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw

[PATCH v7 3/5] apic, i386/tcg: add x2apic transitions

2023-07-28 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc

[PATCH v7 1/5] i386/tcg: implement x2APIC registers MSR access

2023-07-28 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4

Re: [PATCH v6 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-21 Thread Bui Quang Minh
On 7/21/23 03:47, Peter Xu wrote: On Mon, Jul 17, 2023 at 11:29:56PM +0700, Bui Quang Minh wrote: On 7/17/23 17:47, Joao Martins wrote: +Peter, +Jason (intel-iommu maintainer/reviewer) Thanks for copying me, Joan. On 15/07/2023 16:22, Bui Quang Minh wrote: As userspace APIC now supports

Re: [PATCH v6 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-17 Thread Bui Quang Minh
On 7/17/23 17:47, Joao Martins wrote: +Peter, +Jason (intel-iommu maintainer/reviewer) On 15/07/2023 16:22, Bui Quang Minh wrote: As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Reviewed-by: Michael S. Tsirkin

[PATCH] apic: stop timer when changing mode and current count reaches 0

2023-07-16 Thread Bui Quang Minh
>env); s->spurious_vec &= ~APIC_SV_ENABLE; } +*/ } Signed-off-by: Bui Quang Minh --- hw/i386/kvm/apic.c | 2 +- hw/intc/apic.c | 37 ++--- hw/intc/apic_common.c | 41 +

[PATCH v6 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-15 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/i386

[PATCH v6 1/5] i386/tcg: implement x2APIC registers MSR access

2023-07-15 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4

[PATCH v6 2/5] apic: add support for x2APIC mode

2023-07-15 Thread Bui Quang Minh
register access are supported. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 8 +- hw/intc/apic.c | 266 hw/intc/apic_common.c | 9 ++ include/hw/i386/apic.h | 3

[PATCH v6 3/5] apic, i386/tcg: add x2apic transitions

2023-07-15 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc

[PATCH v6 5/5] amd_iommu: report x2APIC support to the operating system

2023-07-15 Thread Bui Quang Minh
device. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 129 +++ hw/i386/amd_iommu.c | 29 +- hw/i386/amd_iommu.h | 16 -- 3 files changed, 117 insertions(+), 57 deletions(-) diff --git a/hw/i386/acpi

[PATCH v6 0/5] Support x2APIC mode with TCG accelerator

2023-07-15 Thread Bui Quang Minh
IC suuport - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (5): i386/tcg: implement x2APIC registers MSR access apic: add support for x2APIC mode apic, i386/tcg: add x2apic transitions intel_iommu: allow Extended Interrupt Mode when usin

Re: [PATCH v5 0/5] Support x2APIC mode with TCG accelerator

2023-07-15 Thread Bui Quang Minh
On 7/15/23 21:28, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC interrupt remapping. With this series, we can now boot

[PATCH v5 2/5] apic: add support for x2APIC mode

2023-07-15 Thread Bui Quang Minh
register access are supported. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 8 +- hw/intc/apic.c | 266 hw/intc/apic_common.c | 9 ++ include/hw/i386/apic.h | 3

[PATCH v5 0/5] Support x2APIC mode with TCG accelerator

2023-07-15 Thread Bui Quang Minh
nformation in x2APIC instead of extending log_dest for backward compatibility in vmstate Version 2 changes, - Add support for APIC ID larger than 255 - Adjust AMD iommu for x2APIC suuport - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (5): i386

[PATCH v5 5/5] amd_iommu: report x2APIC support to the operating system

2023-07-15 Thread Bui Quang Minh
device. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 127 ++- hw/i386/amd_iommu.c | 30 +- hw/i386/amd_iommu.h | 16 -- 3 files changed, 117 insertions(+), 56 deletions(-) diff --git a/hw/i386/acpi

[PATCH v5 3/5] apic, i386/tcg: add x2apic transitions

2023-07-15 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc

[PATCH v5 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-07-15 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/i386

[PATCH v5 1/5] i386/tcg: implement x2APIC registers MSR access

2023-07-15 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4

Re: [PATCH v4 0/5] Support x2APIC mode with TCG accelerator

2023-07-12 Thread Bui Quang Minh
On 7/11/23 01:39, Michael S. Tsirkin wrote: On Mon, May 22, 2023 at 11:31:52PM +0700, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted

Re: [PATCH v4 5/5] amd_iommu: report x2APIC support to the operating system

2023-07-12 Thread Bui Quang Minh
On 7/11/23 01:37, Michael S. Tsirkin wrote: On Fri, Jun 23, 2023 at 10:28:43PM +0700, Bui Quang Minh wrote: On 6/23/23 03:26, Michael S. Tsirkin wrote: On Mon, May 22, 2023 at 11:31:57PM +0700, Bui Quang Minh wrote: This commit adds XTSup configuration to let user choose to whether enable

Re: [PATCH v4 5/5] amd_iommu: report x2APIC support to the operating system

2023-06-23 Thread Bui Quang Minh
On 6/23/23 03:26, Michael S. Tsirkin wrote: On Mon, May 22, 2023 at 11:31:57PM +0700, Bui Quang Minh wrote: This commit adds XTSup configuration to let user choose to whether enable this feature or not. When XTSup is enabled, additional bytes in IRTE with enabled guest virtual VAPIC are used

Re: [REPOST PATCH v3 5/5] amd_iommu: report x2APIC support to the operating system

2023-05-22 Thread Bui Quang Minh
On 5/14/23 15:55, Bui Quang Minh wrote: On 5/12/23 21:39, Michael S. Tsirkin wrote: On Tue, Apr 11, 2023 at 09:24:40PM +0700, Bui Quang Minh wrote: This commit adds XTSup configuration to let user choose to whether enable this feature or not. When XTSup is enabled, additional bytes in IRTE

[PATCH v4 5/5] amd_iommu: report x2APIC support to the operating system

2023-05-22 Thread Bui Quang Minh
device. Signed-off-by: Bui Quang Minh --- hw/i386/acpi-build.c | 127 ++- hw/i386/amd_iommu.c | 21 ++- hw/i386/amd_iommu.h | 16 -- 3 files changed, 108 insertions(+), 56 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c

[PATCH v4 3/5] apic, i386/tcg: add x2apic transitions

2023-05-22 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc

[PATCH v4 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-05-22 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/i386

[PATCH v4 1/5] i386/tcg: implement x2APIC registers MSR access

2023-05-22 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4

[PATCH v4 2/5] apic: add support for x2APIC mode

2023-05-22 Thread Bui Quang Minh
register access are supported. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/i386/x86.c | 8 +- hw/intc/apic.c | 266 hw/intc/apic_common.c | 9 ++ include/hw/i386/apic.h | 3

[PATCH v4 0/5] Support x2APIC mode with TCG accelerator

2023-05-22 Thread Bui Quang Minh
IC suuport - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (5): i386/tcg: implement x2APIC registers MSR access apic: add support for x2APIC mode apic, i386/tcg: add x2apic transitions intel_iommu: allow Extended Interrupt Mode when using usersp

Re: [REPOST PATCH v3 5/5] amd_iommu: report x2APIC support to the operating system

2023-05-15 Thread Bui Quang Minh
On 5/15/23 03:44, Michael S. Tsirkin wrote: On Sun, May 14, 2023 at 03:55:11PM +0700, Bui Quang Minh wrote: On 5/12/23 21:39, Michael S. Tsirkin wrote: On Tue, Apr 11, 2023 at 09:24:40PM +0700, Bui Quang Minh wrote: This commit adds XTSup configuration to let user choose to whether enable

Re: [REPOST PATCH v3 5/5] amd_iommu: report x2APIC support to the operating system

2023-05-14 Thread Bui Quang Minh
On 5/12/23 21:39, Michael S. Tsirkin wrote: On Tue, Apr 11, 2023 at 09:24:40PM +0700, Bui Quang Minh wrote: This commit adds XTSup configuration to let user choose to whether enable this feature or not. When XTSup is enabled, additional bytes in IRTE with enabled guest virtual VAPIC are used

Re: [REPOST PATCH v3 0/5] Support x2APIC mode with TCG accelerator

2023-05-12 Thread Bui Quang Minh
On 4/11/23 21:24, Bui Quang Minh wrote: [Reposting due to broken threading in previous post] Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC

Re: [REPOST PATCH v3 0/5] Support x2APIC mode with TCG accelerator

2023-04-21 Thread Bui Quang Minh
On 4/21/23 14:57, Michael S. Tsirkin wrote: On Tue, Apr 11, 2023 at 09:24:35PM +0700, Bui Quang Minh wrote: [Reposting due to broken threading in previous post] Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers

[REPOST PATCH v3 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-04-11 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386

[REPOST PATCH v3 5/5] amd_iommu: report x2APIC support to the operating system

2023-04-11 Thread Bui Quang Minh
for feature report to operating system. This is because Linux does not use XTSup in IOMMU Feature Reporting field of IVHD type 0x10 but only use XTSup bit in EFR Register Image of IVHD 0x11 to indicate x2APIC support (see init_iommu_one in linux/drivers/iommu/amd/init.c) Signed-off-by: Bui Quang Minh

[REPOST PATCH v3 3/5] apic, i386/tcg: add x2apic transitions

2023-04-11 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc/apic_common.c| 7

[REPOST PATCH v3 2/5] apic: add support for x2APIC mode

2023-04-11 Thread Bui Quang Minh
register access are supported. Signed-off-by: Bui Quang Minh --- Version 3 changes: - Allow APIC ID > 255 only when x2APIC feature is supported on CPU - Make physical destination mode IPI which has destination id 0x a broadcast to xAPIC CPUs - Make cluster address 0xf in cluster mo

[REPOST PATCH v3 1/5] i386/tcg: implement x2APIC registers MSR access

2023-04-11 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4 +- include/hw/i386/apic.h

[REPOST PATCH v3 0/5] Support x2APIC mode with TCG accelerator

2023-04-11 Thread Bui Quang Minh
st AMD iommu for x2APIC suuport - Reorganize and split patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (5): i386/tcg: implement x2APIC registers MSR access apic: add support for x2APIC mode apic, i386/tcg: add x2apic transitions intel_iommu: allow Extended In

Re: [PATCH v3 0/5] Support x2APIC mode with TCG accelerator

2023-04-11 Thread Bui Quang Minh
On 4/11/23 14:09, Michael S. Tsirkin wrote: On Sun, Apr 09, 2023 at 09:40:22PM +0700, Bui Quang Minh wrote: Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted

[PATCH v3 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-04-09 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386

[PATCH v3 3/5] apic, i386/tcg: add x2apic transitions

2023-04-09 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc/apic_common.c| 7

[PATCH v3 5/5] amd_iommu: report x2APIC support to the operating system

2023-04-09 Thread Bui Quang Minh
for feature report to operating system. This is because Linux does not use XTSup in IOMMU Feature Reporting field of IVHD type 0x10 but only use XTSup bit in EFR Register Image of IVHD 0x11 to indicate x2APIC support (see init_iommu_one in linux/drivers/iommu/amd/init.c) Signed-off-by: Bui Quang Minh

[PATCH v3 1/5] i386/tcg: implement x2APIC registers MSR access

2023-04-09 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4 +- include/hw/i386/apic.h

[PATCH v3 2/5] apic: add support for x2APIC mode

2023-04-09 Thread Bui Quang Minh
register access are supported. Signed-off-by: Bui Quang Minh --- Version 3 changes: - Allow APIC ID > 255 only when x2APIC feature is supported on CPU - Make physical destination mode IPI which has destination id 0x a broadcast to xAPIC CPUs - Make cluster address 0xf in cluster mo

[PATCH v3 0/5] Support x2APIC mode with TCG accelerator

2023-04-09 Thread Bui Quang Minh
it patch 1,2 into patch 1,2,3 in version 2 Thanks, Quang Minh. Bui Quang Minh (5): i386/tcg: implement x2APIC registers MSR access apic: add support for x2APIC mode apic, i386/tcg: add x2apic transitions intel_iommu: allow Extended Interrupt Mode when using userspace APIC amd_iommu

  1   2   >