summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve/pci_passthru.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-07-21 19:08:02 +0000
committerjhb <jhb@FreeBSD.org>2014-07-21 19:08:02 +0000
commite6b48465b7c368666e10a2bd8f4f500483497b24 (patch)
tree7e529f938e1d777df1f54045191fa3003056dbda /usr.sbin/bhyve/pci_passthru.c
parentb164bf591711a4c455ca47e1f58b0bb91e5e904c (diff)
downloadFreeBSD-src-e6b48465b7c368666e10a2bd8f4f500483497b24.zip
FreeBSD-src-e6b48465b7c368666e10a2bd8f4f500483497b24.tar.gz
MFC 264353,264509,264768,264770,264825,264846,264988,265114,265165,265365,
265941,265951,266390,266550,266910: Various bhyve fixes: - Don't save host's return address in 'struct vmxctx'. - Permit non-32-bit accesses to local APIC registers. - Factor out common ioport handler code. - Use calloc() in favor of malloc + memset. - Change the vlapic timer frequency to be in the ballpark of contemporary hardware. - Allow the guest to read the TSC via MSR 0x10. - A VMCS is always inactive when it exits the vmx_run() loop. Remove redundant code and the misleading comment that suggest otherwise. - Ignore writes to microcode update MSR. This MSR is accessed by RHEL7 guest. Add KTR tracepoints to annotate wrmsr and rdmsr VM exits. - Provide an alias for the userboot console and name it 'comconsole'. - Use EV_ADD to create an mevent and EV_ENABLE to enable it. - abort(3) the process in response to a VMEXIT_ABORT. - Don't include the guest memory segments in the bhyve(8) process core dump. - Make the vmx asm code dtrace-fbt-friendly. - Allow vmx_getdesc() and vmx_setdesc() to be called for a vcpu that is in the VCPU_RUNNING state. - Enable VMX in the IA32_FEATURE_CONTROL MSR if it not enabled and the MSR isn't locked.
Diffstat (limited to 'usr.sbin/bhyve/pci_passthru.c')
-rw-r--r--usr.sbin/bhyve/pci_passthru.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c
index 562d532..04d68c4 100644
--- a/usr.sbin/bhyve/pci_passthru.c
+++ b/usr.sbin/bhyve/pci_passthru.c
@@ -232,8 +232,7 @@ cfginitmsi(struct passthru_softc *sc)
/* Allocate the emulated MSI-X table array */
table_size = pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE;
- pi->pi_msix.table = malloc(table_size);
- bzero(pi->pi_msix.table, table_size);
+ pi->pi_msix.table = calloc(1, table_size);
/* Mask all table entries */
for (i = 0; i < pi->pi_msix.table_count; i++) {
@@ -574,8 +573,7 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
if (vm_assign_pptdev(ctx, bus, slot, func) != 0)
goto done;
- sc = malloc(sizeof(struct passthru_softc));
- memset(sc, 0, sizeof(struct passthru_softc));
+ sc = calloc(1, sizeof(struct passthru_softc));
pi->pi_arg = sc;
sc->psc_pi = pi;
OpenPOWER on IntegriCloud