[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v21 17/17] i386: move cpu_load_efer into SOFTMMU-only section of
From: |
Claudio Fontana |
Subject: |
[PATCH v21 17/17] i386: move cpu_load_efer into SOFTMMU-only section of cpu.h |
Date: |
Mon, 22 Feb 2021 14:36:34 +0100 |
cpu_load_efer is now used only for softmmu code.
Therefore, make this inline function not visible anymore
in CONFIG_USER_ONLY builds.
Signed-off-by: Claudio Fontana <cfontana@suse.de>
---
target/i386/cpu.h | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 770c833363..3ccf28b443 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1957,6 +1957,22 @@ 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?
+ */
+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;
+ }
+}
+
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);
@@ -2053,21 +2069,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 });
--
2.26.2
- [PATCH v21 07/17] i386: split off softmmu-only functionality in tcg-cpu, (continued)
- [PATCH v21 07/17] i386: split off softmmu-only functionality in tcg-cpu, Claudio Fontana, 2021/02/22
- [PATCH v21 01/17] i386: split cpu accelerators from cpu.c, using AccelCPUClass, Claudio Fontana, 2021/02/22
- [PATCH v21 08/17] i386: split smm helper (softmmu), Claudio Fontana, 2021/02/22
- [PATCH v21 09/17] i386: split tcg excp_helper into softmmu and user parts, Claudio Fontana, 2021/02/22
- [PATCH v21 04/17] target/i386: fix host_cpu_adjust_phys_bits error handling, Claudio Fontana, 2021/02/22
- [PATCH v21 05/17] accel-cpu: make cpu_realizefn return a bool, Claudio Fontana, 2021/02/22
- [PATCH v21 14/17] i386: split seg_helper into user-only and softmmu parts, Claudio Fontana, 2021/02/22
- [PATCH v21 16/17] i386: gdbstub: only write CR0/CR2/CR3/EFER for SOFTMMU, Claudio Fontana, 2021/02/22
- [PATCH v21 10/17] i386: move TCG btp_helper into softmmu/, Claudio Fontana, 2021/02/22
- [PATCH v21 13/17] i386: split svm_helper into softmmu and stub-only user, Claudio Fontana, 2021/02/22
- [PATCH v21 17/17] i386: move cpu_load_efer into SOFTMMU-only section of cpu.h,
Claudio Fontana <=
- [PATCH v21 11/17] i386: split misc helper into user and softmmu parts, Claudio Fontana, 2021/02/22
- [PATCH v21 12/17] i386: separate fpu_helper into user and softmmu parts, Claudio Fontana, 2021/02/22
- [PATCH v21 15/17] i386: split off softmmu part of cpu.c, Claudio Fontana, 2021/02/22
- Re: [PATCH v21 00/17] i386 cleanup PART 2, no-reply, 2021/02/22