[HN Gopher] Apple Silicon Hardware Secrets: SPRR and Guarded Exc... ___________________________________________________________________ Apple Silicon Hardware Secrets: SPRR and Guarded Exception Levels (GXF) Author : mpweiher Score : 205 points Date : 2021-05-07 17:41 UTC (5 hours ago) (HTM) web link (blog.svenpeter.dev) (TXT) w3m dump (blog.svenpeter.dev) | 29athrowaway wrote: | I think the should be more protection levels so the kernel itself | could have at least 2 rings. | saagarjha wrote: | The kernel does essentially have two rings: the "regular" | exception level and the "guarded" level. | robbiep wrote: | I only surface level understand this but the eloquence and level | of detail is very impressive | wly_cdgr wrote: | What is the point of doing this? Is there practical value for | third parties (and if so, what & which?) or is this primarily a | skate video? | | No right answer, just curious | capableweb wrote: | You're questioning the value of reverse-engineering things in | general and publishing them on the internet or this specific | reverse-engineering? | | For me the basic value is just having more knowledge published | in the open for anyone to read. I might not have any practical | value of it, either ever or today, but I did learn a bunch | reading it and I'm glad I did. | varispeed wrote: | This is really cool! However, it breaks my heart that talented | people have to spend their time on something like this - | companies should be required to release a documentation for | consumers so they can fully use their products. Otherwise you | don't really buy e.g. a Mac, only a privilege of using whatever | Apple cooked up for you. This erosion of ownership should stop. | If you bought a computer in the 80s you could get everything you | need to write your own operating system etc. you could get | schematics, parts and so on. Today you pay a lot of money for an | illusion of owning something. I get that many people don't care, | but this is not the world I want to live in. Hopefully | initiatives like right to repair will change it and companies | like Apple will be forced to treat consumers like consumers and | not sheep that they can fleece as they please. Apple (and other | big corporations) should serve consumers, not shareholders. | systemvoltage wrote: | The gist of your argument is sound, but consumer culture is | equally to blame as manufacturers. Consumers are used to throw- | away cheap goods. People HN != consumers. Apple's consumer base | is mostly iPhone users and non-techie crowd. | | If you bought a $30000 server, you'll get schematics and a lot | of information of the product. Including motherboard traces and | gerber files: | | https://www.opencompute.org/wiki/Server/ProjectOlympus | | https://www.youtube.com/watch?v=FXZJ6jrpIKU | smoldesu wrote: | If these people are willing to provide schematics and | motherboard traces to < 10,000 users, why can't Apple provide | schematics and traces for devices being used by tens of | millions of people? | mhh__ wrote: | Just because we know enough to know when we are getting | shafted why is that an excuse to shaft other people who | don't? | | Intel have done some really shady things, and yet they still | publish _extensive_ documentation on how their processors | work and how to get the best from them - Apple? Nothing. | simonh wrote: | That's hardly surprising. Intel sell their chips as | components to be used by third parties who clearly need | that information to do so, whereas Apple uses them only | internally for their own products. | mhh__ wrote: | Not my problem. | simonh wrote: | Right, so don't buy Apple products. Again, not a problem. | [deleted] | dylan604 wrote: | I make a thing to a function that I want it to do. I release | that thing so other people can do the thing I envisioned. | Someone else then realizes they might be able to use the thing | I made for something else entirely, but only if I provide | instructions on how to do it? How is that my | problem/responsibility? | beckman466 wrote: | Serious question: could anyone please share why this plea for | repairable tech is so heavily downvoted by this community? | setpatchaddress wrote: | I'm not voting on it either way, so I can't say, but I | personally find it off topic. TFA is a technical article; | there are plenty of articles that discuss right-to-repair | etc. | | Edited to add: the author doesn't seem to themselves be | heartbroken. This level of detail suggests enthusiasm. | svenpeter wrote: | > Edited to add: the author doesn't seem to themselves be | heartbroken. This level of detail suggests enthusiasm. | | Absolutely not! Reverse engineering is a lot of fun to me! | Especially the moment of clarity when all the unknown | pieces eventually fall together and I finally get the whole | picture. | Cloudef wrote: | I dont think its the community. Its just that the people who | read/comment on apple related articles tend to be the kind of | demographic that dont value those aspects as much. They are | looking for a service, not a product. | criddell wrote: | It is the community, but not because we don't care about | it. It's because in a thread on an article like this it's | not a very valuable comment. The comments it generates | (including yours and mine) has nothing to do with the SPRR | or exception levels. | Toutouxc wrote: | > They are looking for a service, not a product | | That's an unfortunate choice of words. I'm definitely | looking for a product, not a service (which is why I bought | my MacBook instead of leasing it), but everything I need | the machine for overlaps with what Apple envisions me doing | with the machine. | | I don't want my machine to be amateur-repairman friendly | and my OS to be infinitely customizable and tinkerable, | because we already have that, it's called Linux on a | ThinkPad and to me that's the antithesis of a Mac and I | consciously decided not to use that kind of setup. | | (I'm not strongly for or anti right-to-repair, but I tend | to be against tight regulation when avoidable.) | blendergeek wrote: | Probably partly because it uses the word, "sheep". The word | "sheep" is often considered a derogatory non-argument that | serves only to rally up believers rather than a substantive | piece of rhetoric. | userbinator wrote: | You may find the Rossmann Group logo amusing - it's a black | sheep. | smoldesu wrote: | To be fair, the words "Apple" and "sheep" are so closely | associated in the tech world at this point that it's hard | to fault someone for using it. I get what you're saying, | but there's a reason nobody is in these comments defending | Apple for being conscious engineers or helpful to third- | party repair shops. | smoldesu wrote: | Perennial Apple users are attracted to HN like moths to a | flame. The typical cycle involves upvoting random articles | with "M1" in the title, and then serial downvoting anyone who | asks questions/criticizes the article or Apple. I wish I | could say it was anything else, but given that none of them | leave comments on these downvoted replies, it's hard to tell | what their gripes are. | Jtsummers wrote: | Probably the repeated insistence on "force" and "forcing" | this result. It's not a practical requirement or an | enforceable one in the end unless nearly every government | (and every government for every country with a significant | manufacturing industry) goes in on this together. | varispeed wrote: | It only takes one government to make it happen (or even a | state that is large enough that manufacturers will not | choose to stop selling products there). If this was passed | e.g. in California, that would open the access up for | almost anyone in the world. | Jtsummers wrote: | It would be practically unenforceable if CA did it, or | even the US. The market in both is large, but not large | enough, and it's hard to force compliance on companies | from other countries. | | The result would be similar to the protectionist trade | policies that hamper market entry for foreign produced | goods in India and some Latin American countries like | Argentina. There are enough customers elsewhere whose | governments wouldn't give a thought to this that non- | CA/US companies would safely ignore CA/US in this case. | It would only work with coordinated effort. | | There are also other second order effects not considered | by a policy like this. | | What's the timeline and what's the company scale that | this levies? | | Is the documentation expected on day 1? Great, Apple and | Google and Sony and others will squash all small | competitors. You will never see another small (< 20) | person hardware startup (not that we see them often | anyways) because the cost to produce this kind of | documentation is non-zero, and the big players can easily | absorb it into their processes. Additionally, small | players would _literally be handing the design to | competitors_. OK, maybe patents and things like that stop | some companies from being bad actors and reproducing the | product in short order, but it won 't stop everyone | especially in countries with laxer or no enforcement of | patents. | | Additionally, problems would be created if designs were | produced in non-compliant countries. If I start up a | hardware company and make a new device, but half my | components are designed in Taiwan and they've decided to | explicitly reject this, am _I_ non-compliant for not | releasing documentation I don 't have the authority to | release? And if I'm able to become exempted because of a | 3rd party component, everyone else would start shifting | their design departments to contractors (if necessary) in | those countries or shift a portion of their company | there. | wolverine876 wrote: | > It would be practically unenforceable if CA did it, or | even the US. The market in both is large, but not large | enough, and it's hard to force compliance on companies | from other countries. | | The U.S. regularly imposes plenty of requirements that | are far more difficult to meet, in many industries. The | U.S. is the largest market in the world for many goods; I | think the parent greatly underestimates the power and | practices of national governments. Smaller countries also | impose requirements. | smoldesu wrote: | What you're outlining right now are issues that affect | the status quo anyways. Small companies always fight an | uphill battle with larger ones, and copyright law is | almost never respected: what else is new? Even still, | they're weak excuses not to provide the public with | information that likely already exists. | Jtsummers wrote: | I'd contend that a requirement like this, without | exemptions for small businesses, would make things | _worse_ for small businesses than big businesses and | worse than the present situation. It 's similar to many | other legal regulatory requirements, small businesses end | up bearing an outsized cost relative to their revenue. | | And if you create exemptions for small businesses, the | big businesses would do exactly what they always do, find | loopholes to get subsidiaries/contractors to do the work | and exempted and nullify the entire thing. | | As nice as it would be to bring back (easier) access to | system specs, it's impractical without fundamental | culture changes that laws themselves don't usually | produce. | varispeed wrote: | This is wrong on so many levels, but I will address this | one: | | > You will never see another small (< 20) person hardware | startup (not that we see them often anyways) because the | cost to produce this kind of documentation is non-zero, | and the big players can easily absorb it into their | processes. | | I highly doubt that small players would be affected at | all, because a small player wouldn't produce a custom | chip. The level of documentation required is akin to API | documentation that many services produce and this is not | revealing any trade secrets, but enables customer to make | full use of the device. If you create a product without | any documentation, then you have bigger problems. | | > If I start up a hardware company and make a new device, | but half my components are designed in Taiwan and they've | decided to explicitly reject this, am I non-compliant for | not releasing documentation I don't have the authority to | release? | | This is false, because it is companies like Apple that | tell component manufacturers to not sell or to not | disclose documentation. Virtually any chip that you can | get on an open market has complete documentation | available. If you are ordering a custom chip, you | shouldn't be allowed to tell manufacturer to not sell it | to anyone else nor hide its documentation if it goes into | your product. | | If you were actually working in hardware design space you | would know that what is being asked does not compromise | trading secrets, it is done solely out of greed so that | people are nudged towards subscription models and | becoming dependent on a particular corporation. | smoldesu wrote: | I almost agree with this, except for the part where you | claim that "It's not a practical requirement": this is | entirely a practical requirement. People who use Macbooks | gripe constantly about the viscous repair and replacement | process. Apple's refusal to recover data (or even help | customers recover data) is a hostile experience, whether it | logistically qualifies as one or not. Customers deal with | these issues, and Apple holds all the cards in their hands | with the capabilities to fix them. People wouldn't care if | the latest iMacs were twice as thick but could upgrade the | memory and maintenance the internals. People wouldn't give | the Macbook shit if it was twice as thick but had HDMI and | USB A. Nobody cares about a thinner product, our current | devices are about as ergonomic as they can get without | sacrificing durability (if not compromising it, in Apple's | case). | | This is just a case of Apple being careless. We have a | right to criticize the largest company in the world, if not | hold them to the highest standards possible. Instead, we've | let Apple off the hook because nobody wants to stand up to | them and call them out on it. We're all willing to bury | those experiences, as long as our next laptop can export | our Photoshop projects 500ms faster. | Jtsummers wrote: | It's not a practical requirement in that from an | enforcement perspective and economic sense (under the | current commercial and economic models) it is not | practical. | | It is a practical requirement in the sense that it | improves (potentially) the practicality of hardware | systems. | | Those are two distinct senses, I was writing about the | former. | simonh wrote: | >People wouldn't care if the latest iMacs were twice as | thick... | | I think Apple have a pretty good idea about marketing, | and what sells a product and what most customers find | attractive about it. The vast majority of computers sold | are never upgraded, whether they can be or not and most | people would never even think about it. | kitsunesoba wrote: | > People wouldn't give the Macbook shit if it was twice | as thick but had HDMI and USB A. Nobody cares about a | thinner product, our current devices are about as | ergonomic as they can get without sacrificing durability | (if not compromising it, in Apple's case). | | Isn't this statement a bit of a blanket? Not too long ago | I purchased a laptop specifically for being tiny and | lightweight (X1 Nano). Ports and expandability were an | afterthought. Certainly many wouldn't mind increased | thickness and bulk but there is absolutely a market for | portability, at least in laptops and other mobile | devices. | | That said, the X1 Nano at least has removable/upgradable | storage, which can't be found on heavier MacBooks, so | there's absolutely an argument for adding expandability | where it doesn't negatively impact portability. | dylan604 wrote: | Apple makes hardware that runs macOS. They do not make | hardware to run Windows/*nix. They do not need/want to | support those other OSes, else, they would make a product | that would do that. They have theirs and they feel it is | perfectly fine for the product they are offering "thank you | very much". Since day one of Apple, the Steves argued | open/closed system. Up to the Apple II, Woz won. With the | Macintosh and ever since, Jobs won. It is now Apple's ethos. | It is theirs to decide. You are free to not like it. Others | don't like it, shrug their shoulders and choose to do it | anyways. Some of them will even share what they've learned, | and some of those will even do that well. If you choose to | follow, thank them, and join the movement. Complaing that a | company isn't doing exactly what you want just seems sad and | pathetic to me. | salawat wrote: | Besides the sheep bit, there's two unsaid parts that ring out | to me. | | Understanding IC's to repair them is a failing prospect. They | are black boxes by nature. If you can't actually repair it | without the factory, why should they write you a manual to | help you repair it? | | Beyond that though, there is a degree of Power lost through | dispelling the blackbox (information asymmetry is Power, | never forget). Explaining how it works opens up PR doors | places would rather not have to deal with, and cuts off | avenues of development that companies in the space thrive on. | See Nvidia graphics cards for an example. Nvidia doesn't | "sell" you the card, in the sense of allowing you to do | whatever you want with it because they can't. They are | contractually required to hide implementation details around | things like HDCP and the in hardware foundations of many | streaming related DRM technologies. | | Then you have other aspects, like their move to requiring | Nvidia signed firmware to access the power control of modern | cards. This ensures only their driver can feasibly compete in | the market and locks out any potential competition that may | be able to pull off a true innovation using their own | hardware platform (see nouveau and the signed firmware | issue). | | All of this would be undone by actually being required to | support user firmware implementation, and disclosing how | everything works. | | https://docs.nvidia.com/drive/drive_os_5.1.6.1L/nvvib_docs/i. | .. | | The above is a link to an offering for a self-driving | processing offering (therefore safety-criticality somewhat | justifies the absurd guarantees of firmware lockdown), but my | experience tells me that once ypu nail down a tricky process | like that, you worm it into as many parallel business | vehicles as you can. | | Just knowing another company is even capable of doing | something like that is a signal of demand to competitors. | Hence the desire to hide everything possible as no one else's | business. | anoncake wrote: | Because for some reason, many here believe companies have the | right to do things not in the interest of their customers. | yalogin wrote: | What has repairability do with OS security? They are two | different topics. You have a valid gripe about the first one | but it's misplaced in this thread | smoldesu wrote: | Not sure why people are downvoting you, documentation of the | product that I own is one of the most basic expectations I can | have going into owning something. Having every interface | abstracted away and being told not to worry too much about the | hardware details breaks my heart, because this stuff isn't | going to leak any trade secrets: it really only serves to help | developers better suit their programs to run on their hardware. | 2OEH8eoCRo0 wrote: | I don't understand the trade secret concern. Reverse | engineering is legal. If you're afraid someone might rip off | your product that's what the law is for. | | All they do is lock out customers from owning their devices. | It's about control- plain and simple. | my123 wrote: | > If you're afraid someone might rip off your product | that's what the law is for. | | You have two mechanisms to protect from copying: trade | secrets and patents. | | If you document it, it's not a trade secret anymore. If | another person figures it out, it's also not a trade secret | anymore. | | And Apple (and others) document plenty of stuff in patents. | However, those aren't loved by this community either. | smoldesu wrote: | Don't forget that if e-ink wasn't patented, there's a | good chance that it would be cheap enough to integrate | into everyday utilities. | s1artibartfast wrote: | And if it wasn't patentable, there is a good chance that | it would never have been developed or industrialized. It | will eventually go off patent and be widely available | xenadu02 wrote: | My purely personal opinion is that it should be obvious why | manufacturers/vendors don't document everything in great | detail: that is tantamount to making those implementation | details API and promising support for some indefinite period | into the future - no matter how many warnings are put on it. | Any observable behavior of a system (or CPU instruction set) | becomes public API over time. | | People get irately angry when a warranty replacement ends up | with a slightly different system (CPU stepping, firmware | revision, or whatever) that breaks something. They get only | slightly less angry when buying a newer system does the same: | "XYZ worked on my previous system!!!!1 this is broken | garbage!!1111 Widget Inc is deliberately screwing over loyal | paying customers to force us to buy more widgets, it makes me | sick!!!!!1111" - this is not too far off from comments made | here on HN at times. | | Making seemingly trivial changes becomes an exercise in | walking a minefield of unknown compatibility constraints. | | That's besides the extra work of hiring technical writers to | spend time converting a jumble of engineering notes, comments | on bug tickets, and code comments into publicly presentable | documentation - and making sure to keep all of that up to | date when anything changes. For something almost no one knows | or cares about that you may completely change in the next | version. | saagarjha wrote: | Apple (and I'm pretty sure ARM as well) does not want you | writing programs that rely on its proprietary extensions to | the ISA. The specific things mentioned here are either not | exposed to userspace or wrapped in API that hides these | implementation details so that third party developers don't | have to deal with them. And Apple changes all these almost | every year, which they certainly wouldn't be able to do if | they exposed these; you'll note that some of my experiments | that I wrote not even a year ago are linked in the article as | being fundamentally broken now. | tomxor wrote: | The parent comment was no where near delicate enough to have | any chance - I believe that Apple has simply become too | polarising a subject on HN to be able to have a productive | debate about their flaws, perceived or real, technical or | ethical. As a result many of us have learned the hard way to | not bother engaging any more... I might be in for one more | lesson. | kingsuper20 wrote: | There's no point in the hivemind downvoting you, but it is an | interesting question on product philosophy. | | One way to look at it is as ('at it is as'? English is weird) | general purpose computer vs. appliance. Apple probably feels no | more obligated to give you schematics, chip internals, etc. | than Garmin does for a GPS. | | Another angle is that hardware companies are becoming more | secretive over time. There weren't many secrets in a Marantz | receiver or a shortwave radio. Perhaps there's been a change in | approach due to low-cost Asian manufacture and the tendency to | ignore IP. | saagarjha wrote: | Note that these features exist on the M1. | salawat wrote: | The IP I'd say is the core of the problem. | | There are only so many way ways to skin a cat (in nuts and | bolts engineering). When constrained by physics, everyone is | going to converge on the same fundamental designs. You | therefore have two or three options. Take or leave the | licensing agreement of the IP holder, which need not be | reasonable or effective; say screw it, use the IP and hide | the schemata behind enough trade secret bs red tape that no | one is comfortable leaking it, or give up. | | I wager the second option contributes to things when number 1 | fails. At least, it's the only reason that holds water for | me, then again, I haven't gotten into that industry enough to | vouch for the presence of skeletal remains in the closet. | Someone wrote: | There also is a lot more to document. That Marantz receiver | or shortwave radio probably had less than 100 transistors. | Your smartphone has billions. The cost of providing | documentation alone may be sufficient reason not to provide | it to customers (yes, they have documentation, but that may | not be sufficiently checked for use in a B2C setting, where | you likely can't provide documentation with a "reality may be | different" disclaimer) | | I also think that, historically, electronics were documented | because they broke down so often. | | You just had to be able to spot a broken tube in your radio, | clean a potentiometer, etc. | svenpeter wrote: | hi, and thanks! I'm the author of this post and I'm a little | bit conflicted where I stand in this discussion. | | In general, I agree that the world would be a better place if | corporations would release documentation. | | But my life would be much less fun then. Reverse engineering | scratches a certain itch like nothing else does! So I'm kinda | happy that mysteries like this exist and gladly spend my time | on something like this :-) | beckman466 wrote: | > But my life would be much less fun then. Reverse | engineering scratches a certain itch like nothing else does! | | Totally, yet at the same time I'm worried that knowledge | workers aren't aware enough of just how privileged they are | to have been able to 'climb the ladder' to be able to do work | like that, and how, unless you're 1) well off and 2) living | in the global north, gaining such skills has been made nearly | impossible because the ladders needed to climb up are often | not available, despite humans having been gifted digital | technology (and therefore a zero-marginal cost of information | reproduction). | | As an example: I'm not technically skilled enough to reverse | engineer the things I'd like to, and because of the way | knowledge is controlled by big companies as trade secrets and | patent claims [1], it's near impossible to gain these skills | in an affordable way. I also cannot take apart the technology | I already own since it is not modular, it voids the warranty | or is it is damaged (since I'm not skilled because I didn't | realize early enough how important technology is). | | So yes, it sounds super fun for you to reverse engineer this | stuff, yet when are we going to seriously admit that this IP | system has become a massive problem, and that the people who | came before are literally 'kicking away the ladder' they used | to climb up themselves? That when people say that the only | thing people need to do to succeed is to 'work hard', that | that is a lie, since information is made artificially scarce | by human systems/institutions. | | Edit: just saw you are a console hacker, thanks for the | awesome work! | | [1] https://www.ipwatchdog.com/2019/02/19/dont-fooled-patent- | pur... | [deleted] | rowanG077 wrote: | Well it's not like you couldn't scratch that itch. Biology | and medical sciences are the most hardcore reverse | engineering club there is. | namdnay wrote: | I think it's just a consequence of the computer market | maturing. I'm sure if you bought a car in the 1900s you got | detailed schematics as well | marcosdumay wrote: | If you brought anything by 1980 you'd get detailed | schematics. It doesn't matter if the thing was recently | invented or existed for centuries. | | And if you buy anything nowadays you will get undocumented | locked-down hardware. It doesn't happen if it's recently | invented or existed for centuries. ___________________________________________________________________ (page generated 2021-05-07 23:00 UTC)