Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
xen.10697
5aec744a-7-x86-xpti-pv_guest_cr4_to_real_cr4.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5aec744a-7-x86-xpti-pv_guest_cr4_to_real_cr4.patch of Package xen.10697
From a5407c1d8c6c0cac96d3e84e7b2b25b18fa2bf4d Mon Sep 17 00:00:00 2001 From: Juergen Gross <jgross@suse.com> Date: Thu, 26 Apr 2018 13:33:16 +0200 Subject: [PATCH] xen/x86: convert pv_guest_cr4_to_real_cr4() to a function pv_guest_cr4_to_real_cr4() is becoming more and more complex. Convert it from a macro to an ordinary function. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -496,6 +496,20 @@ void make_cr3(struct vcpu *v, unsigned l v->arch.cr3 = mfn << PAGE_SHIFT; } +unsigned long pv_guest_cr4_to_real_cr4(const struct vcpu *v) +{ + const struct domain *d = v->domain; + unsigned long cr4; + + cr4 = v->arch.pv_vcpu.ctrlreg[4] & ~X86_CR4_DE; + cr4 |= mmu_cr4_features & (X86_CR4_PSE | X86_CR4_SMEP | + X86_CR4_OSXSAVE | X86_CR4_FSGSBASE); + cr4 |= d->arch.pv_domain.xpti ? 0 : X86_CR4_PGE; + cr4 |= d->arch.vtsc ? X86_CR4_TSD : 0; + + return cr4; +} + void write_ptbase(struct vcpu *v) { struct cpu_info *cpu_info = get_cpu_info(); --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -501,14 +501,8 @@ void vcpu_show_registers(const struct vc unsigned long pv_guest_cr4_fixup(const struct vcpu *, unsigned long guest_cr4); /* Convert between guest-visible and real CR4 values. */ -#define pv_guest_cr4_to_real_cr4(v) \ - (((v)->arch.pv_vcpu.ctrlreg[4] \ - | (mmu_cr4_features \ - & (X86_CR4_PSE | X86_CR4_SMEP | \ - X86_CR4_OSXSAVE | X86_CR4_FSGSBASE)) \ - | ((v)->domain->arch.pv_domain.xpti ? 0 : X86_CR4_PGE) \ - | ((v)->domain->arch.vtsc ? X86_CR4_TSD : 0)) \ - & ~X86_CR4_DE) +unsigned long pv_guest_cr4_to_real_cr4(const struct vcpu *v); + #define real_cr4_to_pv_guest_cr4(c) \ ((c) & ~(X86_CR4_PGE | X86_CR4_PSE | X86_CR4_TSD | \ X86_CR4_OSXSAVE | X86_CR4_SMEP | X86_CR4_FSGSBASE))
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor