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

1 messages Ā· Page 71 of 1

hallow marten
#

then linux

slim panther
#

huge

hallow marten
#

what IRC client do you use btw?

#

is it konversation?

full nimbus
#

This looks like the lounge?

hallow marten
#

what

full nimbus
#

Atleast the color scheme and layout

full nimbus
slim panther
full nimbus
#

Called it

slim panther
#

it's a web client

hallow marten
#

I like weechat

slim panther
#

on zinnia i use irssi

#

or sometimes thunderbird but it kinda sucks

jaunty fox
#

they can mount a smear campaign against ACPICA

#

as OGs of this thread know there is more than enough fuel for that fire

full nimbus
#

We don't even need to smear them

#

Just tell the truth

fiery turtle
#

Who is that?

jaunty fox
#

just ask the guy with the corvette

full nimbus
#

ACPICA also killed my parents

fiery turtle
#

the acpica maintainer corvette incident

slim panther
fiery turtle
#

zircon?

jaunty fox
hallow marten
pallid lava
#

uacpi first got into react

vocal geyser
pallid lava
#

then it has to get into fuchsia, linux

#

finally windows

fiery turtle
pallid lava
#

uacpi becomes the new reference

full nimbus
pallid lava
vocal geyser
hallow marten
#

we should tell israel ACPICA is anti-semitic

#

they'll handle it in no time

full nimbus
#

True

#

😭

vocal geyser
#

šŸ™

pallid lava
#

wait

#

geist is in this server

#

now I remember

fiery turtle
# vocal geyser šŸ™

It's funny how it's saying "please try a different search", as if it really wants you to dig something up

lethal trench
# vocal geyser šŸ™

Would of been funny if some random email from Epstein like ā€œthis acpica thing is really coolā€ came up

kind mantle
#

doubt

#

it was basically never happening

#

it's just too niche

full nimbus
#

He used ACPICA by proxy

#

Which was the joke I was going for

hallow marten
#

this is in epstein's mail

full nimbus
steel inlet
fiery turtle
#

lol

steel inlet
#

and i saw some emails of orders for hp linux servers or smth iirc

#

not sure what that was about

hallow marten
#

bunch of linux mentions from that

lethal trench
#

(:P)

pallid lava
#

got back in my hands an old laptop with a touchscreen

#

the madt is fucked

#

non-sequential APIC ids

#

this one is subtler, but it specifies NMIs as level triggered

#

which is prohibited by the intel sdm

#

and i cant get my os to proceed because i get an apic error

#

someone is sending me an IPI with vector 0-15

#

it is not me

kindred beacon
pallid lava
#

no idea

#

the laptop is super fucked overall

#

the quality is bad

#

the keyboard's up arrow is spammed constantly

kindred beacon
#

you can determine if it's usb by looking at lsusb output

pallid lava
#

typing commands is a pain when im in grub

#

but i have ssh so

#

i can check it now

kindred beacon
#

alternatively you can get a nice listing of all input devices with evtest

fiery turtle
fiery turtle
pallid lava
#

when i type nmi in the qemu monitor it is received by linux

#

how does it know what parameters and what lints

fiery turtle
#

It hardcodes the classic config

#

Its the only one that works

pallid lava
#

i see

#

