Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107068551
D40992.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D40992.diff
View Options
diff --git a/usr.sbin/bhyve/bootrom.c b/usr.sbin/bhyve/bootrom.c
--- a/usr.sbin/bhyve/bootrom.c
+++ b/usr.sbin/bhyve/bootrom.c
@@ -118,12 +118,15 @@
void
init_bootrom(struct vmctx *ctx)
{
+ vm_paddr_t highmem;
+
romptr = vm_create_devmem(ctx, VM_BOOTROM, "bootrom", BOOTROM_SIZE);
if (romptr == MAP_FAILED)
err(4, "%s: vm_create_devmem", __func__);
- gpa_base = (1ULL << 32) - BOOTROM_SIZE;
+ highmem = vm_get_highmem_base(ctx);
+ gpa_base = highmem - BOOTROM_SIZE;
gpa_allocbot = gpa_base;
- gpa_alloctop = (1ULL << 32) - 1;
+ gpa_alloctop = highmem - 1;
}
int
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c
--- a/usr.sbin/bhyve/pci_emul.c
+++ b/usr.sbin/bhyve/pci_emul.c
@@ -1509,7 +1509,8 @@
pci_emul_iobase = PCI_EMUL_IOBASE;
pci_emul_membase32 = PCI_EMUL_MEMBASE32;
- pci_emul_membase64 = 4*GB + vm_get_highmem_size(ctx);
+ pci_emul_membase64 = vm_get_highmem_base(ctx) +
+ vm_get_highmem_size(ctx);
pci_emul_membase64 = roundup2(pci_emul_membase64, PCI_EMUL_MEMSIZE64);
pci_emul_memlim64 = pci_emul_membase64 + PCI_EMUL_MEMSIZE64;
diff --git a/usr.sbin/bhyve/smbiostbl.c b/usr.sbin/bhyve/smbiostbl.c
--- a/usr.sbin/bhyve/smbiostbl.c
+++ b/usr.sbin/bhyve/smbiostbl.c
@@ -600,7 +600,7 @@
{ NULL,NULL, NULL }
};
-static uint64_t guest_lomem, guest_himem;
+static uint64_t guest_lomem, guest_himem, guest_himem_base;
static uint16_t type16_handle;
static int
@@ -831,8 +831,8 @@
curaddr, endaddr, n);
type19 = (struct smbios_table_type19 *)curaddr;
type19->arrayhand = type16_handle;
- type19->xsaddr = 4*GB;
- type19->xeaddr = type19->xsaddr + guest_himem;
+ type19->xsaddr = guest_himem_base;
+ type19->xeaddr = guest_himem_base + guest_himem;
}
return (0);
@@ -891,6 +891,7 @@
guest_lomem = vm_get_lowmem_size(ctx);
guest_himem = vm_get_highmem_size(ctx);
+ guest_himem_base = vm_get_highmem_base(ctx);
startaddr = paddr_guest2host(ctx, SMBIOS_BASE, SMBIOS_MAX_LENGTH);
if (startaddr == NULL) {
diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c
--- a/usr.sbin/bhyve/snapshot.c
+++ b/usr.sbin/bhyve/snapshot.c
@@ -758,8 +758,8 @@
if (highmem == 0)
goto done;
- ret = vm_snapshot_mem_part(snapfd, lowmem, baseaddr + 4*GB,
- highmem, totalmem, op_wr);
+ ret = vm_snapshot_mem_part(snapfd, lowmem,
+ baseaddr + vm_get_highmem_base(ctx), highmem, totalmem, op_wr);
if (ret) {
fprintf(stderr, "%s: Could not %s highmem\r\n",
__func__, op_wr ? "write" : "read");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 3:02 PM (15 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15743580
Default Alt Text
D40992.diff (2 KB)
Attached To
Mode
D40992: bhyve: Use vm_get_highmem_base() instead of hard-coding the value
Attached
Detach File
Event Timeline
Log In to Comment