Am 17.05.2021 um 11:39 schrieb Harry Schmalzbauer:
Am 17.05.2021 um 08:47 schrieb Konstantin Belousov:
On Mon, May 17, 2021 at 06:33:19AM +0000, Wei Hu wrote:
-----Original Message-----
From: Konstantin Belousov <kostik...@gmail.com>
Sent: Monday, May 17, 2021 1:47 PM
To: Wei Hu <w...@microsoft.com>
Cc: Harry Schmalzbauer <free...@omnilan.de>; Chris Knight
<str...@gmail.com>; freebsd-virtualization@freebsd.org
Subject: Re: FreeBSD 12.1 i386 on Hyper-V Fails to Mount Root

On Mon, May 17, 2021 at 04:12:20AM +0000, Wei Hu wrote:
:
:
:
separately. The workaround for this on amd64 is either build these
Hyper-V modules into the kernel or completely disable mitigation by
setting vm.pmap.pti="0" in /boot/loader.conf in the affect FreeBSD guests.


Just to share some hopefully helpful pre-check's I've done so far:

Disabling PTI via vm.pmap.pti="0" in /boot/loader.conf doesn't make any difference for the i386 issue (at least x86/x86/local_apic.c always uses non-pti path; tried nontheless, with identical result).

As far as my analysis isn't completely wrong, the problem is about IDT pointer. IDTVEC(rsvd) doesn't match in line 2180 of x86/x86/local_apic.c in native_lapic_ipi_alloc():
(ip->gd_hioffset << 16) | ip->gd_looffset;


I managed to setup an i386 vm with -current from 3 years ago (not the most straight forward task due to compiler infrastructure changes back then).
Up to r332488 vmbus(4) resp. hyperv(4) is working fine.
Updating r332488 to r332489 breaks like already described.

Since r332489 is a huge patch with lots of x86 art, the only chance I see, how this can be resolved, is with Konstantin's help.

I can just assure that I tracked it down to the single r332489 committ which makes vmbus(4) failing on i386.
Verification done:
- built/installed world&kernel on i386 HyV guest with r332488
  reboot fine.
- built/installed kernel on the same vm after svnlite up -r 332489
  reboot fails with "vmbus0: cannot find free IDT vector"
- loaded kernel.old/kernel, did revert 332489, by 'svnlite up -r 332488' and compiled/reinstalled kernel (again r332488)
  reboot fine.

I tried to revert r332489 on stable/13 but failed due to lots of conflicting changes (including CVE driven) affecting the same area.

To summarize: r332489 only breaks i386 native_lapic_ipi_alloc(), amd64 is not affected (but haven't checked if PTI has any influence on amd64).
The effect is 100% reproducable.
Happy to test any suggestion or debug extension!

Thanks,
-harry




_______________________________________________
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"

Reply via email to