kvm: remove non-sane sanity check

Apparently some platforms don't have pSize < vSize.

Fixes #208

PiperOrigin-RevId: 245480998
Change-Id: I2a98229912f4ccbfcd8e79dfa355104f14275a9c
This commit is contained in:
Adin Scannell 2019-04-26 13:51:48 -07:00 committed by Shentubot
parent 228dc15fd1
commit 5749f64314
1 changed files with 8 additions and 7 deletions

View File

@ -50,8 +50,9 @@ type physicalRegion struct {
var physicalRegions []physicalRegion var physicalRegions []physicalRegion
// fillAddressSpace fills the host address space with PROT_NONE mappings until // fillAddressSpace fills the host address space with PROT_NONE mappings until
// the number of available bits until we have a host address space size that is // we have a host address space size that is less than or equal to the physical
// equal to the physical address space. // address space. This allows us to have an injective host virtual to guest
// physical mapping.
// //
// The excluded regions are returned. // The excluded regions are returned.
func fillAddressSpace() (excludedRegions []region) { func fillAddressSpace() (excludedRegions []region) {
@ -67,11 +68,6 @@ func fillAddressSpace() (excludedRegions []region) {
pSize := uintptr(1) << ring0.PhysicalAddressBits() pSize := uintptr(1) << ring0.PhysicalAddressBits()
pSize -= reservedMemory pSize -= reservedMemory
// Sanity check.
if vSize < pSize {
panic(fmt.Sprintf("vSize (%x) < pSize (%x)", vSize, pSize))
}
// Add specifically excluded regions; see excludeVirtualRegion. // Add specifically excluded regions; see excludeVirtualRegion.
applyVirtualRegions(func(vr virtualRegion) { applyVirtualRegions(func(vr virtualRegion) {
if excludeVirtualRegion(vr) { if excludeVirtualRegion(vr) {
@ -81,6 +77,11 @@ func fillAddressSpace() (excludedRegions []region) {
} }
}) })
// Do we need any more work?
if vSize < pSize {
return excludedRegions
}
// Calculate the required space and fill it. // Calculate the required space and fill it.
// //
// Note carefully that we add faultBlockSize to required up front, and // Note carefully that we add faultBlockSize to required up front, and