Re: main cadd2ca217 doesn't boot

2024-05-26 Thread FreeBSD User
Am Sun, 26 May 2024 09:29:08 +0200
Bojan Novković  schrieb:

> Hi,
> 
> da76d349b6b1 replaced a UMA-related symbol but missed three instances 
> where the old one was used, ultimately causing the wrong UMA page 
> allocator to get selected and crashing the machine.
> 
> I tested this patch as a part of a bigger series where it works fine, so 
> this slipped through cracks without getting noticed.
> 
> I've attached a patch with a fix, I can boot an amd64 VM with it applied.
> Could you please give it a try and let me know if it fixes the issue?
> 
> Bojan

The patch fixes the problem on amd64 here ...

-- 
O. Hartmann



Re: main cadd2ca217 doesn't boot

2024-05-26 Thread David Wolfskill
On Sun, May 26, 2024 at 09:29:08AM +0200, Bojan Novković wrote:
> Hi,
> 
> da76d349b6b1 replaced a UMA-related symbol but missed three instances where
> the old one was used, ultimately causing the wrong UMA page allocator to get
> selected and crashing the machine.
> 
> I tested this patch as a part of a bigger series where it works fine, so
> this slipped through cracks without getting noticed.
> 
> I've attached a patch with a fix, I can boot an amd64 VM with it applied.
> Could you please give it a try and let me know if it fixes the issue?

TL;DR: Yes, it fixes it (for 2 of my laptops, at least).

Details:
Laptops were running (e.g.):

FreeBSD 15.0-CURRENT #155 main-n270400-02d15215cef2: Sat May 25 14:19:27 UTC 
2024 
r...@g1-70.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY amd64 
1500018 1500018

After updating sources to main-n270407-73eb53813fe3 and doing a normal
in-place source-based update (which owrked, as such), I (attempted)
rebooting, which exhibited the previously-documented failures.

I rebooted using the kernel from main-n270400-02d15215cef2, applied the
patch, rebuilt the kernel, and ... the reboot this time was successful:

FreeBSD 15.0-CURRENT #157 main-n270407-73eb53813fe3-dirty: Sun May 26 13:02:07 
UTC 2024 
r...@g1-51.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY amd64 
1500018 1500018

(My 3rd "development" machine -- the fastest one -- is still bogged down
with Yet Another Chromium Rebuild on behalf of production machines that
are due to be updated once that completes.)

Thanks!

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
I will not be voting for a "unified reich" in the US.

See https://www.catwhisker.org/~david/publickey.gpg for my public key.


signature.asc
Description: PGP signature


Re: main cadd2ca217 doesn't boot

2024-05-26 Thread Oleg Nauman
Hello,

I can confirm that your patch fixes this issue ( am64 CURRENT cadd2ca21765 )

Thank you

On Sun, May 26, 2024 at 10:29 AM Bojan Novković  wrote:
>
> Hi,
>
> da76d349b6b1 replaced a UMA-related symbol but missed three instances
> where the old one was used, ultimately causing the wrong UMA page
> allocator to get selected and crashing the machine.
>
> I tested this patch as a part of a bigger series where it works fine, so
> this slipped through cracks without getting noticed.
>
> I've attached a patch with a fix, I can boot an amd64 VM with it applied.
> Could you please give it a try and let me know if it fixes the issue?
>
> Bojan



Re: main cadd2ca217 doesn't boot

2024-05-26 Thread tuexen
> On 26. May 2024, at 09:29, Bojan Novković  wrote:
> 
> Hi,
> 
> da76d349b6b1 replaced a UMA-related symbol but missed three instances where 
> the old one was used, ultimately causing the wrong UMA page allocator to get 
> selected and crashing the machine.
> 
> I tested this patch as a part of a bigger series where it works fine, so this 
> slipped through cracks without getting noticed.
> 
> I've attached a patch with a fix, I can boot an amd64 VM with it applied.
> Could you please give it a try and let me know if it fixes the issue?
Hi Hojan,

this fixes the issue for me using an arm64 VM (VMWare Fusion).

Best regards
Michael
> 
> Bojan
> 




Re: main cadd2ca217 doesn't boot

2024-05-26 Thread Bojan Novković

Hi,

