Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
bhyve gcc9 fixes
diff --git a/usr/src/uts/i86pc/io/vmm/amd/svm.c b/usr/src/uts/i86pc/io/vmm/amd/svm.c
index 4c5e3112c0..5a2653ff08 100644
--- a/usr/src/uts/i86pc/io/vmm/amd/svm.c
+++ b/usr/src/uts/i86pc/io/vmm/amd/svm.c
@@ -1513,11 +1513,14 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit)
break;
case VMCB_EXIT_CPUID:
vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_CPUID, 1);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
handled = x86_emulate_cpuid(svm_sc->vm, vcpu,
(uint32_t *)&state->rax,
(uint32_t *)&ctx->sctx_rbx,
(uint32_t *)&ctx->sctx_rcx,
(uint32_t *)&ctx->sctx_rdx);
+#pragma GCC diagnostic pop
break;
case VMCB_EXIT_HLT:
vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_HLT, 1);
diff --git a/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c b/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c
index 9477bf5056..fa098c106e 100644
--- a/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c
+++ b/usr/src/cmd/mdb/intel/mdb/mdb_bhyve.c
@@ -1370,15 +1370,15 @@ bhyve_putareg(mdb_tgt_t *tgt, mdb_tgt_tid_t tid, const char *rname,
static const mdb_tgt_ops_t bhyve_ops = {
.t_setflags = bhyve_setflags,
- .t_setcontext = (int (*)()) mdb_tgt_notsup,
+ .t_setcontext = (void *)mdb_tgt_notsup,
.t_activate = bhyve_activate,
.t_deactivate = bhyve_deactivate,
- .t_periodic = (void (*)()) mdb_tgt_nop,
+ .t_periodic = (void *)mdb_tgt_nop,
.t_destroy = bhyve_destroy,
.t_name = bhyve_name,
.t_isa = bhyve_isa,
- .t_platform = (const char *(*)()) mdb_conf_platform,
- .t_uname = (int (*)()) mdb_tgt_notsup,
+ .t_platform = (void *)mdb_conf_platform,
+ .t_uname = (void *)mdb_tgt_notsup,
.t_dmodel = bhyve_dmodel,
.t_aread = bhyve_aread,
.t_awrite = bhyve_awrite,
@@ -1391,35 +1391,35 @@ static const mdb_tgt_ops_t bhyve_ops = {
.t_ioread = bhyve_ioread,
.t_iowrite = bhyve_iowrite,
.t_vtop = bhyve_vtop,
- .t_lookup_by_name = (int (*)()) mdb_tgt_notsup,
- .t_lookup_by_addr = (int (*)()) mdb_tgt_notsup,
- .t_symbol_iter = (int (*)()) mdb_tgt_notsup,
- .t_mapping_iter = (int (*)()) mdb_tgt_notsup,
- .t_object_iter = (int (*)()) mdb_tgt_notsup,
+ .t_lookup_by_name = (void *)mdb_tgt_notsup,
+ .t_lookup_by_addr = (void *)mdb_tgt_notsup,
+ .t_symbol_iter = (void *)mdb_tgt_notsup,
+ .t_mapping_iter = (void *)mdb_tgt_notsup,
+ .t_object_iter = (void *)mdb_tgt_notsup,
.t_addr_to_map = (const mdb_map_t *(*)()) mdb_tgt_null,
.t_name_to_map = (const mdb_map_t *(*)()) mdb_tgt_null,
.t_addr_to_ctf = (struct ctf_file *(*)()) mdb_tgt_null,
.t_name_to_ctf = (struct ctf_file *(*)()) mdb_tgt_null,
.t_status = bhyve_status,
- .t_run = (int (*)()) mdb_tgt_notsup,
+ .t_run = (void *)mdb_tgt_notsup,
.t_step = bhyve_step,
- .t_step_out = (int (*)()) mdb_tgt_notsup,
- .t_next = (int (*)()) mdb_tgt_notsup,
+ .t_step_out = (void *)mdb_tgt_notsup,
+ .t_next = (void *)mdb_tgt_notsup,
.t_cont = bhyve_cont,
- .t_signal = (int (*)()) mdb_tgt_notsup,
- .t_add_vbrkpt = (int (*)()) mdb_tgt_null,
- .t_add_sbrkpt = (int (*)()) mdb_tgt_null,
- .t_add_pwapt = (int (*)()) mdb_tgt_null,
- .t_add_vwapt = (int (*)()) mdb_tgt_null,
- .t_add_iowapt = (int (*)()) mdb_tgt_null,
- .t_add_sysenter = (int (*)()) mdb_tgt_null,
- .t_add_sysexit = (int (*)()) mdb_tgt_null,
- .t_add_signal = (int (*)()) mdb_tgt_null,
- .t_add_fault = (int (*)()) mdb_tgt_null,
+ .t_signal = (void *)mdb_tgt_notsup,
+ .t_add_vbrkpt = (void *)mdb_tgt_null,
+ .t_add_sbrkpt = (void *)mdb_tgt_null,
+ .t_add_pwapt = (void *)mdb_tgt_null,
+ .t_add_vwapt = (void *)mdb_tgt_null,
+ .t_add_iowapt = (void *)mdb_tgt_null,
+ .t_add_sysenter = (void *)mdb_tgt_null,
+ .t_add_sysexit = (void *)mdb_tgt_null,
+ .t_add_signal = (void *)mdb_tgt_null,
+ .t_add_fault = (void *)mdb_tgt_null,
.t_getareg = bhyve_getareg,
.t_putareg = bhyve_putareg,
- .t_stack_iter = (int (*)()) mdb_tgt_notsup,
- .t_auxv = (int (*)()) mdb_tgt_notsup
+ .t_stack_iter = (void *)mdb_tgt_notsup,
+ .t_auxv = (void *)mdb_tgt_notsup
};
int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.