[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 37/42] target/i386: move cpu_sync_bndcs_hflags() func
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 37/42] target/i386: move cpu_sync_bndcs_hflags() function |
Date: |
Wed, 5 Jul 2017 09:14:40 +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>
---
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] [PULL 23/42] configure: early test for supported targets, (continued)
- [Qemu-devel] [PULL 23/42] configure: early test for supported targets, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 20/42] qemu-thread: Assert locks are initialized before using, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 25/42] vl: convert -tb-size to qemu_strtoul, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 27/42] tcg: move page_size_init() function, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 28/42] cpu: move interrupt handling out of translate-common.c, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 29/42] tcg: make tcg_allowed global, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 32/42] tcg: add the tcg-stub.c file into accel/stubs/, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 31/42] vapic: use tcg_enabled, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 30/42] monitor: disable "info jit" and "info opcount" if !TCG, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 33/42] tcg: move tb_lock out of translate-all.h, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 37/42] target/i386: move cpu_sync_bndcs_hflags() function,
Paolo Bonzini <=
- [Qemu-devel] [PULL 34/42] exec: elide calls to tb_lock and tb_unlock, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 36/42] tcg: add the CONFIG_TCG into Makefiles, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 35/42] tcg: add CONFIG_TCG guards in headers, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 38/42] target/i386: make cpu_get_fp80()/cpu_set_fp80() static, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 41/42] target/i386: add the tcg_enabled() in target/i386/, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 39/42] target/i386: split cpu_set_mxcsr() and make cpu_set_fpuc() inline, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 42/42] target/i386: add the CONFIG_TCG into Makefiles, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 40/42] target/i386: move TLB refill function out of helper.c, Paolo Bonzini, 2017/07/05
- Re: [Qemu-devel] [PULL 00/42] Misc changes for 2017-07-05, Peter Maydell, 2017/07/06
- Re: [Qemu-devel] [PULL 00/42] Misc changes for 2017-07-05, no-reply, 2017/07/06