From nobody Thu Nov 6 01:09:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538298472056966.7982331922054; Sun, 30 Sep 2018 02:07:52 -0700 (PDT) Received: from localhost ([::1]:54520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6Xhe-0003Lw-RQ for importer@patchew.org; Sun, 30 Sep 2018 05:07:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WsJ-0003CD-5G for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6WsF-0001JS-5i for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:46 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43542) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6WsC-00011c-R6 for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:41 -0400 Received: by mail-wr1-x443.google.com with SMTP id n1-v6so331370wrt.10 for ; Sun, 30 Sep 2018 01:14:19 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.14.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=laHq/4+rhGmVub8X+NEkCtKGvgxeOXbvVJYR03KjLiQ=; b=TOaQx8xyzAGFYfG10C0raWc0HEB8a3Sm2zHYoYT49f4QA6qrUJ7TagTqb9UhV88qJu YtD1AOndnJ3AB09Hqa/GB98Dngj+PNU0el5/eTii+KM/5JR35ZXGXZmxZxZfv5Rl/3Yp XVoXHP/ktoLu1buiP5gM2whUZFRUrpiuGCyxSytf28bs0Ij/RaX5OJ+YCO2uG0VsTHFw 1u3uoivlszUgzWfDiowbSLePlyItB/x6G1/PKMTEfxd8nBmbFV5SMitJ3QXs91j9jPzg YK5MftNPA7mYnW4xjyYyTNV1agJYhxIX1f8fu4lbyaGJ0PdeSwiH1xhF6fY+WLoe1/AA eRvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=laHq/4+rhGmVub8X+NEkCtKGvgxeOXbvVJYR03KjLiQ=; b=hgyhm3GPHJZ0W0aRKqrMbEvyLFwY8DGopFSb6ZpetX3Cbh9QhvCJFlRM248XcHD47d +8uD/kun+zAFdsd/YKV9CDKtwSR86LyFr8tryUWm3mXMo4KN4W1EzWizExI8gqJGgQsD JTE7Mjs4TsDhleLzg6fTTyKvE40jfhOeYf2utRJU0ZQE6QPb57ym+inimIgGZIA/erm0 f8oLuS3tFjH2mSqF2fyLqcXfZRP3YoCkwDYnWHKamXncTFWEL5qMD5yR7V6QSxdz6DVA rQV4hwyTnZIW4rorrJFGGWDUlpj1/riySqcfuOXHg7xxHrax72hSkbunLpmMBEDuQkwS ljVg== X-Gm-Message-State: ABuFfoj1LlY5s6fbHLxOoAZ5Sia21u4kPmixxRYtR6z5TztATofEvZVN G/NlR28Leupb4MnL6DtdJCW7clI1 X-Google-Smtp-Source: ACcGV63HSSPwm0rwt5ynTyiAlfgz+bACtSvTrya+oe5/j+gdkeu6zMFq/kxdFmSKV0g08AIORHy6og== X-Received: by 2002:a5d:65d1:: with SMTP id e17-v6mr3593342wrw.149.1538295257683; Sun, 30 Sep 2018 01:14:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:12:54 +0200 Message-Id: <1538295197-23704-57-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PULL 56/79] target/i386: rename HF_SVMI_MASK to HF_GUEST_MASK X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This flag will be used for KVM's nested VMX migration; the HF_GUEST_MASK na= me is already used in KVM, adopt it in QEMU as well. Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 4 ++-- target/i386/excp_helper.c | 2 +- target/i386/seg_helper.c | 6 +++--- target/i386/svm_helper.c | 6 +++--- target/i386/translate.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 227a5d9..6f0e4de 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -171,7 +171,7 @@ typedef enum X86Seg { #define HF_AC_SHIFT 18 /* must be same as eflags */ #define HF_SMM_SHIFT 19 /* CPU in SMM mode */ #define HF_SVME_SHIFT 20 /* SVME enabled (copy of EFER.SVME) */ -#define HF_SVMI_SHIFT 21 /* SVM intercepts are active */ +#define HF_GUEST_SHIFT 21 /* SVM intercepts are active */ #define HF_OSFXSR_SHIFT 22 /* CR4.OSFXSR */ #define HF_SMAP_SHIFT 23 /* CR4.SMAP */ #define HF_IOBPT_SHIFT 24 /* an io breakpoint enabled */ @@ -196,7 +196,7 @@ typedef enum X86Seg { #define HF_AC_MASK (1 << HF_AC_SHIFT) #define HF_SMM_MASK (1 << HF_SMM_SHIFT) #define HF_SVME_MASK (1 << HF_SVME_SHIFT) -#define HF_SVMI_MASK (1 << HF_SVMI_SHIFT) +#define HF_GUEST_MASK (1 << HF_GUEST_SHIFT) #define HF_OSFXSR_MASK (1 << HF_OSFXSR_SHIFT) #define HF_SMAP_MASK (1 << HF_SMAP_SHIFT) #define HF_IOBPT_MASK (1 << HF_IOBPT_SHIFT) diff --git a/target/i386/excp_helper.c b/target/i386/excp_helper.c index 37a33d5..49231f6 100644 --- a/target/i386/excp_helper.c +++ b/target/i386/excp_helper.c @@ -53,7 +53,7 @@ static int check_exception(CPUX86State *env, int intno, i= nt *error_code, =20 #if !defined(CONFIG_USER_ONLY) if (env->old_exception =3D=3D EXCP08_DBLE) { - if (env->hflags & HF_SVMI_MASK) { + if (env->hflags & HF_GUEST_MASK) { cpu_vmexit(env, SVM_EXIT_SHUTDOWN, 0, retaddr); /* does not re= turn */ } =20 diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c index ba9cc68..33714bc 100644 --- a/target/i386/seg_helper.c +++ b/target/i386/seg_helper.c @@ -1244,7 +1244,7 @@ static void do_interrupt_all(X86CPU *cpu, int intno, = int is_int, } if (env->cr[0] & CR0_PE_MASK) { #if !defined(CONFIG_USER_ONLY) - if (env->hflags & HF_SVMI_MASK) { + if (env->hflags & HF_GUEST_MASK) { handle_even_inj(env, intno, is_int, error_code, is_hw, 0); } #endif @@ -1259,7 +1259,7 @@ static void do_interrupt_all(X86CPU *cpu, int intno, = int is_int, } } else { #if !defined(CONFIG_USER_ONLY) - if (env->hflags & HF_SVMI_MASK) { + if (env->hflags & HF_GUEST_MASK) { handle_even_inj(env, intno, is_int, error_code, is_hw, 1); } #endif @@ -1267,7 +1267,7 @@ static void do_interrupt_all(X86CPU *cpu, int intno, = int is_int, } =20 #if !defined(CONFIG_USER_ONLY) - if (env->hflags & HF_SVMI_MASK) { + if (env->hflags & HF_GUEST_MASK) { CPUState *cs =3D CPU(cpu); uint32_t event_inj =3D x86_ldl_phys(cs, env->vm_vmcb + offsetof(struct vmcb, diff --git a/target/i386/svm_helper.c b/target/i386/svm_helper.c index 342ece0..9fd22a8 100644 --- a/target/i386/svm_helper.c +++ b/target/i386/svm_helper.c @@ -228,7 +228,7 @@ void helper_vmrun(CPUX86State *env, int aflag, int next= _eip_addend) } =20 /* enable intercepts */ - env->hflags |=3D HF_SVMI_MASK; + env->hflags |=3D HF_GUEST_MASK; =20 env->tsc_offset =3D x86_ldq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, control.tsc_offset)); @@ -503,7 +503,7 @@ void cpu_svm_check_intercept_param(CPUX86State *env, ui= nt32_t type, { CPUState *cs =3D CPU(x86_env_get_cpu(env)); =20 - if (likely(!(env->hflags & HF_SVMI_MASK))) { + if (likely(!(env->hflags & HF_GUEST_MASK))) { return; } switch (type) { @@ -697,7 +697,7 @@ void do_vmexit(CPUX86State *env, uint32_t exit_code, ui= nt64_t exit_info_1) =20 /* Reload the host state from vm_hsave */ env->hflags2 &=3D ~(HF2_HIF_MASK | HF2_VINTR_MASK); - env->hflags &=3D ~HF_SVMI_MASK; + env->hflags &=3D ~HF_GUEST_MASK; env->intercept =3D 0; env->intercept_exceptions =3D 0; cs->interrupt_request &=3D ~CPU_INTERRUPT_VIRQ; diff --git a/target/i386/translate.c b/target/i386/translate.c index b8222dc..8fcd88e 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -632,7 +632,7 @@ static void gen_check_io(DisasContext *s, TCGMemOp ot, = target_ulong cur_eip, tcg_abort(); } } - if(s->flags & HF_SVMI_MASK) { + if(s->flags & HF_GUEST_MASK) { gen_update_cc_op(s); gen_jmp_im(s, cur_eip); svm_flags |=3D (1 << (4 + ot)); @@ -2316,7 +2316,7 @@ gen_svm_check_intercept_param(DisasContext *s, target= _ulong pc_start, uint32_t type, uint64_t param) { /* no SVM activated; fast case */ - if (likely(!(s->flags & HF_SVMI_MASK))) + if (likely(!(s->flags & HF_GUEST_MASK))) return; gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); --=20 1.8.3.1