[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/22] target/i386: move cpu_sync_bndcs_hflags() fun
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 16/22] target/i386: move cpu_sync_bndcs_hflags() function |
Date: |
Tue, 4 Jul 2017 13:12:09 +0200 |
From: Yang Zhong <address@hidden>
Move cpu_sync_bndcs_hflags() function from mpx_helper.c
to helper.c because mpx_helper.c need be disabled when
tcg is disabled.
Signed-off-by: Yang Zhong <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
v2: moved cpu_report_tpr_access hunk later [Richard]
target/i386/helper.c | 30 ++++++++++++++++++++++++++++++
target/i386/mpx_helper.c | 30 ------------------------------
2 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/target/i386/helper.c b/target/i386/helper.c
index ef05059..4d584b5 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -29,6 +29,36 @@
#include "hw/i386/apic_internal.h"
#endif
+void cpu_sync_bndcs_hflags(CPUX86State *env)
+{
+ uint32_t hflags = env->hflags;
+ uint32_t hflags2 = env->hflags2;
+ uint32_t bndcsr;
+
+ if ((hflags & HF_CPL_MASK) == 3) {
+ bndcsr = env->bndcs_regs.cfgu;
+ } else {
+ bndcsr = env->msr_bndcfgs;
+ }
+
+ if ((env->cr[4] & CR4_OSXSAVE_MASK)
+ && (env->xcr0 & XSTATE_BNDCSR_MASK)
+ && (bndcsr & BNDCFG_ENABLE)) {
+ hflags |= HF_MPX_EN_MASK;
+ } else {
+ hflags &= ~HF_MPX_EN_MASK;
+ }
+
+ if (bndcsr & BNDCFG_BNDPRESERVE) {
+ hflags2 |= HF2_MPX_PR_MASK;
+ } else {
+ hflags2 &= ~HF2_MPX_PR_MASK;
+ }
+
+ env->hflags = hflags;
+ env->hflags2 = hflags2;
+}
+
static void cpu_x86_version(CPUX86State *env, int *family, int *model)
{
int cpuver = env->cpuid_version;
diff --git a/target/i386/mpx_helper.c b/target/i386/mpx_helper.c
index 7e44820..ade5d24 100644
--- a/target/i386/mpx_helper.c
+++ b/target/i386/mpx_helper.c
@@ -24,36 +24,6 @@
#include "exec/exec-all.h"
-void cpu_sync_bndcs_hflags(CPUX86State *env)
-{
- uint32_t hflags = env->hflags;
- uint32_t hflags2 = env->hflags2;
- uint32_t bndcsr;
-
- if ((hflags & HF_CPL_MASK) == 3) {
- bndcsr = env->bndcs_regs.cfgu;
- } else {
- bndcsr = env->msr_bndcfgs;
- }
-
- if ((env->cr[4] & CR4_OSXSAVE_MASK)
- && (env->xcr0 & XSTATE_BNDCSR_MASK)
- && (bndcsr & BNDCFG_ENABLE)) {
- hflags |= HF_MPX_EN_MASK;
- } else {
- hflags &= ~HF_MPX_EN_MASK;
- }
-
- if (bndcsr & BNDCFG_BNDPRESERVE) {
- hflags2 |= HF2_MPX_PR_MASK;
- } else {
- hflags2 &= ~HF2_MPX_PR_MASK;
- }
-
- env->hflags = hflags;
- env->hflags2 = hflags2;
-}
-
void helper_bndck(CPUX86State *env, uint32_t fail)
{
if (unlikely(fail)) {
--
1.8.3.1
- [Qemu-devel] [PATCH 09/22] monitor: disable "info jit" and "info opcount" if !TCG, (continued)
- [Qemu-devel] [PATCH 09/22] monitor: disable "info jit" and "info opcount" if !TCG, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 10/22] vapic: use tcg_enabled, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 11/22] tcg: add the tcg-stub.c file into accel/stubs/, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 12/22] tcg: move tb_lock out of translate-all.h, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 13/22] exec: elide calls to tb_lock and tb_unlock, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 14/22] tcg: add CONFIG_TCG guards in headers, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 15/22] tcg: add the CONFIG_TCG into Makefiles, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 16/22] target/i386: move cpu_sync_bndcs_hflags() function,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 17/22] target/i386: make cpu_get_fp80()/cpu_set_fp80() static, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 21/22] target/i386: add the CONFIG_TCG into Makefiles, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 18/22] target/i386: split cpu_set_mxcsr() and make cpu_set_fpuc() inline, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 20/22] target/i386: add the tcg_enabled() in target/i386/, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 19/22] target/i386: move TLB refill function out of helper.c, Paolo Bonzini, 2017/07/04
- [Qemu-devel] [PATCH 22/22] configure: warn on untested --disable-tcg, Paolo Bonzini, 2017/07/04