commit | e93b16cefccc3dcd69b9722e2483037586192688 | [log] [tgz] |
---|---|---|
author | Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> | Thu Mar 31 10:42:01 2022 +0800 |
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Apr 25 06:11:45 2022 +0000 |
tree | ba0d18ab35a857f64c95c56f984506fd8bd91f5f | |
parent | f82754c78cf8207d76cd902aaa1632b1a788e3d3 [diff] |
x86_64: Redesign MTRR setting Currently MTRR setting is: the default cache type is write back and the pci low mmio range is uncache, then guest memory is WB by default, but pci high mmio and the gap between ram end and pci start below 4G are WB also, this part is wrong. In order to fix it, var mtrr should be used to set pci high mmio as uncache, but pci high mmio is too large to have enough var mtrrs. This commit change MTRR setting as: the default cache type is uncache, and the guest memory is WB. So memory range below 4G and above 4G are passed into setup_msrs(). And the variable MTRR registers are limited and have base and length requirement, so guest memory size is aligned to 256MB to avoid MTRR failure. BUG=None TEST=check guest mtrr setting with different guest memory size Change-Id: I4c18e83ce5e7fac9ac1bf6e174116a69924184ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3578015 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Junichi Uekawa <uekawa@chromium.org> Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on Chrome OS devices.