#
d521fdc7 |
| 24-Apr-2025 |
Paolo Bonzini <pbonzini@redhat.com> |
target/i386: remove lflags
Just use cc_dst and cc_src for the same purpose.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
5b80dcf9 |
| 03-Apr-2025 |
Paolo Bonzini <pbonzini@redhat.com> |
target/i386/emulate: mostly rewrite flags handling
While Bochs's algorithms are pretty solid, there are small opportunities to improve them or to make their logic more similar to TCG's handling of c
target/i386/emulate: mostly rewrite flags handling
While Bochs's algorithms are pretty solid, there are small opportunities to improve them or to make their logic more similar to TCG's handling of condition codes.
- use a single bit for the difference between bits 0..7 of result and PF. This is useful because "set only ZF" is not a common case.
- place SD in the same place as SF
- move CF and PO at bits 62 and 63 when target_ulong is 64-bits wide, so that 64-bit ALU operations need fewer shifts
- use rotates to move CF and AF from auxbits to their eflags position
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
77a2dba4 |
| 02-May-2025 |
Paolo Bonzini <pbonzini@redhat.com> |
target/i386/emulate: stop overloading decode->op[N].ptr
decode->op[N].ptr can contain either a host pointer (!) in CPUState or a guest virtual address. Pass the whole struct to read_val_ext and wri
target/i386/emulate: stop overloading decode->op[N].ptr
decode->op[N].ptr can contain either a host pointer (!) in CPUState or a guest virtual address. Pass the whole struct to read_val_ext and write_val_ext, so that it can decide the contents based on the operand type.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
7abf0d95 |
| 02-May-2025 |
Paolo Bonzini <pbonzini@redhat.com> |
target/i386/emulate: fix target_ulong format strings
Do not assume that TARGET_FMT_lx is %llx.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
27458df8 |
| 07-Mar-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386: move x86 instruction emulator out of hvf
Move x86_decode, x86_emu, x86_flags and some headers to the new location. Fix up all the inclusion sites in hvf.
Signed-off-by: Wei Liu <liuwe@
target/i386: move x86 instruction emulator out of hvf
Move x86_decode, x86_emu, x86_flags and some headers to the new location. Fix up all the inclusion sites in hvf.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-14-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
3667f0bb |
| 07-Mar-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: drop unused headers
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-10-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Pa
target/i386/hvf: drop unused headers
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-10-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
58567864 |
| 07-Mar-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: provide and use simulate_{wrmsr, rdmsr} in emul_ops
Change the first argument's type to be CPUState to match other hooks.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: h
target/i386/hvf: provide and use simulate_{wrmsr, rdmsr} in emul_ops
Change the first argument's type to be CPUState to match other hooks.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-8-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
63d8bc66 |
| 07-Mar-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: provide and use write_mem in emul_ops
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-7-git-send-email-liuwe@linux.microsoft.com
target/i386/hvf: provide and use write_mem in emul_ops
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-7-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
ae3c6134 |
| 07-Mar-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: use emul_ops->read_mem in x86_emu.c
No functional change.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-6-git-send-email-liuwe
target/i386/hvf: use emul_ops->read_mem in x86_emu.c
No functional change.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-6-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
e9c40026 |
| 07-Mar-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386: rename hvf_mmio_buf to emu_mmio_buf
We want to refactor HVF's instruction emulator to a common component. Renaming hvf_mmio_buf removes the association between HVF and the instruction e
target/i386: rename hvf_mmio_buf to emu_mmio_buf
We want to refactor HVF's instruction emulator to a common component. Renaming hvf_mmio_buf removes the association between HVF and the instruction emulator.
The definition of the field is still guarded by CONFIG_HVF for now, since it is the only user.
No functional change.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-5-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
444bae08 |
| 07-Mar-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: provide and use handle_io in emul_ops
This drops the calls to hvf_handle_io from x86_emu.c.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/17413
target/i386/hvf: provide and use handle_io in emul_ops
This drops the calls to hvf_handle_io from x86_emu.c.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-4-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
26a44d9d |
| 07-Mar-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: introduce x86_emul_ops
This will be used to remove HVF specific code from the instruction emulator.
For now we only introduce two hooks for x86_decode.c. More hooks will be added w
target/i386/hvf: introduce x86_emul_ops
This will be used to remove HVF specific code from the instruction emulator.
For now we only introduce two hooks for x86_decode.c. More hooks will be added when the code is refactored.
The emulator initialization function now takes in a pointer to the ops structure.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1741377325-28175-2-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
646140df |
| 21-Feb-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: drop some dead code
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1740126987-8483-16-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Pao
target/i386/hvf: drop some dead code
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1740126987-8483-16-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
99e5aaf9 |
| 21-Feb-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: move and rename simulate_{rdmsr, wrmsr}
This requires making raise_exception non-static. That function needs to be renamed to avoid clashing with a function in TCG.
Mostly code mov
target/i386/hvf: move and rename simulate_{rdmsr, wrmsr}
This requires making raise_exception non-static. That function needs to be renamed to avoid clashing with a function in TCG.
Mostly code movement. No functional change.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1740126987-8483-12-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
dbccd48d |
| 21-Feb-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: move and rename {load, store}_regs
They contain HVF specific code. Move them to a better location and add "hvf_" prefix. Fix up all the call sites.
No functional change.
Signed-of
target/i386/hvf: move and rename {load, store}_regs
They contain HVF specific code. Move them to a better location and add "hvf_" prefix. Fix up all the call sites.
No functional change.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1740126987-8483-7-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
bc4fa8c3 |
| 21-Feb-2025 |
Wei Liu <liuwe@linux.microsoft.com> |
target/i386/hvf: fix the declaration of hvf_handle_io
There is a conflicting declaration for hvf_handle_io in x86_emu.c. The type of the first argument is wrong. There has never been a problem bec
target/i386/hvf: fix the declaration of hvf_handle_io
There is a conflicting declaration for hvf_handle_io in x86_emu.c. The type of the first argument is wrong. There has never been a problem because the first argument is not used in hvf_handle_io.
That being said, the code shouldn't contain such an error. Use the proper declaration from hvf-i386.h.
Take the chance to change the first argument's type to be CPUState.
Signed-off-by: Wei Liu <liuwe@linux.microsoft.com> Link: https://lore.kernel.org/r/1740126987-8483-3-git-send-email-liuwe@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
d3bb5d0d |
| 19-Dec-2024 |
Xiaoyao Li <xiaoyao.li@intel.com> |
i386/cpu: Extract a common fucntion to setup value of MSR_CORE_THREAD_COUNT
There are duplicated code to setup the value of MSR_CORE_THREAD_COUNT. Extract a common function for it.
Signed-off-by: X
i386/cpu: Extract a common fucntion to setup value of MSR_CORE_THREAD_COUNT
There are duplicated code to setup the value of MSR_CORE_THREAD_COUNT. Extract a common function for it.
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20241219110125.1266461-2-xiaoyao.li@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
04858f95 |
| 05-Nov-2024 |
Phil Dennis-Jordan <phil@philjordan.eu> |
i386/hvf: Raise exception on error setting APICBASE
When setting the APICBASE MSR to an illegal value, the APIC implementation will return an error. This change forwards that report to the guest as
i386/hvf: Raise exception on error setting APICBASE
When setting the APICBASE MSR to an illegal value, the APIC implementation will return an error. This change forwards that report to the guest as an exception rather than ignoring it when using the hvf accelerator.
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu> Link: https://lore.kernel.org/r/20241105155800.5461-5-phil@philjordan.eu Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
0e27f3a5 |
| 05-Nov-2024 |
Phil Dennis-Jordan <phil@philjordan.eu> |
i386/hvf: Integrates x2APIC support with hvf accel
Support for x2APIC mode was recently introduced in the software emulated APIC implementation for TCG. Enabling it when using macOS’s hvf accelerato
i386/hvf: Integrates x2APIC support with hvf accel
Support for x2APIC mode was recently introduced in the software emulated APIC implementation for TCG. Enabling it when using macOS’s hvf accelerator is useful and significantly helps performance, as Qemu currently uses the emulated APIC when running on hvf as well.
This change wires up the read & write operations for the MSR VM exits and allow-lists the CPUID flag in the x86 hvf runtime.
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu> Link: https://lore.kernel.org/r/20241105155800.5461-2-phil@philjordan.eu Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
0e4e622e |
| 05-Jun-2024 |
Phil Dennis-Jordan <phil@philjordan.eu> |
i386/hvf: Fixes some compilation warnings
A bunch of function definitions used empty parentheses instead of (void) syntax, yielding the following warning when building with clang on macOS:
warning:
i386/hvf: Fixes some compilation warnings
A bunch of function definitions used empty parentheses instead of (void) syntax, yielding the following warning when building with clang on macOS:
warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
In addition to fixing these function headers, it also fixes what appears to be a typo causing a variable to be unused after initialisation.
warning: variable 'entry_ctls' set but not used [-Wunused-but-set-variable]
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu> Reviewed-by: Roman Bolshakov <roman@roolebo.dev> Tested-by: Roman Bolshakov <roman@roolebo.dev> Message-ID: <20240605112556.43193-3-phil@philjordan.eu> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
3152e954 |
| 20-Oct-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
target/i386/hvf: Rename 'X86CPU *x86_cpu' variable as 'cpu'
Follow the naming used by other files in target/i386/.
No functional changes.
Suggested-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by
target/i386/hvf: Rename 'X86CPU *x86_cpu' variable as 'cpu'
Follow the naming used by other files in target/i386/.
No functional changes.
Suggested-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Message-Id: <20231020111136.44401-4-philmd@linaro.org>
show more ...
|
#
5366a064 |
| 20-Oct-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
target/i386/hvf: Rename 'CPUState *cpu' variable as 'cs'
Follow the naming used by other files in target/i386/.
No functional changes.
Suggested-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: P
target/i386/hvf: Rename 'CPUState *cpu' variable as 'cs'
Follow the naming used by other files in target/i386/.
No functional changes.
Suggested-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Message-Id: <20231020111136.44401-3-philmd@linaro.org>
show more ...
|
#
89c02195 |
| 20-Oct-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
target/i386/hvf: Use CPUState typedef
Follow C style guidelines and use CPUState forward declaration from "qemu/typedefs.h".
No functional changes.
Signed-off-by: Philippe Mathieu-Daudé <philmd@li
target/i386/hvf: Use CPUState typedef
Follow C style guidelines and use CPUState forward declaration from "qemu/typedefs.h".
No functional changes.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Message-Id: <20231020111136.44401-2-philmd@linaro.org>
show more ...
|
#
a9e445df |
| 09-Oct-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
target/i386/hvf: Use env_archcpu() in simulate_[rdmsr/wrmsr]()
When CPUArchState* is available (here CPUX86State*), we can use the fast env_archcpu() macro to get ArchCPU* (here X86CPU*). The QOM ca
target/i386/hvf: Use env_archcpu() in simulate_[rdmsr/wrmsr]()
When CPUArchState* is available (here CPUX86State*), we can use the fast env_archcpu() macro to get ArchCPU* (here X86CPU*). The QOM cast X86_CPU() macro will be slower when building with --enable-qom-cast-debug.
Pass CPUX86State* as argument to simulate_rdmsr / simulate_wrmsr instead of a CPUState* to avoid an extra cast.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Roman Bolshakov <roman@roolebo.dev> Tested-by: Roman Bolshakov <roman@roolebo.dev> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Message-Id: <20231009110239.66778-7-philmd@linaro.org>
show more ...
|
#
82b641d6 |
| 09-Oct-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
target/i386/hvf: Use x86_cpu in simulate_[rdmsr|wrmsr]()
We already have 'x86_cpu = X86_CPU(cpu)'. Use the variable instead of doing another QOM cast with X86_CPU().
Signed-off-by: Philippe Mathieu
target/i386/hvf: Use x86_cpu in simulate_[rdmsr|wrmsr]()
We already have 'x86_cpu = X86_CPU(cpu)'. Use the variable instead of doing another QOM cast with X86_CPU().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Roman Bolshakov <roman@roolebo.dev> Tested-by: Roman Bolshakov <roman@roolebo.dev> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Message-Id: <20231009110239.66778-6-philmd@linaro.org>
show more ...
|