[Bug 246321] Key press timing/repeat issue on UEFI VNC console for OpenBSD => 6.6 guest

2020-05-09 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246321

--- Comment #2 from Jason Tubnor  ---
(In reply to Peter Grehan from comment #1)

FreeBSD 11.3, 12.1 and 13-HEAD (r360181 20200422)

UltraVNC and Tight VNC

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Bug 246168] Ubuntu 20.04 KVM / QEMU Failure with nested FreeBSD bhyve

2020-05-09 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246168

--- Comment #12 from Peter Grehan  ---
Glad to hear that worked.

x2apic is fine - it has to be explicitly enabled in bhyve for a guest to use.

This would appear to be a bug in kvm since apic-virtualization in bhyve has
been working fine on h/w for a number of years now. However, the fact that it
fails almost immediately (on first guest entry perhaps) would indicate it may
not be difficult to fix.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: patch to make vboxvfs work again

2020-05-09 Thread Mateusz Guzik
That will do the trick indeed.

I don't know about that bcmp thingy, ideally it would be needed. I
presume there is a sufficient header mess which makes this to be the
easiest hack.

On 5/9/20, John-Mark Gurney  wrote:
> Hello virtualbox maintainer(s),
>
> Attached is a patch to make VirtualBox vboxvfs work again.  I've only
> tested under -current.
>
> mjg, what is the correct way to make this patch work on past versions
> of FreeBSD?  would a simple #ifdef VFS_VOP_VECTOR_REGISTER wrapper
> around the call work?
>
> Thanks.
>
> --
>   John-Mark GurneyVoice: +1 415 225 5579
>
>  "All that I will do, has been done, All that I have, has not."
>


-- 
Mateusz Guzik 
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


patch to make vboxvfs work again

2020-05-09 Thread John-Mark Gurney
Hello virtualbox maintainer(s),

Attached is a patch to make VirtualBox vboxvfs work again.  I've only
tested under -current.

mjg, what is the correct way to make this patch work on past versions
of FreeBSD?  would a simple #ifdef VFS_VOP_VECTOR_REGISTER wrapper
around the call work?

Thanks.

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
Index: virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk
===
--- virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk	(revision 534710)
+++ virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk	(working copy)
@@ -1,8 +1,10 @@
 src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig	2017-04-28 16:59:22.0 +0200
-+++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk	2017-07-13 00:52:49.020669620 +0200
-@@ -33,32 +33,36 @@
+--- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig	2019-10-10 18:06:51.0 +
 src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk	2020-05-09 06:51:51.411749000 +
+@@ -32,33 +32,38 @@
+ . \
 $(vboxvfs_0_OUTDIR)
  vboxvfs_SOURCES   = \
++	bcmp.c \
  	vboxvfs_vfsops.c \
 -	vboxvfs_vnops.c
 +	vboxvfs_vnops.c \
Index: virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c
===
--- virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c	(nonexistent)
+++ virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c	(working copy)
@@ -0,0 +1,12 @@
+--- src/VBox/Additions/freebsd/vboxvfs/bcmp.c.orig	2020-05-09 06:57:06.22914 +
 src/VBox/Additions/freebsd/vboxvfs/bcmp.c	2020-05-09 06:54:55.886751000 +
+@@ -0,0 +1,9 @@
++#include 
++
++int bcmp(const void *b1, const void *b2, size_t len);
++
++int
++bcmp(const void *b1, const void *b2, size_t len)
++{
++	return __builtin_memcmp((b1), (b2), (len));
++}

Property changes on: virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c
___
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
===
--- virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c	(revision 534793)
+++ virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c	(working copy)
@@ -1,5 +1,5 @@
 src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2019-10-10 18:06:51 UTC
-+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c
+--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2019-10-10 18:06:51.0 +
 src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c	2020-05-09 07:07:49.485808000 +
 @@ -1,10 +1,6 @@
 -/* $Id: vboxvfs_vnops.c $ */
 -/** @file
@@ -12,7 +12,7 @@
   *
   * This file is part of VirtualBox Open Source Edition (OSE), as
   * available from http://www.virtualbox.org. This file is free software;
-@@ -14,228 +10,1338 @@
+@@ -14,228 +10,1339 @@
   * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
   * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
   */
@@ -172,6 +172,7 @@
 +	.vop_write	= vboxfs_write,
 +	.vop_bmap	= VOP_EOPNOTSUPP
  };
++VFS_VOP_VECTOR_REGISTER(vboxfs_vnodeops);
  
 -static int vboxvfs_access(struct vop_access_args *ap)
 +static uint64_t
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Bug 246168] Ubuntu 20.04 KVM / QEMU Failure with nested FreeBSD bhyve

2020-05-09 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246168

