On 26 June 2010 01:34, Chris Craddock <[email protected]> wrote: > I can't believe how often the old chestnut about running in key zero versus > user ket comes > up. There is nothing inherently risky running in key zero - presuming of > course that you're > not a cowboy coder who fails to validate input and output areas.
Or a coder who's convinced all bugs in his code have been found, or perhaps that he never writes bugs in the first place. Probably doesn't need to test his code either. > Store instructions only go where you point them. The overlay bogey is > shorthand for > sloppy coding. Uh huh. It certainly reduces the number of S0C4s if you aren't bothered by pesky restrictions on where you can store. Used to be even fewer many years ago before we got things like low storage protection and page protection. > As for running in key 8 in an SRB, it is certainly NOT necessary (there are > mixed key > instructions for safely moving data to/from caller storage) and furthermore > it is actually a > bad idea for a number of reasons. First, it is a fairly unusual condition for > an SRB to run in > - potentially causing serious astonishment (I.e. Generally a bad idea) in > called code, So the SRB-mode code should run in key 0, since it won't have bugs (unless written by a cowboy), but the called code (presumably also SRB mode) may be "astonished" by its caller's not being in key 0. (Not, I understand, that *it* may receive control in a non-0 key, but that it's going to poke around and be dismayed and confused when it sees that the *caller* wasn't running key 0). > but here's my personal favorite dingbat reason... Running an SRB in a user > key is a > probable integrity violation if the SRB uses user key storage for work areas, > save areas > etc. So the ostensible "ooh it is safer in user key" is just a crock. Case closed, I guess. > For the record, I have never once run an SRB in anything but a system PSW > key, and > wouldn't. There's just no reason to Have you ever had occasion to run *someone else's code* (maybe that kind that would be surprised and upset to get control in the wrong key) in SRB mode? Tony H.
