applause
123 karma · joined September 30, 2020
applause
Seriously though, this is really cool
$ ln /usr/bin/sudo ./my-chroot
$ echo "$USER ALL=(ALL) NOPASSWD: ALL" > ./my-chroot/etc/sudoers.d/01-oops
$ chroot ./my-chroot
$ sudo bash
modern Linux distributions prevent creation of hard links to suid binaries, but the restrictions on chroot came years before that.Because Jazelle converted Java bytecodes into ARM instructions in sequence, there is no opportunity for any instruction scheduling. So a bytecode sequence like:
// public static int get_x(int x, T a, T b) { return a.x+b.x; }
aload_1
getfield #N
aload_2
getfield #N
iadd
would go down the pipeline as something like: LDR r1, [r0, #4] // a_load1
* LDR r1, [r1] // getfield
LDR r2, [r0, #8] // aload_2
* LDR r2, [r2] // getfield
* ADD r1, r1, r2 // iadd
There would be a pipeline stall before each instruction marked with a *.On the first ARM 9 CPUs with Jazelle, the pipeline is fairly similar to the standard 5 stage RISC pipeline (Fetch-Decode-Execute-MemoryAccess-Writeback) so this stall would be 1 cycle. That wasn't too bad - you could just accept that loads took usally 2 cycles, and it would still be pretty fast.
However, on later CPUs with a longer pipeline the load-use delay was increased. By ARM11, it was 2 cycles - so now the CPU is spending more time waiting for pipeline stalls that it spends actually executing instructions.
In contrast, even a basic JIT can implement instruction scheduling and find some independent instructions to do between a load and the use of the result, which makes the JIT much more performant than Jazelle could be.
> When it started testing simulations of early Pentium prototypes, Intel discovered that a lot of game designers had found that they could shave one instruction off a hot loop by relying on a bug in the flag-setting behavior of Intel's 486 microprocessor. This bug had to be made part of the architecture: If the Pentium didn't run popular 486 games, customers would blame Intel, not the game authors.
Does anybody know the details of this?
* have reduced source code for the example, preferably a single source file, in a form which can be compiled
* have the exact command line used to build it
* have the exact compiler version being used
* apply to a supported version of the compiler (GCC 5 is from 2015...)
* include an accurate explanation of what is wrong with the generated code
Maybe the last one is covered by this blog post, but things like
> I can maybe understand the subtraction of constant 0, if there’s another code path that jumps to 7ba6
suggests that the author hasn't fully analysed the generated code.
The analysis is OK though and with source code it would be a pretty good bug report.
If anything, the UNIX philosophy is more like "do one thing, and do it to a text file".
Even in TCP sequence numbers, it can be implemented incorrectly.
https://engineering.skroutz.gr/blog/uncovering-a-24-year-old...
The progression of the Arm brand goes something like this:
* ARM (abbreviation for Advanced RISC Machines)
* ARM (not an abbreviation for anything, but looks like one)
* Arm (current name, still not an abbreviation, now looks like a word)
* arm (what the current logo looks like, even though the company name has a capital letter)
Try to be less defensive, the editor has taken the time to give you feedback - you can take the opportunity to learn why he might have interpreted your work in that way. Even if not every reader does, you now know that some readers do.
6502 (Apple 1,2,3): 1976
68k (Mac): 1984 (+8 years)
PPC: 1994 (+10 years)
x86: 2006 (+12 years)
ARM: 2020 (+14 years)
If the trend continues, we will see Apple's next architecture in 2036.
https://www.research.manchester.ac.uk/portal/files/56078084/...