zlacker

[parent] [thread] 5 comments
1. Diggse+(OP)[view] [source] 2023-04-05 19:55:15
Well, also Firefox is making an excessive number of calls to that slow system call compared to other browsers (Chrome, Edge).
replies(3): >>sfink+18 >>zokier+Gj >>gcp+im1
2. sfink+18[view] [source] 2023-04-05 20:41:00
>>Diggse+(OP)
My understanding is that until recently (January), V8 (inside Chrome & Edge) made a similar number of calls. The main use is making it so that JIT-generated code is not writable while it is executing. It's an important security measure. V8 switched to a more recent mechanism (memory protection keys) that have been gradually getting support from the various OSes. But IIUC, they switched off the mprotect/VirtualProtect calls unconditionally, and added in the protection key stuff only where supported, which suggests that they left some configurations without any protection at all. SpiderMonkey (in Firefox) has not yet switched to the cheaper mechanism.

I may have some of the details wrong.

https://source.chromium.org/chromium/_/chromium/v8/v8.git/+/...

replies(1): >>nagisa+Ov
3. zokier+Gj[view] [source] 2023-04-05 21:45:12
>>Diggse+(OP)
Well, it was fast system call until MS added AV hook to it.
replies(1): >>Diggse+BP
◧◩
4. nagisa+Ov[view] [source] [discussion] 2023-04-05 22:51:13
>>sfink+18
pkeys are hardware-specific as far as I am aware, and at least last time I tried them didn't work on hardware as recent as zen 1.
◧◩
5. Diggse+BP[view] [source] [discussion] 2023-04-06 01:11:03
>>zokier+Gj
My comment was only intended to add missing information to the TLDR (since this fact is important in the linked thread) not to say that Firefox is at fault.

Now that you raised it however, even if the system call used to be fast, Firefox is making an extremely high number of calls to that sytem call, and there's always going to be some overhead to that. There are almost certainly ways that Firefox could reduce the number of calls it needs to make.

6. gcp+im1[view] [source] 2023-04-06 06:16:42
>>Diggse+(OP)
What determines "excessive"? In this case it's for a security feature that Chrome lacks(!).
[go to top]