#uACPI - a portable and easy-to-integrate ACPI implementation

1 messages ยท Page 70 of 1

fiery ice
#

arduino uses 5V io

#

rpi 3.3V

#

just choose the correct one

sharp lichen
#

arent motherboard com headers on 12V?

fiery turtle
fiery ice
#

huuh, i don't think they are 12V

fiery turtle
#

its called idc10 to db9

gentle peak
#

I don't have any machines with rs232 ports

fiery ice
#

there are usb to rs232 if you want

fiery turtle
#

just search idc10 to usb

#

or similar

#

alternatively u can have 2 separate cables, idc10 to db9, and db9 to usb serial

calm latch
#

And a modem cable

fiery turtle
#

would be nice if u could test it out

calm latch
#

(Including my B550 Ryzen system)

fiery turtle
#

and check logs if it crashes as well on your hw

full nimbus
#

i used it to test my gdb stub on real hardware

fiery turtle
#

nice

calm latch
#

I've bought 3 adapters, but lost one of them

fiery turtle
#

more people noticing vibecoding regressions

#

its been almost a month and a half

#

but the maintainer merges typo fixes instead

#

anyone wants to make an ASL compiler for the uacpi org? trl

#

tbh a clanker could probably oneshot that but

#

maybe someone wants to do it by hand

pallid lava
#

apart from the interpreter, it's an assembler, disassembler, and anything else?

fiery turtle
#

an interactive debugger

#

but that can be tackled on top of the uacpi test runner

pallid lava
#

yes

#

for the assembler, would it be possible to make something quick and good using flex and bison?

fiery turtle
#

acpica uses bison i think so yes

#

or flex

#

idk

pallid lava
#

i don't think the grammar is too complicated

fiery turtle
#

yeah its pretty simple honestly

#

they designed it so that all the complexity goes into the kernel and not the compiler

#

which is very smart ofc

pallid lava
#

99.9999% of the complexity is in interpreting the garbage gnuslashtroll

fiery turtle
#

yeah

#

they could make a proper bytecode with virtual registers, simple non recursive logical ops etc

#

but instead its ASL but translated 1 for 1 into AML

pallid lava
#

i was going to ask whether the assembler is also at fault for being too lax

fiery turtle
#

yeah partially

pallid lava
#

maybe if the compiler wasn't so garbage and firmware devs were a bit smarter aml wouldn't be crazy

fiery turtle
#

the NT ASL compiler does 0 checking

#

u can put any garbage consisting of valid keywords

pallid lava
#

bruh

fiery turtle
#

thats partially why the AML is such a mess yeah

#

very poor underdeveloped tooling

#

these days acpica produces more warnings and stuff

#

but sometimes that does more harm as well

#

because they work around the warnings by doing even stupider stuff

fiery ice
#

I mean, i could try to write one when i'm at home

#

Or well, let clanker loose

#

I have 5.5 for free trl

fiery turtle
#

the acpi dump repo has a lot of decompiled ASL you could throw at it

hallow marten
#

@fiery turtle so what do i need to work on for the uacpi linux stuff

#

i missed a few things here and too lazy so tldr trl

gentle peak
#

well there's the suspend stuff

#

I've ordered the serial stuff so I should be able to get logs on that soon

hallow marten
#

great

#

@gentle peak it suspended but didnt wake right?

gentle peak
#

no it didn't suspend in the first place

hallow marten
#

huh

#

well I fixed a wake path

#

the clanker stubbed it lol

gentle peak
#

power led stayed on and fans kept spinning

#

is there a repo for this btw? or is it just sharing patch files

hallow marten
#

for now it's just sharing patches but I'll update the uacpi repo eventually

#

@fiery ice you had issues with wake right?

#

can you try this

fiery ice
fiery turtle
fiery turtle
#

but no srsly push it somewhere

hallow marten
#

it stubbed acpi_any_fixed_event_status_set acpi_any_gpe_status_set

hallow marten
fiery turtle
#

its fiiiine

gentle peak
#

I'm mostly asking because the patches thing is inconvenient lol

hallow marten
#

how should we do this

#

do we delete the repo and make a new linux fork

#

or what

gentle peak
#

especially since testing it on the affected machine requires a custom kernel config (for amdgpu) and a custom initrd (for the firmware binaries)

gentle peak
hallow marten
#

can you do it infy

#

i have org rights but not delete rights (and I shouldnt have them)

fiery turtle
#

do u want to import it with the name uacpi-linux?

hallow marten
#

yeah i guess

#

wait wdym

#

I make the repo on my profile then move it?

fiery turtle
#

exactly yeah

#

alright ive deleted the uacpi-linux repo

#

u can move now

hallow marten
#

for commits

fiery turtle
#

that would be nice i suppose

hallow marten
#

or if this does end up being patches we would just redo the patches anyway

#

with good conventions

fiery turtle
#

i mean the conventions are pretty simple no?

hallow marten
#

Signed-Off-By: is annoying meme

fiery turtle
#

component: msg

S-o-b

#

wdym why

hallow marten
#

no reason im just lazy trl

fiery turtle
#

git commit -s?

#

have u been typing it manually or smth lol

hallow marten
#

no

#

but then i have to dox myself

fiery turtle
#

make up a fake name if u want

hallow marten
#

nah it's fine ive already doxxed myself on the lkml anyway

fiery turtle
#

i mean especially if we consider the remote possibility of ever upstreaming it

pallid lava
#

linux doesn't allow anonymous contributors anyways

fiery turtle
#

thatd be useful

hallow marten
#

I have made very important contributions

#

society using linux after the patch I sent ^

steel inlet
#

Add files via upload

full nimbus
#

Also I spent like 2 hours trying to make a minimal and decent kernel config

#

Just for some bullshit to nuke it

#

๐Ÿ’€

#

I'm doing ts tomorrow

hallow marten
#

@fiery turtle I'll just name the repo "linux", it's cooler

fiery turtle
#

sure, whatever u want lol

hallow marten
#

you need to clone uACPI in the source tree as well

hollow scaffold
hallow marten
#

ugh the commit message is shit forced push lol

full nimbus
hallow marten
#

not sure that's a thing linux does

fiery turtle
#

yeah no

hallow marten
#

in the future the source code will just be inside linux

#

if it gets merged

fiery ice
#

@fiery turtle could you create a repo for the compiler / disassembler pls?

fiery turtle
#

Why lol

#

make something working first

fiery ice
#

k

#

clanker is doing stuff

#

@hallow marten using this cmd it still cannot wakeup

fiery turtle
#

does it like not react to anything at all

#

or hangs

fiery ice
#

then if i press anything, nothing happens

#

not even the power button

fiery turtle
#

Yeah that sounds like _PTS and stuff is not getting called for some reason

fiery turtle
fiery ice
#

huuh idk

#

tho i don't think blue

gentle peak
fiery turtle
#

Really could use those logs

#

like it could literally be panicking in the kernel and we wouldnt know

fiery ice
#

i don't have serial there

fiery turtle
#

Ye I know

#

@ mishakov nooo

fiery ice
#

@fiery turtle how did i dump the acpi to test?

#

think i did it

fiery turtle
#

acpidump

fiery ice
#

yeah, but it was decompiling it to multiple table files, lol

#

i just kept dsdt and ssdt

#

that had actual aml code

fiery turtle
#

Yea

#

U can use the acpi dumps repo in the uacpi org

#

It has a lot of asl

fiery ice
#

yeah i saw

#

i'm trying with the one from my pc first

fiery turtle
#

Sure

fiery ice
#

i hate that AI literally "fixes" the missing operation and replaces them with a No-Op

hallow marten
#

Lol I should try the new mythos release

#

on the uACPI thing

#

Claude fix everything make no mistake

#

(I won't, I'm not AI bro enough)

fiery turtle
#

oh yeah

fiery ice
#

oh, dsdt compiled

#

and my 5 hour limit is finished

#

pain

fiery turtle
#

lol

#

disassemble with acpica and see if it works

sharp lichen
#

does Intel AMT Serial-over-lan thingy also work for getting logs? If so, then I might be able to test on my laptop

fiery turtle
#

depends if yours captures normal output via COM1 or a PCI bar

#

if its a pci bar it might be too late but not sure

fiery ice
#

the disassembler is borked on the app clanker made

#

i need to force it to fix it

#

๐Ÿ’€

#

bruh, it was using medium reasoning

fiery turtle
#

gg

fiery ice
calm latch
sharp lichen
fiery turtle
#

