Live data from Hacker News

Spectre mitigations murder userspace performance

robert.ocallahan.org

141–150 of 294 posts

Re: Spectre mitigations murder userspace performance

#141
post #77

Earlier quoted context omitted.

> I love that this is a toggle like this, having control of my system is why I love Linux. You can disable mitigations on Windows too.

Yeah but the next update will probably turn it back on silently...

Unlikely; Windows updates (mostly) only turn things you disabled back on if they're harmful to you.

Re: Spectre mitigations murder userspace performance

#142
post #43

Earlier quoted context omitted.

How long would you have to run JavaScript on your desktop to leak sensitive information and has there been any known exploits in the wild ?

https://leaky.page/ I don't know about the wild, but if this were tuned (i.e. this requires a lot of work for the first byte, the rest are easy) for a HVT you wouldn't know.

On my laptop's Core i5-10210U with mitigations=off, the demo just prints "[!] error: could not infer memory layout" until it runs out of retries.

This is on Chromium 91.0.4472.106 and kernel 5.12.11-arch1-1. lscpu shows vulnerabilities:

    Itlb multihit:         KVM: Mitigation: VMX disabled
    L1tf:                  Not affected
    Mds:                   Not affected
    Meltdown:              Not affected
    Spec store bypass:     Vulnerable
    Spectre v1:            Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers
    Spectre v2:            Vulnerable, IBPB: disabled, STIBP: disabled
    Srbds:                 Mitigation; TSX disabled
    Tsx async abort:       Not affected

Re: Spectre mitigations murder userspace performance

#143
post #26

Earlier quoted context omitted.

I suspect our heavy reliance on speculative execution is just a local optimum, and we can grow out of it by providing the processor more information about the data flow, making memory access more explicitly asynchronous, and simplifying the hot paths. I like the way the mill approaches these architectural problems.

I'm very unconvinced by these arguments. Providing enough information to the processor to claw back all the performance that predictors give you, that requires some way of knowing all those things in advance. Statically. And so you fall into the pit of tar and despair that is relying on Sufficiently Smart Compilers. Same one that couldn't save Intel's shiny new IA-64 architecture (the "Itanic"). Static analysis is ju…

> And so you fall into the pit of tar and despair that is relying on Sufficiently Smart Compilers.

How will we ever know that a Sufficiently Smart Compiler is impossible, if we never have processors where compiler intelligence is useful?

Re: Spectre mitigations murder userspace performance

#144
post #69

Earlier quoted context omitted.

I'm continually shocked that people are so ok with automatically executing any code random sites they connect to shove at them.

Code is data. Data is code.

Viral bacteria are matter. Matter is viral bacteria.

Re: Spectre mitigations murder userspace performance

#145

Earlier quoted context omitted.

And teams. And all that software that you used to be able to use that you have to make exceptions for so that in the end you end up forgetting to re-enable some critical part of the windows scareware implementation. Seriously: try installing Firefox on Windows 10 (I had to do this recently, I have now one computer in the house on Win 10 due to a hard requirement for some software/hardware combo), and you'll see Micro…

I just setup 2 laptops this week on Win10 Pro, inatlled Firefox and Chrome, and nowhere did it mention anything about Firefox being bad? Maybe a Win10 Home, or some other version? Or was that in a search result (or ad) not actually Windows?

Give it time; it's a trickle campaign. Just this morning I updated my Win 10 Pro desktop, and on reboot I got a full screen wizard prompting me to "use recommended browser settings" which is doublespeak for changing my default browser to Edge.

Edit: On re-reading, I believe OP was specifically referring to false positives with SmartScreen that crop up regularly, like at https://www.reddit.com/r/firefox/comments/n7gige/ms_edge_blo...

Re: Spectre mitigations murder userspace performance

#146
post #95

Earlier quoted context omitted.

That's what JavaScript blockers like NoScript and uBlock Origin are for.

Ad blockers can not know if a JavaScript algorithm is dangerous or not

It doesn't matter if it's dangerous or not if it doesn't get to run in the first place.

Re: Spectre mitigations murder userspace performance

#147

Earlier quoted context omitted.

> I’d rather have simple hardware that is light on energy requirements and easier to understand. I don’t think software as an industry really has a “this chip isn’t fast enough problem”. Turning off speculative execution reduces performance enormously . Yes, code is often less efficient than it could be but "surprise, you need 5x as large of a datacenter because your hardware isn't doing fancy stuff" is not going to…

I suspect our heavy reliance on speculative execution is just a local optimum, and we can grow out of it by providing the processor more information about the data flow, making memory access more explicitly asynchronous, and simplifying the hot paths. I like the way the mill approaches these architectural problems.

I agree with what you're saying around the Mill and dataflow in a sense, but feel like we disagree in the details. The issue with Spectre, etc. is that data of different trust levels are comingled in a single address space. We want the processor to speculate on some data, but not others and we don't tell it how to tell the difference. What's going to save us isn't dependency information or static scheduling, but more fine grained permissions around the data accessible at a single time.

IMO we need to bring back segmentation hardware. Not the x86 version of segmentation (there's not a feature that x86 wasn't able to make twice as complicated as it needed to be while only giving you half the use cases), but the cleaner object capability on top of paging hardware versions of segmentation. That solves the really rough Spectre cases like even NetSpectre where you can slurp out kernel state remotely from untrusted network packets. Just stick them in a "this memory is untrusted" segment. From there the CPU's dynamic dataflow optimizations can include speculation where memory is marked as trusted.

Re: Spectre mitigations murder userspace performance

#148

Earlier quoted context omitted.

Yeah but the next update will probably turn it back on silently...

Unlikely; Windows updates (mostly) only turn things you disabled back on if they're harmful to you.

Yeah: and disabling mitigations for an attack certainly wouldn't be considered "harmful" by anyone.

Re: Spectre mitigations murder userspace performance

#149
post #98

Earlier quoted context omitted.

/second NoScript. Instead of whitelisting whole sites, you can whitelist links to JavaScript imports across all sites, temporarily or permanently. So for example, you can whitelist urls to all the major JavaScript frontend frameworks’ CDNs, like bootstrap, etc. while leaving known trackers and spyware blacklisted by default. Anecdotally it seems most websites still work with their trackers disabled, as long as they h…

I disagree. There are way too many sites that require javascript that you'll eventually get into the habit of blindly enabling scripts when a site breaks, negating any security benefits.

I've been using noscript for at least a decade and it hasn't happened yet. I have conditioned my wife to use it too. She doesn't do it either

Re: Spectre mitigations murder userspace performance

#150
post #69

Earlier quoted context omitted.

I'm continually shocked that people are so ok with automatically executing any code random sites they connect to shove at them.

Code is data. Data is code.

It's more or less impossible to express recursion (in the same ways you can with js) with pure css/html.

If you want to be overly reductionist then you can argue nothing matters because your just staring at a box with lights in it.

Post reply on HN