Page MenuHomeFreeBSD
Feed Advanced Search

May 14 2020

grehan requested review of D24837: Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest..
May 14 2020, 5:17 AM

Apr 29 2020

grehan added a comment to D24525: vmm(4), bhyve(8): Expose kernel-emulated special devices to userspace.

Thanks for taking a look! Does this approach seem plausibly reasonable, outside of the implementation-detail type issues already raised?

Apr 29 2020, 11:38 AM

Apr 28 2020

grehan committed rS360432: MFC r358848: Untangle TPR shadowing and APIC virtualization..
MFC r358848: Untangle TPR shadowing and APIC virtualization.
Apr 28 2020, 8:28 AM
grehan added a comment to D22942: Untangle TPR shadowing and APIC virtualization .

Jason Tubnor has tested the MFC on 11-stable so I'll commit once acked by bz.

Apr 28 2020, 7:21 AM · bhyve

Apr 27 2020

grehan accepted D24593: Update the cached MSI state when any MSI capability register is written..
Apr 27 2020, 9:28 PM
grehan added a comment to D24549: Use a pthread mutex to protect the MSI and MSI-X state..

And this is indeed the AHCI controller. MSI is being used in the known-working 19.10, but there is no migration going on there. Disabling the MSI capability on the controller and falling back to legacy interrupts allowed an 8-vCPU install to complete and also showed the interrupt being migrated to another vCPU during the install (from /proc/interrupts).

Apr 27 2020, 6:24 AM

Apr 26 2020

grehan added a comment to D24549: Use a pthread mutex to protect the MSI and MSI-X state..

virtio uses MSI-x on Linux so the MSI issue isn't directly related to that.

Apr 26 2020, 10:32 PM
grehan added inline comments to D24525: vmm(4), bhyve(8): Expose kernel-emulated special devices to userspace.
Apr 26 2020, 11:46 AM

Apr 24 2020

grehan added a comment to D24549: Use a pthread mutex to protect the MSI and MSI-X state..

Rather than locking, I'm thinking this might be the lack of PBA emulation for MSI-x
(which in turn will require locking, though slightly different)

Apr 24 2020, 7:56 AM

Apr 23 2020

grehan added a comment to D24549: Use a pthread mutex to protect the MSI and MSI-X state..

I don't think the tread/twrite routines need any locking: the updates are memory operations. Modifying an MSIx table is always going to take multiple writes so the lock can't protect the update.

Apr 23 2020, 10:20 PM

Apr 21 2020

grehan added a comment to D24463: vmm(4): Decode and emulate BEXTR.
In D24463#539490, @cem wrote:

I see; it seems like there is some additional instruction emulation specific to APIC accesses in sys/amd64/vmm/io, and those ranges aren't exposed to userspace's MMIO.

Apr 21 2020, 8:50 PM
grehan added a comment to D24463: vmm(4): Decode and emulate BEXTR.
In D24463#539489, @cem wrote:

I'm not seeing how we ever register a MMIO region for LAPIC_PADDR or IOAPIC_PADDR. Do we?

Apr 21 2020, 8:47 PM
grehan added a comment to D24463: vmm(4): Decode and emulate BEXTR.

My understanding is that gpa is precomputed for me and I don’t need to add displacement or compute it from regs. Is that right?

Apr 21 2020, 8:32 AM

Apr 19 2020

grehan accepted D24507: vmm(4): Bump VM_MAX_MEMMAPS for vmgenid.
Apr 19 2020, 11:52 PM

Apr 18 2020

grehan added a comment to D24463: vmm(4): Decode and emulate BEXTR.

I'll have a closer look at the emulation. Might even break out Intel XED for some comparison testing.

Apr 18 2020, 12:29 PM
grehan added a comment to D24464: bhyve(8): For prototyping, reattempt decode in userspace.

Debugging the APIC is a slog. Start with KTR compiled in an single vCPU guests. See what accesses are being done with BEXTR and what the device emulation is returning. Use FreeBSD as a guest and ddb to put in guest breakpoints to allow the ktr log to be examined. You may have to spend a lot more time with SDM Vol3 Ch10 than you would care for.

Apr 18 2020, 12:27 PM
grehan added inline comments to D24462: vmm(4): Decode 3-byte VEX-prefixed instructions.
Apr 18 2020, 12:23 PM

