xenos1984 has quit [Read error: Connection reset by peer]
pieguy128 has joined #osdev
saltd has joined #osdev
xenos1984 has joined #osdev
sonny has quit [Quit: Client closed]
tarel2 has quit [Ping timeout: 252 seconds]
arch_angel has joined #osdev
scoobydoo_ has joined #osdev
scoobydoo has quit [Ping timeout: 252 seconds]
scoobydoo_ is now known as scoobydoo
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
scoobydoo_ has joined #osdev
<heat>
you got me to start upgrading my toolchains again
<heat>
yay
scoobydoo has quit [Ping timeout: 252 seconds]
scoobydoo_ is now known as scoobydoo
<heat>
i started with llvm because gcc is always a bitch when it comes to its own libsanitizer, which is pretty much compiler-rt but slightly forked at a random point in time
<heat>
they keep upgrading it but not in such a way that I can transparently apply the LLVM compiler-rt patch to it
<zid>
I might as well install 12.2 and try the new analyzer changes, see if it just prints "depth too deep" a thousand times and does nothing or not
<heat>
i havent used the analyzer yet
<heat>
is it any good?
<zid>
.it just prints "depth too deep" a thousand times and does nothing or not
<zid>
is my full experience so far
<moon-child>
it found a couple of trivial places where I forgot to check for alloc failure
<moon-child>
so that's something. Not very much, though
<heat>
is it better or worse than clang-tidy?
<moon-child>
idk, haven't used that
<moon-child>
dmalcolm is cool though
<zid>
I assumed clang-tidy was a formatter
<zid>
it's an oldschool linter?
saltd has quit [Quit: joins libera]
scoobydoo has quit [Ping timeout: 268 seconds]
scoobydoo has joined #osdev
<heat>
zid, clant-tidy is a linter + static analyzer
<heat>
s/clant/clang/
<heat>
clang-format is the formatter
<zid>
yea oldschool linter
<zid>
that was to provide warnings
<zid>
not to format
<zid>
linters these days just warn about formatting
moberg1 has joined #osdev
moberg has quit [Ping timeout: 255 seconds]
<zid>
Okay it took me 10 minutes but I figured out how to merge gcc 12.2
<zid>
I had forgotten how my distro worked
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
carbonfiber has quit [Quit: Connection closed for inactivity]
<heat>
gentoo bad, arch lunix good
<zid>
how do you pull things that aren't "out" into your system set in arch?
<heat>
i either compile them manually or if I really want to I'll go to the trouble of grabbing the PKGBUILD and changing some stuff up
<heat>
but erm, this is super rare
<heat>
arch rolls very quickly so
<heat>
i already have 12.2
<heat>
as well as qemu 7.1
<moon-child>
there is also aur
<zid>
I have 12.2 it just isn't official yet
<zid>
i.e the base set doesn't include it, it includes 11.3
<zid>
important that they build the entire ecosystem with 12.2 for a few weeks first
jjuran has quit [Ping timeout: 268 seconds]
orccoin has quit [Quit: Leaving.]
jjuran has joined #osdev
jjuran has quit [Remote host closed the connection]
jjuran has joined #osdev
orccoin has joined #osdev
<geist>
man, been staring at the qemu page table code for arm64 and i just dont see where it implements the A and D bit writeback logic
<geist>
despite declaring that it deoes implement it
<zid>
I am not a computer, gcc 12.2 crashed during build
<zid>
no computing happening
<zid>
kswapd used all my cpu then the build failed, at least
<zid>
I assume it ran out of memory somewhere
<zid>
ah yea, cc1plus tried to use 17GB of ram
<jjuran>
I'm not a computer! I'm a human being!
<dminuoso>
You should start Haskell development. You'd have 32GiB RAM minimum.
<zid>
how does that work dminuoso?
<dminuoso>
GHC is a memory hungry monster. If it had existed longer, you'd be telling kids stories about the "Glorious Memory Consumer" from Glasgow.
<dminuoso>
But we dont tell kids stories anymore, so...
<zid>
do you mean "need"?
<dminuoso>
Heh. Yeah
epony has quit [Read error: Connection reset by peer]
<zid>
That makes a *lot* more sense.
<clever>
dminuoso: i once hit a brick wall just LINKING firefox on a 32bit machine
<clever>
it needed >3gig of ram, and with a 32bit virtual space, it aint happening
<jjuran>
Is it still free as in freedom if you can't build it, but merely have the /right/ to build it?
<zid>
3GB? cute
<zid>
chrome needs like 40
<clever>
zid: last i checked, electron needed ~30gig of DISK SPACE just to checkout its source, lol
<zid>
rust needs about that
<zid>
10-30 somewhere, that's why my VM has another drive
<clever>
because the tooling keeps the .git's for everything
<zid>
because I have to mount /dev/sdc1 over /var/db/portage/packages/sys-devel/rust/work
<zid>
to add enough disk space to the machine to get rust to build
<geist>
hmm, really unclear how to tellk in linux if it's using accessed faults or not on arm64
<geist>
i see no mention of it in dmesg, and there doesn't seem to be a counter
<clever>
geist: bit 55 in /proc/PID/pagemap maybe? "pte is soft-dirty"
<clever>
Documentation/admin-guide/mm/soft-dirty.rst and admin-guide/mm/pagemap.rst in the linux source
<geist>
well, its not whether or not the upper level code has an accessed bit, it's if its using the hardware a-bit or emulating it with accsseed faults
<clever>
ah, yeah, this wont tell you if its faked with ro pages, or if the hw is editing pagetables for you
<clever>
you would have to dig deeper into the source
* dminuoso
needs about 16GiB to compute the entire nixos closure of his mail setup (16 machines)
<dminuoso>
Memory has become just a resource that is cheaper to waste and buy than to conserve
<kazinsal>
RAM that doesn't contain anything is wasted
<kazinsal>
free RAM means you're not getting your money's worth
<clever>
i often see rpi users complaining on the forum when `free -m` reports very little free
<clever>
kazinsal: and then exactly what you said is posted as a reply
<dminuoso>
kazinsal: That argument is two fold. If your program uses much physical memory, that reduces available memory for buffers/caches, and it increases thrashing.
<dminuoso>
It's not necessarily about whether ram is used, but how much ram is used by a particular process
<clever>
yeah
<kazinsal>
my desktop (windows machine) is at ~23380 MB in use, ~220 MB modified (about to be paged out), ~8890 MB cache, and I don't even see a "free" bar
<dminuoso>
Besides, the more developers are liberal, the more frequent you have to upgrade hardware. :(
<dminuoso>
clever: Wow that's hefty. What's the cause here?
<dminuoso>
Forgot to install memory? :>
<kazinsal>
part of that first bit is also 3400 MB of compressed in-use that's 10700 MB uncompressed
<clever>
dminuoso: chromium and about 4000 open tabs, 32gig of ram, 64gig of swap
<kazinsal>
windows LOVES swap
<kazinsal>
it's great
<kazinsal>
I've got 38 GB of swap in use but I don't care because my system is fast and I boot from NVMe
<zid>
windows has always loved swap very much
<kazinsal>
people are always like "ugh why do you need a swapfile so big" and it's like, because the system is faster when it can page your bajillion porno tabs out in favour of doing useful shit
<zid>
It used to page my audio drivers out
<dminuoso>
clever: Ah yes. I recall having extreme memory problems since firefox introduced their new site isolation.
<zid>
they thankfully got a *little* better about it
<clever>
dminuoso: one example, discord leaks memory, its up to 1.8gig for that single tab
<dminuoso>
It stopped my behavior of just collecting tabs all week long
<zid>
discord doesn't leak memory
<kazinsal>
haha yeah at some point Microsoft started saying "please mark your code segments as non-pageable if you're writing drivers"
<zid>
images and videos etc are just fucking big
<clever>
zid: then why is it using 1.8gig?
<zid>
it's literally just a chrome tab
<zid>
it uses as much memory as chrome would, with all your servers/channels open in a tab each
<kazinsal>
yeah that's just CEF/electron doing big honkin cache stuff
<clever>
zid: this IS a chrome tab, in chromium, its not electron
<kazinsal>
iirc chromium/CEF lets you set a specific fractional limit for your app
<dminuoso>
clever: It's 1.2GiB of npm dependencies. Half of that by all possible versions of left_pad coexisting.
<zid>
Mine's often using 2-3GB if I click a bunch of channels with heavy images etc in them
<clever>
after hitting refresh, that tab is down to 400mb used
<dminuoso>
/s
<clever>
dminuoso: then why is it using 400mb after a refresh?
<zid>
realloc :P
<kazinsal>
my Electron!Discord is 992 MB right now
<clever>
did it magically loose 1.4gig of dependencies?
<dminuoso>
clever: It was a humerous remark. :)
<clever>
or was it leaking 1.4gig worth of html elements?
<kazinsal>
post-refresh it's actually gone up!
<zid>
images are *big*
<zid>
like genuinely fucking huge
<kazinsal>
ooh, nitro gets 500 meg files now
<clever>
zid: yeah, but it should free those when its done
<kazinsal>
thanks for reminding me to refresh discord
<zid>
when is it "done"?
<clever>
when they arent visible anymore
<zid>
It'd be a bad look if it redownloaded every image every time you changed channel
<zid>
they're always visible
<zid>
potentially
<kazinsal>
again, caching is important
<clever>
thats what the cache is for
<kazinsal>
free ram is unused ram
<clever>
why does it have to keep it in ram?
<zid>
so why complain that it's caching
<kazinsal>
and unused ram is wasted ram
<kazinsal>
speed!
<zid>
because hdds are fucking dick slow and 2GB is nothing in the real world
<kazinsal>
people want shit now now now now now
<clever>
zid: its not caching it in the network cache, its caching the uncompessed image
<zid>
yesand?
<clever>
i say it shouldnt :P
<clever>
i have nvme, my disk isnt dick sow :P
<zid>
use irc then
<clever>
slow*
<clever>
zid: a far bigger problem i have, is that many tasks in chromium depend on the master process, and its very easy to deadlock it
<zid>
you can also turn off images I think
<kazinsal>
while I am thoroughly on team "broadband internet to the masses was a mistake" I cannot change the past so I am also on team "faster is better and caching is great if I don't have to suffer for it"
<zid>
"Developers should not have SSDs" is my motto
<kazinsal>
and y'know what? I don't suffer for discord using 800 megs of RAM while I'm watching Irish people try Carolina Reaper candies
<zid>
They should have 5400rpm laptop drives
<zid>
Until your program runs nicely like that, don't darken my doorstep :P
<clever>
lol
<kazinsal>
oh man 5400 rpm drives
<kazinsal>
I haven't seen those in a while
<zid>
My mother's laptop had one
<zid>
it was running windows *10*
<zid>
It took 10 minutes to boot
<kazinsal>
yeah I think my family is all off spinning rust at this point
<clever>
that reminds me, my dads desktop, i dont know his rpm, but its horid slow
<zid>
I installed w7 on it and now it boots in 30 seconds
<zid>
cus w7 knows what a hdd is
<clever>
last time i visited, the hdd ldd was just permanently on, for HOURS
<mats1>
whats your mom's phone number
<clever>
i then found out why, avg had an update waiting for a reboot
<zid>
w10 just expects to be on an ssd so touches millions of tiny files at boot
<kazinsal>
I have spinnies for mass data storage but like, we don't even sell that kinda thing at work anymore
<clever>
and for some reason, that makes avg spin and use 100% cpu and disk io
<zid>
mats1: I don't know it and that's inappropriate
<kazinsal>
AFFs are just so fuckin common and cheap now
<clever>
rebooting made it instantly stop
<zid>
yea I use spinnie rust for torrents
<zid>
I snagged 4TB for £30 recently, bargain
<mats1>
i'm just going to tell her i work for msft and she has a virus
<kazinsal>
when I do my next desktop build I'm going to grab another bunch of 4s or maybe a set of 8s, depending on pricing
<zid>
smaller drives are way less price efficient in my experience
<zid>
I wanted another 1TB for my machine a few years ago, and it was like, £100 for 1TB, £120 for 2TB, etc
<kazinsal>
because new desktop CPU/mobo/RAM will replace the 8700K/Z370/DDR4 and that will replace the E5-2650/nightmare custom mobo/DDR3
<zid>
so I just gave up cus I couldn't afford 8TB and everything else felt bad :P
<zid>
kazinsal: Still got the nightmare ram? :P
<mats1>
what's the point of hoarding torrents
<zid>
ratio
<zid>
and anti-snatch
<mats1>
amateur
<kazinsal>
yeah, it's 64 GB ECC DDR3-1333 I think
<kazinsal>
it's still in the machine
<zid>
on certain trackers if you don't reseed for a monh it counts as a snatch
<zid>
ah damn I can't use rdimms I don't think, only urdimms / udimms
<mats1>
i pay for the month long freeleech and then rent a feralhosting box
<kazinsal>
I'm planning on upgrading this thing around Christmas I think
<mats1>
comes to like $40 for 15+tb
<kazinsal>
that should be when I get the incoming promised fat raise and bonus
<zid>
kazinsal: you're just going to have to buy me a new PC then, sorry
<kazinsal>
and Zen 4 should be out and BIOSes for it should be less buggy by then
<mats1>
its more price efficient, and you don't waste electricity keeping a box going 24h a day
<mats1>
take notes
<zid>
I can't turn my desktop off though
<kazinsal>
my SAN is also my firewall
<zid>
my idle games give me faster rewards if they're running
<kazinsal>
and I live in magical canuckistan where we have cheap hydroelectricity
<kazinsal>
liquid cooled? nah man my compute is liquid powered
<mats1>
is hydro still cheap during these heat waves
<mats1>
buncha dams in teh news are down like 70% output
<kazinsal>
oh yeah
<kazinsal>
all our dams are on the main rivers of the pacific northwest
<kazinsal>
shit's all gotta go through us before it gets to the PNW states
<kazinsal>
I pay about 0.09 CAD/kWh
epony has joined #osdev
<kazinsal>
so that's like 0.07 USD/kWh
<kazinsal>
over 90% of electricity generation in BC is hydro
<mats1>
sounds good for mining bitcorns
<kazinsal>
the rest is a mix of geothermal and some natgas and diesel up in the frozen wastes
moberg has joined #osdev
<zid>
we're about to hit $1/kwhr :D
<zid>
and it's only price gouging
<mats1>
that's the price we pay to hurt the muscovites
moberg1 has quit [Ping timeout: 252 seconds]
<mats1>
long live the anglo empire
<kazinsal>
damn shouldn't have shut off all those tasty tasty atoms
<kazinsal>
this post brought to you by: CANDU gang
epony has quit [Ping timeout: 252 seconds]
<zid>
except it's literally nothing to do with russia here
<zid>
it's 100% price gouging
<kazinsal>
also her, wait, sorry, his majesty's imperial credits of the realm have tanked in value
<zid>
germany's problem is that they fucked up their power market on purpose
<zid>
ours is tories
<kazinsal>
solution: we outlaw conservatives
epony has joined #osdev
<zid>
kazinsal that's disgraceful how could you suggest such a thing
<zid>
We put them into industrial furnaces and at least get some use out of them.
<kazinsal>
the arch-conservative is gone, we just need to remove her underlings
<zid>
wat
<kazinsal>
the queen is dead, not sure if you heard
<zid>
yes
<zid>
why is she the arch conservative
<kazinsal>
tories love the monarchy
<zid>
she's not the one selling me out to corporations
<zid>
that's the PM, head of government, queen is head of state, completely different job
<zid>
she greets foreign diplomats and has tea
<zid>
300 times a year
<kazinsal>
(I'm wondering if the canadian mint will attempt to just put actual canadians on the coins instead of charles or if tories will just immediately block that)
<kazinsal>
put friggin terry fox on the money goddammit
<zid>
I'm expecting a lot of countries to no longer have our monarchy
<zid>
and for it to slowly die here
<kazinsal>
september 8th will be a national holiday for like, 70% of the planet
<kazinsal>
the next 72 hours or so are gonna be one giant party all over the place
<kazinsal>
at least one news station in I think Argentina popped champagne
<zid>
liz was amazing, nobody will be able to compete, and there's a chance that charles/etc will just be actually incompetent
<zid>
and kill the monarchy off
<zid>
The only people who have a legitimate (ish) beef with ER2 were the irish
<zid>
everyone else is just being mean to a nice old lady
<kazinsal>
liz somehow managed to be non-inbred enough to be sociable
<zid>
in order to posture against the UK
elastic_dog has quit [Ping timeout: 268 seconds]
elastic_dog has joined #osdev
carbonfiber has quit [Quit: Connection closed for inactivity]
freakazoid333 has quit [Ping timeout: 244 seconds]
m5zs7k has quit [Ping timeout: 252 seconds]
<zid>
where's heat when you need someone to translate .pt
m5zs7k has joined #osdev
vdamewood has joined #osdev
pie_ has quit []
vancz has quit []
pie_ has joined #osdev
vancz has joined #osdev
elderK has quit [Quit: Connection closed for inactivity]
<zid>
okay they fixed the typo I found
GeDaMo has joined #osdev
* vdamewood
makes an better typo
opal has quit [Remote host closed the connection]
opal has joined #osdev
netbsduser has joined #osdev
<epony>
if only someone knew what the monarchy is used for..
<zid>
head of state + tourism
<zid>
could have googled that yourself
<epony>
running continents as a service, and feeling noble of course, more than the ohers, important and "superior" majestic
<GeDaMo>
A distraction from government incompetence
<zid>
That'll be the tory plan currently
<zid>
And the americans won't stop fucking memeing about her dying because they don't know shit
<epony>
feodalism is a form of tourism too by that logic
<zid>
we're about to get fucking *hosed* by the tories not having to show up in the news
<GeDaMo>
Have you seen anything about the actual unit rate / standing charge rather than this "average £2500" on energy bills?
<epony>
so the defender of the common people lives in several castles with the most riches and excesses of the world now, and feels compassionate, for which they are awarded the estates of centuries old captive peasantry owners
<kazinsal>
we have a completely different set of issues in the New World
<epony>
but the same economic and political (feodal) system
<GeDaMo>
I'm pretty sure they're the same issues just wearing a different hat :P
<kazinsal>
wherein we have all the water north of the 49th parallel and the desert nation of America has little of it
<zid>
GeDaMo: it's typical tory propaganda, it's a tax cut for the rich, fucks the poor, and phrased as an amazing idea
<GeDaMo>
We have the same issue in Scotland :|
<zid>
but they won't have to defend it now
<GeDaMo>
I'm just reading that with parliament suspended the freeze might not happen before October
<zid>
or anything, for like, a month, then for a month or two after that it will be "Let's not get bogged down in politics in these trying times"
<kazinsal>
I expect by 2025 I will either be living in the forest fighting off fascist militias stealing the water of Kootenay Lake or I will be a subject of the American Occupancy Governance
<zid>
then a few months after that they will turn on the monarchy and claim the root of all the country's woes are how much the monarchy cost
nyah has joined #osdev
<zid>
it'd be funny if it weren't so depressingly sad
<epony>
too much scare, too little fair
<GeDaMo>
"If we wait a bit longer the poor will have died off and the problem will have solved itself" :|
<epony>
there is enough for everybody, if the few were not holding it all for them, the many would have had for them too
<zid>
Thankfully the people who die first in cold snaps are their voting bloc, pensioners
<epony>
https://en.wikipedia.org/wiki/Charles_Dickens#Social_commentary : Karl Marx asserted that Dickens "issued to the world more political and social truths than have been uttered by all the professional politicians, publicists and moralists put together".
<bslsk05>
en.wikipedia.org: Charles Dickens - Wikipedia
orccoin has quit [Ping timeout: 244 seconds]
mykernel has joined #osdev
Ali_A has joined #osdev
Ali_A has quit [Quit: Client closed]
foudfou has joined #osdev
foudfou_ has quit [Quit: Bye]
sebonirc has quit [Ping timeout: 248 seconds]
sebonirc has joined #osdev
mykernel_ has joined #osdev
mykernel has quit [Ping timeout: 252 seconds]
elastic_dog has quit [Ping timeout: 248 seconds]
epony has quit [Remote host closed the connection]
elastic_dog has joined #osdev
<mykernel_>
my code works on qemu, bochs, my i5-7200, but it triple faults on my other two machines (old intel atom and amd a4-4020). the triple fault occurs on same instruction on both cpus - modifying page table lvl2. is there a problem modifying page tables directly? the instruction is located at early stages of initialization while memory mapping framebuffer, so my debbuging options are limited :(
<mykernel_>
this started happening on my switch from x86 higher half (3gb+1mb) to x86_64 higher half (-2gb+1mb)
[itchyjunk] has joined #osdev
pitust has joined #osdev
<Mutabah>
TLB invalidation?
<mykernel_>
i loaded cr3 with new page directory 1000 lines before that
<mykernel_>
that invalidates all caches ifaik
<Mutabah>
... 1000 lines?
<pitust>
if CR4.PCIDE is clear then move to cr3 invalidates pcid 0x0000
<mykernel_>
i meant the memory i am using for page tables are mapped correctly
<pitust>
it sounds like a tlb thing i agree
<pitust>
put something like `asm volatile("mov %%cr3, %%rax;mov %%rax, %%cr3" ::: "rax", "memory");` before that part
\Test_User has quit [Quit: e]
smach has joined #osdev
epony has joined #osdev
\Test_User has joined #osdev
<mykernel_>
still triple faults
<pitust>
also put it right after that
<pitust>
then run in qemu
<pitust>
also WHAT instruction is that even
<pitust>
and what error code
<mykernel_>
cant get error code because this only happens on some hw :(
<pitust>
i can't see what "only happens on some hw" has to do with "print the error code in the exception handler"
<mykernel_>
please read what i wrote up here
<mykernel_>
i cant write because this exception happens during mem mapping framebuffer
<pitust>
ah okay
<pitust>
uh
<\Test_User>
print the error code to the tripple fault exception handler? doesn't work out well...
<pitust>
|Test_User: well obviously not the triple fault handler
<pitust>
write all the debug text to memory, reboot and read out the results in the bootloader?
<\Test_User>
if what's noticed is tripple fault, then which handler should it be
<pitust>
hmm
<pitust>
~~smm handler~~
<pitust>
what if you ran the os in kvm on those machines
<mykernel_>
pitust: i will try this rn
<mykernel_>
this one cpu does not have virt support :(
<pitust>
both of them?
<mykernel_>
i do not have linux on the other one
<pitust>
oh okay, they sound pretty old so it wouldn't have virt probably anyway
<pitust>
also i think this is a great moment to shill limine which is a great bootloader puts you straight into 64bit mode and it maps the framebuffer and shit
<pitust>
now with arm
<pitust>
*arm64 support
<pitust>
as opposed to certain protocols i could name which are x86-only and dont really work all that well on 64bit either
<bslsk05>
en.wikipedia.org: Bastard Operator From Hell - Wikipedia
<mjg_>
weird feature which keeps fcking people over
<geist>
gosh no
<geist>
so being that kernel stacks are permanently wired, and fuchsia has a relatively high number of stacks, reducing the size of the stacks is paramount
<geist>
actually to be fair, it's not really 8k. it's per arch. on arm64 it's 8k stack, 4k call stack
<geist>
on x86-64 it's 8k stack + 8k safe stack. so i'm being kinda cheesy
<mjg_>
why high number?
<geist>
but on the arm side it is basically 8k, since the call tack is not used much
<mjg_>
you are doing something nasty there?
<mjg_>
i mean does it differ from thread count
<geist>
wait, what number?
<mjg_>
> fuchsia has a relatively high number of stack
<mjg_>
s
<geist>
oh, lots of threads i mean
<mjg_>
ok
<geist>
sorry, i've only partially woken up
<geist>
just starting to drink my morning coffee
<geist>
so yeah on x86 we are effectively using 16k tacks, but the usage is not distributed evenly between both 8ks
vdamewood has quit [Quit: Life beckons]
vdamewood has joined #osdev
pieguy128 has quit [Ping timeout: 244 seconds]
pieguy128 has joined #osdev
frkzoid has joined #osdev
pieguy128_ has joined #osdev
pieguy128 has quit [Ping timeout: 252 seconds]
pieguy128_ has quit [Ping timeout: 260 seconds]
arch_angel has left #osdev [Leaving]
xenos1984 has quit [Ping timeout: 248 seconds]
xenos1984 has joined #osdev
<mjg_>
re stack swapping, it is still a thing on some systems i'm not going to name
<mjg_>
and as you can imagine adds funny complexity where there shuld be none
<geist>
heat: two different things. there's a shadow stack, and then there's a shadow call stack
<geist>
er safe stack and shadow call stack
<geist>
on x86 we use safe stack, on arm64 we use shadow call stack
<heat>
yeh
<heat>
i get the two confused frequently
<heat>
(and I don't get why each one doesn't support the other arch)
<geist>
you can't easily do a shadow call stack on x86 because of cal/ret, but on arm64 it's fairly natural becaus eyou just have to stuff lr on x18
<geist>
so the codegen for it isn't really bad at all. you just have to burn a register (x18 in this case) to hold the call stack
<geist>
it even grows upwards!
<heat>
cringe
<geist>
you can do safe stack on arm64, but i think the idea is shadow call stack is most of the win, so you dont really need *both* at the same time
<heat>
stacks that grow upwards are like, not cool man
<moon-child>
shadow callstack is pretty easy on x86, _if_ you give up backwards compatibility
<moon-child>
rsp is 16-byte records; 8-byte ret, 8-byte framepointer
<geist>
moon-child: easy but maybe not fast, because of call instruction
<moon-child>
rbp is current framepointer
<moon-child>
that's fast
<geist>
call already dumps the return address on the stack, you hvae to then pop it off, etc
<moon-child>
but clang thing wanted to keep compatibility with existing debug tools and unwinders
<moon-child>
actually, hmm, could you be fast and keep compat? I think you'd need three words per activation record in rsp: one for ret, one for previous rsp, and one for previous rbp, and then it would just work
<froggey>
use rsp as the shadow call stack and steal another register to act as the normal data stack, abi be damned
<heat>
yeah that's what I was thinking of
<heat>
screw compat
<geist>
i think there's some effort underway for that
<geist>
but the idea is it probably wont be as efficient on x86. probably something like call, and then a separate instruction inside to copy off the main stack to the shadow call stack
<geist>
and then return via that
<geist>
such that it's there, but you can't hack it to return
<moon-child>
why wouldn't it be as efficient?
<geist>
because of the extra steps, and probably defeating the return call stack
<moon-child>
there's no need to copy anything; you just leave the return address on rsp
<heat>
does it need to be efficient though? these are just sanitizers
<geist>
since there wouldn't be a corresponding ret instruction
<moon-child>
nothing else aliases rsp, so there's no danger of overhead
<heat>
and yes, I know fuchsia compiles regular code with em
<geist>
heat: oh no nota t all, the whole point of the shadow call stack is to keep code from doing return-address-hacks
<geist>
it's not a sanitizer, it's a ROP avoidance thing
<moon-child>
err, no danger of overflow
<geist>
same with the safe stack, etc. you can't overrun a local variable and hack the return address
<heat>
why not CET»
<heat>
?
<geist>
what is CET?
<heat>
intel CET
<geist>
on what hardware is it available?
<heat>
tl;dr CFI
<geist>
and is it available on ARM?
<heat>
doesn't arm have something similar?
<geist>
if so, what is it and what variant of arm is it avilable in? (hint: no)
<geist>
point is, yes maybe at some point hardware will ubiqioutously have it, but not right now
<geist>
so given a software solution, the point is to avoid ROP exploits
<geist>
by keeping the return address off the same stack as any local vars that can be overrun
<geist>
also, and somewhat more importantly, these are already existing solutions in clang/llvm and dont change the abi, so they're nice
<heat>
true
<geist>
the arm shadow call stack doesn't even destroy the return address cache, because you just pop it off of x18 back into lr before running a regular ret instruction
saltd has quit [Read error: Connection reset by peer]
saltd has joined #osdev
ephemer0l has joined #osdev
<mrvn>
moon-child: if you know where the stack and the shadow stack is then can calulate how much to overflow your local variable to corrupt the return address. It just a bigger offset.
<moon-child>
yes but you don't know where the call stack is
<moon-child>
put it at a randomised address, and you never have any pointers into it (aside from rsp)
<mrvn>
That's what she said. :)
* moon-child
trouts mrvn
ThinkT510 has quit [Quit: WeeChat 3.6]
<mrvn>
Has anyone found a bug where the shadow stack address leaks yet?
saltd has quit [Remote host closed the connection]
<geist>
yah that's the key, there's no way to programmatically get ahold of the shadow call stack, except via actually directly reading the register (x18)
<geist>
but if you can do that you have to either be corrupting the text segment, or compiling code itself. and it's not there to protect against code that is being compiled
<geist>
it's to protect against attacks against existing code
<mrvn>
Huh? I thought you had to compile for shadow stack. Do you mean existing source?
<geist>
sure, but what i mean is it's not intneded to protect against code that is compiled with it
saltd has joined #osdev
<geist>
ie, you can still write inline assembly that just reads x18 and trashes the call stack
saltd has quit [Read error: Connection reset by peer]
<mrvn>
No, just mitigates accidental buffer overflows.
<mrvn>
(accidentaly by the author, not the attacker)
Matt|home has quit [Quit: Leaving]
wxwisiasdf has joined #osdev
<wxwisiasdf>
good morning Operatives in Developing a Sus system
<wxwisiasdf>
When an IRQ fires it **should** disable interrupts, right?
<clever>
wxwisiasdf: yeah, i believe most arches do that
xenos1984 has quit [Read error: Connection reset by peer]
<clever>
and the status reg which holds that flag, is also saved automatically before doing so
<clever>
so when you restore the status reg+pc, you turn it back on
saltd has joined #osdev
<wxwisiasdf>
Yeah
<wxwisiasdf>
it **should** normally do that...
<clever>
on x86, i think the pc+status get pushed to a stack automatically?
<clever>
on arm, they get copied to a pair of registers
<clever>
bbl
<wxwisiasdf>
so I am using the tss hw switch feature on x86, and normally the irq would be like: fire, handle, iretl, however here it's doing some pretty wacky shit
<wxwisiasdf>
it's doing: fire handle, fire handle, fire handle
<wxwisiasdf>
i already cleared the task-switch flag to prevent autoswitch on iret
<wxwisiasdf>
but no avail
<wxwisiasdf>
i also went out of my way and cli'd the saved flags that iret pops, no avail
<bslsk05>
fuchsia.googlesource.com: zircon/kernel/object - fuchsia - Git at Google
<geist>
more or less one of those per types of object you can have a handle to, and the dispatcher objects sometimes implement the entire functionality, or sometimes call through to another piece of the tree
<geist>
so channel_dispatcher.cc for example implements basically the channel ipc mechanism, though it's built on top of a lower level message queue object implemented elsewhere
saltd has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alpha2023 has quit [Quit: No Ping reply in 180 seconds.]
alpha2023 has joined #osdev
davidrg has joined #osdev
<wxwisiasdf>
enabling IRQs for PS2 causes the 8 irqs after it to fire
<wxwisiasdf>
eg, if PS2 is at IRQ e9, it is firing E9 to F3