mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-02 05:34:04 +00:00
Linux commit edfe63ec97ed ("x86/mtrr: Fix Xorg crashes in Qemu sessions") disables PAT feature if MTRR is not enabled. This patch does partial emulation of MTRR to prevent this from happening: enable fixed-range MTRRs and disable virable range MTRRs By default IA32_PAT MSR (SDM Vol3 11.12.4, Table 11-12) doesn't include 'WC' type. If MTRR is disabled from the guests, Linux doesn't allow writing IA32_PAT MSR so WC type can't be enabled. This creates some performance issues for certian applications that rely on WC memory type. Implementation summary: - Enable MTRR feature: MTRRdefType.E=1 - Enable fixed range MTRRs: MTRRCAP.fix=1, MTRRdefType.FE=1 - For simplicity, disable variable range MTRRs: MTRRCAP.vcnt=0. It's expected that this bit is honored by the guests and they won't change the guest memory type through variable MTRRs. Signed-off-by: bliu11 <baohong.liu@intel.com> Signed-off-by: Zide Chen <zide.chen@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
40 lines
678 B
C
40 lines
678 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef HV_ARCH_H
|
|
#define HV_ARCH_H
|
|
|
|
#include <cpu.h>
|
|
#include <gdt.h>
|
|
#include <idt.h>
|
|
#include <apicreg.h>
|
|
#include <ioapic.h>
|
|
#include <lapic.h>
|
|
#include <msr.h>
|
|
#include <io.h>
|
|
#include <mtrr.h>
|
|
#include <vcpu.h>
|
|
#include <trusty.h>
|
|
#include <pm.h>
|
|
#include <vm.h>
|
|
#include <cpuid.h>
|
|
#include <mmu.h>
|
|
#include <irq.h>
|
|
#include <timer.h>
|
|
#include <softirq.h>
|
|
#include <vmx.h>
|
|
#include <assign.h>
|
|
#include <vtd.h>
|
|
|
|
#include <vpic.h>
|
|
#include <vlapic.h>
|
|
#include <vioapic.h>
|
|
#include <guest.h>
|
|
#include <vmexit.h>
|
|
#include <cpufeatures.h>
|
|
|
|
#endif /* HV_ARCH_H */
|