with the appropriate command line to enable said output

fiery ice
#

@hallow marten @fiery turtle i have some logs

#

full logs from serial

#

it seems to behave the same way

fiery turtle
#

so it does wake up but the screen doesnt light up or?

fiery ice
#

no, this is from qemu

#

it never reaches full sleep seems like

fiery turtle
#

from your log it does, and it even wakes up

#

qemu has a seabios bug that prevents ECAM from working on resume

#

try without q35

fiery ice
#

ah

#

what machine then

fiery turtle
#

just omit machine

fiery ice
#

i did

#

qemu-system-x86_64 -cdrom /home/diamantino/Downloads/uacpi.iso -serial stdi

#

i'm running it like this

fiery turtle
#

ah ok

#

then thats the bug

#

But your qemu does wake up [ 33.454310] PM: suspend exit

fiery ice
#

i never touch anything

#

it wakes up from itself

#

and also, the terminal gets stuck

#

i can't do anything

fiery turtle
#

ah ok then that should be easy to debug by clanker

#

@hallow marten can u tell clanker to run suspend in qemu and see why it doesnt suspend?

fiery ice
#

anyway, 5 hour window resetted, time to get clanker back at working, lol

fiery turtle
#

lol

steel inlet
#

uAICP

fiery ice
#

the compiler is almost done i think

calm latch
fiery ice
#

๐Ÿ’€

#

5hr budget already run out

#

but seems like it won't stop the current job

#

it's now trying to fix the decompiler

fiery turtle
#

what language are you even doing it in

fiery ice
#

c

fiery turtle
#

ah

fiery ice
#

why?

fiery turtle
#

idk

fiery ice
#

i think it's done?

#

ok nope

#

oh finally

#

after 40 mins

#

(or well 70 in total)

#

@fiery turtle

fiery turtle
#

lol nice

#

u could try shoving it into the uacpi test runner instead of acpica

#

and see if its able to compile stuff

fiery ice
#

hmm

#

lemme check

fiery turtle
#

theres the --asl-compiler argument

#

but it will obv try to pass acpica options to it

fiery ice
#

those will not work, yeah

fiery ice
#

@fiery turtle

#

if you wanna check

fiery turtle
#

Maybe the generated aml is not correct so acpiexec doesn't generate whats expected as the output

fiery ice
#

f

#

any way to add more debug and check if that's the case?

fiery turtle
#

Compile the test file with iasl and your compiler and then run with acpiexec and compare the outputs ig

fiery ice
#

what file is that if you know

#

maybe 2080-buffer-reads?

#

it's the only one without a .aml

#

hmm, 2080 runs fine i think?

#

the writes does not tho

fiery turtle
#

Yeah the 2080 is the autogenerated thing

fiery turtle
#

It failed to parse the output of the answers run

fiery turtle
fiery ice
#

yeah

fiery turtle
#

Compiler bug?

fiery ice
#

idk, maybe?

#

i'll ask clanker tmr

fiery turtle
#

Yeah im pretty sure it is tbh

#

It creates buffer ops incorrectly I think

hallow marten
fiery ice
hallow marten
#

Maybe but rust is agentic language bro

fiery ice
#

XD

hallow marten
#

idk what hes on about

gentle peak
#

qemu-system-x86_64 -cdrom uacpi-linux-iso -serial stdio, add no_console_suspend to kernel args, echo mem > /sys/power/state

#

interestingly it has different behavior with kvm enabled: it does enter suspend but on wakeup it gets stuck at the same point that it gets to with no interaction on tcg

#

or at least sometimes it does? sometimes it behaves the same as tcg

gentle peak
#

nevermind i'm stupid

#

this is just because linux defconfig doesn't have a proper vga driver

#

the "automatic wakeup" is just the interrupt for the enter key being released

#

and it's only "stuck" because userspace uses tty0 instead of ttyS0 and it doesn't know how to resume vga

gentle peak
fiery turtle
#

That explains why his log contained 0 errors

fiery turtle
#

Like ecam shouldn't be usable at that point unless linux fixes the chipset register itself

fiery turtle
#

That would also explain how that regression has gone unnoticed

fiery ice
fiery turtle
#

do u think i know all 2080 values it outputs by heart? KEKW

#

cant u just compare to the iasl output?

fiery ice
#

that's buffer-writes

#

not 2080

fiery turtle
#

thats the 2080

#

just the preparation part

fiery ice
#

ah

#

well, at least it doesn't fail XD

fiery turtle
#

the test idea is:
generate asl that writes every possbile combination of buffer fields
compile it
run it in acpiexec, get what it outputs
run it in uacpi, get what it outputs
make sure they agree

fiery turtle
fiery ice
#

gg

#

this was why btw, lol

fiery turtle
#

makes sense

fiery ice
#

@fiery turtle good progress

#

lol

fiery turtle
#

lol

fiery ice
#

well, it is going so hopefully in a bit we'll have a good version

hallow marten
#

/goal make all tests run

fiery ice
#

67/69 tests completed

fiery ice
#

@fiery turtle

#

it's done

#

all tests complete successfully

fiery turtle
#

Crazy

#

How bad is the compiler code KEKW

fiery ice
#

huuh

#

lemme go see

#

not that bad tbh

#

it could def use some refactoring, but it is not very bad

#

and the file with the most LOCs is just the parser at 3.5k LOC

#

all the others are 1.5k or less

fiery turtle
#

what about the disassembler?

fiery ice
#

lemme test

#

it's broken again, ooooof

#

i think it only updated the compiler for the tests

hallow marten
#

yk it's AI code when it has =======

fiery turtle
#

In this case its actually handrolled uacpi tests

calm latch
#

I think ======= is just very popular in general?

kind mantle
hallow marten
kind mantle
#

Yes it does???

#

I've used LLM monkeys you know

fiery ice
#

@fiery turtle i was stupid, i tried to decompile using compile ๐Ÿ’€

#

it decompiled correctly i think

hallow marten
#

but like

#

i never saw it print("emdashemdashemdash")

#

it's always print("==========")

slim panther
#

yeah that's true

lofty dragon
#

my 2017 project that does ======== was secretly written by an LLM

calm latch
#

Are you secretly a LLM?

fiery ice
#

and i fixed a small bug where strings didn't get copied correctly

fierce kiln
#

it's pretty surprising that people are able to find an uptime window long enough to perform github CI cyberattacks

frank canopy
#

@fiery turtle out of curiosity, do you actually have numbers for perf benefits for keeping aml microps stored inline? or is that just a code thing where in C its easier to make them like that?

fiery turtle
#

But in general id assume there's some benefit since the entire op array can be hot

frank canopy
#

it is probably better for cache true

fiery turtle
#

Sure yeah

#

Gonna make a thread btw?

frank canopy
#

probably when i have more than two ish lines of code

#

its all in the mind only at this point

fiery turtle
#

Fair

frank canopy
#

@fiery turtle how does UACPI_UNRESOLVED_NAME_STRING_OP work? im having trouble understanding what the microcode is even doing for those

#

is it just hijacking it into the nameseg parsing or something?

#

ig the resolution thing would skip past the whole nameseg looking at this more

frank canopy
# fiery turtle Gonna make a thread btw?

would an acpi library go under non-os or is it close enough for my thread to go in this category? not sure if uacpi is effectively grandfathered in or if this is the right category for mine too lol

fiery turtle
#

imo it belongs in an os category

frank canopy
#

๐Ÿ‘ I'll make a thread this afternoon sometime then

fiery turtle
#

I was asleep

frank canopy
gentle peak
#

update on the whole uacpi-linux real hardware suspend serial output thing: first I mistakenly bought both idc10-to-male-db9 and male-db9-to-usb adapters, then I bought a female-db9-to-usb adapter but when it arrived today I noticed that my idc10-to-db9 used the wrong idc10 layout so I bought the correct one today

#

hopefully tomorrow I will be able to get output

fiery turtle
fiery turtle
frank canopy
fiery turtle
#

yep

fiery turtle
gentle peak
#

nah

frank canopy
gentle peak
#

even if they were I'm getting a full refund

fiery turtle
#

so ig drop that case lol

fiery turtle
frank canopy
fiery turtle
#

ye

gentle peak
#

so make sure you get the right one

kindred beacon
#

wtf

fiery turtle
#

once we have fully working uacpi-linux ill make that the reference uacpi test os lol

#

if someone comes in with one of those uacpi bugs again meme

full nimbus
#

i could test this today

#