--- Comment #11 from John Hartley  ---
(In reply to Peter Grehan from comment #10)

Hi Peter,

you have eagle eyes.

Your suggestion worked and I now have Layer 3 - FreeBSD UEFI guest doing an
install.


I also tried to see if disabling X2APIC via QEMU fixed the problem via:


  


This did not work, but it did turn off the feature correct in Layer 1 - Guest /
Host.

Here is output from sysctl on Layer 1 - FreeBSD Guest Host

<>
# sysctl hw.vmm
hw.vmm.amdvi.domain_id: 0
hw.vmm.amdvi.disable_io_fault: 0
hw.vmm.amdvi.ptp_level: 4
hw.vmm.amdvi.host_ptp: 1
hw.vmm.amdvi.enable: 0
hw.vmm.amdvi.count: 0
hw.vmm.npt.pmap_flags: 0
hw.vmm.svm.num_asids: 0
hw.vmm.svm.disable_npf_assist: 0
hw.vmm.svm.features: 4294967295
hw.vmm.svm.vmcb_clean: 1023
hw.vmm.vmx.l1d_flush_sw: 0
hw.vmm.vmx.l1d_flush: 0
hw.vmm.vmx.vpid_alloc_failed: 0
hw.vmm.vmx.posted_interrupt_vector: -1
hw.vmm.vmx.cap.posted_interrupts: 0
hw.vmm.vmx.cap.virtual_interrupt_delivery: 0
hw.vmm.vmx.cap.invpcid: 1
hw.vmm.vmx.cap.monitor_trap: 1
hw.vmm.vmx.cap.unrestricted_guest: 1
hw.vmm.vmx.cap.pause_exit: 1
hw.vmm.vmx.cap.halt_exit: 1
hw.vmm.vmx.initialized: 1
hw.vmm.vmx.cr4_zeros_mask: 18446744073705934848
hw.vmm.vmx.cr4_ones_mask: 8192
hw.vmm.vmx.cr0_zeros_mask: 18446744071025197056
hw.vmm.vmx.cr0_ones_mask: 32
hw.vmm.vmx.no_flush_rsb: 0
hw.vmm.ept.pmap_flags: 1531
hw.vmm.vrtc.flag_broken_time: 1
hw.vmm.ppt.devices: 0
hw.vmm.iommu.enable: 1
hw.vmm.iommu.initialized: 0
hw.vmm.bhyve_xcpuids: 0
hw.vmm.topology.cpuid_leaf_b: 1
hw.vmm.create: beavis
hw.vmm.destroy: beavis
hw.vmm.trace_guest_exceptions: 0
hw.vmm.ipinum: 251
hw.vmm.halt_detection: 1
<>


So have work around.

Do think believe this needs fix within FreeBSD bhyve or is issue with QEMU /
KVM ?

NOTE: I also tested with FreeBSD 13 CURRENT and this had same problem.

Thanks again for help on this.

Cheers,


John Hartley

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Bug 246168] Ubuntu 20.04 KVM / QEMU Failure with nested FreeBSD bhyve

2020-05-09 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246168

--- Comment #10 from Peter Grehan  ---
I used a laptop-class CPU when trying the repro (core i5-8250U). In particular,
there is a difference in VT-x features as reported by the L1 guest:

  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID

vs your system:

  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr

The one of interest here is that KVM is emulating APIC-virtualization
(VID,PostIntr).

One thing to try is to disable this feature in the L1 guest. In
/boot/loader.conf, put an entry 

hw.vmm.vmx.use_apic_vid=0

After (re)booting the L1 guest, the status of this parameter can be checked
with:

# sysctl hw.vmm.vmx.cap.virtual_interrupt_delivery
hw.vmm.vmx.cap.virtual_interrupt_delivery: 0  <- should be zero

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Bug 246321] Key press timing/repeat issue on UEFI VNC console for OpenBSD => 6.6 guest

2020-05-09 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246321

Peter Grehan  changed:

   What|Removed |Added

 CC||gre...@freebsd.org