Apr 17 2020

grehan accepted D24464: bhyve(8): For prototyping, reattempt decode in userspace.

Nice change. GCE has moved instruction emulation out of kernel KVM, and it would be interesting for bhyve to also have that ability: this is a step towards that.

Apr 17 2020, 5:17 AM
grehan accepted D24463: vmm(4): Decode and emulate BEXTR.

Clang 10 -march=native kernels on znver1 emit BEXTR for APIC reads

Apr 17 2020, 5:14 AM
grehan accepted D24462: vmm(4): Decode 3-byte VEX-prefixed instructions.
Apr 17 2020, 5:09 AM
grehan accepted D24461: vmm.h: Add ABI assertions and mark implicit holes.
Apr 17 2020, 4:48 AM

Apr 16 2020

grehan accepted D24439: vmm(4): Expose instruction decode to userspace build.

There is a slightly hackier version of this and a harness at http://www.freebsd.org/~grehan/itest.tgz

Apr 16 2020, 6:10 AM

Apr 15 2020

grehan added inline comments to D23165: bhyve(8): Add VM Generation Counter ACPI device.
Apr 15 2020, 2:25 AM

Apr 14 2020

grehan accepted D24422: bhyve(8): Add bootrom allocation abstraction.
Apr 14 2020, 8:56 PM

Apr 6 2020

grehan added a comment to D24066: bhyve: support relocating fbuf and passthru data BARs.

That problem has since been fixed, and I've found NVMe to work well now.

Apr 6 2020, 12:31 AM · bhyve

Apr 3 2020

grehan added a comment to D24066: bhyve: support relocating fbuf and passthru data BARs.

(I'm not sure if the nvme spec requires the bar to be 64-bit capable.)

Apr 3 2020, 7:02 AM · bhyve

Mar 29 2020

grehan added a comment to D24107: Bhyve: fix SMBIOS Type 17 table generation.

There is no need to error out on overflow here. The type17 isn't used by most o/s's for determining how much memory is available: there is e820, the EFI memory map, etc etc. Perhaps print an error in bhyve, buit there doesn't seem any point in erroring out.

Okay. Also, I don't think we're going to have guests configured with ~2PB memory any time in the near future :)

Mar 29 2020, 12:25 AM

Mar 28 2020

grehan added a comment to D24107: Bhyve: fix SMBIOS Type 17 table generation.
  • Rework type17 generation and error out on overflow.
Mar 28 2020, 10:30 PM

Mar 20 2020

grehan added a comment to D24107: Bhyve: fix SMBIOS Type 17 table generation.

add GUID value for discovering SMBIOS tables in UEFI, which iirc would help our UEFI situation

Mar 20 2020, 11:02 PM

Mar 18 2020

grehan accepted D24107: Bhyve: fix SMBIOS Type 17 table generation.

Looks good.

Mar 18 2020, 3:36 AM

Mar 16 2020

grehan added a comment to D24066: bhyve: support relocating fbuf and passthru data BARs.

So it will be a choice of a UEFI firmware that does VNC and passthru but no NVMe or one
that does VNC and NVMe, that will be confusing.

Mar 16 2020, 7:07 AM · bhyve

Mar 15 2020

grehan added a comment to D24066: bhyve: support relocating fbuf and passthru data BARs.

I'm assuming this is an illumos specific issue, but it might be worth to test this on FreeBSD too.

Mar 15 2020, 11:17 PM · bhyve

Mar 1 2020

grehan accepted D22942: Untangle TPR shadowing and APIC virtualization .

Yamagi has mentioned some small optimizations that could be added to this (e.g. saving the TPR in the vcpu struct and only writing to the VMCS if there has been a change) but this can be done in future commits.

Mar 1 2020, 4:53 AM · bhyve

Feb 18 2020

grehan accepted D23472: bhyve: enable virtio-net mergeable rx buffers for tap(4).

Looks good.

Feb 18 2020, 11:45 AM

Feb 13 2020

grehan added a comment to D23342: bhyve: move virtio-net header processing to pci_virtio_net.

Is this good to go?

Feb 13 2020, 11:17 PM

Feb 12 2020