also wait there are multible difrent IDC10 things??

gentle peak
#

does it have the same issue?

gentle peak
full nimbus
#

oh fuck right trl

#

i did never get to test it working fully

gentle peak
#

I've tested it on two of my three computers and it's worked on one

full nimbus
gentle peak
#

I was troubleshooting for like two hours before I decided to check the pinout of the adapter (I would've done so earlier but the adapter I bought had like 0 documentation so it wasn't immediately obvious where to find the pinout)

#

in fact I never did find any adapter specific pinout documentation

#

I found out about the multiple layouts thing first and then noticed that the packaging said "DTK" (as in "DTK/Intel layout")

gentle peak
#

now to get the actual suspend output

fiery turtle
#

Whats that printout at the top?

gentle peak
#

thats just the stuff from the initramfs

gentle peak
fiery turtle
#
[   75.281499] BUG: kernel NULL pointer dereference, address: 0000000000000008
[   75.288456] #PF: supervisor read access in kernel mode
[   75.293585] #PF: error_code(0x0000) - not-present page
[   75.298720] PGD 10905b067 P4D 10905b067 PUD 10905c067 PMD 0
[   75.304372] Oops: Oops: 0000 [#1] SMP NOPTI
[   75.308556] CPU: 12 UID: 0 PID: 1 Comm: sh Not tainted 7.1.0-rc7-geb39c6a26396 #4 PREEMPT(lazy)
[   75.317322] Hardware name: Gigabyte Technology Co., Ltd. B550M S2H/B550M S2H, BIOS F19d 09/02/2024
[   75.326265] RIP: 0010:handle_control_flow+0x32/0xe0
[   75.331136] Code: 48 8b 8f 38 1d 00 00 4c 8b 87 58 1d 00 00 48 8b 91 08 07 00 00 48 85 d2 74 77 48 8b 87 40 1d 00 00 48 39 c2 75 33 49 8b 70 08 <8b> 50 08 66 81 7e 1a a5 00 0f 45 50 04 89 91 1c 07 00 00 48 8b 87
[   75.349859] RSP: 0018:ffffa5c980013bf0 EFLAGS: 00010246
[   75.355077] RAX: 0000000000000000 RBX: ffff90ff898a6000 RCX: ffff90ff8713c000
[   75.362202] RDX: 0000000000000000 RSI: ffffffff9c088c40 RDI: ffff90ff898a6000
[   75.369326] RBP: 0000000000000015 R08: ffff90ff8713c080 R09: 0000000000000001
[   75.376450] R10: 0000000000000005 R11: 0000000000000000 R12: ffff90ff8713c080
[   75.383572] R13: 0000000000000015 R14: 0000000000000000 R15: ffff90ff8713c000
[   75.390697] FS:  0000000000713198(0000) GS:ffff910ee17a2000(0000) knlGS:0000000000000000
[   75.398772] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   75.404510] CR2: 0000000000000008 CR3: 0000000109054000 CR4: 0000000000750ef0
[   75.411634] PKRU: 55555554
[   75.414341] Call Trace:
[   75.416791]  <TASK>
[   75.418892]  uacpi_execute_control_method+0xea4/0x2660
#

whats the addr2line for this rip?

gentle peak
#

one sec i messed around with a few things between making the usb and today so i don't have the vmlinux for that build anymore

fiery turtle
#

u did disable kaslr right?

#

but the fact that it page faults is good tbh, if it was silently suceeding but still hanging that would be way scarier

gentle peak
#

not via the command line and the build i'm using there is just defconfig + amdgpu builtin

fiery turtle
#

ah yeah then addr2line wont work

gentle peak
#

i'll make a more debugging friendly build and retry

fiery turtle
#

whats interesting is it dies in uacpi control flow opcodes handler

#

handle_control_flow

#

which (should) be a pretty well tested code path

gentle peak
#

also the uacpi entrypoint is uacpi_prepare_for_sleep_state so it can't just be a simple "oh the shim maps arguments incorrectly"

fiery turtle
#

yeah

#

have u sent the dump for this hardware before btw

gentle peak
#

i think so yes

fiery turtle
#

but tbh yours is not the only one that dies on suspend so I doubt its related to a particular aml blob

gentle peak
fiery turtle
#

the former is a good point, i should probably add a way to replace that with a kernel specific function, e.g. do_div on linux

#

the latter i guess is also a config option

gentle peak
#

yeah it's probably a shim thing that the acpica osl.c takes into account

fiery turtle
#

ill add those to my todo list, thanks

fiery turtle
gentle peak
#

for some reason addr2line is saying it's line number 0 wtf

fiery turtle
#

lol it GPFed and page faulted at the same time?

fiery turtle
gentle peak
#

i just passed the sym+x to llvm-addr2line directly

fiery turtle
#

ooh

gentle peak
#

doesn't seem to have worked perfectly though

#
$ llvm-addr2line -e vmlinux 0xffffffff823dce20
/home/monkuous/dev/linux/drivers/acpi/uacpi/lib/../../../../uACPI/source/interpreter.c:4175``` this should be accurate
fiery turtle
#

very strange

gentle peak
#

(i just did objdump -t vmlinux | grep handle_control_flow and added the offset manually)

fiery turtle
gentle peak
#

this should be on uacpi master as of ~30 minutes ago

gentle peak
#

using the correct offset does reproduce the interpreter.c:0 thing (???)

fiery turtle
#

wtf

#

did it per chance jump to an invalid offset or smth

#

which misinterpreted the instruction

gentle peak
#
;         if (op_ctx->op->code == UACPI_AML_OP_BreakOp)
ffffffff823dcbcc: 49 83 c4 08           addq    $0x8, %r12
ffffffff823dcbd0: 4c 89 e0              movq    %r12, %rax
ffffffff823dcbd3: 48 c1 e8 03           shrq    $0x3, %rax
ffffffff823dcbd7: 42 80 3c 30 00        cmpb    $0x0, (%rax,%r14)
ffffffff823dcbdc: 74 08                 je      0xffffffff823dcbe6 <handle_control_flow+0x146>
ffffffff823dcbde: 4c 89 e7              movq    %r12, %rdi
ffffffff823dcbe1: e8 4a bf 55 ff        callq   0xffffffff81938b30 <__asan_report_load8_noabort>
ffffffff823dcbe6: 4d 8b 24 24           movq    (%r12), %r12
ffffffff823dcbea: 49 83 c4 1a           addq    $0x1a, %r12
ffffffff823dcbee: 4c 89 e0              movq    %r12, %rax
ffffffff823dcbf1: 48 c1 e8 03           shrq    $0x3, %rax
ffffffff823dcbf5: 42 0f b6 04 30        movzbl  (%rax,%r14), %eax
ffffffff823dcbfa: 84 c0                 testb   %al, %al
ffffffff823dcbfc: 0f 85 2d 01 00 00     jne     0xffffffff823dcd2f <handle_control_flow+0x28f>
ffffffff823dcc02: 31 c0                 xorl    %eax, %eax
ffffffff823dcc04: 66 41 81 3c 24 a5 00  cmpw    $0xa5, (%r12)
ffffffff823dcc0b: 0f 94 c0              sete    %al
ffffffff823dcc0e: 4c 8d 24 85 04 00 00 00       leaq    0x4(,%rax,4), %r12
ffffffff823dcc16: 4d 01 ec              addq    %r13, %r12
ffffffff823dcc19: 4c 89 e0              movq    %r12, %rax
ffffffff823dcc1c: 48 c1 e8 03           shrq    $0x3, %rax
ffffffff823dcc20: 42 0f b6 04 30        movzbl  (%rax,%r14), %eax``` this is what `llvm-objdump -dS` has to say about it (last instruction is the faulting one)
fiery turtle
#

frame->code_offset = ctx->cur_block->begin; probably this line, because thats the only field at offset 8 there

#

Or rather, this line

        if (op_ctx->op->code == UACPI_AML_OP_BreakOp)
            frame->code_offset = ctx->cur_block->end;
#

Lemme try to look for a dump

#

this i think

gentle peak
#

yeah

#

it's the gigabyte one

#

i don't think i've updated the bios since then so that should be the exact one

#

i could try kgdb?

#

afaik that's like an in kernel gdbserver thing

fiery turtle
#

Wow it executes just ridiculous amounts of AML when u _PTS with != 5

fiery turtle
#

if u could dump the state of the execution_context when it dies

#

ill try to look at the aml in the meantime

hallow marten
fiery turtle
# gentle peak i could try kgdb?

