View | Details | Raw Unified | Return to bug 245392
Collapse All | Expand All

(-)b/usr.sbin/bhyve/pci_emul.c (+7 lines)
Lines 905-910 msicap_cfgwrite(struct pci_devinst *pi, int capoff, int offset, Link Here
905
	uint16_t msgctrl, rwmask, msgdata, mme;
905
	uint16_t msgctrl, rwmask, msgdata, mme;
906
	uint32_t addrlo;
906
	uint32_t addrlo;
907
907
908
	/* Convert a 4-byte write at offset 0 into a 2-byte write at 2 */
909
	if (offset == capoff && bytes == 4) {
910
		offset += 2;
911
		bytes -= 2;
912
		val >>= 16;
913
	}
914
908
	/*
915
	/*
909
	 * If guest is writing to the message control register make sure
916
	 * If guest is writing to the message control register make sure
910
	 * we do not overwrite read-only fields.
917
	 * we do not overwrite read-only fields.
(-)b/usr.sbin/bhyve/pci_passthru.c (-2 / +2 lines)
Lines 811-818 passthru_cfgread(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, Link Here
811
	if (coff == PCIR_COMMAND) {
811
	if (coff == PCIR_COMMAND) {
812
		if (bytes <= 2)
812
		if (bytes <= 2)
813
			return (-1);
813
			return (-1);
814
		*rv = pci_get_cfgdata16(pi, PCIR_COMMAND) << 16 |
814
		*rv = pci_get_cfgdata16(pi, PCIR_COMMAND) |
815
		    read_config(&sc->psc_sel, PCIR_STATUS, 2);
815
			read_config(&sc->psc_sel, PCIR_STATUS, 2) << 16;
816
		return (0);
816
		return (0);
817
	}
817
	}
818
818

Return to bug 245392