FreeBSD 12.1 i386 on Hyper-V Fails to Mount Root
Harry Schmalzbauer
freebsd at omnilan.de
Mon May 17 09:40:12 UTC 2021
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 <kostikbel at gmail.com>
>>> Sent: Monday, May 17, 2021 1:47 PM
>>> To: Wei Hu <weh at microsoft.com>
>>> Cc: Harry Schmalzbauer <freebsd at omnilan.de>; Chris Knight
>>> <stryqx at gmail.com>; freebsd-virtualization at 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;
Workign 11.4 shows these values:
11.4-i386 idx 251 (252-1 because no r363527, IPI_SWI) :
hi = (49417) 1100 0001 0000 1001
lo = (5472) 0001 0101 0110 0000
func = 1100 0001 0000 1001 0001 0101 0110 0000
IDTVEC(rsvd) = 1100 0001 0000 1001 0001 0101 0110 0000
== rsvd_pti
stable/13:
i386 idx 252 Nok:
hi = (65472) 1111 1111 1100 0000
lo = (12456) 0011 0000 1010 1000
func = 1111 1111 1100 0000 0011 0000 1010 1000
IDTVEC(rsvd) = 0 1110 0100 1011 1011 1110 1000
== rsvd_pti
My knowledge about IDT and it's handling by OS/FreeBSD is by far not
enough to get a solution/explanation for the above. I couldn't find the
relevant paths in our source code (starting with the lack of basic asm
skills).
For sure I'm missing the important path here, maybe I'm totaly wrong...
if not this hopefully saves you some time.
I noticed r332489 too as a candidate for the regression beteween 12(.0)
and 11(.2+).
I prepared a diff which applies to 11.4 (sources from iso) but
recompiling 11.4 fails currently, I would need to rework the
i386/i386/pmap.c adoption.
:
:
:
>> know the link to the patch or the commit if you already have checked in? I will
>> need to test and inform the parties who got affected.
>
> It was mailed for you after your query, then I pinged you several times.
> Anyway, look at and try https://reviews.freebsd.org/D30310
I applied it to stable/13 and this doesn't make any difference, still
the (ip->gd_hioffset << 16) | ip->gd_looffset; and
(uintptr_t)IDTVEC(rsvd) differ with exactly the same values as shown above.
Thanks for your attention, best regards,
-harry
More information about the freebsd-virtualization
mailing list