Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140467444
D50116.id154777.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50116.id154777.diff
View Options
diff --git a/usr.sbin/bhyve/mem.c b/usr.sbin/bhyve/mem.c
--- a/usr.sbin/bhyve/mem.c
+++ b/usr.sbin/bhyve/mem.c
@@ -43,8 +43,10 @@
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <vmmapi.h>
+#include "debug.h"
#include "mem.h"
struct mmio_rb_range {
@@ -163,6 +165,35 @@
return (error);
}
+static int
+no_mem_handler(struct vcpu *vcpu __unused, int dir, uint64_t addr __unused,
+ int size, uint64_t *val, void *arg1 __unused, long arg2 __unused)
+{
+ if (dir == MEM_F_READ) {
+ switch (size) {
+ case 1:
+ *val = 0xff;
+ break;
+ case 2:
+ *val = 0xffff;
+ break;
+ case 4:
+ *val = 0xffffffff;
+ break;
+ case 8:
+ *val = 0xffffffffffffffff;
+ break;
+ }
+ }
+ return (0);
+}
+
+static struct mmio_rb_range fb_entry = {
+ .mr_param.handler = no_mem_handler,
+ .mr_param.base = 0,
+ .mr_param.size = 0xffffffffffffffff,
+};
+
static int
access_memory(struct vcpu *vcpu, uint64_t paddr, mem_cb_t *cb, void *arg)
{
@@ -186,9 +217,10 @@
/* Update the per-vCPU cache */
mmio_hint[vcpuid] = entry;
} else if (mmio_rb_lookup(&mmio_rb_fallback, paddr, &entry)) {
- perror = pthread_rwlock_unlock(&mmio_rwlock);
- assert(perror == 0);
- return (ESRCH);
+ entry = &fb_entry;
+ EPRINTLN(
+ "Emulating access to non-existent address to %#lx\n",
+ paddr);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 25, 6:44 AM (2 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27242829
Default Alt Text
D50116.id154777.diff (1 KB)
Attached To
Mode
D50116: bhyve: when accessing non-backed gpa, emulate hw
Attached
Detach File
Event Timeline
Log In to Comment