2015-05-18 18:07:39

by Richard Yao

[permalink] [raw]
Subject: Is there anyway to do direct mapped cache on Intel hardware?

Is there anyway to do direct mapped cache on Intel hardware?

Direct mapped cache should allow me to implement software ECC via the
low memory / high memory split. It would be slow, but I would prefer to
have a slow laptop than one that is vulnerable to bit flips.

If direct mapped cache is possible and non-NUMA systems could avoid
writing it back/through, I imagine that people could also protect
against cold boot attacks by encrypting main memory. This would be also
be slow, but the AES instructions that Intel's newer processors are
supposed to have should keep the slowdown within some reasonable bound.

There might also be applications for using external memory algorithms
(e.g. fractal tree indexes) to speed up in-memory operations. I also am
not sure if the difference between system memory and cache is big enough
to make it a win, but I am sure that is not something that I would want
to implement on my laptop in my spare time.

If someone knows a way to do direct mapped cache, please share.


Attachments:
signature.asc (819.00 B)
OpenPGP digital signature

2015-05-18 18:33:37

by Richard Yao

[permalink] [raw]
Subject: Re: Is there anyway to do direct mapped cache on Intel hardware?

It seems that there are ways:

"These are officially undocumented modes known as "cache-as-RAM mode" in
AMD land an "no-fill mode" in Intel's"
https://stackoverflow.com/questions/19591500/how-to-make-sure-a-piece-of-code-never-leaves-the-cpu-cache-l3/24710093#24710093

Now all I need to do is take time during my weekend to figure out how to
do it. My apologies for the noise.

On 05/18/2015 02:07 PM, Richard Yao wrote:
> Is there anyway to do direct mapped cache on Intel hardware?
>
> Direct mapped cache should allow me to implement software ECC via the
> low memory / high memory split. It would be slow, but I would prefer to
> have a slow laptop than one that is vulnerable to bit flips.
>
> If direct mapped cache is possible and non-NUMA systems could avoid
> writing it back/through, I imagine that people could also protect
> against cold boot attacks by encrypting main memory. This would be also
> be slow, but the AES instructions that Intel's newer processors are
> supposed to have should keep the slowdown within some reasonable bound.
>
> There might also be applications for using external memory algorithms
> (e.g. fractal tree indexes) to speed up in-memory operations. I also am
> not sure if the difference between system memory and cache is big enough
> to make it a win, but I am sure that is not something that I would want
> to implement on my laptop in my spare time.
>
> If someone knows a way to do direct mapped cache, please share.
>



Attachments:
signature.asc (819.00 B)
OpenPGP digital signature

2015-07-01 09:36:15

by Pavel Machek

[permalink] [raw]
Subject: Re: Is there anyway to do direct mapped cache on Intel hardware?

On Mon 2015-05-18 14:07:30, Richard Yao wrote:
> Is there anyway to do direct mapped cache on Intel hardware?
>
> Direct mapped cache should allow me to implement software ECC via the
> low memory / high memory split. It would be slow, but I would prefer to
> have a slow laptop than one that is vulnerable to bit flips.

One of the bit flip papers actually presented the way to detect RAM
attacks using performance coutners....

But yes, software ECC would be cooler hack ;-).
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html