grehan accepted D23342: bhyve: move virtio-net header processing to pci_virtio_net.
Feb 12 2020, 11:02 AM

Feb 10 2020

grehan accepted D23591: bhyve: use stream_read() to read 12 bytes of RFB client version.
Feb 10 2020, 2:22 AM

Feb 7 2020

grehan added inline comments to D23553: vmm: Add Hygon Dhyana support.
Feb 7 2020, 11:34 AM

Jan 29 2020

grehan added a comment to D23342: bhyve: move virtio-net header processing to pci_virtio_net.

The alternative solution (the same used by QEMU) is to read the packet in a local bounce buffer (64KB), so that we figure out its actual length and then we call vq_getchain() the corrent number of times (e.g. just once for 1500 bytes packets). The cost for this solution is an additional packet copy, which is not good imho.

Jan 29 2020, 12:47 PM

Jan 28 2020

grehan added a comment to D23342: bhyve: move virtio-net header processing to pci_virtio_net.

I'd suggest going even further by not making it an option and fixing it as always on. There doesn't seem to be any reason to have it disabled.

Jan 28 2020, 8:26 PM

Jan 17 2020

grehan added a comment to D22942: Untangle TPR shadowing and APIC virtualization .

I think this change breaks x2apic mode (and Yamagi might have a patch for that) so I'd hold off committing for a bit.

Jan 17 2020, 10:34 PM · bhyve

Jan 15 2020

grehan added inline comments to D23165: bhyve(8): Add VM Generation Counter ACPI device.
Jan 15 2020, 11:55 AM
grehan added a comment to D23165: bhyve(8): Add VM Generation Counter ACPI device.

I don't understand how to parse that sentence (or how it would work). Is this just a function of our EFI stack being a borrowed blob from TianoCore EDK II?

Jan 15 2020, 11:52 AM
grehan added a comment to D23165: bhyve(8): Add VM Generation Counter ACPI device.

Yeah, I first learned of this horror when an ACPICA update broke Bhyve because the syntax the compiler recognized for FADT or similar changed. It's... not as crazy as it might seem. It might be preferable if the compiler was linked in instead of system()'d, but whatever.

Jan 15 2020, 11:44 AM
grehan added a comment to D23165: bhyve(8): Add VM Generation Counter ACPI device.

A note for future work: with Windows, the ACPI tables are generated from within UEFI. You would need either a tag on the UUID so EFI could search for it (like it does with the SMBIOS tables), or use the fw i/f to allow UEFI to query the address of the UUID. I can help with that.

Jan 15 2020, 3:54 AM

Jan 7 2020

grehan accepted D22657: bhyve: add wrapper for debug printf statements.

A worthwhile change.

Jan 7 2020, 9:53 PM

Jun 13 2019

grehan added inline comments to D20626: bhyve: move common code to net_utils.c.
Jun 13 2019, 3:50 PM

Jun 10 2018

grehan committed rS334913: Pass on bhyve kernel module maintenance to.
Pass on bhyve kernel module maintenance to
Jun 10 2018, 4:25 AM

May 23 2018

grehan accepted D15533: Fix coverity CID: 1391235, 1193654 and 1193651 (Unchecked return value).
May 23 2018, 9:25 AM

May 14 2018

grehan accepted D15156: vmmdev: return EFAULT when trying to read beyond VM system memory max address.

Good to go with the name change.

May 14 2018, 7:13 AM
grehan accepted D15421: bhyve: fix usage formatting.
May 14 2018, 7:09 AM

May 4 2018

grehan added a comment to D15290: recursive mutex in pci_xhci leads to deadlock.

I checked with Leon and he thought this was fine. Will submit pending the copyright issue.

May 4 2018, 4:46 AM
grehan committed rS333235: Allow arbitrary numbers of columns for VNC server screen resolution..
Allow arbitrary numbers of columns for VNC server screen resolution.
May 4 2018, 1:37 AM
grehan closed D15274: Allow arbitrary numbers of columns in the VNC server..
May 4 2018, 1:37 AM

May 3 2018

grehan closed D15269: Allow PCI VGA devices to be detached..
May 3 2018, 10:52 PM
grehan committed rS333230: Allow PCI VGA devices to be detached..
Allow PCI VGA devices to be detached.
May 3 2018, 10:51 PM

