]> git.proxmox.com Git - mirror_qemu.git/commit
target/i386/hvf: Use env_archcpu() in simulate_[rdmsr/wrmsr]()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 9 Oct 2023 10:35:04 +0000 (12:35 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 7 Nov 2023 11:13:27 +0000 (12:13 +0100)
commita9e445df545158e3d6e3239f10c2e88d8119fdd1
tree38d0977c43777a6a1376f56c6fa543392fd3f1b3
parent82b641d6261a58d9fba5a6ce786e7d58a8876e25
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>
target/i386/hvf/hvf.c
target/i386/hvf/x86_emu.c
target/i386/hvf/x86_emu.h