@kindred beacon ```
Available devices:
/dev/input/event0: Lid Switch
/dev/input/event1: Power Button
/dev/input/event10: HDA Intel PCH Mic
/dev/input/event11: HDA Intel PCH Speaker Front
/dev/input/event12: HDA Intel PCH HDMI/DP,pcm=3
/dev/input/event13: HDA Intel PCH HDMI/DP,pcm=7
/dev/input/event14: HDA Intel PCH HDMI/DP,pcm=8
/dev/input/event2: AT Translated Set 2 keyboard
/dev/input/event3: Video Bus
/dev/input/event4: Intel HID events
/dev/input/event5: Intel HID 5 button array
/dev/input/event6: PC Speaker
/dev/input/event7: FTSC1000:00 2808:50C5
/dev/input/event8: FTSC1000:00 2808:50C5 UNKNOWN
/dev/input/event9: SYNA3602:00 0911:5288 Touchpad

#

the touchscreen is event7

kindred beacon
#

what the fuck

fiery turtle
#

synaptics touchpad letsgo

pallid lava
#

so yes, over i2c

kindred beacon
#

jeez

#

good luck

pallid lava
#

oh by the way

#

this laptop is from 2017

#

and has no csm

#

quite visionary

kindred beacon
#

that's based actually

fiery turtle
#

who needs csm tbh

kindred beacon
#

fuck that old cruft

pallid lava
#

back in 2020 i was forced to use tomatboot šŸ˜”

fiery turtle
#

i was surprised to learn none of my laptops support the PXE GET_FILE_SIZE request, which is a fucking pain

#

havent tried the bios PXE yet, maybe that one is better

pallid lava
#

let me now debug harder what is the apic error issue and i'll try to see how uacpi goes

kindred beacon
#

only use TFTP for limine +Ā kernel binary + initrd, NVMe-oF for the rest meme

pallid lava
fiery turtle
pallid lava
#

yes

fiery turtle
#

ah

fiery turtle
pallid lava
#

virtio net

kindred beacon
#

actual troll

fiery turtle
#

doesnt that already have one?

pallid lava
#

yeah ofc

fiery turtle
#

ah

pallid lava
#

the storage is also unironically an emmc card

mortal yoke
#

I have always wondered why do the cheap laptops/chromebooks use emmc instead of ufs

#

its literally worse than phones lol

calm latch
#

It's cheaper?

#

UFS is like in the flagship smartphones, and only became a thing recently

#

I mean everyone uses NVMe now?

#

Smartphones, SD cards

mortal yoke
#

like oneplus nord n10 that cost like 250€ back then

vast kestrel
#

I think it's because emmc works over SD bus that chipsets already have

#

Meanwhile ufs is a different bus

#

And nvme is just pcie

full nimbus
#

how much cheaper even is emmc to skip nvmes? iirc you can get 256gb ones for like 30 bucks wholesale

mortal yoke
#

the nice thing about UFS over emmc is that the controller interface is standardized (though ofc it can also come with quirks like all hardware)

pallid lava
#

rip, i have to actualy implement the ec region handlers nooo

#

no idea why the apic error happens

#

it happens only once after i sti

#

the error status register has bit 6 set, which means that someone is sending me an interrupt with a vector from 0 to 15, which is illegal

#

it happens with the other cpu too when i bring it up

pallid lava
#

also, during initialization, i get a gpe before they're enabled

#

okay, there is something worse happening

#

when uacpi calls the battery's _STA, it accesses a register inside the embedded controller space

#

and i have no handler for it, because i have to first initialize the namespace, and then iterate over the devices looking for the embedded controller, and after that attach a handler?

calm latch
#

Like it's just the SD card

pallid lava
#

i dont have that

fiery turtle
#

Lol

#

You can find the ec device before initializing the namespace, after loading it

pallid lava
#

oh okay

fiery turtle
#

Idr how linux handles it exactly, I did look into it a while ago

mortal yoke
#

though even on devices that implement the sd host controller interface sometimes they are pretty broken and you have to write values to fields that are marked as RO in the spec (e.g. a register where you are supposed to discover supported voltages from so then the generic driver can properly read them from there) meme

slim panther
pallid lava
#

why would it not be legal

#

it's just quirky lol

#

mfs want to be unique

vocal geyser
slim panther
#

if it works anyways

#

we know firmware devs are insane

vast kestrel
#

It is very common, because on some CPUs the IDs encode the hierarchy iirc

frank canopy
#

theres even a cpuid to discover how many bits are used for each field

pallid lava
#

yes

calm latch
#

My old PC starts at 16 and doesn't match CPUID trl

fiery turtle
#

Looks like future snapdragon laptops will be acpi only

#

Thank god

pine leaf
#

lame, device trees on top šŸ—£ļø šŸ”„

kindred beacon
kind mantle
#

If someone has that Linux kernel with uACPI, I'd be willing to test

rugged silo
#

@fiery turtle i have some problems with implementing uacpi, somehow the compiler wont see the uacpi functions but the ide sees them perfectly
https://codeberg.org/aiqe/forward/src/branch/main/kernel/src/acpi/acpi_init.c
compiler errors:

src/acpi/acpi_init.c: In function ā€˜acpi_init’:
src/acpi/acpi_init.c:9:24: error: implicit declaration of function ā€˜uacpi_initialize’ [-Wimplicit-function-declaration]
    9 |     uacpi_status ret = uacpi_initialize(0);
      |                        ^~~~~~~~~~~~~~~~
src/acpi/acpi_init.c:14:11: error: implicit declaration of function ā€˜uacpi_namespace_load’ [-Wimplicit-function-declaration]
   14 |     ret = uacpi_namespace_load();
      |           ^~~~~~~~~~~~~~~~~~~~
src/acpi/acpi_init.c:19:11: error: implicit declaration of function ā€˜uacpi_namespace_initialize’ [-Wimplicit-function-declaration]
   19 |     ret = uacpi_namespace_initialize();
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/acpi/acpi_init.c:24:5: error: implicit declaration of function ā€˜uacpi_set_interrupt_model’ [-Wimplicit-function-declaration]
   24 |     uacpi_set_interrupt_model(1);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
src/acpi/acpi_init.c:25:11: error: implicit declaration of function ā€˜uacpi_finalize_gpe_initialization’ [-Wimplicit-function-declaration]
   25 |     ret = uacpi_finalize_gpe_initialization();
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fiery turtle
rugged silo
#

config.h defines?

fiery turtle
#

Anyway the most likely reason is you have barebones mode enabled

rugged silo
#

wait

#

didnt i say that

#

oh yeah im stupid

#

yeah, i use barebones mode

#

is there smth wrong with it

fiery turtle
#

well those functions dont exist in barebones mode

rugged silo
#

oh

#

ig its not very possible to use uacpi this early

#

okay i will delay it then

fiery turtle
#

barebones mode only includes tables.h

rugged silo
#

uacpi needs pci, pci needs interrupt controller, interrupt controller (apic) needs uacpi

#

well ig i could bootstrap pci with pic

fiery turtle
#

thats why theres the early_table_access helper

#

so u can parse static tables before doing aml or allocations or anything

#

and uacpi doesnt need pci until you start running aml

rugged silo
#

oh okay thanks

rugged silo
#

gpfs with error code 0 in at if (uacpi_signatures_match(hdr, ACPI_FACS_SIGNATURE)) somehow, what could this relate to

static void dump_table_header(
    uacpi_phys_addr phys_addr, void *hdr
)
{
    struct acpi_sdt_hdr *sdt = hdr;

    if (uacpi_signatures_match(hdr, ACPI_FACS_SIGNATURE)) {
        uacpi_info(
            "FACS 0x%016"UACPI_PRIX64" %08X", UACPI_FMT64(phys_addr),
            sdt->length
        );
        return;
    }

    if (!uacpi_memcmp(hdr, ACPI_RSDP_SIGNATURE, sizeof(ACPI_RSDP_SIGNATURE) - 1)) {
        struct acpi_rsdp *rsdp = hdr;

        uacpi_info(
            "RSDP 0x%016"UACPI_PRIX64" %08X v%02X (%6.6s)",
            UACPI_FMT64(phys_addr), rsdp->revision >= 2 ? rsdp->length : 20,
            rsdp->revision, rsdp->oemid
        );
        return;
    }

    uacpi_info(
        "%.4s 0x%016"UACPI_PRIX64" %08X v%02X (%6.6s %8.8s)",
        sdt->signature, UACPI_FMT64(phys_addr), sdt->length, sdt->revision,
        sdt->oemid, sdt->oem_table_id
    );
}
fiery turtle
#

Bad implementation of uacpi_kernel_map

rugged silo
#

that workaround should work i suppose

void *uacpi_kernel_map(uacpi_phys_addr addr, uacpi_size len)
{
    void *AddrVirt = (uint64_t)addr + offset;
    return (void *)AddrVirt;
}
#

i feel like its incredibly stupid but cant prove it because im incredibly stupid bruh

fiery ice
#

at least use the hhdm

#

i mean, if you mapped all of it it should work then

full nimbus
fiery ice
#

especially if running in the kernel

full nimbus
#

Sure, but you don't want to do that

#

The physical memory could have anything, things that may need different caching modes etc.

#

You can even get machine checks due to mapping shit improperly

#

Eg MTRRs not liking huge pages in some cases

kind mantle
#

Not everything that ACPI will want is gonna be in the HHDM

rustic compass
north hull
#

if your kernel cant easily impl this api then u are not ready to impl uacpi

#

u have other things to worry about

fiery turtle
#

At least add logs

#

To trace what you return

full nimbus
#

eg mapping the memory map exactly and when using large pages make sure they dont spill over into unknown memory

#

Loongarch64 would also let you cheat this with DMWs since it's a safe way to have an HHDM of all physical memory and with different caching modes

#

But again it's much easier to just have a proper virtual memory allocator

#

You won't be starving for virtual address space especially if you support 5 level paging

full nimbus
full nimbus
rugged silo
#

yeah i will use the vmm then

#

find free unmapped address and use it

slim panther
#

ayo?

#

uacpi 6?

fiery turtle
#

Yep

steel inlet
#

me (again), still on 3.2.0:

slim panther
rugged silo
slim panther
#

let's see

fiery turtle
#

Next up I want to add an ability to attach arbitrary user data to a uacpi namespace node (to simplify uacpi-linux), and an optional 64-bit division platform helper

kind mantle
#

I wonder if uACPI for Linux is ever going to be a real thing

#

As opposed to a tech demo

calm latch
#

Considering it fixed a bunch of stuff for reactos...

fiery turtle
rugged silo
fiery turtle
#

Nah the work is mostly on the uacpi linux side

calm latch
#

Linux 33.0.0

pallid lava
#

just updated to latest

#

have there been any changes to the gpe code, or my kernel is broken?

#

the power off button does not send any ec gpe

#

ok nvm, you removed the got gpe message flesh

fiery turtle
#

There was such a message?

#

What version were you on before lol

pallid lava
#

february/march i think

fiery turtle
#

Maybe that was your kernel

fiery turtle
#

nice! new NT regression after recent update

#

am i supposed to migrate my pc to uacpi now KEKW

fiery ice
#

XD

full nimbus
#

Windows to switch to uACPI

#

uACPI to take over the world

#

uACPI for president

pallid lava
#

thought i was going crazy... but actually, uacpi_find_devices ignores devices whose _STA reports they're not active (skrill issue)

fiery turtle
pallid lava
#

nah, it's not for real hw

#

i am implementing memory hotplugging, and obviously unplugged memory is reported as not present

fiery turtle
#

Ah

#

Oh cool

pallid lava
#

yes coolmeme

hallow marten
#

that sounds like hell

pallid lava
#

yes

#

it's the 2 things i want to do before continuing

#

i should create a thread tbh once i clean some things up

hallow marten
#

Actually cpu hotplug shouldn't be that bad now that I think of it

#

You "just" try migrating everything

pallid lava
#

yeah

chrome crow
fiery turtle
#

Booted my computer

calm latch
pallid lava
#

yes

hallow marten
#

actually I'll look into this eventually

pallid lava
#

implementing hotplug support is not necessary for having in your os support for software disabling cpus during runtime, making them sleep for a long time and whatever

hallow marten
#

doesn't really seem that hard

pallid lava
#

i just want to get my hands dirty with acpi

#

(aka match processors to processor objects and call _ej0)

hallow marten
#

implement it in zag

#

you will get mentorship from the zag foundation

#

(ā„¢)

pallid lava
#

based?

fiery ice
#

hmm @fiery turtle what could cause uacpi to hang before saying it loaded all the tables and did tot ops in tot ms?

fiery turtle
#

gdb

fiery ice
#

i can't šŸ’€

#

it's on real hw

#

it only happens there

fiery turtle
#

debug prints

#

uacpi_context_set_log_level

fiery ice
#

gets stuck there

fiery turtle
#

if i had to guess it hangs in your allocator

fiery ice
#

hmm

#

i'll check it then thx

fiery turtle
#

yeah just add a bunch of prints

fiery ice
#

another strange thing would be the messages for port 0

#

tho maybe that's another process

#

and i'm gonna check it now

#

hmm, no, it's uacpi

#

i think it's hanging on the pci read or something? since that's where i'm using ports

fiery turtle
#

Create namestring just allocates

fiery ice
#

for some reason on kvm it doesn't request pci reads / writes before i call send mcfg

#

but on real hw yes

#

the hanging is caused by the pci service not responding bc it's not active yet

fiery ice
#

it is doing pci operations during namespace load

fiery turtle
slim panther
#

inb4 switch on log type but no break;

pallid lava
#

small typo in include/uacpi/types.h:37

pallid lava
#

okay, so, i have written a wrapper for _OST, but i am not sure if it's entirely correct

#
int
acpi_device_ost(uacpi_namespace_node *node, unsigned int source_event,
                unsigned int status_code)
{
        uacpi_status status;
        uacpi_namespace_node *ost;
        uacpi_object_array args;
        uacpi_object *arg0, *arg1, *args_ptr[3];

        status = uacpi_namespace_node_find(node, "_OST", &ost);
        if (status == UACPI_STATUS_NOT_FOUND) {
                return 0;
        } else if (status != UACPI_STATUS_OK) {
                return -1;
        }

        arg0 = uacpi_object_create_integer(source_event);
        if (!arg0) {
                return -ERROR_OUT_OF_MEMORY;
        }

        arg1 = uacpi_object_create_integer(status_code);
        if (!arg1) {
                free(arg0);
                return -ERROR_OUT_OF_MEMORY;
        }

        args_ptr[0] = arg0;
        args_ptr[1] = arg1;
        args_ptr[2] = UACPI_NULL;
        args.count = 3;
        args.objects = args_ptr;

        status = uacpi_execute(ost, nullptr, &args);
        free(arg0);
        free(arg1);
        if (uacpi_likely_success(status)) {
                return 0;
        } else {
                return -1;
        }
}
#

is this the right way of passing optional arguments?

#

specifically, _OST takes three arguments: arg0 (integer), arg1(integer), arg2(optional buffer)

fiery ice
fiery turtle
#

you cant pass 2 arguments to methods that accept 3

#

you also cant just free the arguments, you must use uacpi_object_unref

#

since aml can just arbitrarily grab a reference to it and you wont know

pallid lava
#

oh okay

#

so, how do i create an empty buffer? do i use uacpi_object_create_buffer, with view.length = 0, or how?

fiery turtle
#

yeah

pallid lava
#

i see

#

thanks letsgo

fiery turtle
#

npnp

#

i think linux does that also

pallid lava
#

perfect then

#

lmao

#

_OST for memory hotplug in qemu is just this

#

tbf, there's not much useful stuff that qemu can do

#

at most, print a message or trace _OST calls, which is what it does

fiery turtle
#

makes sense lol

quaint lotus
#

I know this is mostly NIH but using a whole ACPI system feels kinda like cheating

#

Is there a way to trim uACPI down to just an AML interpreter

pallid lava
#

but... it's an aml interpreter?

#

just don't use the helpers

quaint lotus
# pallid lava but... it's an aml interpreter?

From the git it seems to also do those:

A fairly advanced event subsystem (GPE/fixed, wake, implicit notify, AML handlers)
Table management API (search, dynamic installation/loading, overrides, etc.)
Operation region subsystem (user handlers, support for BufferAcc opregions, builtins for common types)
Sleep state management (transition to any S state, wake vector programming)
PCI routing table retrieval & interrupt model API
Device search API
Interface & feature management exposed via _OSI
Client-defined Notify() handlers
Firmware global lock management (_GL, locked fields, public API)
GAS read/write API

fiery ice
pallid lava
#

you can use or not use all that stuff

fiery ice
#

i didn't think it wanted to interact with pci things during namespace load

fiery turtle
fiery ice
#

šŸ’€

#

damn you samsung

lethal trench
quaint lotus
fiery turtle
#

this one is relatively harmless at least

lethal trench
#

at this point I'm convinced firmware devs are paid by microsoft to add bugs to firmware

fiery ice
#

well, i have a pci write / read before loading now

#

it is legacy only

#

but should help a bit XD

fiery turtle
#

u can parse mcfg before namespace load no? lol

fiery ice
#

no

#

uacpi wants namespace loaded at least

#

with my current method i mean

#

i use uacpi_find_devices_at

fiery turtle
#

table_find("MCFG")?

fiery ice
#

hmm, i do it on the callback of uacpi_find_devices_at

fiery turtle
#

anyway legacy access works fine

fiery turtle
#

with acpica

fiery ice
#

oh

fiery turtle
#

check your dmsg

steel inlet
#
fiery turtle
#

šŸ’€

pallid lava
#

dw, it's not over for you

steel inlet
#

(because i already knew)

quaint lotus
#

I went to that site way too many times

gloomy helm
#

me writing my own aml parser and shi cuz uacpi is too complex: ._.

torpid root
gloomy helm
#

(also 70000th message!! trl)

lethal trench
fiery turtle
#

yeah its 30k lines mostly because i wanted to troll

#

it actually requires 10 loc

lethal trench
#

not even

#
if(firmware_is_bugged()) {
  panic("buggy firmware I aint even gonna bother");
}
#

this always panics

fiery turtle
#

does this check just return true always?

torpid root
#

it calls is_computer_on()

lethal trench
rugged silo
gloomy helm
fiery turtle
#

if you strip references from AML it could be much simpler

#

most of the complexity i would say comes from them

#

and no one really knows how they are supposed to work, especially not the spec

torpid root
#

lol

lethal trench
fiery turtle
#

the entire aml/asl spec is designed around ignoring the existence of edge cases

#

you would never do multilevel references anyway right trl

lethal trench
#

sureeeee

fiery turtle
#

you would never try to make local references escape the method right trl

#

and if you're the implementor, go figure it out lol

#

gl

lethal trench
#

"it worked when we tested it on nt"

#

"acpica threw errors but it booted so who cares"

fiery turtle
#

so this whole thing works only becaused firmware engineers made sure to only use the bare minimum of features that never trigger such edge cases

gloomy helm
fiery turtle
#

like its not even anything crazy, e.g.

Method (TEST) {
    Return (RefOf(Local0))
}
#

no one really knows how this is supposed to work

lethal trench
#

replace aml with jvm bytecode atp šŸ™

fiery turtle
#

unironically it would be simpler

#

or at least have defined behavior

fiery turtle
lethal trench
#

i am now tempted but I must resist

fiery turtle
#

yeah imo bytecode vms are super fun

#

or any emulators or interpreters

lethal trench
#

and that's why I'm so tempted 😭

fiery turtle
#

the worst one jvm has is like invokedynamic or whatever

full nimbus
pallid lava
#

even our beloved emulator (qemu) does not implement properly the acpi spec nooo

#

for memory devices, The physical address space described by _CRS object must be described using the Extended Address Space Resource Descriptor macro.

what i actually get: a qword memory descriptor

fiery turtle
#

Gg

frank canopy
#

the q35 machine in qemu is missing an aml field that the spec defines as required for the pci root

#

there is no consistency or correctness. only what will work under windows

pallid lava
#

which field?

frank canopy
#

BBN iirc

pallid lava
#

i think it can be assumed to 0?

frank canopy
#

_SEG is defined 0 if missing but _BBN is officially supposed to be required despite being assume 0 if missing in practice

pallid lava
#

oh yes, you're right

frank canopy
#

so like it's fine it's just more evidence that the acpi spec is just a suggestion

pallid lava
fiery turtle
#

Lmao

#

Finally, linux support in aml

pallid lava
#

it uses this macro/function (which is not defined anywhere)

#

and according to gemini, it converts any memory resource to that

#

and the qemu aml is capable of creating a dword memory descriptor, if the hp region is in low memory

pallid lava
#

elixir is tweaking for some reason

gentle peak
pallid lava
#

acpi_resource_to_address64 takes a word, dword or qword descriptor, and converts it to a qword descriptor

gentle peak
#

drivers/acpi/acpica is excluded from elixir for some reason

pallid lava
#

and if there is an extended one (the required one by the spec), it fails chad

fiery turtle
gloomy helm
lethal trench
#

acpi hates all of us

pallid lava
#

it isn't acpi's fault, tbf

#

it's linux being stupid now this time for real

lethal trench
#

fair enough but it works 😭

full nimbus
frank canopy
#

and then they get mad when other people do that to their specs

quaint lotus
#

Out of curiosity what does AML typically do?

#

Like does it only contain data, or can it write to ports or memory addresses and crazy stuff like that

torpid root
gloomy helm
#

aml allows for some kewl shit like acpi shutdown

#

and more

#

so in a sense it does allow memory writes and shit

pallid lava
#

shutdown would have been good if the s5 slp_type was in the fadt and there were no need of doing whatever _pts garbage

fiery turtle
#

It does everything and anything it wants

#

Typically programming the chipset, talking to the firmware over SMM and many other things

quaint lotus
#

At that point why don’t hardware developers just write their drivers in AML trl

fiery turtle
#

They do ship a lot of power management drivers in aml

#

Thats how you retrieve the battery percentage for example

#

Some roll entire i2c drivers

#

And the nice thing for the kernel is it just runs a method which does this black magic under the hood

quaint lotus
#

Why can’t this apply to more drivers? Like GPU drivers for instance

#

Imagine AML mode setting

pallid lava
#

that was called running the rom in v8086 nooo

#

aml is too much trouble and is not very performant

fiery turtle
#

But not modeset yeah

#

Idk why they never did that

#

Probably because that wasn't needed and was covered by generic gpu drivers

#

Whereas backlight and mux is always ad hoc chipset specific stuff

full nimbus
fiery turtle
full nimbus
#

ah true

flat badge
kind mantle
fiery turtle
#

yes

kind mantle
#

Damn

flat badge
#

Hm?

#

which GPUs do that?

#

for integrated GPUs, the AML is typically embedded in the uefi firmware image

#

and not in the gpu

fiery turtle
fiery turtle
#

Where does said image live

flat badge
#

rom on the mainboard

#

spi flash or whatever

#

with the rest of the uefi firmware

fiery turtle
#

Mainboard of the gpu?

flat badge
#

no, mainboard

fiery turtle
#

Oh ok no thats not how that works

flat badge
#

for integrated gpus? yes, it is

fiery turtle
#

I said Nvidia

flat badge
#

for integrated GPUs, the AML is typically embedded in the uefi firmware image

#

that's what i said

fiery turtle
#

I mean where else would it live for an integrated gpu lol

flat badge
#

gpu option rom

#

but that's not how it's done for integrated

#

I don't think nvidia has any AML (?)

fiery turtle
#

Definitely does

flat badge
#

discrete nvidia gpus?

fiery turtle
#

Yes, ill take a look at a few dumps from desktops later to check

flat badge
#

I don't have any on my machine

#

i never saw a SSDT with nvidia vendor

#

on a desktop

fiery turtle
#

They dont have the Nvidia vendor

#

But if you grep for a gpu object you will see multiple

#

One for integrated and one for discrete

flat badge
#

which vendor do they have?

fiery turtle
#

Ill get back to you

flat badge
#
$ grep -rio 'GFX.' | uniq
DSDT.dsl:GFX0
SSDT2.dsl:GFX0
SSDT2.dsl:Gfx 
SSDT2.dsl:GFX0
#

only has integrated

slim panther
#

what gpu do you have

flat badge
#

this machine has a 1660

#

but i also never saw it on other desktops

#

the bus that the card is on is not even in ACPI

fiery turtle
#

you mean as _BBN? That only exposes root ports

flat badge
#

no, i mean as _ADR

fiery turtle
#

_ADR doesnt include the bus

flat badge
#

how do you address a device on a non root bus then?

fiery turtle
#

_BBN of the parent device

flat badge
#

ah

#

so it'd be nested under the bridge

#

under PCI0.PEG0 or whatever in this case

fiery turtle
#

yeah it would have to be under a parent bridge dev, so like the pcie root port device ig

#

yeah nothing on my amd desktop, i have like 3 tables with gfx, but i think they're all talking about the embedded gpu

flat badge
#

yeah okay it has a device there but that's supplied by the firmware

#

not by the gpu

#

and it only has generic stuff, nothing nvidia specific

fiery turtle
#

i could've sworn i had a table on my rtx2080 that had nvidia stuff

#

but this one is 5xxx series

flat badge
#

that'd mean that the option rom would need to install it

fiery turtle
#

yeah

flat badge
#

which is not impossible but kinda rare

#

proprietary devices do this sometimes (e.g., to boot from raid) but there's probably no point in doing it for a gpu

#

since you'll have a driver anyway once you're in the proper OS

fiery turtle
#

so like, in a setup with a desktop motherboard, the cpu is not known at firmware compile time

#

so someone has to install it dynamically

#

i mean e.g. the amd integrated gpu tables

flat badge
#

yeah the firmware hard codes a set of igpus

#

that work on the particular machine

fiery turtle
#

you think it has a hardcoded set of supported igpus?

#

What if i plug in a zen6 cpu that didnt exist when it was made

flat badge
#

you have to update your bios

#

at least that's how it works on intel

fiery turtle
#

maybe

mortal yoke
#

the gop driver is also in the bios image on intel

flat badge
#

yeah

fiery turtle
#

true

#

i saw the gop driver version hardcoded in bios

#

but yeah that was intel

flat badge
#

idk how it works on AMD. AMD has a wider set of CPUs per socket, so maybe they're doing it in a less static way

fiery turtle
#

perhaps

kindred beacon
#

The UEFI ROMs can install tables at runtime

frank canopy
#

yup

#

theres a uefi protocol for it

flat badge
#

yes, it's clear that they can do it, the question is whether they do it in practice

kindred beacon
#

I have seen that, yes

#

For AMD iirc

hearty pike
#

Is there any way obtain the uacpi_generic_region_info associated with a UACPI_OBJECT_OPERATION_REGION?

fiery turtle
#

What are you trying to do?

#

This info is passed to you on region attach

hearty pike
#

I'm figuring out what all needs to be done for the Linux integration. acpi_check_address_range seems to require something like that.

fiery turtle
#

But Linux integration already exists, or are you doing something else?

hearty pike
#

From what I saw, a decent number of the functions were not implemented such that linux got the full use of them (including acpi_check_address_range and acpi_initialize_subsystem).

fiery turtle
#

Ill have to get back to you because idk what check_address_range does off the top of my head, but iirc most unimplemented functions were either not super useful or something very misc

hearty pike
#

If the most up to date version is the repository posted online, then it seems to lack at least some of the functionality that Linux uses to protect against buggy firmware.

fiery turtle
#

Yeah its possible

#

Are you working on improving the port?

#

If anything, since linux is using uacpi source directly, it can just import the private api from internal/ and access any fields of an object

craggy epoch
kindred beacon
#

quick question, is IVRS something you'd want to have upstream

#

also, are you taking sloperated imhex patterns for tables meme

fiery turtle
kindred beacon
#

hex editor that has a pattern lang for dissecting stuff

fiery turtle
#

we would probably need a separate "disassembler" project for that like iasl in acpica

#

have u tried running that table against iasl btw

#

it can disassemble stuff nicely

kindred beacon
#

didn't know

#

sec

fiery turtle
#

its just iasl ivrs.dat

kindred beacon
#

with .dat just being the binary dump?

#

TIL

fiery turtle
#

yep

#

i typically just do iasl *.dat to get the disassembled versions for all tables in a dump

kindred beacon
#

yeah it decodes IVRS as well

frank canopy
#

ive got a non-slop imhex pattern for table headers and also has a thing for pkglen decoding

#

its very nice

fiery turtle
#

how is your aml project going btw

frank canopy
fiery turtle
#

ah damn

frank canopy
#

oh also theres a massive thunderstorm coming with a tornado watch so i might end up sheltering in the basement instead of doing dev work tonight lmao

fiery turtle
#

holy

#

stay safe

frank canopy
#

its not uncommon here this time of year, and ive never actually been caught in a tornado despite that

#

but still will play it safe if theres a warning on one

flat badge
#

where do you live?

frank canopy
#

pennsylvania

#

in the greater philadelphia area, which is big enough that i feel ok saying it publicly

#

we dont get big tornadoes