diff options
author | Gareth Webb <gareth.webb@umbralsoftware.co.uk> | 2022-02-06 22:36:09 +0000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-02-16 15:01:33 +0100 |
commit | 637f1ee377eab718cb23808299ea2770e722da5c (patch) | |
tree | 7c4c7fe9083ed819ea20fc3f38fa9d772b1daf87 /target/i386/helper.c | |
parent | ad38520bdeb2b1e0b487db317f29119e94c1c88d (diff) |
target/i386: add TCG support for UMIP
Signed-off-by: Gareth Webb <gareth.webb@umbralsoftware.co.uk>
Message-Id: <164425598317.21902.4257759159329756142-1@git.sr.ht>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/helper.c')
-rw-r--r-- | target/i386/helper.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/target/i386/helper.c b/target/i386/helper.c index 533b29cb91..a4315048c0 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -174,7 +174,7 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_cr4) } /* Clear bits we're going to recompute. */ - hflags = env->hflags & ~(HF_OSFXSR_MASK | HF_SMAP_MASK); + hflags = env->hflags & ~(HF_OSFXSR_MASK | HF_SMAP_MASK | HF_UMIP_MASK); /* SSE handling */ if (!(env->features[FEAT_1_EDX] & CPUID_SSE)) { @@ -190,6 +190,12 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_cr4) if (new_cr4 & CR4_SMAP_MASK) { hflags |= HF_SMAP_MASK; } + if (!(env->features[FEAT_7_0_ECX] & CPUID_7_0_ECX_UMIP)) { + new_cr4 &= ~CR4_UMIP_MASK; + } + if (new_cr4 & CR4_UMIP_MASK) { + hflags |= HF_UMIP_MASK; + } if (!(env->features[FEAT_7_0_ECX] & CPUID_7_0_ECX_PKU)) { new_cr4 &= ~CR4_PKE_MASK; |