da76d349b6b1 replaced a UMA-related symbol but missed three instances 
where the old one was used, ultimately causing the wrong UMA page 
allocator to get selected and crashing the machine.


I tested this patch as a part of a bigger series where it works fine, so 
this slipped through cracks without getting noticed.


I've attached a patch with a fix, I can boot an amd64 VM with it applied.
Could you please give it a try and let me know if it fixes the issue?

Bojan
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 59066eb96ae9..516ac2c2965a 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -2523,7 +2523,7 @@ keg_ctor(void *mem, int size, void *udata, int flags)
 	 * If we haven't booted yet we need allocations to go through the
 	 * startup cache until the vm is ready.
 	 */
-#ifdef UMA_MD_SMALL_ALLOC
+#ifdef UMA_USE_DMAP
 	if (keg->uk_ppera == 1)
 		keg->uk_allocf = uma_small_alloc;
 	else
@@ -2536,7 +2536,7 @@ keg_ctor(void *mem, int size, void *udata, int flags)
 		keg->uk_allocf = contig_alloc;
 	else
 		keg->uk_allocf = page_alloc;
-#ifdef UMA_MD_SMALL_ALLOC
+#ifdef UMA_USE_DMAP
 	if (keg->uk_ppera == 1)
 		keg->uk_freef = uma_small_free;
 	else
@@ -5221,7 +5221,7 @@ uma_zone_reserve_kva(uma_zone_t zone, int count)
 	keg->uk_kva = kva;
 	keg->uk_offset = 0;
 	zone->uz_max_items = pages * keg->uk_ipers;
-#ifdef UMA_MD_SMALL_ALLOC
+#ifdef UMA_USE_DMAP
 	keg->uk_allocf = (keg->uk_ppera > 1) ? noobj_alloc : uma_small_alloc;
 #else
 	keg->uk_allocf = noobj_alloc;


Re: main cadd2ca217 doesn't boot

2024-05-25 Thread Ryan Libby
On Sat, May 25, 2024 at 5:47 PM Tomoaki AOKI  wrote:
>
> On Sun, 26 May 2024 00:21:31 +0100
> Nuno Teixeira  wrote:
>
> > Hello,
> >
> > Just upgraded to latest main at cadd2ca217
> >
> > Boot menu shows up and then it stops earlier around:
> > ..
> > FreeBSD clang version ...
> >
> > No crash dump.
> >
> > Thanks,
> >
> > --
> > Nuno Teixeira
> > FreeBSD UNIX: Web:  https://FreeBSD.org
>
> Just a FYI:
> commit 40d951bc5932deb87635f5c1780a6706d0c7c012, amd64 boots fine for
> me. So commits after 02d15215cef2a28f1865e6ad5b19f18af1398b8b caused
> the problem, maybe.
>
> Regards.
>
> --
> Tomoaki AOKI
>

I'm on amd64 running GENERIC.

This boots:
9b1de7e4844d vt/sc: retire logic to select vt(4) by default for UEFI boot

This doesn't:
da76d349b6b1 uma: Deduplicate uma_small_alloc

On one failed boot I saw a failed MPASS
panic: Assertion size != 0 && qsize != 0 failed at
/usr/src/freebsd/sys/kern/subr_vmem.c:427

Followed by about 1000 stack frames with 7 frames repeating, presumably
deep/infinite recursion.

Probably want to back this out until stabilized.

Ryan



Re: main cadd2ca217 doesn't boot

2024-05-25 Thread Tomoaki AOKI
On Sun, 26 May 2024 00:21:31 +0100
Nuno Teixeira  wrote:

> Hello,
> 
> Just upgraded to latest main at cadd2ca217
> 
> Boot menu shows up and then it stops earlier around:
> ..
> FreeBSD clang version ...
> 
> No crash dump.
> 
> Thanks,
> 
> -- 
> Nuno Teixeira
> FreeBSD UNIX: Web:  https://FreeBSD.org

Just a FYI:
commit 40d951bc5932deb87635f5c1780a6706d0c7c012, amd64 boots fine for
me. So commits after 02d15215cef2a28f1865e6ad5b19f18af1398b8b caused
the problem, maybe.

Regards.

-- 
Tomoaki AOKI