May 2 2018

grehan created D15274: Allow arbitrary numbers of columns in the VNC server..
May 2 2018, 9:47 PM
grehan updated the diff for D15269: Allow PCI VGA devices to be detached..

Update style as per jhb.

May 2 2018, 5:47 PM
grehan committed rS333174: Use PCI power-mgmt to reset a device if FLR fails..
Use PCI power-mgmt to reset a device if FLR fails.
May 2 2018, 5:41 PM
grehan closed D15268: Use PCI power-mgmt to reset a device if FLR fails..
May 2 2018, 5:41 PM
grehan created D15269: Allow PCI VGA devices to be detached..
May 2 2018, 5:20 PM
grehan added a comment to D15268: Use PCI power-mgmt to reset a device if FLR fails..

Yes, this code was submitted by Matt M.

May 2 2018, 5:15 PM
grehan added a comment to D15268: Use PCI power-mgmt to reset a device if FLR fails..

bhyve passthru is currently restricted to the subset of devices that can support MSI/MSI-x so this doesn't come into play for older PCI devices.

May 2 2018, 5:14 PM
grehan created D15268: Use PCI power-mgmt to reset a device if FLR fails..
May 2 2018, 4:57 PM

Apr 30 2018

grehan accepted D15022: Initial debug server for bhyve..
Apr 30 2018, 5:17 PM

Apr 24 2018

grehan accepted D15180: sysutils/uefi-edk2-bhyve: update to v0.1.
Apr 24 2018, 1:37 PM · bhyve

Apr 21 2018

grehan accepted D15138: Correct undesirable interaction between caching of %cr4 in bhyve and invltlb_glob()..

This looks fine, though I'm interested in the circumstances that this can happen - can module-load pre-empt an existing kernel thread that is in the midst of invltlb_glob() ?

Apr 21 2018, 7:01 PM

Apr 15 2018

grehan committed rS332517: MFC r330764.
MFC r330764
Apr 15 2018, 8:29 PM
grehan committed rS332516: MFC r325261.
MFC r325261
Apr 15 2018, 8:20 PM

Apr 12 2018

grehan accepted D14656: Add SDT probes to the VMX VMexit interface.

I think this should be fine. Can always be tweaked later.

Apr 12 2018, 4:37 PM · DTrace, bhyve

Apr 6 2018

grehan accepted D14466: Add a way to temporarily suspend and resume virtual CPUs..

Fine by me. Looking forward to using this :)

Apr 6 2018, 6:55 PM

Mar 20 2018

grehan added a comment to D14466: Add a way to temporarily suspend and resume virtual CPUs..

Anything available I could use to test this on AMD ?

Mar 20 2018, 6:41 AM

Mar 18 2018

grehan added a reviewer for D14656: Add SDT probes to the VMX VMexit interface: tychon.

Adding Tycho to this.

Mar 18 2018, 2:58 AM · DTrace, bhyve
grehan added a comment to D12419: HD Audio Emulation For Bhyve (Based on D7840).

Needs capsicum patches or it won't work (testing was done with Capsicum disabled).

Mar 18 2018, 2:15 AM

Mar 11 2018

grehan committed rS330764: Add CR2 get/set support..
Add CR2 get/set support.
Mar 11 2018, 8:27 AM
grehan closed D14648: Add CR2 get/set to bhyvectl..
Mar 11 2018, 8:27 AM
grehan created D14648: Add CR2 get/set to bhyvectl..
Mar 11 2018, 8:08 AM

Mar 7 2018

grehan added a comment to D14473: userboot: add callbacks to set unrestricted guest mode.

