diff options
author | gjb <gjb@FreeBSD.org> | 2016-03-02 16:14:46 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2016-03-02 16:14:46 +0000 |
commit | 955ce29ea33f5aa2d5477a1fe1a2735ac278cd0d (patch) | |
tree | 9c83d6fb30867514fbcff33f80605a1fb118d720 /usr.sbin/bhyveload | |
parent | 4719e40f5bedd0f88591120e071741635f07993b (diff) | |
parent | 774a6245596e60bf04f03e8cccab06a3194504f5 (diff) | |
download | FreeBSD-src-955ce29ea33f5aa2d5477a1fe1a2735ac278cd0d.zip FreeBSD-src-955ce29ea33f5aa2d5477a1fe1a2735ac278cd0d.tar.gz |
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin/bhyveload')
-rw-r--r-- | usr.sbin/bhyveload/bhyveload.8 | 9 | ||||
-rw-r--r-- | usr.sbin/bhyveload/bhyveload.c | 26 |
2 files changed, 32 insertions, 3 deletions
diff --git a/usr.sbin/bhyveload/bhyveload.8 b/usr.sbin/bhyveload/bhyveload.8 index 918e1f0..b566343 100644 --- a/usr.sbin/bhyveload/bhyveload.8 +++ b/usr.sbin/bhyveload/bhyveload.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2015 +.Dd February 26, 2016 .Dt BHYVELOAD 8 .Os .Sh NAME @@ -35,6 +35,7 @@ guest inside a bhyve virtual machine .Sh SYNOPSIS .Nm +.Op Fl C .Op Fl S .Op Fl c Ar cons-dev .Op Fl d Ar disk-path @@ -125,6 +126,12 @@ respectively. The default value of .Ar mem-size is 256M. +.It Fl C +Include guest memory in the core file when +.Nm +dumps core. +This is intended for debugging an OS loader as it allows inspection of +the guest memory. .It Fl S Wire guest memory. .El diff --git a/usr.sbin/bhyveload/bhyveload.c b/usr.sbin/bhyveload/bhyveload.c index badf5f4..8417f2a 100644 --- a/usr.sbin/bhyveload/bhyveload.c +++ b/usr.sbin/bhyveload/bhyveload.c @@ -542,6 +542,21 @@ cb_getenv(void *arg, int num) return (NULL); } +static int +cb_vm_set_register(void *arg, int vcpu, int reg, uint64_t val) +{ + + return (vm_set_register(ctx, vcpu, reg, val)); +} + +static int +cb_vm_set_desc(void *arg, int vcpu, int reg, uint64_t base, u_int limit, + u_int access) +{ + + return (vm_set_desc(ctx, vcpu, reg, base, limit, access)); +} + static struct loader_callbacks cb = { .getc = cb_getc, .putc = cb_putc, @@ -571,6 +586,10 @@ static struct loader_callbacks cb = { .getmem = cb_getmem, .getenv = cb_getenv, + + /* Version 4 additions */ + .vm_set_register = cb_vm_set_register, + .vm_set_desc = cb_vm_set_desc, }; static int @@ -655,7 +674,7 @@ main(int argc, char** argv) consin_fd = STDIN_FILENO; consout_fd = STDOUT_FILENO; - while ((opt = getopt(argc, argv, "Sc:d:e:h:l:m:")) != -1) { + while ((opt = getopt(argc, argv, "CSc:d:e:h:l:m:")) != -1) { switch (opt) { case 'c': error = altcons_open(optarg); @@ -690,6 +709,9 @@ main(int argc, char** argv) if (error != 0) errx(EX_USAGE, "Invalid memsize '%s'", optarg); break; + case 'C': + memflags |= VM_MEM_F_INCORE; + break; case 'S': memflags |= VM_MEM_F_WIRED; break; @@ -765,7 +787,7 @@ main(int argc, char** argv) addenv("smbios.bios.vendor=BHYVE"); addenv("boot_serial=1"); - func(&cb, NULL, USERBOOT_VERSION_3, ndisks); + func(&cb, NULL, USERBOOT_VERSION_4, ndisks); free(loader); return (0); |