Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/bhyverun.c
Show First 20 Lines • Show All 481 Lines • ▼ Show 20 Lines | build_vcpumaps(void) | ||||
} | } | ||||
} | } | ||||
void | void | ||||
vm_inject_fault(void *arg, int vcpu, int vector, int errcode_valid, | vm_inject_fault(void *arg, int vcpu, int vector, int errcode_valid, | ||||
int errcode) | int errcode) | ||||
{ | { | ||||
struct vmctx *ctx; | struct vmctx *ctx; | ||||
int error, restart_instruction; | int error, restart_instruction; | ||||
jhb: I would go ahead and use "gdb.address" as the name. | |||||
ctx = arg; | ctx = arg; | ||||
restart_instruction = 1; | restart_instruction = 1; | ||||
error = vm_inject_exception(ctx, vcpu, vector, errcode_valid, errcode, | error = vm_inject_exception(ctx, vcpu, vector, errcode_valid, errcode, | ||||
restart_instruction); | restart_instruction); | ||||
assert(error == 0); | assert(error == 0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 751 Lines • ▼ Show 20 Lines | case 'p': | ||||
errx(EX_USAGE, "invalid cpu topology " | errx(EX_USAGE, "invalid cpu topology " | ||||
"'%s'", optarg); | "'%s'", optarg); | ||||
} | } | ||||
break; | break; | ||||
case 'C': | case 'C': | ||||
set_config_bool("memory.guest_in_core", true); | set_config_bool("memory.guest_in_core", true); | ||||
break; | break; | ||||
case 'G': | case 'G': | ||||
if (optarg[0] == 'w') { | set_config_value("gdb.address", optarg); | ||||
set_config_bool("gdb.wait", true); | |||||
optarg++; | |||||
} | |||||
set_config_value("gdb.port", optarg); | |||||
break; | break; | ||||
case 'k': | case 'k': | ||||
parse_simple_config_file(optarg); | parse_simple_config_file(optarg); | ||||
break; | break; | ||||
case 'l': | case 'l': | ||||
if (strncmp(optarg, "help", strlen(optarg)) == 0) { | if (strncmp(optarg, "help", strlen(optarg)) == 0) { | ||||
lpc_print_supported_devices(); | lpc_print_supported_devices(); | ||||
exit(0); | exit(0); | ||||
▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | #endif | ||||
/* | /* | ||||
* Initialize after PCI, to allow a bootrom file to reserve the high | * Initialize after PCI, to allow a bootrom file to reserve the high | ||||
* region. | * region. | ||||
*/ | */ | ||||
if (get_config_bool("acpi_tables")) | if (get_config_bool("acpi_tables")) | ||||
vmgenc_init(ctx); | vmgenc_init(ctx); | ||||
value = get_config_value("gdb.port"); | init_gdb(ctx, get_config_value("gdb.address")); | ||||
if (value != NULL) | |||||
init_gdb(ctx, atoi(value), get_config_bool_default("gdb.wait", | |||||
false)); | |||||
Done Inline ActionsThis won't actually work due to the way get_config_value works (it uses a single static buffer in case it has to do any variable expansion, so the next call to get_config_* invalidates any previously-returned char *. The old code ran atoi() before calling get_config_bool_default() which was ok, but the new code can't do that. Probably should just move the parsing into init_gdb() instead and call init_gdb() unconditionally. jhb: This won't actually work due to the way get_config_value works (it uses a single static buffer… | |||||
Done Inline ActionsOh, I didn't notice that. I have look into the function and seen that you are using nvlist under hood and assume that you are just returning the value. As I test it only with the static texts I got two different pointers and everything look good. Your suggestion makes sense for me. oshogbo: Oh, I didn't notice that. I have look into the function and seen that you are using nvlist… | |||||
if (lpc_bootrom()) { | if (lpc_bootrom()) { | ||||
if (vm_set_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, 1)) { | if (vm_set_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, 1)) { | ||||
fprintf(stderr, "ROM boot failed: unrestricted guest " | fprintf(stderr, "ROM boot failed: unrestricted guest " | ||||
"capability not available\n"); | "capability not available\n"); | ||||
exit(4); | exit(4); | ||||
} | } | ||||
error = vcpu_reset(ctx, BSP); | error = vcpu_reset(ctx, BSP); | ||||
assert(error == 0); | assert(error == 0); | ||||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |
I would go ahead and use "gdb.address" as the name.