--- Comment #1 from Peter Grehan  ---
Which VNC clients/versions (and host o/s's) ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Bug 246168] Ubuntu 20.04 KVM / QEMU Failure with nested FreeBSD bhyve

2020-05-09 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246168

--- Comment #9 from John Hartley  ---
(In reply to Peter Grehan from comment #8)

Hi Peter,

thanks for reviewing.

I have done further testing:

A. Running bhyveload first as per your feedback

Result:

Brings up FreeBSD Loader and then get to "/dev/entropy not found message and
closes machine


<>
# bhyvectl --vm=bee --get-stats > bee-vm-stats-01.txt
# cat bee-vm-stats-01.txt 
vcpu0 stats:
number of times in/out was intercepted  0
number of times cpuid was intercepted   0
vm exits due to nested page fault   0
vm exits for instruction emulation  0
number of vm exits for unknown reason   0
number of times astpending at exit  0
number of times idle requested at exit  0
number of vm exits handled in userspace 0
number of times rendezvous pending at exit  0
number of vm exits due to exceptions0
number of NMIs delivered to vcpu0
number of ExtINTs delivered to vcpu 0
Resident memory 0
Wired memory0
vcpu total runtime  0
EOI without any in-service interrupt0
error interrupts generated by vlapic0
timer interrupts generated by vlapic0
corrected machine check interrupts generated by vlapic  0
lvts triggered[0]   0
lvts triggered[1]   0
lvts triggered[2]   0
lvts triggered[3]   0
lvts triggered[4]   0
lvts triggered[5]   0
lvts triggered[6]   0
ipis sent to vcpu[0]0
ipis sent to vcpu[1]0
ipis sent to vcpu[2]0
ipis sent to vcpu[3]0
ipis sent to vcpu[4]0
ipis sent to vcpu[5]0
ipis sent to vcpu[6]0
ipis sent to vcpu[7]0
ipis sent to vcpu[8]0
ipis sent to vcpu[9]0
ipis sent to vcpu[10]   0
ipis sent to vcpu[11]   0
ipis sent to vcpu[12]   0
ipis sent to vcpu[13]   0
ipis sent to vcpu[14]   0
ipis sent to vcpu[15]   0
number of ticks vcpu was idle   0
vcpu migration across host cpus 0
total number of vm exits0
vm exits due to external interrupt  0
Number of vpid invalidations saved  0
Number of vpid invalidations done   0
number of times hlt was intercepted 0
number of times %cr access was intercepted  0
number of times rdmsr was intercepted   0
number of times wrmsr was intercepted   0
number of monitor trap exits0
number of times pause was intercepted   0
vm exits due to interrupt window opening0
vm exits due to nmi window opening  0
<>

This was then followed with invoking Bhyve, as per original posting.

This again results in Layer 1 - FreeBSD VM going to pause with same error via
Layer 0 - /var/log/libvirt/qemu/VM.log

<>
char device redirected to /dev/pts/27 (label charserial0)
2020-05-09T06:28:07.870436Z qemu-system-x86_64: warning: host doesn't support
requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-05-09T06:28:07.870499Z qemu-system-x86_64: warning: host doesn't support
requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2020-05-09T06:28:07.872528Z qemu-system-x86_64: warning: host doesn't support
requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-05-09T06:28:07.872543Z qemu-system-x86_64: warning: host doesn't support
requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2020-05-09T06:28:07.873742Z qemu-system-x86_64: warning: host doesn't support
requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-05-09T06:28:07.873757Z qemu-system-x86_64: warning: host doesn't support
requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2020-05-09T06:28:07.874950Z qemu-system-x86_64: warning: host doesn't support
requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-05-09T06:28:07.874964Z qemu-system-x86_64: warning: host doesn't support
requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
KVM internal error. Suberror: 1
emulation failure
EAX= EBX= ECX= EDX=
ESI= EDI= EBP= ESP=
EIP= EFL= [---] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =   8000 DPL=0 
CS =   8000 DPL=0 

[Bug 246321] Key press timing/repeat issue on UEFI VNC console for OpenBSD => 6.6 guest

2020-05-09 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246321

Bug ID: 246321
   Summary: Key press timing/repeat issue on UEFI VNC console for
OpenBSD => 6.6 guest
   Product: Base System
   Version: Unspecified
  Hardware: amd64
OS: Any
Status: New
  Severity: Affects Some People
  Priority: ---
 Component: bhyve
  Assignee: virtualizat...@freebsd.org
  Reporter: ja...@tubnor.net

When using the UEFI terminal console for an OpenBSD 6.6 or later guest, there
appears to be some sort of timing issue with the emulated VNC keyboard. After
booting the installer or and installed 6.6/6.7 operating system, a key press
can exhibit shorter than usual delay before repeat, therefor echoing more
characters than desired into the console as well as an increase in the
character repeat per second.

Another side affect is the login delay time. This is usually set to 300 seconds
on a a default install.  If you try logging into the console, this delay time
reduces to 58 seconds.

How to reproduce (this was tested on a variety of hardware including Xeon and
Atom based hosts):

Using 11.3 to 13-HEAD, configure a bhyve guest and install from miniroot66.fs
or miniroot67.fs

https://openbsd.cs.toronto.edu/pub/OpenBSD/6.6/amd64/miniroot66.fs
https://openbsd.cs.toronto.edu/pub/OpenBSD/snapshots/amd64/miniroot67.fs

Once at the Install/Upgrade prompt, select Shell.  Start typing a sentence as
you normally do to see the issue.

To replicate the shortened timeout issue on the login prompt, either try to get
the install down with the key press issue, install using miniroot65.fs[1] and
then perform a syspatch/sysupgrade to bring it up to 6.6 or install via
UEFI-serial and at the OpenBSD boot loader, issue 'set tty com0' to install via
the bhyve serial console.  Once installed, type root and the incorrect
password.  Start a timing device to see the difference between the reported 300
seconds of timeout and the actual time elapsed.

[1] An archive of an older, unsupported OpenBSD 6.5 release can be found here: 
https://mirror.cdn.ar18.org/pub/archive/OpenBSD/6.5/amd64/miniroot65.fs

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"