Page MenuHomeFreeBSD

bhyve: add support for MTRR
ClosedPublic

Authored by corvink on Dec 8 2021, 12:01 PM.
Tags
Referenced Files
Unknown Object (File)
Mar 7 2024, 7:33 PM
Unknown Object (File)
Feb 9 2024, 9:05 AM
Unknown Object (File)
Feb 9 2024, 5:37 AM
Unknown Object (File)
Jan 3 2024, 4:46 AM
Unknown Object (File)
Dec 20 2023, 3:22 AM
Unknown Object (File)
Dec 12 2023, 5:08 AM
Unknown Object (File)
Nov 6 2023, 7:18 AM
Unknown Object (File)
Oct 13 2023, 6:18 PM

Details

Summary

Some guests or driver might depend on MTRR to work properly. E.g. the
nvidia gpu driver won't work without MTRR.

Note:
I've only tested this patch on an Intel system.

The patch is also published on https://github.com/Beckhoff/freebsd-src/commits/phab/corvink/mtrr.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/amd64/vmm/x86.c
672

This isn't right, there is one field for each variable range, but there are two registers associated with each range, base and mask.

  • add base and mask register for variable ranges
corvink added inline comments.
sys/amd64/vmm/x86.c
672

Sry for my late update. Thanks for catching this.

sys/amd64/vmm/x86.c
672

Why uint64_t? num is a u_int.

690

Which MSRs is this comment referring to?

corvink marked an inline comment as done.
  • fix type of MTRR offset
  • handle writes to reserved fields
corvink added inline comments.
sys/amd64/vmm/x86.c
690

Reserved fields should be checked for each MSR. I've added a check for it to all MSRs now.

markj added inline comments.
sys/amd64/vmm/x86.c
699

def_type will be 0 by default, it looks like at least FreeBSD's MTRR driver expects the "enabled" and "fixed-enabled" bits to be set by the BIOS. I guess it's ok to leave those bits off though...

This revision is now accepted and ready to land.Jan 7 2022, 3:36 PM
This revision was automatically updated to reflect the committed changes.