|
Pablo Greco |
e6a3ae |
From 9d1e37615a8285d852b7d8f829b9f9aeed703f14 Mon Sep 17 00:00:00 2001
|
|
Pablo Greco |
e6a3ae |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
Pablo Greco |
e6a3ae |
Date: Mon, 22 Jul 2019 18:22:04 +0100
|
|
Pablo Greco |
e6a3ae |
Subject: [PATCH 23/39] target/i386: rename HF_SVMI_MASK to HF_GUEST_MASK
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
Pablo Greco |
e6a3ae |
Message-id: <20190722182220.19374-3-pbonzini@redhat.com>
|
|
Pablo Greco |
e6a3ae |
Patchwork-id: 89620
|
|
Pablo Greco |
e6a3ae |
O-Subject: [RHEL-8.1.0 PATCH qemu-kvm v3 02/18] target/i386: rename HF_SVMI_MASK to HF_GUEST_MASK
|
|
Pablo Greco |
e6a3ae |
Bugzilla: 1689269
|
|
Pablo Greco |
e6a3ae |
RH-Acked-by: Peter Xu <zhexu@redhat.com>
|
|
Pablo Greco |
e6a3ae |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
Pablo Greco |
e6a3ae |
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
This flag will be used for KVM's nested VMX migration; the HF_GUEST_MASK name
|
|
Pablo Greco |
e6a3ae |
is already used in KVM, adopt it in QEMU as well.
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Pablo Greco |
e6a3ae |
(cherry picked from commit f8dc4c645ec2956a6cd97e0ca0fdd4753181f735)
|
|
Pablo Greco |
e6a3ae |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
Pablo Greco |
e6a3ae |
---
|
|
Pablo Greco |
e6a3ae |
target/i386/cpu.h | 4 ++--
|
|
Pablo Greco |
e6a3ae |
target/i386/excp_helper.c | 2 +-
|
|
Pablo Greco |
e6a3ae |
target/i386/seg_helper.c | 6 +++---
|
|
Pablo Greco |
e6a3ae |
target/i386/svm_helper.c | 6 +++---
|
|
Pablo Greco |
e6a3ae |
target/i386/translate.c | 4 ++--
|
|
Pablo Greco |
e6a3ae |
5 files changed, 11 insertions(+), 11 deletions(-)
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
|
|
Pablo Greco |
e6a3ae |
index 4f9df6e..923dfcd 100644
|
|
Pablo Greco |
e6a3ae |
--- a/target/i386/cpu.h
|
|
Pablo Greco |
e6a3ae |
+++ b/target/i386/cpu.h
|
|
Pablo Greco |
e6a3ae |
@@ -171,7 +171,7 @@ typedef enum X86Seg {
|
|
Pablo Greco |
e6a3ae |
#define HF_AC_SHIFT 18 /* must be same as eflags */
|
|
Pablo Greco |
e6a3ae |
#define HF_SMM_SHIFT 19 /* CPU in SMM mode */
|
|
Pablo Greco |
e6a3ae |
#define HF_SVME_SHIFT 20 /* SVME enabled (copy of EFER.SVME) */
|
|
Pablo Greco |
e6a3ae |
-#define HF_SVMI_SHIFT 21 /* SVM intercepts are active */
|
|
Pablo Greco |
e6a3ae |
+#define HF_GUEST_SHIFT 21 /* SVM intercepts are active */
|
|
Pablo Greco |
e6a3ae |
#define HF_OSFXSR_SHIFT 22 /* CR4.OSFXSR */
|
|
Pablo Greco |
e6a3ae |
#define HF_SMAP_SHIFT 23 /* CR4.SMAP */
|
|
Pablo Greco |
e6a3ae |
#define HF_IOBPT_SHIFT 24 /* an io breakpoint enabled */
|
|
Pablo Greco |
e6a3ae |
@@ -196,7 +196,7 @@ typedef enum X86Seg {
|
|
Pablo Greco |
e6a3ae |
#define HF_AC_MASK (1 << HF_AC_SHIFT)
|
|
Pablo Greco |
e6a3ae |
#define HF_SMM_MASK (1 << HF_SMM_SHIFT)
|
|
Pablo Greco |
e6a3ae |
#define HF_SVME_MASK (1 << HF_SVME_SHIFT)
|
|
Pablo Greco |
e6a3ae |
-#define HF_SVMI_MASK (1 << HF_SVMI_SHIFT)
|
|
Pablo Greco |
e6a3ae |
+#define HF_GUEST_MASK (1 << HF_GUEST_SHIFT)
|
|
Pablo Greco |
e6a3ae |
#define HF_OSFXSR_MASK (1 << HF_OSFXSR_SHIFT)
|
|
Pablo Greco |
e6a3ae |
#define HF_SMAP_MASK (1 << HF_SMAP_SHIFT)
|
|
Pablo Greco |
e6a3ae |
#define HF_IOBPT_MASK (1 << HF_IOBPT_SHIFT)
|
|
Pablo Greco |
e6a3ae |
diff --git a/target/i386/excp_helper.c b/target/i386/excp_helper.c
|
|
Pablo Greco |
e6a3ae |
index cb4d1b7..7153837 100644
|
|
Pablo Greco |
e6a3ae |
--- a/target/i386/excp_helper.c
|
|
Pablo Greco |
e6a3ae |
+++ b/target/i386/excp_helper.c
|
|
Pablo Greco |
e6a3ae |
@@ -53,7 +53,7 @@ static int check_exception(CPUX86State *env, int intno, int *error_code,
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
#if !defined(CONFIG_USER_ONLY)
|
|
Pablo Greco |
e6a3ae |
if (env->old_exception == EXCP08_DBLE) {
|
|
Pablo Greco |
e6a3ae |
- if (env->hflags & HF_SVMI_MASK) {
|
|
Pablo Greco |
e6a3ae |
+ if (env->hflags & HF_GUEST_MASK) {
|
|
Pablo Greco |
e6a3ae |
cpu_vmexit(env, SVM_EXIT_SHUTDOWN, 0, retaddr); /* does not return */
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c
|
|
Pablo Greco |
e6a3ae |
index 600a4d7..f028045 100644
|
|
Pablo Greco |
e6a3ae |
--- a/target/i386/seg_helper.c
|
|
Pablo Greco |
e6a3ae |
+++ b/target/i386/seg_helper.c
|
|
Pablo Greco |
e6a3ae |
@@ -1239,7 +1239,7 @@ static void do_interrupt_all(X86CPU *cpu, int intno, int is_int,
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
if (env->cr[0] & CR0_PE_MASK) {
|
|
Pablo Greco |
e6a3ae |
#if !defined(CONFIG_USER_ONLY)
|
|
Pablo Greco |
e6a3ae |
- if (env->hflags & HF_SVMI_MASK) {
|
|
Pablo Greco |
e6a3ae |
+ if (env->hflags & HF_GUEST_MASK) {
|
|
Pablo Greco |
e6a3ae |
handle_even_inj(env, intno, is_int, error_code, is_hw, 0);
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
#endif
|
|
Pablo Greco |
e6a3ae |
@@ -1254,7 +1254,7 @@ static void do_interrupt_all(X86CPU *cpu, int intno, int is_int,
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
} else {
|
|
Pablo Greco |
e6a3ae |
#if !defined(CONFIG_USER_ONLY)
|
|
Pablo Greco |
e6a3ae |
- if (env->hflags & HF_SVMI_MASK) {
|
|
Pablo Greco |
e6a3ae |
+ if (env->hflags & HF_GUEST_MASK) {
|
|
Pablo Greco |
e6a3ae |
handle_even_inj(env, intno, is_int, error_code, is_hw, 1);
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
#endif
|
|
Pablo Greco |
e6a3ae |
@@ -1262,7 +1262,7 @@ static void do_interrupt_all(X86CPU *cpu, int intno, int is_int,
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
#if !defined(CONFIG_USER_ONLY)
|
|
Pablo Greco |
e6a3ae |
- if (env->hflags & HF_SVMI_MASK) {
|
|
Pablo Greco |
e6a3ae |
+ if (env->hflags & HF_GUEST_MASK) {
|
|
Pablo Greco |
e6a3ae |
CPUState *cs = CPU(cpu);
|
|
Pablo Greco |
e6a3ae |
uint32_t event_inj = x86_ldl_phys(cs, env->vm_vmcb +
|
|
Pablo Greco |
e6a3ae |
offsetof(struct vmcb,
|
|
Pablo Greco |
e6a3ae |
diff --git a/target/i386/svm_helper.c b/target/i386/svm_helper.c
|
|
Pablo Greco |
e6a3ae |
index 3504923..5b8458d 100644
|
|
Pablo Greco |
e6a3ae |
--- a/target/i386/svm_helper.c
|
|
Pablo Greco |
e6a3ae |
+++ b/target/i386/svm_helper.c
|
|
Pablo Greco |
e6a3ae |
@@ -206,7 +206,7 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
|
|
Pablo Greco |
e6a3ae |
));
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
/* enable intercepts */
|
|
Pablo Greco |
e6a3ae |
- env->hflags |= HF_SVMI_MASK;
|
|
Pablo Greco |
e6a3ae |
+ env->hflags |= HF_GUEST_MASK;
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
env->tsc_offset = x86_ldq_phys(cs, env->vm_vmcb +
|
|
Pablo Greco |
e6a3ae |
offsetof(struct vmcb, control.tsc_offset));
|
|
Pablo Greco |
e6a3ae |
@@ -481,7 +481,7 @@ void cpu_svm_check_intercept_param(CPUX86State *env, uint32_t type,
|
|
Pablo Greco |
e6a3ae |
{
|
|
Pablo Greco |
e6a3ae |
CPUState *cs = CPU(x86_env_get_cpu(env));
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
- if (likely(!(env->hflags & HF_SVMI_MASK))) {
|
|
Pablo Greco |
e6a3ae |
+ if (likely(!(env->hflags & HF_GUEST_MASK))) {
|
|
Pablo Greco |
e6a3ae |
return;
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
switch (type) {
|
|
Pablo Greco |
e6a3ae |
@@ -674,7 +674,7 @@ void do_vmexit(CPUX86State *env, uint32_t exit_code, uint64_t exit_info_1)
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
/* Reload the host state from vm_hsave */
|
|
Pablo Greco |
e6a3ae |
env->hflags2 &= ~(HF2_HIF_MASK | HF2_VINTR_MASK);
|
|
Pablo Greco |
e6a3ae |
- env->hflags &= ~HF_SVMI_MASK;
|
|
Pablo Greco |
e6a3ae |
+ env->hflags &= ~HF_GUEST_MASK;
|
|
Pablo Greco |
e6a3ae |
env->intercept = 0;
|
|
Pablo Greco |
e6a3ae |
env->intercept_exceptions = 0;
|
|
Pablo Greco |
e6a3ae |
cs->interrupt_request &= ~CPU_INTERRUPT_VIRQ;
|
|
Pablo Greco |
e6a3ae |
diff --git a/target/i386/translate.c b/target/i386/translate.c
|
|
Pablo Greco |
e6a3ae |
index c9ed8dc..2a1b39e 100644
|
|
Pablo Greco |
e6a3ae |
--- a/target/i386/translate.c
|
|
Pablo Greco |
e6a3ae |
+++ b/target/i386/translate.c
|
|
Pablo Greco |
e6a3ae |
@@ -621,7 +621,7 @@ static void gen_check_io(DisasContext *s, TCGMemOp ot, target_ulong cur_eip,
|
|
Pablo Greco |
e6a3ae |
tcg_abort();
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
}
|
|
Pablo Greco |
e6a3ae |
- if(s->flags & HF_SVMI_MASK) {
|
|
Pablo Greco |
e6a3ae |
+ if(s->flags & HF_GUEST_MASK) {
|
|
Pablo Greco |
e6a3ae |
gen_update_cc_op(s);
|
|
Pablo Greco |
e6a3ae |
gen_jmp_im(cur_eip);
|
|
Pablo Greco |
e6a3ae |
svm_flags |= (1 << (4 + ot));
|
|
Pablo Greco |
e6a3ae |
@@ -2305,7 +2305,7 @@ gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start,
|
|
Pablo Greco |
e6a3ae |
uint32_t type, uint64_t param)
|
|
Pablo Greco |
e6a3ae |
{
|
|
Pablo Greco |
e6a3ae |
/* no SVM activated; fast case */
|
|
Pablo Greco |
e6a3ae |
- if (likely(!(s->flags & HF_SVMI_MASK)))
|
|
Pablo Greco |
e6a3ae |
+ if (likely(!(s->flags & HF_GUEST_MASK)))
|
|
Pablo Greco |
e6a3ae |
return;
|
|
Pablo Greco |
e6a3ae |
gen_update_cc_op(s);
|
|
Pablo Greco |
e6a3ae |
gen_jmp_im(pc_start - s->cs_base);
|
|
Pablo Greco |
e6a3ae |
--
|
|
Pablo Greco |
e6a3ae |
1.8.3.1
|
|
Pablo Greco |
e6a3ae |
|