Also, it would really help if u added a printf that printed the method name that it tries to call in prepare_method_call, maybe just using uacpi_namespace_node_generate_absolute_path on the node object

gentle peak
#

lol kgdb isn't very well integrated with the rest of the kernel it seems

#

i was just setting up my breakpoints and when i continued it triggered the watchdog

fiery turtle
pallid lava
#

this problem wouldn't have happened if uacpi were written in rust trollmogus

fiery turtle
#

there isnt even a problem yet KEKW

#

or rather, we dont know what its about

gentle peak
fiery turtle
#

lol

gentle peak
#

at least this time it's not a panic

pallid lava
#

that happens to me

#

rarely though

gentle peak
#

ok it seems like kgdb is just bitrot central

full nimbus
gentle peak
#

it triggered the breakpoint but i didn't get a gdb prompt

#

printf debugging it is

pallid lava
#

btw, my laptop's nvidia gpu has an _EJ0

fiery turtle
#

๐Ÿ’€

pallid lava
#

i am afraid to call it KEKW

gentle peak
#

what is _EJ0

full nimbus
#

What's that again?

pallid lava
#

to eject it

fiery turtle
#

@gentle peak wont be needed

STDERR FOR desktop_gigabyte_technology_b550m_b550m_s2h_a1360a8647f9:
    /home/d-tatianin/Projects/uACPI/source/interpreter.c:4127:48: runtime error: member access within null pointer of type 'struct code_block'
    AddressSanitizer:DEADLYSIGNAL
    =================================================================
    ==310039==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x58ac07f76ba5 bp 0x7ffdb5997690 sp 0x7ffdb5997660 T0)
    ==310039==The signal is caused by a READ memory access.
    ==310039==Hint: address points to the zero page.
        #0 0x58ac07f76ba5 in handle_control_flow /home/d-tatianin/Projects/uACPI/source/interpreter.c:4127
        #1 0x58ac07f84b3c in exec_op /home/d-tatianin/Projects/uACPI/source/interpreter.c:5727
        #2 0x58ac07f88aa7 in uacpi_execute_control_method /home/d-tatianin/Projects/uACPI/source/interpreter.c:6136
        #3 0x58ac07f372f1 in uacpi_eval /home/d-tatianin/Projects/uACPI/source/uacpi.c:779
        #4 0x58ac07fae120 in eval_sleep_helper /home/d-tatianin/Projects/uACPI/source/sleep.c:290
        #5 0x58ac07fae267 in eval_pts /home/d-tatianin/Projects/uACPI/source/sleep.c:309
        #6 0x58ac07fae64d in uacpi_prepare_for_sleep_state /home/d-tatianin/Projects/uACPI/source/sleep.c:386
        #7 0x58ac07f08ddb in enumerate_namespace /home/d-tatianin/Projects/uACPI/tests/runner/test_runner.c:212
        #8 0x58ac07f09849 in run_test /home/d-tatianin/Projects/uACPI/tests/runner/test_runner.c:436
        #9 0x58ac07f0a006 in main /home/d-tatianin/Projects/uACPI/tests/runner/test_runner.c:569
        #10 0x752a55c2a600 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:59
        #11 0x752a55c2a717 in __libc_start_main_impl ../csu/libc-start.c:360
        #12 0x58ac07f049e4 in _start (/home/d-tatianin/Projects/uACPI/tests/runner/build-linux-64bits/test-runner+0x12a9e4) (BuildId: 86cac9384beae0bde0a4b9ac9f3f72e7ac3b01a8)
    
full nimbus
#

๐Ÿ˜ญ

gentle peak
#

oh nice

full nimbus
#

@pallid lava try it

#

For science

pallid lava
#

nah

full nimbus
#

Or at least decompile it maybe?

pallid lava
#

i think it's just calling some off method and that's it

#

powers it down

fiery turtle
#

I added uacpi_prepare_for_sleep_state to the test runner

#

SUMMARY: 681/689 in 105.85s (8 FAILED)

gentle peak
#

and one of those is my dump?

fiery turtle
#

8 segfaults, all on gigabyte B5XX

gentle peak
#

gigabyte W

fiery turtle
gentle peak
#

yeah i think so judging by the name

fiery turtle
#

@fiery ice what was your pc where our uacpi linux died on suspend?

fiery ice
#

Samsung galaxy book

fiery turtle
#

๐Ÿ’€

#

did u send a dump of it?

fiery ice
#

yes

#

in this chat a while ago

#

for the pci stuff

#

if i remember correctly

#

and the suspend one

fiery turtle
fiery turtle
gentle peak
#

weird that it triggered ASAN in the test runner but not in the live kernel

#

nevermind i'm illiterate

fiery turtle
#

lol

gentle peak
# fiery turtle Also, it would really help if u added a printf that printed the method name that...

in case it helps (even if just to check whether you're reproducing the same issue): [ 37.987287] ACPI: PM: Preparing to enter system sleep state S3 [ 37.993268] ACPI: prepare_method_call: \_PTS [ 37.999361] ACPI: prepare_method_call -> OK [ 38.005383] ACPI: prepare_method_call: \_SB_.MPTS [ 38.011909] ACPI: prepare_method_call -> OK [ 38.017929] ACPI: prepare_method_call: \GSA1.MPTS [ 38.024454] ACPI: prepare_method_call -> OK [ 38.030459] ACPI: prepare_method_call: \GSA1.EZV8 [ 38.036995] ACPI: prepare_method_call -> OK [ 38.043028] ACPI: prepare_method_call: \GSA1.EZVH [ 38.049560] ACPI: prepare_method_call -> OK [ 38.055614] ACPI: prepare_method_call: \GSA1.MM01 [ 38.062138] ACPI: prepare_method_call -> OK [ 38.069271] ACPI: prepare_method_call: \GSA1.ISMF [ 38.075827] ACPI: prepare_method_call -> OK [ 38.081898] ACPI: prepare_method_call: \GSA1.HWC0 [ 38.088430] ACPI: prepare_method_call -> OK [ 38.199038] ACPI: prepare_method_call: \GSA1.SMM2 [ 38.205594] ACPI: prepare_method_call -> OK [ 38.211636] ACPI: prepare_method_call: \GSA1.SMB2 [ 38.218171] ACPI: prepare_method_call -> OK [ 38.224179] ACPI: prepare_method_call: \GSA1.SRDY [ 38.230711] ACPI: prepare_method_call -> OK [ 38.236877] ACPI: prepare_method_call: \GSA1.CMPL [ 38.243406] ACPI: prepare_method_call -> OK [ 38.249663] ACPI: prepare_method_call: \GSA1.SMM5 [ 38.256201] ACPI: prepare_method_call -> OK [ 38.262235] ACPI: prepare_method_call: \GSA1.SMB5 [ 38.268768] ACPI: prepare_method_call -> OK [ 38.274773] ACPI: prepare_method_call: \GSA1.SRDY [ 38.281291] ACPI: prepare_method_call -> OK [ 38.287467] ACPI: prepare_method_call: \GSA1.CMPL [ 38.293992] ACPI: prepare_method_call -> OK [ 38.300340] ACPI: prepare_method_call: \GSA1.CMN1 [ 38.306879] ACPI: prepare_method_call -> OK [ 38.313070] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI

fiery turtle
#

thanks

fiery turtle
gentle peak
#

where do i add a printf to trace returns

fiery turtle
#

hmm good Q

#

technically its ctx_reload_post_ret but there isnt a trivial way to extract the top most code block, which is the bounds of the method, which contains the method node

gentle peak
#

i mean i don't need to get the method node, if i just make sure to trace every return i can look at the prepare_method_call log to see what it returned from

fiery turtle
#

ah true

gentle peak
fiery turtle
#

huh ofc msvc doesnt catch it for some reason

uACPI][ERROR] loop time out after running for 3 seconds
[uACPI][ERROR] aborting method invocation due to previous error: hanging AML while loop
[uACPI][ERROR]     #0 in \GSA1.SRDY()
[uACPI][ERROR]     #1 in \GSA1.SMB2()
[uACPI][ERROR]     #2 in \GSA1.SMM2()
[uACPI][ERROR]     #3 in \GSA1.ISMF()
[uACPI][ERROR]     #4 in \GSA1.EZVH()
[uACPI][ERROR]     #5 in \GSA1.EZV8()
[uACPI][ERROR]     #6 in \GSA1.MPTS()
[uACPI][ERROR]     #7 in \_SB_.MPTS()
[uACPI][ERROR]     #8 in \_PTS()
[uACPI][ERROR] error while evaluating _PTS: hanging AML while loop
gentle peak
#

