hmmmm has quit [Read error: Connection reset by peer]
slidercrank has joined #osdev
hmmmm has joined #osdev
danilogondolfo has joined #osdev
rnicholl1 has joined #osdev
nyah has joined #osdev
gareppa has joined #osdev
Brnocrist has joined #osdev
GeDaMo has joined #osdev
gog has joined #osdev
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
gxt__ has quit [Remote host closed the connection]
gxt__ has joined #osdev
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
jjuran has quit [Quit: Killing Colloquy first, before it kills me…]
jjuran has joined #osdev
<mcrod>
hi
<gog>
hi
<sham1>
hi
<sham1>
My vacation starts in under 3 hours
<mcrod>
gog want a fish
<mcrod>
my vacation starts in 7 weeks
<mcrod>
but it's not much of a vacation; all of that is going to be spending moving
<gog>
hi
<gog>
no idk what i want rn
<gog>
lunch is an unknown
<gog>
also there's an issue with amazon cognito that i'm unable to figure out
<bnchs>
hi
<gog>
i can't even reproduce the error
<gog>
but two users are having the same problem and idk why
vai has joined #osdev
<Ermine>
gog: may I pet you
<gog>
yes
zxrom has quit [Quit: Leaving]
clever has quit [Ping timeout: 252 seconds]
[itchyjunk] has joined #osdev
* Ermine
pets gog
* gog
prr
clever has joined #osdev
zxrom has joined #osdev
xvmt has quit [Ping timeout: 260 seconds]
xvmt has joined #osdev
Left_Turn has joined #osdev
<junon>
The page fault handler must pop off the first item from the stack in x86_64 before IRET'ing, right?
<junon>
cc heat - testing the "phantom write" thing we discussed the other day, manually incrementing the IP on the stack prior to an IRET, but it's triple faulting
<gog>
yes, page faults have an error code
<gog>
there are a handful of exceptions that push a code
<gog>
the recommended thing to do is have a macro that defines a bunch of stubs that call the next handler, and that macro is defined in such a way that it either pushes a dummy value to the stack for vectors that don't use an error code or doesn't
<bslsk05>
github.com: sophia/kc/core/cpu/exceptions.S at main · adachristine/sophia · GitHub
<gog>
see the macro EXCEPTION_DEFINE
<junon>
In this case I'm trying to skip an instruction that page faults by manually incrementing the IP on the stack prior to iret. I know this is weird, I just want to see if it works. I know the faulting instruction is encoded as 4 bytes, so in the page fault handler (just to test) I'm doing 'ADD rsp, 8' to pop off the code from the stack, and then 'ADD [rsp], 4' to increment the IP. I verified that the value at the top of the stack after the 'add 8' is the address of
<junon>
the faulting instruction.
Turn_Left has joined #osdev
<junon>
but QEMU just quits after that, doesn't even fire the double fault handler.
<gog>
make sure you're adding to the right location in the stack
<junon>
and 'nexti' in gcc doesn't jump anywhere.
<gog>
are you sure that the instruction fetch isn't what's causing the page fault?
<junon>
wouldn't the instructions be fetched already?
<junon>
it's just 4 bytes from the current IP
<junon>
or maybe I'm not understanding the question
<junon>
I'm 100% certain the memory mapping is correct in terms of the executable being run
Left_Turn has quit [Ping timeout: 240 seconds]
zxrom has quit [Ping timeout: 250 seconds]
<gog>
ok
<gog>
then are you positive you're adding to the saved instruction pointer?
<gog>
the stack frame that a fault pushes has a lot of stuff
<junon>
as far as I understand, it pushes some selectors, then the return address (which I verified is the address that fauled), followed by in this case the error code. So I'm popping just the error code, then adding 4 to the top of the stack with 'add QWORD PTR[rsp], 4', which I verified adds 4 and results in address of the instruction after it. Then I iretq.
<junon>
Maybe the 'q' suffix for 'iret' is incorrect in this case?
<gog>
no, you're in long mode so it has to be iretq
<junon>
right and if I don't specify then it emits an iretw for some reason
<gog>
yes
<gog>
which is wrong because it'll pop 4 bytes for the ip then 4 for the code segment
<junon>
right okay, so iretq is the correct one.
<junon>
let me turn on exception logging when I get to the iretq and see what it says, sec
<zid>
x86_64's default size being 32bit strikes again?
<junon>
old -1, new 0xd; old 0xd new 0xb; old 0x8 new 0xb all directly after the iretq
<zid>
check the first fault and it'll give you a v=
<zid>
and e=
<zid>
those can be handy
<junon>
v=0d e=0030
<zid>
is 0x30 your cs?
<junon>
can't be, I don't have that many entries in the GDT.
<zid>
oh dear.
<junon>
My TSS must be pooched then
<junon>
also I just realized, thus far I haven't actually returned from a handler yet, I've always halted, so maybe this was masking another bug
<junon>
So 'e' is the selector that will be switched back to after the iret, if I'm understanding correctly?
<junon>
(trying to wrap my head around TSSes still, sorry if I'm asking dumb questions)
<junon>
okay so there are generally only two TSSes when doing software multitasking, one for ring0 and one for ring3, right?
slidercrank has quit [Ping timeout: 240 seconds]
zxrom has joined #osdev
gareppa has quit [Quit: gareppa]
gareppa has joined #osdev
<mrvn>
why would you have 2?
jjuran has quit [Read error: Connection reset by peer]
<gog>
you need 1 per cpu iirc
<gog>
logical cpu
jjuran has joined #osdev
<mrvn>
right. Each core needs it's own double fault stack in case more than one core double faults at the same time.
eck has quit [Quit: PIRCH98:WIN 95/98/WIN NT:1.0 (build 1.0.1.1190)]
eck has joined #osdev
FreeFull has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
gog has quit [Quit: Konversation terminated!]
xenos1984 has quit [Ping timeout: 264 seconds]
xenos1984 has joined #osdev
JerryXiao has quit [Quit: Bye]
danilogondolfo has quit [Quit: Leaving]
JerryXiao has joined #osdev
JerryXiao has quit [Quit: Bye]
JerryXiao has joined #osdev
travisg has quit [Server closed connection]
travisg has joined #osdev
gorgonical` has joined #osdev
<gorgonical`>
That Finnish juustoleipä is maybe the greatest thing ever
danlarkin has quit [Server closed connection]
vin has quit [Remote host closed the connection]
danlarkin has joined #osdev
vai has quit [Ping timeout: 260 seconds]
slidercrank has joined #osdev
* geist
yawns at everyone
<geist>
so todays mission: more support for the visionfive 2 board
<geist>
i had a basic port, but nothing else. need to flesh it out
<Ermine>
geist: are you talking about support by lk?
<geist>
yeah
<geist>
then i'll switch over and bring up zircon on it
<geist>
but figure i may as well flesh it out on LK where it's easier and faster to move
<geist>
i was gonna do a bunch of bringup when i first got the board, but it's been generally more useful as a linux-riscv machine up until now
<sham1>
gorgonical`: it's "leipäjuusto", "juustoleipä" is bread with cheese on it
<gorgonical>
Oh. I read that it goes either way but I suppose bread-cheese makes more sense than cheese-bread
<sham1>
absolute heresy
<gorgonical>
Anyway I love it
<sham1>
People from the east use "juustoleipä" for it and they're wrong
<sham1>
And yes, it's good
<gorgonical>
I read in Sweden they call it coffee cheese because they put it in their hot coffee
<gorgonical>
Sounds gross
gog has joined #osdev
deflated8837 has joined #osdev
dude12312414 has joined #osdev
k0valski188910 has joined #osdev
gareppa has quit [Quit: WeeChat 3.8]
<geist>
interesting, zen4 apparently coalesces 4 4K pages into 16K pages in the L2 DTLB
<geist>
ie, 4 aligned 4K pages with the same permission bits get transparently coalesced. I wonder how things like D bits being out of sync between them works
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
frkazoid333 has joined #osdev
<zid>
I am zen3 so I have no cool coallessing AND no memory renaming :'(
rnicholl1 has joined #osdev
zxrom_ has joined #osdev
zxrom has quit [Ping timeout: 260 seconds]
lanodan has quit [Ping timeout: 246 seconds]
lanodan has joined #osdev
zxrom_ is now known as zxrom
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
snowcra5h has quit [Read error: Connection reset by peer]
snowcra5h has joined #osdev
snowcra5h has quit [Client Quit]
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
<mcrod>
does gcc really generate this bad of code in the presence of std::function?
<mcrod>
or am I missing something
<sham1>
Generating bad code in the presence of std::function isn't exactly unexpected
<zid>
"help, my crappy wrapper class is generating more code than 0" is the complaint?
<sham1>
But my epic C++ zero-cost abstractioneeros, noook
<mcrod>
sham1 it is unexpected when clang saw right through that shit
Turn_Left has quit [Read error: Connection reset by peer]
<sham1>
Well both compilers have different optimisations and of course clang is just more aggressive in general
<zid>
and I don't thinking adding -ffast-math is going to help this code, lol
<zid>
(-Ofast is -O3 + -ffast-math)
<mcrod>
duh
<mcrod>
I just use -Ofast just cuz
<mcrod>
for this example
<mcrod>
sham1 don't worry, I showed this to a die hard C++ fan who is somehow also a friend, and he was like "i agree. but i'll still use std::function."
<mcrod>
i was sad.
<mcrod>
where is everyone
<sakasama>
Doing cool stuff with std::function.
<zid>
playing FF12
slidercrank has quit [Ping timeout: 246 seconds]
benlyn has quit [Remote host closed the connection]
<kof123>
fighting the compiler dragon
<kof123>
then you must make a potion out of his blood
[itchyjunk] has quit [Ping timeout: 246 seconds]
nyah has quit [Quit: leaving]
[itchyjunk] has joined #osdev
FreeFull has quit []
<gog>
ryzen ryzen ryzen ryzen
<mjg>
-Opessimal
<gog>
why are you so pessimal
<gog>
cheer up buddy
<gog>
it's gonna be ok
<gog>
we'll get through this together
<gog>
i believe in you
<mjg>
-O2
<bl4ckb0ne>
-Os
<mjg>
nothing like a good pep talk innit
<mjg>
bl4ckb0ne: that's back to pessimal
<mjg>
you need a pep talk?
<gog>
-fsmol-bean -mhave-anxiety
<gog>
pessimal
<mjg>
-fuck=performance
<bl4ckb0ne>
pep talk me mjg
<mjg>
cheer up buddy
<mjg>
i'm not good at this
<mjg>
gog wanna take over for some pets in return
* gog
patpatat
* mjg
pets gog
<gog>
bl4ckb0ne: it's gonna be ok
<gog>
we'll get through this together
<gog>
i believe in you
<mjg>
unpet yourself
<mjg>
was hoping for new content
<mjg>
now that i said, chatgpt should be able to help
<mjg>
lul i actually asked it
<mjg>
> Alright, team, gather 'round! Today is a big day, and I know each and every one of you has what it takes to rise to the occasion. I see a group of talented, driven individuals before me, and together, we're going to accomplish amazing things.
<mjg>
the occasion being another lapsed deadline
<mjg>
:S
<mjg>
and expected action to dodge responsibility
<bl4ckb0ne>
6/10 pep talk mjg
<mcrod>
gog may I pet you
<bl4ckb0ne>
what about -Oz
<mjg>
-OuWu
<bl4ckb0ne>
i might not give you a pep talk but i can give you a peppa pig drawing