Re: [Qemu-devel] *BSD kernel crash at boot in qemu with seabios 1.7.4 (bisected)

2014-02-12 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 2/6/14, 4:44 AM, Michael Tokarev wrote: > [Changing subject to reflect reality] > > I don't really understand what it is all about, as I initially > said. But I've been told on freebsd IRC channels to post the issue > to freebsd-emulation list, w

[Qemu-devel] bug reporting procedure

2010-03-01 Thread Xin Li
Hello qemu devs, I'm recently playing with QEMU for my research project. I think I've found a bug on my way, and I have my patch solving it. I wonder if there is a formal procedure to follow in order to file a bug report? Thanks! -Xin

[Qemu-devel] Bug: hpet timer hangs QEMU using icount

2010-03-01 Thread Xin Li
Hpet hangs QEMU when icount is present. I don't know if this is a universal problem. The cause is that for periodical timers, hpet_timer function tries to insert the timer back to the active timers queue, using an updated expire time. However, before the update, if the expire time is equal to t

Re: [PATCH v1 2/3] target/i386: Add VMX control bits for nested FRED support

2024-08-08 Thread Xin Li
On 8/7/2024 8:58 AM, Zhao Liu wrote: On Wed, Aug 07, 2024 at 01:18:11AM -0700, Xin Li (Intel) wrote: @@ -1435,7 +1435,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { "vmx-exit-save-efer", "vmx-exit-load-efer", "vmx-exit-save-pre

Re: [PATCH v1 3/3] target/i386: Raise the highest index value used for any VMCS encoding

2024-08-08 Thread Xin Li
+if (f[FEAT_7_1_EAX] & CPUID_7_1_EAX_FRED) { +/* FRED injected-event data (0x2052). */ +kvm_msr_entry_add(cpu, MSR_IA32_VMX_VMCS_ENUM, 0x52); HMM, I have the questions when I check the FRED spec. Section 9.3.4 said, (for injected-event data) "This field has uses the encodin

Re: [PATCH v1 2/3] target/i386: Add VMX control bits for nested FRED support

2024-08-08 Thread Xin Li
@@ -1450,7 +1450,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { NULL, "vmx-entry-ia32e-mode", NULL, NULL, NULL, "vmx-entry-load-perf-global-ctrl", "vmx-entry-load-pat", "vmx-entry-load-efer", "vmx-entry-load-bndcfgs", NULL, "vmx-entry-load-r

Re: [PATCH v1 3/3] target/i386: Raise the highest index value used for any VMCS encoding

2024-08-09 Thread Xin Li
On 8/8/2024 11:27 PM, Xin Li wrote: +    if (f[FEAT_7_1_EAX] & CPUID_7_1_EAX_FRED) { +    /* FRED injected-event data (0x2052).  */ +    kvm_msr_entry_add(cpu, MSR_IA32_VMX_VMCS_ENUM, 0x52); HMM, I have the questions when I check the FRED spec. Section 9.3.4 said, (for injected-e

[PATCH v2 2/4] target/i386: mark CR4.FRED not reserved

2023-10-02 Thread Xin Li
The CR4.FRED bit, i.e., CR4[32], is no longer a reserved bit when FRED is exposed to guests, otherwise it is still a reserved bit. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.h | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.h

[PATCH v2 1/4] target/i386: add support for FRED in CPUID enumeration

2023-10-02 Thread Xin Li
for FRED/LKGS, and expose them to KVM guests only. Because FRED relies on LKGS, add it to feature dependency map. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.c | 6 +- target/i386/cpu.h | 4 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/target/i386

[PATCH v2 0/4] target/i386: add support for FRED

2023-10-02 Thread Xin Li
support to scripts/kvm/vmxcap (Paolo Bonzini). - Move FRED MSRs from basic x86_cpu part to .subsections part (Weijiang Yang). Xin Li (4): target/i386: add support for FRED in CPUID enumeration target/i386: mark CR4.FRED not reserved target/i386: enumerate VMX nested-exception support target

[PATCH v2 4/4] target/i386: Add get/set/migrate support for FRED MSRs

2023-10-02 Thread Xin Li
FRED CPU states are managed in 9 new FRED MSRs, in addtion to a few existing CPU registers and MSRs, e.g., CR4.FRED and MSR_IA32_PL0_SSP. Save/restore/migrate FRED MSRs if FRED is exposed to the guest. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.h | 26

[PATCH v2 3/4] target/i386: enumerate VMX nested-exception support

2023-10-02 Thread Xin Li
Allow VMX nested-exception support to be exposed in KVM guests, thus nested KVM guests can enumerate it. Tested-by: Shan Kang Signed-off-by: Xin Li --- scripts/kvm/vmxcap | 1 + target/i386/cpu.c | 1 + target/i386/cpu.h | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/kvm

[PATCH v3A 1/6] target/i386: add support for FRED in CPUID enumeration

2023-12-21 Thread Xin Li
] enumerates WRMSRNS. Add CPUID definitions for FRED/LKGS/WRMSRNS, and expose them to KVM guests. Because FRED relies on LKGS and WRMSRNS, add that to feature dependency map. Tested-by: Shan Kang Signed-off-by: Xin Li --- Changelog v3A: - Fix reversed dependency (Wu Dan1). --- target/i386

[PATCH v3 2/6] target/i386: mark CR4.FRED not reserved

2023-11-08 Thread Xin Li
The CR4.FRED bit, i.e., CR4[32], is no longer a reserved bit when FRED is exposed to guests, otherwise it is still a reserved bit. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.h | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.h

[PATCH v3 1/6] target/i386: add support for FRED in CPUID enumeration

2023-11-08 Thread Xin Li
] enumerates WRMSRNS. Add CPUID definitions for FRED/LKGS/WRMSRNS, and expose them to KVM guests. Because FRED relies on LKGS and WRMSRNS, add that to feature dependency map. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.c | 10 +- target/i386/cpu.h | 6 ++ 2

[PATCH v3 0/6] target/i386: add support for FRED

2023-11-08 Thread Xin Li
(Weijiang Yang). Xin Li (6): target/i386: add support for FRED in CPUID enumeration target/i386: mark CR4.FRED not reserved target/i386: add the secondary VM exit controls MSR target/i386: add support for VMX FRED controls target/i386: enumerate VMX nested-exception support target/i386

[PATCH v3 4/6] target/i386: add support for VMX FRED controls

2023-11-08 Thread Xin Li
Add VMX FRED controls used to enable save/load of FRED MSRs. Tested-by: Shan Kang Signed-off-by: Xin Li --- scripts/kvm/vmxcap | 3 +++ target/i386/cpu.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap index 7da1e00ca8..44898d73c2

[PATCH v3 3/6] target/i386: add the secondary VM exit controls MSR

2023-11-08 Thread Xin Li
Add the secondary VM exit controls MSR to prepare for KVM FRED enabling. Tested-by: Shan Kang Signed-off-by: Xin Li --- scripts/kvm/vmxcap | 9 + target/i386/cpu.c | 2 +- target/i386/cpu.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/kvm/vmxcap b

[PATCH v3 6/6] target/i386: Add get/set/migrate support for FRED MSRs

2023-11-08 Thread Xin Li
FRED CPU states are managed in 9 new FRED MSRs, in addtion to a few existing CPU registers and MSRs, e.g., CR4.FRED and MSR_IA32_PL0_SSP. Save/restore/migrate FRED MSRs if FRED is exposed to the guest. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.h | 22

[PATCH v3 5/6] target/i386: enumerate VMX nested-exception support

2023-11-08 Thread Xin Li
Allow VMX nested-exception support to be exposed in KVM guests, thus nested KVM guests can enumerate it. Tested-by: Shan Kang Signed-off-by: Xin Li --- scripts/kvm/vmxcap | 1 + target/i386/cpu.c | 1 + target/i386/cpu.h | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/kvm

[PATCH 1/4] target/i386: add support for FRED in CPUID enumeration

2023-08-31 Thread Xin Li
guests only. Because FRED relies on LKGS, add it to feature dependency map. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.c | 6 +- target/i386/cpu.h | 4 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 00f913b638

[PATCH 2/4] target/i386: mark CR4.FRED not reserved

2023-08-31 Thread Xin Li
The CR4.FRED bit, i.e., CR4[32], is no longer a reserved bit when FRED is exposed to guests, otherwise it is still a reserved bit. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.h | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.h

[PATCH 0/4] target/i386: add support for FRED

2023-08-31 Thread Xin Li
establishes the full supervisor context and that event return establishes the full user context. Search for the latest FRED spec in most search engines with this search pattern: site:intel.com FRED (flexible return and event delivery) specification Xin Li (4): target/i386: add support for FRED

[PATCH 3/4] target/i386: enumerate VMX nested-exception support

2023-08-31 Thread Xin Li
Allow VMX nested-exception support to be exposed in KVM guests, thus nested KVM guests can enumerate it. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 3dba6b46d9..ba579e1fb7

[PATCH 4/4] target/i386: add live migration support for FRED

2023-08-31 Thread Xin Li
FRED CPU states are managed in 10 FRED MSRs, in addtion to a few existing CPU registers and MSRs, e.g., the CR4.FRED bit. Add the 10 new FRED MSRs to x86 CPUArchState for live migration support. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.h | 24

[PATCH v1 1/1] target/i386: Delete a duplicated macro definition CR4_FRED_MASK

2024-07-02 Thread Xin Li (Intel)
Macro CR4_FRED_MASK is defined twice due to a merge incident, delete one. Signed-off-by: Xin Li (Intel) --- target/i386/cpu.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 29daf37048..b73685a745 100644 --- a/target/i386/cpu.h +++ b/target

[PATCH v1 2/3] target/i386: Add VMX control bits for nested FRED support

2024-08-07 Thread Xin Li (Intel)
Add definitions of 1) VM-exit activate secondary controls bit 2) VM-entry load FRED bit which are required to enable nested FRED. Reviewed-by: Zhao Liu Signed-off-by: Xin Li (Intel) --- target/i386/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386

[PATCH v1 1/3] target/i386: Delete duplicated macro definition CR4_FRED_MASK

2024-08-07 Thread Xin Li (Intel)
Macro CR4_FRED_MASK is defined twice, delete one. Signed-off-by: Xin Li (Intel) --- target/i386/cpu.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c6cc035df3..118ef9cb68 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -267,12

[PATCH v1 3/3] target/i386: Raise the highest index value used for any VMCS encoding

2024-08-07 Thread Xin Li (Intel)
the VMCS field encoding of Secondary VM-exit controls, 0x44, is larger than any existing index value, raise the highest index value used for any VMCS encoding to 0x44. Co-developed-by: Xin Li Signed-off-by: Xin Li Signed-off-by: Lei Wang Signed-off-by: Xin Li (Intel) --- target/i386/cpu.h

[PATCH v1 0/3] target/i386: Add nested FRED support

2024-08-07 Thread Xin Li (Intel)
This patch set adds nested FRED support to allow KVM to run a nested guest with FRED enabled. Lei Wang (1): target/i386: Raise the highest index value used for any VMCS encoding Xin Li (Intel) (2): target/i386: Delete duplicated macro definition CR4_FRED_MASK target/i386: Add VMX control

[PATCH v1 1/1] target/i386: Add VMX entry load FRED control name to VMX feature words

2024-07-07 Thread Xin Li (Intel)
As VMX entry load FRED control is required to enable FRED in nested VMX, add it to VMX feature words. Signed-off-by: Xin Li (Intel) --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c05765eeaf..84a09c19cf 100644

[PATCH v1 2/3] target/i386: Add a new CPU feature word for CPUID.7.1.ECX

2025-01-03 Thread Xin Li (Intel)
The immediate form of MSR access instructions will use this new CPU feature word. Signed-off-by: Xin Li (Intel) --- target/i386/cpu.c | 23 ++- target/i386/cpu.h | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c

[PATCH v1 3/3] target/i386: Add the immediate form MSR access instruction support

2025-01-03 Thread Xin Li (Intel)
The immediate form of MSR access instructions are primarily motivated by performance, not code size: by having the MSR number in an immediate, it is available *much* earlier in the pipeline, which allows the hardware much more leeway about how a particular MSR is handled. Signed-off-by: Xin Li

[PATCH v1 1/3] target/i386: Remove FRED dependency on WRMSRNS

2025-01-03 Thread Xin Li (Intel)
WRMSRNS doesn't become a required feature for FERD, and Linux has removed the dependency, as such remove it from Qemu. Signed-off-by: Xin Li (Intel) --- target/i386/cpu.c | 4 1 file changed, 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 0b639848cd..8a122

[PATCH v1 0/3] target/i386: Add the immediate form MSR access instruction support

2025-01-03 Thread Xin Li (Intel)
advertised through bit 5 of CPUID.7.1.ECX, which needs to be added as a new CPU feature word. WRMSRNS doesn't become a required feature for FERD, and Linux has removed the dependency, as such remove the dependency from Qemu. Xin Li (Intel) (3): target/i386: Remove FRED dependency on WR