so it's after returning from \GSA1.ISMF

#

aka it's in \GSA1.EZVH

fiery turtle
gentle peak
#

that doesn't even have break

#

i might be incorrect then

fiery turtle
#

yeah strange

#

maybe u misread the output

#

huh --log-level=debug gets rid of the crash??

calm latch
#

Do other operating systems with uACPI and S3 sleep work? trl

gentle peak
#

something really weird is going on here

fiery turtle
gentle peak
#

yeah

fiery turtle
#

like its not even a compile time log level change

#

lemme try valgrind maybe

#

Yeah i managed to catch it with break interpreter.c:4118 if strcmp(why, "\GSA1.EZVH") == 0

fiery turtle
#

it has Switch/Case

#

those are macros which are compiled down to while and breaks

gentle peak
#

ahh

#

does the aml decompiler have a "literal" option?

#

seems like it would be useful for stuff like this

fiery turtle
#

it doesnt KEKW

gentle peak
#

damn

fiery turtle
#

@gentle peak can u try this fix locally

@@ -2103,11 +2107,8 @@ static void frame_reset_post_end_block(struct execution_context *ctx,
     code_block_array_pop(&frame->code_blocks);
     ctx->cur_block = code_block_array_last(&frame->code_blocks);

-    if (type == CODE_BLOCK_WHILE) {
-        frame->last_while = find_last_block(&frame->code_blocks, type);
-    } else if (type == CODE_BLOCK_SCOPE) {
-        update_scope(frame);
-    }
+    frame->last_while = find_last_block(&frame->code_blocks, CODE_BLOCK_WHILE);
+    update_scope(frame);
 }
#

i dont understand entirely why thats needed yet but it seems to fix it

gentle peak
#

successfully went to sleep and woke again!

fiery turtle
#

crazy stuff

#

@fiery ice can you try on your hardware with this fix applied?

fiery ice
#

@hallow marten

fiery turtle
#

very cool

#

its the most complex aml ive seen

#

it calls like 20 methods deep

#

at peak

gentle peak
#

note that performance is not representative, this build has kasan and ubsan enabled

fiery ice
#

hmm, i may xorriso it then

gentle peak
#

why bother unless you actually use a dvd

hallow marten
#

so everything works?

#

nice

fiery ice
#

i use ventoy

hallow marten
#

i am a genius

gentle peak
fiery turtle
#

yeah it works now

#

theres a genuine uacpi bug with pointer re-hydration after dynamic array realloc

gentle peak
fiery turtle
#

it would only manifest in deeply nested call stacks

gentle peak
fiery turtle
#

still faster than nyaux ๐Ÿ’€

hallow marten
#

i have a script to generate an iso locally but you could ask a clanker if you dont want to figure it out

gentle peak
fiery turtle
#

thats the real fix i think

@@ -4235,6 +4244,9 @@ static void refresh_ctx_pointers(struct execution_context *ctx)
     ctx->cur_op_ctx = op_context_array_last(&frame->pending_ops);
     ctx->prev_op_ctx = op_context_array_one_before_last(&frame->pending_ops);
     ctx->cur_block = code_block_array_last(&frame->code_blocks);
+
+    frame->last_while = find_last_block(&frame->code_blocks, CODE_BLOCK_WHILE);
+    update_scope(frame);
 }
#

basically pointer hydration was missing

#

ill add a helper for this i think, since theres some duplication going on there

#

and another callsite where hydration was missing but it never manifested

#

i guess normal aml execution is usually not as deeply nested as sleeping/suspend helpers stuff

full nimbus
fiery turtle
#

lol

fiery ice
#

@gentle peak what was the cmd to sleep?

gentle peak
#

echo deep > /sys/power/mem_sleep && echo mem > /sys/power/state

fiery ice
#

thx

fiery turtle
hallow marten
fiery ice
#

ehm, you sure it works?

gentle peak
#

on my pc it does

fiery turtle
gentle peak
#

what happens on yours?

fiery ice
#

not on mine

hallow marten
#

What happens

fiery turtle
#

what happens?

#

lol

fiery ice
#

still the blue led

#

and no response from the keyboard

hallow marten
#

Logs would be nice

fiery ice
#

huuh

#

how

gentle peak
#

serial

fiery turtle
#

it boots but suspend still dies?

fiery ice
fiery ice
gentle peak
#

if you have a serial port and use the 2nd boot option (Linux uACPI - test shell on serial (for debugging suspend)) you get serial output through suspend

hallow marten
#

Can't wait for the uACPI patches to be in Gentoo repos so now people that configure their own kernels can use it

full nimbus
fiery ice
#

i don't have any serial adapter

full nimbus
#

If you have a USB C DRD port

fiery turtle
#

lemme try your aml blob

fiery turtle
fiery ice
#

sec

#

hmm, i tought i did

#

that message was for my main pc

mortal yoke
#

ig I can also try this on my pc for fun KEKW though I don't think it has particularly cursed aml (at least in terms of errors)

fiery turtle
#

that would be nice, if it dies then at least its a pc with a com

fiery ice
#

#osdev-misc-0 message

#

i think it was this one

#

lol

fiery turtle
#

hmm ok doesnt segfault here but it doesnt get far in _PTS because my test runner is not real hardware

[uACPI][ERROR] loop time out after running for 3 seconds
[uACPI][ERROR] aborting method invocation due to previous error: hanging AML while loop
[uACPI][ERROR]     #0 in \_SB_.QPTS()
[uACPI][ERROR]     #1 in \_SB_.SPTS()
[uACPI][ERROR]     #2 in \_PTS()
[uACPI][ERROR] error while evaluating _PTS: hanging AML while loop
#
  While (!(PBTN & 0x02))
  {
      Sleep (0x64)
  }
#

genius hardware

fiery ice
#

XD

mortal yoke
gentle peak
#

what gpu model do you have? the only drm modules i have compiled in are simpledrm, i915, and amdgpu

#

and the only firmware included in the initramfs is amdgpu

mortal yoke
#

rtx 4070 ti s, yeah I guess then that makes sense

fiery turtle
#

@fiery ice whats the model of that laptop?

fiery ice
#

i5 1135g7

fiery turtle
#

it does have a

