#
…

2021-01-20

00:00jn__nGnRnE = non-gathering, non-reordering, no early write acknowledgement
00:01jn__robinp: i don't see a connection to any of these features
00:02jn__(except superficially, everything mentioned is about memory access in a broad sense)
00:02jn__that everything*
00:14acelogic has joined #asahi-dev
00:22acelogic has quit [Ping timeout: 256 seconds]
01:40ransom has joined #asahi-dev
01:48ransom has quit [Ping timeout: 256 seconds]
01:50ransom has joined #asahi-dev
02:37tiagom has joined #asahi-dev
02:54ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:05modwizcode has quit [Quit: Later]
03:55tiagom has quit [Quit: tiagom]
04:24tiagom has joined #asahi-dev
04:26artemist has quit [Ping timeout: 258 seconds]
04:31artemist has joined #asahi-dev
04:34tiagom has quit [Quit: tiagom]
04:57artemist has quit [Read error: Connection reset by peer]
04:57artemist has joined #asahi-dev
05:01acelogic has joined #asahi-dev
05:07tiago has joined #asahi-dev
05:08tiago has quit [Client Quit]
05:15tiagom has joined #asahi-dev
05:20tiagom has quit [Quit: leaving]
05:21ransom has joined #asahi-dev
05:24ransom has quit [Client Quit]
05:28tiagom has joined #asahi-dev
05:29tiagom has quit [Client Quit]
05:32tiagom has joined #asahi-dev
05:33tiagom has quit [Client Quit]
05:33tiagom has joined #asahi-dev
05:37r3n has quit [Ping timeout: 264 seconds]
05:46tiagom has quit [Quit: leaving]
05:47tiagom has joined #asahi-dev
06:03_whitelogger has joined #asahi-dev
06:06tiagom has quit [Quit: leaving]
06:33n40455 has joined #asahi-dev
06:33n40455 has left #asahi-dev [#asahi-dev]
06:34acelogic has quit [Ping timeout: 256 seconds]
06:34VinDuv has joined #asahi-dev
06:36acelogic has joined #asahi-dev
06:46m1kr0[m] has joined #asahi-dev
07:25VinDuv has quit [Quit: Leaving.]
07:40acelogic has quit [Read error: Connection reset by peer]
07:40acelogic has joined #asahi-dev
07:54acelogic has quit [Remote host closed the connection]
07:56acelogic has joined #asahi-dev
07:58volpe has joined #asahi-dev
08:06bostjan has joined #asahi-dev
08:09acelogic has quit [Remote host closed the connection]
08:10acelogic has joined #asahi-dev
08:10volpe_ has joined #asahi-dev
08:14fsc has joined #asahi-dev
08:16mogery has joined #asahi-dev
08:26_jannau_ has joined #asahi-dev
08:37wiloon has joined #asahi-dev
08:38mogeryy has joined #asahi-dev
08:38fsc_ has joined #asahi-dev
08:41fsc has quit [Ping timeout: 256 seconds]
08:41mogery has quit [Ping timeout: 256 seconds]
08:41Esmil has quit [Ping timeout: 256 seconds]
08:41Esmil has joined #asahi-dev
08:54Axenntio has joined #asahi-dev
08:57r1fl has joined #asahi-dev
09:18DrWhax has quit [Ping timeout: 240 seconds]
09:18yeoj has quit [Ping timeout: 240 seconds]
09:19yeoj has joined #asahi-dev
09:19vijfhoek has joined #asahi-dev
09:20DrWhax has joined #asahi-dev
09:34acelogic has quit [Ping timeout: 264 seconds]
09:37Axenntio has quit [Ping timeout: 272 seconds]
09:53thresh has joined #asahi-dev
10:00taziden has quit [Ping timeout: 240 seconds]
10:02mogeryy has quit [Read error: Connection reset by peer]
10:05jixmarcan: from yt: Michiel Visser​Unaligned on the last write in init?
10:05jixmissing a * 4 there?
10:08taziden has joined #asahi-dev
10:10volpe has quit [Remote host closed the connection]
10:10volpe_ is now known as volpe
10:18jixmarcan: get the physical addr from the mapped one and check that?
10:23e820 has joined #asahi-dev
10:25e820 has quit [Client Quit]
10:44mogeryy has joined #asahi-dev
10:46maor26 has joined #asahi-dev
10:46wiloon has quit [Quit: Connection closed for inactivity]
10:46mogeryy has quit [Client Quit]
10:47mogeryy has joined #asahi-dev
10:47mogeryy has quit [Remote host closed the connection]
10:48mogeryy has joined #asahi-dev
10:48mogeryy has quit [Remote host closed the connection]
10:49mogeryy has joined #asahi-dev
10:52maor26 has quit [Remote host closed the connection]
10:52maor26 has joined #asahi-dev
10:58snalty has joined #asahi-dev
11:08mogeryy has quit [Remote host closed the connection]
11:14fewfewwe has joined #asahi-dev
11:22amw2 has joined #asahi-dev
11:26amw2 has quit [Ping timeout: 246 seconds]
11:30vimal has joined #asahi-dev
11:37vimal has quit [Remote host closed the connection]
11:38vimal has joined #asahi-dev
11:38amw2 has joined #asahi-dev
11:44amw2 has quit [Ping timeout: 265 seconds]
11:46diddledanit looks like xnu sets the MAIR value for nGnRE to a different number than Linux does
11:47diddledanLinux and the ARM spec says to use 0x1 so I think Linux is spec correct. I'm not sure why the Apple Silicon might be using a different value
11:51diddledanas to WFI it looks like XNU does do WFI so it's not broken entirely.. the XNU does an extra command between dsb and wfi
11:51j`eydiddledan: 0x1, but in position 3
11:55amw2 has joined #asahi-dev
11:56yrlfso many quirks on that machine, oof
12:01amw2 has quit [Ping timeout: 256 seconds]
12:03vijfhoekkind of to be expected when a party has full control over both hardware and software
12:03vijfhoekdoesn't really matter if they break the spec, as long as it's documented internally
12:04amw2 has joined #asahi-dev
12:17j`eymarcan: did you fix the typo in dts?
12:17Alex[m] has joined #asahi-dev
12:19jn__bools in DT are empty properties
12:20PdimH has joined #asahi-dev
12:28amw2 has quit [Ping timeout: 265 seconds]
12:47yrlflet's see what LKML says about the patch
12:49j`eyi dont think they will be too happy with parts of it :P
12:50j`eyi also think they messed up the emails
12:50maor has joined #asahi-dev
12:53maor26 has quit [Ping timeout: 256 seconds]
12:58jn__marcan: does the kernel output have the "tty0 enabled"/"earlycon0 disabled" thing in it?
13:00_jannau_marcan: samsung-uart probably works not yet. there's "samsung-uart …: could not find driver data" in the log
13:02jn__oh good, simple-fb already supports 30bit pixel formats
13:03jamadazi has joined #asahi-dev
13:03jn__marcan: you might need ranges; on /chosen
13:04jn__other DTs that use simple-fb have it
13:05j`eyjn__: what's he trying now? im in another meeting and havent been listening
13:05jn__j`ey: bringing up simple-framebuffer
13:05jn__and it works!
13:05jn__congrats :)
13:06diddledanneeds moar pingu
13:06jn__pingus are on the way
13:06diddledanthis is way faster than I expected it to happen
13:08jn__marcan: the individual device data selected by the compat strings in the samsung-tty driver are guarded by #if CPU_S3*
13:09diddledanwith 4 big cores and 4 little ones and the bigLITTLE concept becoming more mainstream we need the pingus to be 4 big and 4 small
13:09jn__diddledan: hehe, that'd be nice
13:09jn__diddledan: reminds me of the two/three big and eight small pingus on the Playstation 3
13:11diddledanyeah that's the idea! :-)
13:14Shizwhat's poppin'
13:15fewfewwe has quit [Quit: Connection closed]
13:15j`eyShiz: framebuffs!
13:15diddledanhopefully not fuses or capacitors!
13:15jn__Shiz: fiq+timer running, simplefb running, uart about to start working
13:16jn__tux on top of the framebuffer watching over all of this :)
13:16myfreeweb has joined #asahi-dev
13:17myfreewebmarcan: don't forget to remove allwinner stuff from the framebuffer
13:18myfreeweband next line allwinner-pipelines
13:19myfreewebmarcan: fixed-clock
13:22aknt has joined #asahi-dev
13:35jn__ugh, sprintf(clkname, "clk_uart_baud%d", cnt); clk = clk_get(ourport->port.dev, clkname);
13:35jn__(from the samsung try driver)
13:35jn__does that look up the clock by global name?
13:35arsomeone in the youtube chat claims so >David Ryskalczyk​ e.g. clock-names = "uart", "clk_uart_baud0";
13:39plainbits has joined #asahi-dev
13:47davidrysk[m]I can talk here
13:51TomJepp has joined #asahi-dev
13:58PdimH has quit [Quit: WeeChat 2.9]
14:00modwizcode has joined #asahi-dev
14:02luca020400 has joined #asahi-dev
14:21aknt has quit [Quit: Leaving]
15:04hungryhugo has joined #asahi-dev
15:28ransom has joined #asahi-dev
15:28ransom has quit [Client Quit]
15:29_jannau_they pushed usb support to github a couple of hours ago: https://github.com/corellium/linux-m1/commits/master
15:29thecake21[m]pretty impressive they got there so fast.
15:29thecake21[m]guess having tons of experience with apple socs from iphones did pay off here
15:30j`eyand probably it's the same USB controller?
15:31thecake21[m]gpu acceleration is still the hardest part imho. and not something you can throw together in a few days
15:38skg has quit [Quit: 〜バイバイ〜!]
15:43skg has joined #asahi-dev
15:48sharpiro has joined #asahi-dev
16:15agrafpower management will also be a lot of fun ;)
16:17diddledanshould be be 200 = IRQ enable; 100 = IRQ unmask?
16:17diddledanor other way about?
16:18diddledanI would expect the 000xxx bytes to be TX and xxx000 to be RX
16:18diddledanand I would expect them to mimic each other
16:20diddledanI think RX remasks on purpose because you're expected to drain the buffer before enabling the interrupt or it'll keep firing for every received byte
16:28diddledanwould it be easier to reason about by using bitshifting in the code rather than defining the values using hex? that way we can be sure of the actual bits that are being set
16:30jamadazi has quit [Ping timeout: 272 seconds]
16:31dhewgquote his nick to get his attention
16:34sharpiro has quit [Quit: Leaving]
16:37davidrysk[m]marcan: cutoff at 2am?
17:08lethalbit has joined #asahi-dev
17:26jamadazi has joined #asahi-dev
17:29Starymarcan, from stream chat: ​@marcan just FYI s3c6400 already supports a single-interrupt mode
17:30jamadazi has quit [Client Quit]
17:49VinDuv has joined #asahi-dev
17:52davidrysk[m]marcan: when are you going to sleep? it's nearly 3am
17:53hungryhugo has quit [Quit: Connection closed]
17:53marcanlet me finish this
17:53dhewgusually he mentions to go to bed, and then like two more hours
18:19Axenntio has joined #asahi-dev
18:19alicela1n[m] has joined #asahi-dev
18:22alicela1n[m] is now known as Alice[m]
18:38arthis isn't turning into a circular thing, where printk's from irq_* stuff cause serial writes, and serial writes cause the same irq_ things to happen, right?
18:40Axenntio has quit [Ping timeout: 272 seconds]
18:47yrlfmarcan: your apple_serial code is still using some S3C... macros, don't know if that is deliberate
18:48uberushaximus has quit [Ping timeout: 256 seconds]
19:04modwizcodeSo I've been playing around with other stuff and I was curious what compiler and linker flags m1n1 used and I'm now wondering why it's linked as a shared library before being copied out. Does it make a difference if it's linked that way vs as an executable if you're just copying out the mach-o that's been constructed in the guts anyway?
19:04plainbits has quit [Quit: Bye!]
19:30winocmposition independent code maybe?
19:33svenleftovers from a decade old codebase originally written for the wii :)
19:33modwizcodeI looked at a PR and aparently the way shared is (ab)used here annoys clang which partially answered that question. But I realized there's other weirdness like I'm pretty sure it should be linked with -nostdlib or at least -nostartfiles theoretically. The invocations for doing non-hosted stuff are always like a random smattering of options because I feel like they just get copied forever.
19:33svenfor some reason the linker has -shared and -pie
19:33jixthe only difference when removing -shared is that some relocation data doesn't end up in the elf (and in turn the macho) ... but I'm pretty sure that isn't used anyway?
19:34modwizcodeProbably also because the most documentation you get is other projects with a bunch of those flags/the individual flag documentation which is very unclear about what things actually do. Like -pie is defined as something like "enables position independent executable" or something.
19:35modwizcodeWhich doesn't tell you how that differs from -fpic, nor is the difference between -fPIE and -pie explained (I think I'm remembering the flag names right)
19:37roxfan-fpie, -fpic, -pie, -fPIC, -fPIE, -shared, ...
19:39modwizcodeI'm pedantic about these things and I have not figured out what the big flags are. the docs say large mode but wtf does that mean
19:39modwizcodeI assume maybe using larger offsets but I don't see why I have to tell it to do that???
19:52jannaumarcan: apple-uart uses 1<<5 for UTRSTAT_TX, 1<<8 is called AUTOBAUD
19:53fsc_ has quit [Quit: leaving]
21:07TehLink has joined #asahi-dev
21:08TheLink has quit [Ping timeout: 240 seconds]
21:08TehLink is now known as TheLink
21:30yrlfjix: what difference are you getting when removing the shared? for my GCC toolchain removing -shared literally has no effect when -pie also exists
21:31jixyrlf: ah I partially failed at looking at the diff... I do get a difference... but it's less than I thought
21:31modwizcodeAfter a bit of research I think what would probably be desired is -fpic when doing codegen and -shared when linking.
21:32yrlfmodwizcode: that small/large stuff is about -mcmodel, the code size model
21:32HotSwap has joined #asahi-dev
21:32modwizcodeAfaik (according to one place, next route is checking the gcc/ld source) the difference is the PIE has a fixed entry point
21:32modwizcodewhich is not what we want
21:32modwizcodeAT least I don't think it's what we want it might not matter
21:32modwizcodeBut "correctness" suggest it's not
21:32jixso uh that's a single relocation?
21:32yrlfso e.g. in the large code model it must support offsets in the full 4GB range
21:33yrlfoh yeah, that's a single NONE relocation
21:33modwizcodeI don't think m1n1 should be big enough (I think it's not the overall size but internal to function size or something) to matter for that
21:33modwizcodewtf is a "NONE" relocation
21:33yrlfI don't know why they are put in the ELF anyway, since they literally encode no information
21:33modwizcodeI think there's a flag on to do it anyway
21:33modwizcode--no-apply-dynamic-relocs I think this might do it
21:33jixyrlf: aarch64-linux-gnu-gcc (GCC) 10.2.0 GNU ld (GNU Binutils) 2.35.1
21:33modwizcodebut don't quote me on that
21:34modwizcode"-Bsymbolic" I really want to know if this flag is there for a reason because looking it up suggests it does not
21:45yrlfmodwizcode: at least according to `gcc -dumpspecs`, -shared already implies -Bsymbolic for the linker call
21:46yrlfso maybe the goal was to replicate what GCC would do?
21:47yrlfmodwizcode: apparently, NONE relocations are sometimes used to tell the linker that a section references another to not --gc-sections the other one away
21:47yrlfbut that doesn't apply here, since these NONE relocations don't contain a symbol
21:49yrlfmodwizcode: where have you seen that PIE has a fixed entry point?
21:50modwizcodeUhh it was a random blog post: https://eklitzke.org/position-independent-executables it was literally like the one thing I could find that gave a specific difference. I was going to follow up by checking my own code then the compiler source but my build system was broken.
21:51yrlfyeah, the hardcoded address thing is wrong
21:51modwizcodedamn it made sense too
21:51yrlfthe address in e_entry in the ELF header is relative to the base where the ELF is loaded
21:51modwizcodeAhhh I didn't actually know that
21:51yrlfthat code needs to be dynamic relocation free, and will relocate the rest of the ELF
21:52yrlfthat's apply_rela()
21:52modwizcodeRight that part made sense to me
21:53citruscitrus[m] has joined #asahi-dev
21:53yrlfokay, that also contains some random "am I the dynamic loader" code, but apart from that
21:54yrlfso it's not _that_ minimal
21:54modwizcodeah of course
21:58yrlffor a dynamically linked binary that is not -static-pie, the loader takes care of the relocating
21:58yrlfI think I'm slipping a bit into off-topic territory now I think
21:59modwizcodeNo I think this is relevant I was asking because I think the flags being used for m1n1 should probably be paired down (apparently the existing ones break clang) and the fix for that didn't seem... quite right.
21:59yrlfso, effectively, the topic was: what linker flags are _actually_ needed for m1n1, right?
21:59modwizcodeAnd the compiler flags too
22:00yrlfeffectively, what m1n1 needs is -static-pie behaviour
22:00modwizcodefor -static-pie what does that do?
22:00yrlfm1n1 needs to be relocatable, and m1n1 doesn't have a dynamic loader that loads it
22:00yrlf-static-pie is actually a GCC flag, not an LD flag
22:01yrlfso you have to look into the gcc -dumpspecs to see how it invokes LD then
22:02yrlffor clang, there's nothing like -dumpspecs, so we have to find out ourselves what the equivalent ld.lld args are (probably the same as for GNU ld, but there might be slight quirks)
22:02roxfan-v may be enough
22:03yrlfyeah, verbose might be enough to get clang to tell us
22:03yrlfso the LD stuff is probably not that hard to figure out
22:04yrlfthe question is if clang has an equivalent to -mabi=lp64
22:04yrlfthe -mgeneral-regs-only is also pretty much a hack, that I preemptively added since I noticed that printf writes to the q registers that aren't saved on interrupt.
22:05yrlfit's pure luck that GCC doesn't use them as well
22:10FanfweRoot shell, yay !
22:20VinDuv has quit [Quit: Leaving.]
22:25fridtjof[m]Ah, that's what the R stands for? :D
22:26dottedmagmarcan: R is 01010010 so it really looks like a previous' character garbage in a shift register
22:31bostjan has quit [Quit: Leaving]
22:36Ristovskigood stream, very productive
22:37jn__unexpected problems have been my experience with linux porting, too
22:37modwizcodeWhat was the issue in the end?
22:37jn__modwizcode: the UART does interrupts weirdly
22:37jn__edge-triggered, it seems
22:37modwizcoderight but I was trying to figure out the specific
22:38vijfhoekapple has weird hardware, part 231
22:38modwizcodeI thought the interrupt controller was level triggered?
22:38jn__modwizcode: yeah, so that mismatch seems to create problems, if i understood it correctly
22:39modwizcodeAh that's what I was getting at, maybe I'll notice it if I rewatch from beginning at some point. The bit I watched was like "oh that's it" and then was like "okay I'm done" maybe next time he'll explain XD
22:44marcanthe UART has an internal interrupt controller
22:44marcan*that* has its sources edge-triggered
22:44marcanits output is level-triggered into AIC
22:44marcanthe mismatch isn't the problem, the UART driver assuming level-triggered support is the problem
22:45j`eyand AIC only supports edge level?
22:45jn__thanks for clarifying
22:45diddledan"edge level"? that seems like a paradox
22:45modwizcodeThat's interesting
22:46j`eyerr you know what I meant :P
22:46modwizcode"our innovative technology features edge level interrupts for greater performance" ;)
22:47davidrysk[m]lmao the DMA stuff for the core is `#if 0`'d out
22:47davidrysk[m](for the uart)
22:47diddledan"and the spurving bearing feeds into the encabulator"
22:47davidrysk[m]it seems that apple doesn't use interrupts though, their driver is polled-mode
22:50vijfhoekinteresting
22:50vijfhoekpossibly for a reason
22:51diddledanmight find the DMA stuff is blocked-out because of the unified memory architecture
22:51diddledaneither that or I'm speaking out of my bum :-p
22:56snalty has quit [Quit: Leaving]
23:01maor has quit [Ping timeout: 272 seconds]
23:08volpe has quit [Remote host closed the connection]
23:14Emantor has quit [Quit: ZNC - http://znc.in]
23:17Emantor has joined #asahi-dev
23:33yrlfhuh, I think I have found GCC compiler flags that make it resolve ALL of the relocations at compile time
23:34yrlflike, literally only NONE relocations remain
23:34yrlfthe code looks good though
23:34yrlfhaven't found a way to do it portably (i.e. clang) yet
23:35yrlfprobably not _really_ needed, since what we have works, but I kind of want to know
23:36j`eywhat flags? that sounds like it just got lucky.. because all the flags ive seen just minimise relocations
23:36yrlf(the flags are -static-pie for compiling and -static -pie for linking, clang doesn't like -static-pie for compiling though)
23:36yrlfyeah, most likely just got lucky
23:37yrlfwell, at least for the binary sizes we have here it will always work if we have -z notext
23:37yrlfbecause then the compiler can generate relative accesses for everything
23:38yrlfI think the easiest way we can force a relocation there is `int x; int * xptr = x;` globally somewhere
23:38yrlfbecause that can't be done relatively, since its literally data
23:40yrlfI was looking around trying different flags since both GCC and clang were generating relocations that I have definitely already seen GCC optimize away in my own projects
23:40modwizcodeI've been playing with it too and I was having things go very wrong but it looks like you're right -static-pie or the equivilient functionality is what we want here, the current flags are basically what (at least one definition of) -static-pie does
23:41kit_ty_kate has joined #asahi-dev
23:41j`eyyrlf: it could generate some code before main :P
23:41yrlfyeah, what -static-pie does at the linker level is usually -static -pie --no-dynamic-linker. the latter is done here by /DISCARD/ing the .interp and .dynamic sections
23:41j`ey(to set the int x thing)
23:43yrlfj`ey: sounds ugly
23:43yrlfwait, that's effectively what `apply_rela` is
…