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.

diff --git sys/arch/arm64/arm64/cpu.c sys/arch/arm64/arm64/cpu.c
index b11bf3699ac..1fa647ff6b5 100644
--- sys/arch/arm64/arm64/cpu.c
+++ sys/arch/arm64/arm64/cpu.c
@@ -970,24 +970,29 @@ cpu_attach(struct device *parent, struct device *dev, 
void *aux)
                /*
                 * Lenovo X13s ships with broken EL2 firmware that
                 * hangs the machine if we enable PAuth.
                 */
                if (hw_vendor && hw_prod && strcmp(hw_vendor, "LENOVO") == 0) {
                        if (strncmp(hw_prod, "21BX", 4) == 0 ||
                            strncmp(hw_prod, "21BY", 4) == 0) {
                                cpu_id_aa64isar1 &= ~ID_AA64ISAR1_APA_MASK;
                                cpu_id_aa64isar1 &= ~ID_AA64ISAR1_GPA_MASK;
                        }
                }
 
+               if (hw_vendor && strcmp(hw_vendor, "QEMU") == 0) {
+                       cpu_id_aa64isar1 &= ~ID_AA64ISAR1_APA_MASK;
+                       cpu_id_aa64isar1 &= ~ID_AA64ISAR1_GPA_MASK;
+               }
+
                cpu_identify(ci);
 
                if (OF_getproplen(ci->ci_node, "clocks") > 0) {
                        cpu_node = ci->ci_node;
                        cpu_cpuspeed = cpu_clockspeed;
                }
 
                cpu_init();
 #ifdef MULTIPROCESSOR
        }
 #endif
 

Reply via email to