> Date: Sat, 16 Mar 2024 00:56:52 +1100
> From: Jonathan Gray <j...@jsg.id.au>
> 
> On Fri, Mar 15, 2024 at 02:35:52PM +0100, Mark Kettenis wrote:
> > > Date: Fri, 15 Mar 2024 23:06:31 +1100
> > > From: Jonathan Gray <j...@jsg.id.au>
> > > 
> > > On Fri, Mar 15, 2024 at 11:29:28AM +0100, Marcin Juszkiewicz via arm 
> > > wrote:
> > > > W dniu 15.03.2024 o 03:30, Jonathan Gray pisze:
> > > > > > OpenBSD 7.3 boots fine on all core types. OpenBSD 7.4 fails on
> > > > > > Neoverse-V1/N2/max. Same situation with today's 7.5-current 
> > > > > > snapshot.
> > > > > > 
> > > > > > To track the problem I opened a bug against QEMU [1] to have all
> > > > > > information in one place.
> > > > > > 
> > > > > > 1.https://gitlab.com/qemu-project/qemu/-/issues/2224
> > > > > > 
> > > > > > If I use older cores (like Neoverse-N1 which is default for 
> > > > > > sbsa-ref)
> > > > > > then installer boots fine:
> > > > 
> > > > > I see the same with sbsa-ref using qemu 8.2.1 and the edk2
> > > > > firmware you reference in the qemu issue.
> > > > 
> > > > What made me wonder is that it feels like error on OpenBSD side.
> > > > 7.3 release boots, 7.4 and later do not.
> > > 
> > > I tracked it down to PAC.
> > > 
> > > https://github.com/openbsd/src/commit/4171e492c627a295b38565e1f04e0b7ba62913f8
> > > 
> > > If I disable it, qemu sbsa-ref with cpu max boots.
> > 
> > Does this diff help?
> 
> Yes, boots with this instead.  Does it also remove the need for the
> x13s workaround?

Nope.  On the x13s we boot in EL1, so this code doesn't even run.  But
it could very well be that the x13s EL2 firmware has a very similar
bug ;).

> > Index: arch/arm64/arm64/locore.S
> > ===================================================================
> > RCS file: /cvs/src/sys/arch/arm64/arm64/locore.S,v
> > retrieving revision 1.45
> > diff -u -p -r1.45 locore.S
> > --- arch/arm64/arm64/locore.S       12 Dec 2023 07:37:20 -0000      1.45
> > +++ arch/arm64/arm64/locore.S       15 Mar 2024 13:34:25 -0000
> > @@ -57,6 +57,7 @@ drop_to_el1:
> >  
> >     /* Configure the Hypervisor */
> >     mov     x2, #(HCR_RW)
> > +   orr     x2, x2, #(HCR_API | HCR_APK)
> >     msr     hcr_el2, x2
> >  
> >     /* Load the Virtualization Process ID Register */
> > Index: arch/arm64/include/hypervisor.h
> > ===================================================================
> > RCS file: /cvs/src/sys/arch/arm64/include/hypervisor.h,v
> > retrieving revision 1.3
> > diff -u -p -r1.3 hypervisor.h
> > --- arch/arm64/include/hypervisor.h 21 Feb 2021 13:14:47 -0000      1.3
> > +++ arch/arm64/include/hypervisor.h 15 Mar 2024 13:34:25 -0000
> > @@ -82,6 +82,8 @@
> >  #define    HCR_CD          0x0000000100000000
> >  #define    HCR_ID          0x0000000200000000
> >  #define    HCR_E2H         0x0000000400000000
> > +#define    HCR_APK         0x0000010000000000
> > +#define    HCR_API         0x0000020000000000
> >  
> >  #endif
> >  
> > 
> 

Reply via email to