Commit 08f83508 authored by Juerg Haefliger's avatar Juerg Haefliger

UBUNTU: SAUCE: KVM: Move code fragments, cleanup and re-indent

BugLink: https://bugs.launchpad.net/bugs/1811646

To match upstream stable v4.4 and v4.9, respectively, so that future
cherry-picking results in fewer conflicts.

No functional changes.
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 4ad43721
...@@ -121,28 +121,6 @@ static inline bool guest_cpuid_is_amd(struct kvm_vcpu *vcpu) ...@@ -121,28 +121,6 @@ static inline bool guest_cpuid_is_amd(struct kvm_vcpu *vcpu)
return best && best->ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx; return best && best->ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx;
} }
static inline int guest_cpuid_family(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best;
best = kvm_find_cpuid_entry(vcpu, 0x1, 0);
if (!best)
return -1;
return __x86_family(best->eax);
}
static inline int guest_cpuid_model(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best;
best = kvm_find_cpuid_entry(vcpu, 0x1, 0);
if (!best)
return -1;
return x86_model(best->eax);
}
static inline bool guest_cpuid_has_gbpages(struct kvm_vcpu *vcpu) static inline bool guest_cpuid_has_gbpages(struct kvm_vcpu *vcpu)
{ {
struct kvm_cpuid_entry2 *best; struct kvm_cpuid_entry2 *best;
...@@ -243,4 +221,26 @@ static inline bool guest_cpuid_has_nrips(struct kvm_vcpu *vcpu) ...@@ -243,4 +221,26 @@ static inline bool guest_cpuid_has_nrips(struct kvm_vcpu *vcpu)
} }
#undef BIT_NRIPS #undef BIT_NRIPS
static inline int guest_cpuid_family(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best;
best = kvm_find_cpuid_entry(vcpu, 0x1, 0);
if (!best)
return -1;
return __x86_family(best->eax);
}
static inline int guest_cpuid_model(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best;
best = kvm_find_cpuid_entry(vcpu, 0x1, 0);
if (!best)
return -1;
return x86_model(best->eax);
}
#endif #endif
...@@ -680,7 +680,7 @@ static inline int pi_test_sn(struct pi_desc *pi_desc) ...@@ -680,7 +680,7 @@ static inline int pi_test_sn(struct pi_desc *pi_desc)
} }
struct vmx_msrs { struct vmx_msrs {
unsigned nr; unsigned int nr;
struct vmx_msr_entry val[NR_AUTOLOAD_MSRS]; struct vmx_msr_entry val[NR_AUTOLOAD_MSRS];
}; };
...@@ -702,8 +702,8 @@ struct vcpu_vmx { ...@@ -702,8 +702,8 @@ struct vcpu_vmx {
u64 msr_guest_kernel_gs_base; u64 msr_guest_kernel_gs_base;
#endif #endif
u64 arch_capabilities; u64 arch_capabilities;
u64 spec_ctrl; u64 spec_ctrl;
u32 vm_entry_controls_shadow; u32 vm_entry_controls_shadow;
u32 vm_exit_controls_shadow; u32 vm_exit_controls_shadow;
...@@ -5710,8 +5710,8 @@ static int handle_exception(struct kvm_vcpu *vcpu) ...@@ -5710,8 +5710,8 @@ static int handle_exception(struct kvm_vcpu *vcpu)
/* EPT won't cause page fault directly */ /* EPT won't cause page fault directly */
BUG_ON(enable_ept); BUG_ON(enable_ept);
cr2 = vmcs_readl(EXIT_QUALIFICATION); cr2 = vmcs_readl(EXIT_QUALIFICATION);
vcpu->arch.l1tf_flush_l1d = true;
trace_kvm_page_fault(cr2, error_code); trace_kvm_page_fault(cr2, error_code);
vcpu->arch.l1tf_flush_l1d = true;
if (kvm_event_needs_reinjection(vcpu)) if (kvm_event_needs_reinjection(vcpu))
kvm_mmu_unprotect_page_virt(vcpu, cr2); kvm_mmu_unprotect_page_virt(vcpu, cr2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment