[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/33] i386: make cpu_load_efer sysemu-only
From: |
Paolo Bonzini |
Subject: |
[PULL 19/33] i386: make cpu_load_efer sysemu-only |
Date: |
Tue, 11 May 2021 04:13:36 -0400 |
From: Claudio Fontana <cfontana@suse.de>
cpu_load_efer is now used only for sysemu code.
Therefore, move this function implementation to
sysemu-only section of helper.c
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210322132800.7470-22-cfontana@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.h | 20 +++++---------------
target/i386/helper.c | 13 +++++++++++++
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 5aae3ec0f4..0b182b7a5f 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1958,6 +1958,11 @@ static inline AddressSpace *cpu_addressspace(CPUState
*cs, MemTxAttrs attrs)
return cpu_get_address_space(cs, cpu_asidx_from_attrs(cs, attrs));
}
+/*
+ * load efer and update the corresponding hflags. XXX: do consistency
+ * checks with cpuid bits?
+ */
+void cpu_load_efer(CPUX86State *env, uint64_t val);
uint8_t x86_ldub_phys(CPUState *cs, hwaddr addr);
uint32_t x86_lduw_phys(CPUState *cs, hwaddr addr);
uint32_t x86_ldl_phys(CPUState *cs, hwaddr addr);
@@ -2054,21 +2059,6 @@ static inline uint32_t cpu_compute_eflags(CPUX86State
*env)
return eflags;
}
-
-/* load efer and update the corresponding hflags. XXX: do consistency
- checks with cpuid bits? */
-static inline void cpu_load_efer(CPUX86State *env, uint64_t val)
-{
- env->efer = val;
- env->hflags &= ~(HF_LMA_MASK | HF_SVME_MASK);
- if (env->efer & MSR_EFER_LMA) {
- env->hflags |= HF_LMA_MASK;
- }
- if (env->efer & MSR_EFER_SVME) {
- env->hflags |= HF_SVME_MASK;
- }
-}
-
static inline MemTxAttrs cpu_get_mem_attrs(CPUX86State *env)
{
return ((MemTxAttrs) { .secure = (env->hflags & HF_SMM_MASK) != 0 });
diff --git a/target/i386/helper.c b/target/i386/helper.c
index 8c180b5b2b..533b29cb91 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -574,6 +574,19 @@ void do_cpu_sipi(X86CPU *cpu)
#endif
#ifndef CONFIG_USER_ONLY
+
+void cpu_load_efer(CPUX86State *env, uint64_t val)
+{
+ env->efer = val;
+ env->hflags &= ~(HF_LMA_MASK | HF_SVME_MASK);
+ if (env->efer & MSR_EFER_LMA) {
+ env->hflags |= HF_LMA_MASK;
+ }
+ if (env->efer & MSR_EFER_SVME) {
+ env->hflags |= HF_SVME_MASK;
+ }
+}
+
uint8_t x86_ldub_phys(CPUState *cs, hwaddr addr)
{
X86CPU *cpu = X86_CPU(cs);
--
2.26.2
- [PULL 04/33] cpu: call AccelCPUClass::cpu_realizefn in cpu_exec_realizefn, (continued)
- [PULL 04/33] cpu: call AccelCPUClass::cpu_realizefn in cpu_exec_realizefn, Paolo Bonzini, 2021/05/11
- [PULL 02/33] target/i386: Split out do_fsave, do_frstor, do_fxsave, do_fxrstor, Paolo Bonzini, 2021/05/11
- [PULL 01/33] target/i386: Rename helper_fldt, helper_fstt, Paolo Bonzini, 2021/05/11
- [PULL 08/33] i386: split off sysemu-only functionality in tcg-cpu, Paolo Bonzini, 2021/05/11
- [PULL 03/33] i386: split cpu accelerators from cpu.c, using AccelCPUClass, Paolo Bonzini, 2021/05/11
- [PULL 09/33] i386: split smm helper (sysemu), Paolo Bonzini, 2021/05/11
- [PULL 07/33] accel-cpu: make cpu_realizefn return a bool, Paolo Bonzini, 2021/05/11
- [PULL 06/33] target/i386: fix host_cpu_adjust_phys_bits error handling, Paolo Bonzini, 2021/05/11
- [PULL 05/33] accel: introduce new accessor functions, Paolo Bonzini, 2021/05/11
- [PULL 18/33] target/i386: gdbstub: only write CR0/CR2/CR3/EFER for sysemu, Paolo Bonzini, 2021/05/11
- [PULL 19/33] i386: make cpu_load_efer sysemu-only,
Paolo Bonzini <=
- [PULL 20/33] accel: move call to accel_init_interfaces, Paolo Bonzini, 2021/05/11
- [PULL 23/33] target/i386: move paging mode constants from SVM to cpu.h, Paolo Bonzini, 2021/05/11
- [PULL 17/33] target/i386: gdbstub: introduce aux functions to read/write CS64 regs, Paolo Bonzini, 2021/05/11
- [PULL 14/33] i386: split svm_helper into sysemu and stub-only user, Paolo Bonzini, 2021/05/11
- [PULL 11/33] i386: move TCG bpt_helper into sysemu/, Paolo Bonzini, 2021/05/11
- [PULL 10/33] i386: split tcg excp_helper into sysemu and user parts, Paolo Bonzini, 2021/05/11
- [PULL 12/33] i386: split misc helper user stubs and sysemu part, Paolo Bonzini, 2021/05/11
- [PULL 15/33] i386: split seg_helper into user-only and sysemu parts, Paolo Bonzini, 2021/05/11
- [PULL 13/33] i386: separate fpu_helper sysemu-only parts, Paolo Bonzini, 2021/05/11
- [PULL 22/33] target/i386: merge SVM_NPTEXIT_* with PF_ERROR_* constants, Paolo Bonzini, 2021/05/11