Device (UAH0)
{
    Name (_DDN, "SerialIoUart0")  // _DDN: DOS Device Name
    Name (_UID, "SerialIoUart0")  // _UID: Unique ID
    Method (_HID, 0, NotSerialized)  // _HID: Hardware ID

hmm maybe its possible to capture those

fiery turtle
#

i wonder where the hell that outputs to

fiery ice
#

idk

#

i don't have any port

fiery turtle
#

its probably like

#

raw motherboard pinouts

fiery ice
#

it didn't even have headers

#

from what i could see

fiery turtle
#

damn, I guess we'll have to wait for more test subjects that can repro this nooo

fiery turtle
#

yeah perhaps

full nimbus
#

i do have a serial port

#

il test tomorrow afternoon

#

i gotta finish up riscv/la64 stuff

fiery turtle
#

Thanks, hopefully maybe we get a repro

full nimbus
#

dm me an iso incase i wakeup at 2am again so i can get out of the way then too

fiery turtle
#

I realized the hydration issue was just a stupid design decision, that piece of code doesnt really need to hold a pointer to the array, it just needs to know the index

#

which is what it does now

#

ill make a test case for it, also ill make all large tests run _PTS(3) on top

fiery turtle
#

lets see if CI likes it

#

me when i thought my code was well tested but then I meet firmware devs

full nimbus
#

"I have a firm belief that most firmware developers are not actually humans, but are instead caged rodents fed a solid diet of crack cocaine. Because that would explain a lot."
- Linus Torvalds

hallow marten
fiery turtle
#

yeah this one is completely my fault

#

but to actually repro it you'd need like really complex aml

#

ill see if i can make clanker come up with a minimal repro so i can use it for a standalone test

#

so far the linux experiment has been extremely useful

#

exercising code paths that hobby kernels never touch and uncovering edge cases

hallow marten
#

@anthropic sponsor us

fiery turtle
#

real

hallow marten
#

we could get acquired by spacex

#

@grok acquire us

full nimbus
fiery turtle
#

rok is this true

hallow marten
#

I was saying spacex cuz they just bought cursor

full nimbus
#

They also make a hypervisor

#

Could be useful to buy this

lethal trench
hallow marten
#

spacex is cooler

#

cuz we'd be at the same company as grok

full nimbus
hallow marten
#

which is the greatest AI ever

full nimbus
#

What if we integrated grok into uACPI to dynamically handle complex AML?

hallow marten
#

we could just remove the interpreter entirely and just ask grok

lethal trench
#

grok what on earth were they thinking when they made this?

full nimbus
fiery turtle
lethal trench
#

๐Ÿ˜ญ

fiery turtle
#

github knows whats up

pallid lava
#

lmO

fiery turtle
#

@gentle peak so the fix I gave u was more of a random bullshit go type of fix, I now added a proper one to master + tests, would be nice if you could do a quick re-test once you have the time

gentle peak
#

made this quick little project

#

wonder whether it'd work on real hardware

fiery turtle
#

Wtf thats crazy

pallid lava
#

how long did it take

fiery turtle
#

Did you make a bochs gpu driver also

gentle peak
gentle peak
fiery turtle
#

Does it do the wake gpe and power resource stuff also?

#

Or PCI bar restoration etc

gentle peak
#

i currently do not do anything with acpi on wake

#

the only thing i do on wake is restore cpu state, irq controller state, and reinit serial

fiery turtle
#

Yeah but when suspending, how do you configure the devices for wake?

#

That are allowed to wake you

gentle peak
#

oh i don't do anything with that

#

this is the entire acpi side of entering suspend

#

(arch_prepare_suspend does the waking vector stuff)

fiery turtle
#

Btw uacpi handles tts for you I think

#

So technically u dont need that

fiery turtle
gentle peak
#

it handles SST but not TTS

fiery turtle
#

Ah wait yeah, what was TTS again

gentle peak
#

no idea

fiery turtle
#

Did u get that from linux?

gentle peak
#

linux does do it yes but i got it from the spec

fiery turtle
gentle peak
#

tried it on real hardware, for some reason serial only works if it's a warm boot (???) but more importantly it doesn't enter any sleep states correctly

#

not even S5

fiery turtle
#

F

gentle peak
#

oh nevermind it just takes a while

fiery turtle
#

thanks for testing!

fiery turtle
gentle peak
#

the allocator should be fine

fiery turtle
#

hmm, usually at least S5 should be instant

gentle peak
#

it gets stuck in uacpi_enter_sleep_state_simple before disabling interrupts (since i still get power button! prints)

fiery turtle
#

thats quite interesting

gentle peak
#

might just be a scheduler bug or something, the way i designed this isn't exactly conventional (it has no idle thread)

fiery turtle
#

lol, what does it do if theres nothing to do?

gentle peak
#

this is fully cooperative scheduling, there's no preemption (whether from priority or timeslice stuff)

#

i could see firmware developers relying on the timeslice of the thread executing aml expiring or whatever

#

like maybe they do Stalls to wait for a software event idk

fiery turtle
#

could be

gentle peak
median crest
#

Wtf

#

Insane

kindred beacon
#

fucking legend

gentle peak
#

what the fuck, there's an actual noticeable performance improvement in glxgears fps of all things

median crest
#

Year of the uacpi linux desktop

full nimbus
#

AUR package for linux-uacpi when?

gentle peak
#

uacpi hovers around 20k fps, acpica around 17k

full nimbus
#

I've heard before somewhat

gentle peak
#

it's always been very consistent for me

full nimbus
calm latch
#

Mainline kernel when trl

fiery turtle
#

I wonder if there's some actual gpe traffic that uacpi handles faster

fiery turtle
gentle peak
#

it might just be the changes made between the mainline kernel arch linux uses and the git master that uacpi-linux is based on

fiery turtle
#

Yeah could be ofc

#

Although mainline arch is usually cutting edge kernel

hallow marten
#

It's probably more of a kernel thing than acpi lol

fiery turtle
#

Yep

flat badge
#

or some PM difference where either uACPI or acpica doesn't work correctly

fiery turtle
#

Yeah that could be a reason too

flat badge
#

modern intel chipsets cannot run both the CPU and all chipset devices at maximal performance settings at the same time

full nimbus
flat badge
#

you can dump cat /sys/bus/pci/devices/*/power/runtime_status

#

or similar to check if devices are properly being suspended

#
  • check dmsg for PM issues
gentle peak
#

anyway i did a few more random perf measurements ACPICA: Time-to-boot 18.50 s (started when pressing enter in GRUB, stopped when plasma-login-manager became visible) GLXGears FPS 17k-18k vkmark score 17193 Time-to-suspend 2.55 s (started when clicking sleep button in plasma launcher, stopped when fans stopped spinning) Time-to-wake 6.30 s (started when pressing power button, stopped when plasma lock screen visible) uACPI: Time-to-boot 16.63 s GLXGears FPS 19k-20k vkmark score 17758 Time-to-suspend 2.44 s Time-to-wake 5.78 s

#

the time measurements were done by hand so there's a fairly large margin of error there

quaint lotus
gentle peak
#

i wasn't the one doing the porting

quaint lotus
#

who was?

gentle peak
#

abbix with claude

quaint lotus
#

hmm, did you all review the code?

#

and like fix it

#

if so Iโ€™d honestly like seeing this getting into mainstream kernel

gentle peak
#

my involvement was limited to getting serial output from a device where suspend didn't work initially and using the kernel with an actual distro instead of just a busybox initramfs

#

surprisingly i don't think any of the issues we've encountered so far have been with the llm generated code

#

they've all been uacpi bugs that haven't been encountered before because of the limited scope of hobby kernels

quaint lotus
#

Iโ€™d totally use that

hallow marten
gentle peak
#

@fiery turtle if you want some more stuff for acpidumps, this is from an MSI Venture 14 AI A2HMG-021NL laptop

#

i removed MSDM ofc but still

fiery turtle
#

Did you test the distro on it? meme

#

Is that your new laptop or smth?

gentle peak
#

yeah it's my new laptop

fiery turtle
#

ah nice

#

it probably doesnt have S3, only S2 idle

gentle peak
#

I did try booting uacpi-linux but defconfig lacks a lot of the modules needed to be usable so I don't know how functional it really is

gentle peak
#

although s2idle is selected by default

fiery turtle
#

ah

gentle peak
fiery turtle
#

ah

#

I guess stealing the config from some arch distro is the way

gentle peak
#

worth noting that this laptop isn't perfect for linux regardless

fiery turtle
#

really?

gentle peak
#

even on the regular kernel installed by the distro I get driver errors from i915, aml errors, etc

#

and I had to disable the Intel vmd controller in the bios before I could really do anything

fiery turtle
#

Can you show what the AML errors are btw?

fiery turtle
gentle peak
pallid lava
#

omg i was just yesterday reading how linux actually assigns iommu groups, and for vmd there is a special case

gentle peak
#

nvme io kept timing out randomly and for some reason the system could only even get into bash if I replaced the default loglevel=3 quiet with loglevel=7

fiery turtle
#

lmao

gentle peak
#

and no matter what it couldn't get into a graphical environment

pallid lava
#

is there any chance your distribution doesn't have compiled in support for vmd?

gentle peak
# fiery turtle Can you show what the AML errors are btw?
$ sudo dmesg | grep 'ACPI Error'
[    0.275562] ACPI Error: Missing argument(s) for method [RUCC] (20251212/dsmethod-486)
[    0.275565] ACPI Error: Aborting method \_SB.PC00.XHCI.RHUB.HS02._PLD due to previous error (AE_AML_TOO_FEW_ARGUMENTS) (20251212/psparse-529)
[    0.289605] ACPI Error: Missing argument(s) for method [RUCC] (20251212/dsmethod-486)
[    0.289608] ACPI Error: Aborting method \_SB.PC00.TXHC.RHUB.SS04._PLD due to previous error (AE_AML_TOO_FEW_ARGUMENTS) (20251212/psparse-529)
[    0.541321] ACPI Error: Missing argument(s) for method [RUCC] (20251212/dsmethod-486)
[    0.541325] ACPI Error: Aborting method \_SB.PC00.TXHC.RHUB.SS04._PLD due to previous error (AE_AML_TOO_FEW_ARGUMENTS) (20251212/psparse-529)
[    0.541334] ACPI Error: Missing argument(s) for method [RUCC] (20251212/dsmethod-486)
[    0.541336] ACPI Error: Aborting method \_SB.PC00.TXHC.RHUB.SS04._UPC due to previous error (AE_AML_TOO_FEW_ARGUMENTS) (20251212/psparse-529)
[    0.541346] ACPI Error: Missing argument(s) for method [RUCC] (20251212/dsmethod-486)
[    0.541347] ACPI Error: Aborting method \_SB.PC00.TXHC.RHUB.SS04._PLD due to previous error (AE_AML_TOO_FEW_ARGUMENTS) (20251212/psparse-529)
[    0.543802] ACPI Error: Missing argument(s) for method [RUCC] (20251212/dsmethod-486)
[    0.543803] ACPI Error: Aborting method \_SB.PC00.XHCI.RHUB.HS02._PLD due to previous error (AE_AML_TOO_FEW_ARGUMENTS) (20251212/psparse-529)
[    0.543809] ACPI Error: Missing argument(s) for method [RUCC] (20251212/dsmethod-486)
[    0.543810] ACPI Error: Aborting method \_SB.PC00.XHCI.RHUB.HS02._UPC due to previous error (AE_AML_TOO_FEW_ARGUMENTS) (20251212/psparse-529)
[    0.543818] ACPI Error: Missing argument(s) for method [RUCC] (20251212/dsmethod-486)
[    0.543819] ACPI Error: Aborting method \_SB.PC00.XHCI.RHUB.HS02._PLD due to previous error (AE_AML_TOO_FEW_ARGUMENTS) (20251212/psparse-529)
gentle peak
#

from what i can tell vmd is some storage thing so it shouldn't have been able to find the rootfs without supporting it

pallid lava
#

no idea, the thing i was looking was gated behind a config_vmd

fiery turtle
#

maybe because those errors never show up in NT

#

but it definitely fails in this case also

gentle peak
#

or maybe they do and they just didn't care

fiery turtle
#

its not super important

#

im not even sure what it needs the physical location of usb ports for

gentle peak
pallid lava
#

well trl who knows

fiery turtle
gentle peak
#

why are firmware devs like this

fiery turtle
#

wtf

#

why do they even shove this vmd shit into consumer laptops

#

who even uses that

gentle peak
#

i mean i'm not sure this technically is a consumer laptop

#

like i'm a consumer yes but still

fiery turtle
#

oh its not?

gentle peak
#

like i said i'm not sure

fiery turtle
#

is it supposed to be a corporate laptop?

gentle peak
#

idk i got the vibe that it's supposed to be suitable as a corporate laptop in any case

fiery turtle
#
The MSI Venture 14 AI A2HMG-021NL is a premium, AI-ready business and productivity laptop. Featuring an Intel Core Ultra 7 processor, Copilot+ support, and 32GB of RAM, it easily powers through demanding office workflows, multitasking, and media editing on its sharp 14-inch OLED display
#

clanker opinion KEKW

pallid lava
#

copilot+ support

fiery turtle
#

since its ai-ready i expect you to vibecode all of your stuff from now on

gentle peak
#

i don't think the npu has done a single thing since i got the laptop a month ago

#

the first thing i did was do a clean install and i don't really use any ai ever

kindred beacon
#

you forgot

#

NPU == no purpose unit

fiery turtle
#

what the hell even is copilot+

#

if i knew my hardware supported it, first thing id do is find out how to uninstall it

gentle peak
#

decided to compile uacpi-linux with the arch .config, wonder how long it'll take

fiery turtle
#

its a fast laptop, probably not much

#

Btw why did you pick this one specifically

gentle peak
#

filter by high refresh rate and >=32gb ram, sort by price low to high, look at cpu benchmarks for everything below like 1300eur

fiery turtle
#

Does refresh rate really matter to you that much?

gentle peak
#

i got used to 180 Hz and now whenever i try to use 60 Hz i cannot help but notice the roughness of basically all animations

#

this one is 144 Hz which is enough to feel smooth to me

full nimbus
#

You get used to it if you use a 60hz monitor for like a day or two

gentle peak
#

oh yeah definitely but i didn't want to be switching between the two all the time

fiery turtle
#

yeah

#

one of my monitors is 144, and the other is 60

#

over time i stopped noticing the difference at all lol

full nimbus
#

I can't notice the difference between my 75hz desktop and 120hz phone

gentle peak
#

...huh ```
ERROR: modpost: "acpi_gbl_FADT" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "acpi_gbl_FADT" [sound/soc/intel/avs/snd-soc-avs.ko] undefined!

fiery turtle
#

is that the missing EXPORT_SYMBOL thing again?

gentle peak
#

yeah

#

simple enough to fix

fiery turtle
#

yeah should be

flat badge
#

Afaict the main use cases for NPUs etc are for example doing speed recognition locally such that you don't have to send audio to a remote server

gentle peak
#

it failed to mount /boot from fstab due to a timeout

#

journalctl shows a bunch of udevd hung worker warnings

#

then after a while there's this

#

then a bunch of kernel hung task warnings

#

there's also this earlier in boot which might be related?

#

for what it's worth though the aml errors I had with acpica disappeared

gentle peak
#

because root is on the same device and that's already mounted successfully

#

and io on root works without any timeouts

#

if I disable timeout and let it wait forever it boots successfully

fiery turtle
fiery turtle
#

Or why it would hang somewhere also

gentle peak
#

I'm guessing those all involve i2c in some way

fiery turtle
#

I guess first thing id investigate is that i2c error message, its possible clanker fucked up the handler installation since there's some differences in api there between acpica and uacpi

#

But the errors it produces are really strange

gentle peak
# fiery turtle Huh lol

my thinking is that after the hung task warnings the kernel does something to free up whatever mount is blocking on but that takes longer than the timeout

fiery turtle
#

Yeah maybe

gentle peak
fiery turtle
#

I think it's acpi_install_address_space_handler family of helpers

fiery turtle
gentle peak
#

id guess that has something to do with the i2c stuff as well

fiery turtle
#

yeah probably

gentle peak
#

like maybe whatever's holding the mutex is waiting on something that would get done by the i2c space handler

fiery turtle
#

could be

#

But also it wasnt hanging before you recompiled with the new config right? Did that have i2c disabled or smth

gentle peak
#

well the old config was just defconfig with uapci, amdgpu, and nvme

#

I doubt it had i2c and, even if it did, the specific i2c device used here

fiery turtle
#

hm yeah defconfig probably didnt have it

gentle peak
#

added a few printfs

fiery turtle
gentle peak
#

well the very next line below that is a null check

fiery turtle
#

ah right

#
    /* Check for an existing internal object */

    obj_desc = acpi_ns_get_attached_object(node);
    if (obj_desc) {
        /*
         * The attached device object already exists. Now make sure
         * the handler is not already installed.
         */
        handler_obj = acpi_ev_find_region_handler(space_id,
                              obj_desc->
                              common_notify.
                              handler);

        if (handler_obj) {
            if (handler_obj->address_space.handler == handler) {
                /*
                 * It is (relatively) OK to attempt to install the SAME
                 * handler twice. This can easily happen with the
                 * PCI_Config space.
                 */
                status = AE_SAME_HANDLER;
                goto unlock_and_exit;
            } else {
                /* A handler is already installed */

                status = AE_ALREADY_EXISTS;
            }

            goto unlock_and_exit;
        }
    } else {

ACPICA has this check also

#

so something about that handle must be wrong or something?

gentle peak
#

it does seem to be using the same handle every time

fiery turtle
#

hmm very interesting

#

like that would definitely fail under acpica

#

maybe the way clanker made parent resolution work is wrong

gentle peak
#

I should check whether this happens with the normal kernel

fiery turtle
#

oh yeah true, try replacing the uacpi config with normal acpica

#

and keep these logs

gentle peak
#

I'll need to replicate the logs in drivers/acpi/acpica but yeah

fiery turtle
#

u could probably put them directly in i2c-core-acpi.c?

gentle peak
#

oh true

#

but then i'll have to properly recompile the module and regenerate the initramfs instead of just copying bzimage

fiery turtle
gentle peak
#

okay this is weird

#

on acpica there's only one call to acpi_install_address_space_handler

#

oh nevermind they're just spread out more

fiery turtle
#

hows the handle value looking

gentle peak
#

they are all on different handles though

fiery turtle
#

yeah sounds like clanker fucked something up

gentle peak
#

and there's still not as many calls as with uacpi

#

there's only 7 where uacpi logged 9

fiery turtle
#

could be that it retries some stuff in case it fails from different code paths

gentle peak
#

this is very strange

#

the specific i2c device objects that fail to install their space handlers on uacpi never even try to do so on acpica

fiery turtle
#

wtf

gentle peak
#
$ sudo dmesg | grep 'space handler'
[    1.116434] i2c i2c-0: installing i2c space handler, parent=0xffff8aff01d51410
[    1.121845] i2c i2c-1: installing i2c space handler, parent=0xffff8aff0e781810
[    1.760916] i2c i2c-2: installing i2c space handler, parent=0xffff8aff027870d0
[    1.885632] i2c i2c-11: installing i2c space handler, parent=0xffff8aff1cc87000
[    1.885819] i2c i2c-12: installing i2c space handler, parent=0xffff8aff1cc8a000
[    1.885888] i2c i2c-13: installing i2c space handler, parent=0xffff8aff1cc8a800
[    1.885948] i2c i2c-14: installing i2c space handler, parent=0xffff8aff1cc8e800
[    4.358038] i2c i2c-15: installing i2c space handler, parent=0xffff8aff0312e0d0```
#

and if you look at the uacpi logs its i2c 3-10 that fail

fiery turtle
#

maybe the way it checks for _STA on those is somehow returning the wrong value? Although that still doesnt explain the same parent handle

#

you should be able to generate the absolute path to the device object btw i think

gentle peak
#

when logging what's causing the early exit: Jun 18 10:48:35 archlinux kernel: ACPI Error: Unknown exception code: 0xFFFFFFED (20251212/utexcep-41) Jun 18 10:48:35 archlinux kernel: i2c i2c-3: i2c space handler: acpi_bus_attach_private_data failed: UNKNOWN_STATUS_CODE Jun 18 10:48:35 archlinux kernel: ACPI Error: Unknown exception code: 0xFFFFFFED (20251212/utexcep-41) Jun 18 10:48:35 archlinux kernel: i2c i2c-4: i2c space handler: acpi_bus_attach_private_data failed: UNKNOWN_STATUS_CODE Jun 18 10:48:35 archlinux kernel: ACPI Error: Unknown exception code: 0xFFFFFFED (20251212/utexcep-41) Jun 18 10:48:35 archlinux kernel: i2c i2c-5: i2c space handler: acpi_bus_attach_private_data failed: UNKNOWN_STATUS_CODE Jun 18 10:48:35 archlinux kernel: ACPI Error: Unknown exception code: 0xFFFFFFED (20251212/utexcep-41) Jun 18 10:48:35 archlinux kernel: i2c i2c-6: i2c space handler: acpi_bus_attach_private_data failed: UNKNOWN_STATUS_CODE Jun 18 10:48:35 archlinux kernel: ACPI Error: Unknown exception code: 0xFFFFFFED (20251212/utexcep-41) Jun 18 10:48:35 archlinux kernel: i2c i2c-7: i2c space handler: acpi_bus_attach_private_data failed: UNKNOWN_STATUS_CODE Jun 18 10:48:35 archlinux kernel: ACPI Error: Unknown exception code: 0xFFFFFFED (20251212/utexcep-41) Jun 18 10:48:35 archlinux kernel: i2c i2c-8: i2c space handler: acpi_bus_attach_private_data failed: UNKNOWN_STATUS_CODE Jun 18 10:48:35 archlinux kernel: ACPI Error: Unknown exception code: 0xFFFFFFED (20251212/utexcep-41) Jun 18 10:48:35 archlinux kernel: i2c i2c-9: i2c space handler: acpi_bus_attach_private_data failed: UNKNOWN_STATUS_CODE Jun 18 10:48:35 archlinux kernel: ACPI Error: Unknown exception code: 0xFFFFFFED (20251212/utexcep-41) Jun 18 10:48:35 archlinux kernel: i2c i2c-10: i2c space handler: acpi_bus_attach_private_data failed: UNKNOWN_STATUS_CODE

fiery turtle
#

huh

fiery turtle
#

thats on acpica right?

gentle peak
#

yeah

fiery turtle
#

acpi_bus_attach_private_data calls acpi_attach_data, which is supposed to attach a user pointer to an aml namespace node, but uacpi doesnt even have a mechanism like that so it uses a clanker designed hash table

#

but why it would fail on acpica is beyond me

#

and with an UNKNOWN_STATUS_CODE

#

maybe log it as an int

gentle peak
#

oh the unknown_status_code is because acpi_bus_attach_private_data blindly returns -ENODEV instead of the actual acpi status

#

i'm adding a printf to acpi_bus_attach_private_data now

gentle peak
#

AE_ALREADY_EXISTS

fiery turtle
#

๐Ÿ’€

#

how the hell does it already exist for a unique i2c object

#

Does the clanker rolled hash table attachment check for duplicates also?

gentle peak
#

nope

fiery turtle
#

Ah, that must be it

#

Ill add the native uacpi_namespace_node_attach_user_data in the next version anyway

gentle peak
#

these are the specific semantics acpica has

#

so you can have multiple data things on the same node if they have different handlers

fiery turtle
#
void acpi_bus_private_data_handler(acpi_handle handle,
                   void *context)
{
    return;
}
EXPORT_SYMBOL(acpi_bus_private_data_handler);
#

very important

gentle peak
#

in this case yes but i'd like to actually be correct

fiery turtle
#

yeah ofc

gentle peak
#

this should work i hope

fiery turtle
#

yeah looks correct

gentle peak
#

oh wait no i think i'm overriding e there

fiery turtle
#

ah lol

#

yes

gentle peak
#

also I just realized: those functions errored on acpica anyway for those objects, they just did so silently, so this can't be the underlying issue

fiery turtle
#

maybe something attached some data to them earlier?

gentle peak
#

no I mean that the whole i2c failed to attach thing can't be causing all the other issues I experienced

#

the timeouts, the lack of networking, touchpad, etc

fiery turtle
#

ah, right

fiery turtle
gentle peak
#

yes

fiery turtle
#

maybe its not related to i2c afterall

gentle peak
#

also backlight brightness modification isn't working

fiery turtle
#

yeah something really cursed is going on

full nimbus
fiery turtle
#

@gentle peak btw are you going to try to debug uacpi-linux hangs & other weird behavior on that laptop further? Id be happy to help where I can, would be cool to get that thing working

gentle peak
#

maybe in the future but not any time soon

fiery turtle
#

no worries

#

got some other stuff going atm?

fiery turtle
#

Wake up babe, new uACPI feature dropped. AML backtraces are now more detailed, they include the offset within the method as well as the opcode that caused the failure. This should make pinpointing real hardware problems easier.

Some examples:

[uACPI][ERROR] aborting method invocation due to previous error: hanging AML while loop
[uACPI][ERROR]     #0 in \HANG()+14/14 at WhileOp
[uACPI][ERROR] attempted access to deleted (<unknown>) operation region \CAS4.MYRE: invalid argument
[uACPI][ERROR] aborting method invocation due to previous error: invalid argument
[uACPI][ERROR]     #0 in \CAS4()+47/47 at StoreOp
[uACPI][ERROR] unable to perform a read from field 00007385aade1d50: parent opregion gone
[uACPI][ERROR] aborting table load due to previous error: invalid argument
[uACPI][ERROR]     #0 in \()+126/137 at DerefOfOp
[uACPI][ERROR] aborting method invocation due to previous error: reached maximum AML call stack depth
[uACPI][ERROR]     #0 in \HANG()+9/9 at MethodCallOp
[uACPI][ERROR]     #1 in \HANG()+9/9 at MethodCallOp
[uACPI][ERROR]     #2 in \HANG()+9/9 at MethodCallOp
[uACPI][ERROR]     #3 in \HANG()+9/9 at MethodCallOp
[uACPI][ERROR] attempted to perform an invalid implicit cast (String -> Package)
[uACPI][ERROR] aborting table load due to previous error: incompatible AML object type
[uACPI][ERROR]     #0 in \()+372/775 at StoreOp
[uACPI][ERROR] Load: table size 17 is too small
[uACPI][ERROR] aborting table load due to previous error: invalid table length
[uACPI][ERROR]     #0 in \()+56/370 at LoadOp
[uACPI][INFO] dynamic load of 'DSDT' (OEM ID 'uTEST' OEM Table ID 'TESTTABL')
[uACPI][ERROR] aborting table load due to previous error: invalid table length
[uACPI][ERROR]     #0 in \()+145/370 at LoadTableOp
#

(not yet merged but going to be there for 6.0)

hollow scaffold
#

pretty!

slim panther
#

@fiery turtle uacpi has been shilled to geist

hallow marten
#

imagine fuchsia gets uACPI