News for hackers. Stuff that matters.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by abbeyj on Tuesday April 14, 2020 @07:21PM (#22872650)
Coreboot does something similar to this. Very early in the boot process the RAM has not yet been initialized and so cannot be used. You need to execute some code to set up the RAM before you can use it. One approach to handling this is to write that initialization code in assembly language and make sure it only uses registers and doesn't touch any memory.

But that's inconvenient. You'd much rather be able to write your code in something like C. Any C code compiled by an ordinary compiler is going to access memory (at least for the stack). Writing and maintaining a custom C compiler for this is a lot of work and still comes with a lot of limitations on the C code that it will accept.

So they set up the cache in a way that it will never try to write its contents out to RAM. Then you can use the output of an ordinary C compiler that uses memory accesses and those accesses will all be served by the cache and never touch RAM. They call this "Cache as RAM".

With some work you could probably boot into DOS like this.

https://www.coreboot.org/data/yhlu/cache_as_ram_lb_09142006....

Re:AMD Claims World’s Fastest Per-Core Performance with New ... by als0 on Tuesday April 14, 2020 @07:31PM (#22872725)
Not just coreboot, pretty much any BIOS uses cache-as-RAM.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by ahmedalsudani on Tuesday April 14, 2020 @10:05PM (#22873710)
Wow that is so cool. Most of us never have to dig that deep and so weird stuff like that usually flies completely under the radar...

Thank you for sharing!

Re:AMD Claims World’s Fastest Per-Core Performance with New ... by jnwatson on Wednesday April 15, 2020 @03:04AM (#22875301)
This is a common approach for most bootloaders, in fact for several microprocessors (the IBM 440 comes to mind), it is the only way to boot.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by myself248 on Wednesday April 15, 2020 @09:52AM (#22877684)
Is there a way to mess with the cache or MMU and prevent it from _trying_ to write out to DRAM, and be able run a minimal system purely from cache with the DRAM slots completely empty?
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by mcot2 on Wednesday April 15, 2020 @02:57AM (#22875268)
Interesting that no one to my knowledge has built an architecture where sram is ‘memory’ such that it would be transparent to C code but no slower dram is used. 32MB is more than my 1998 computer had.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by jnwatson on Wednesday April 15, 2020 @03:03AM (#22875289)
Many embedded systems have a block of SRAM directly addressable.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by rijoja on Wednesday April 15, 2020 @03:02AM (#22875285)
modify tcc maybe