So a comment on this: in general, api's are not added to FreeBSD that don't have base-system clients that use them, or for a good reason. I think this falls into the latter but I'd like to cut it down a bit.

  • can the get_unrestricted_guest() routine be removed ? There is an error return on the set, which seems like it can be used to determine if unrestricted mode is not available (e.g. that's how bhyve uses the ioctl).
  • is there a need for vcpu_reset() ? The BSP should be initialized to power-on state.. That could be a bug in bhyve and better to have it fixed there.
Mar 7 2018, 4:55 PM · bhyve
grehan accepted D9930: Bhyve cpu topology control.

so I do not see why running a bunch of tests would yield.

Mar 7 2018, 5:52 AM

Mar 5 2018

grehan added a comment to D9930: Bhyve cpu topology control.

You might have to explain further why you think you are exempt from having to demonstrate testing with this.

Mar 5 2018, 9:40 PM
grehan added a comment to D9930: Bhyve cpu topology control.

I'd like to see some guest test results (FreeBSD, Linux, Windows) for varying numbers of these, in particular, with sockets > 1, and comparing what Qemu shows for the same configuration.

Mar 5 2018, 7:24 PM

Mar 4 2018

grehan accepted D14501: Move new IVHD definitions out of ACPI.
Mar 4 2018, 5:26 PM

Mar 1 2018

grehan accepted D14548: Fix a lock recursion introduced in r327065..
Mar 1 2018, 3:28 PM

Feb 25 2018

grehan accepted D14075: Add a new variant of the GLA2GPA ioctl for use by the debug server..

This is an excellent change :)

Feb 25 2018, 10:44 PM
grehan added inline comments to D14501: Move new IVHD definitions out of ACPI.
Feb 25 2018, 10:40 PM

Feb 22 2018

grehan added inline comments to D14473: userboot: add callbacks to set unrestricted guest mode.
Feb 22 2018, 11:13 PM · bhyve
grehan accepted D14473: userboot: add callbacks to set unrestricted guest mode.

You may be able to get away with just the "set" call. Given that all h/w that is supported by bhyve, with the exception of only Nehalem systems, support this, you may want to use just the error from the set call to handle this low-probability error.

Feb 22 2018, 10:49 PM · bhyve

Feb 21 2018

grehan accepted D14074: Add two new ioctls to bhyve for batch register fetch/store operations..
Feb 21 2018, 3:20 PM

Feb 17 2018

grehan added a comment to D9930: Bhyve cpu topology control.

Thanks for getting back to this Rod.

Feb 17 2018, 3:40 AM

Feb 15 2018

grehan accepted D14382: Fix bhyve w/ INVARIANTS post D13573.

Only minor issue I had was the trailing underscores in the inline routine name: wasn't too sure if that was idiomatic FreeBSD. Maybe "_int" ?

Feb 15 2018, 5:03 PM

Feb 10 2018

grehan accepted D14272: mitigate against CVE-2017-5715 by flushing the return stack buffer (RSB) upon returning from the guest.
Feb 10 2018, 6:20 PM

Jan 26 2018

grehan updated the diff for D14022: NVMe emulation for bhyve (improved).

Update from Leon:

Jan 26 2018, 4:06 PM
grehan added inline comments to D14022: NVMe emulation for bhyve (improved).
Jan 26 2018, 3:12 AM

Jan 25 2018

grehan abandoned D13995: NVMe controller emulator for bhyve..

Closing this revision - moving to D14022

Jan 25 2018, 4:45 PM · bhyve
grehan commandeered D13995: NVMe controller emulator for bhyve..
Jan 25 2018, 4:44 PM · bhyve
grehan added a comment to D13995: NVMe controller emulator for bhyve..

Yep, that's correct. The code in the new review is based on this code so it's really a continuation of the effort.

Jan 25 2018, 4:41 PM · bhyve
grehan requested changes to D13995: NVMe controller emulator for bhyve..

Chuck - the review for this is now in D14022, where I believe your comments have already been addressed.

Jan 25 2018, 3:55 PM · bhyve
grehan updated the diff for D14022: NVMe emulation for bhyve (improved).

Some minor fixes from Leon, and an initial man page update.

Jan 25 2018, 8:16 AM

Jan 23 2018

grehan accepted D13780: vmm/svm: post LAPIC interrupts using event injection rather than virtual interrupts.

I don't think I'll be able to get the CR8 stuff done as quick as I'd hoped, so I think it's fine to go ahead with this as-is. In addition, both Andriy and Anish have reported that Windows guests come up fine so the issue may not be as big a deal as I'd previously thought.

Jan 23 2018, 4:47 PM
grehan added a comment to D14022: NVMe emulation for bhyve (improved).

I'll pull in the man page diff (maybe modified). Leon also sent me an update so I'll roll both in.

Jan 23 2018, 4:10 PM