Post by Rod PembertonOn Fri, 5 Apr 2019 19:41:13 +0100
Post by James HarrisDoes anyone here know what would likely happen to cache lines and
buses if one were to read addresses which had no RAM - with or
without caching enabled for those addresses? Ditto writing such
addresses? Would the reads/writes cause problems? What value would be
read? All zeroes? All ones?
And would such operations be slower than accessing real RAM? I guess
not but I don't know. Accessing non-existent RAM is not something one
gets to do too often!
No, I don't.
I've had another thought on that since Robert Wessel pointed out in a
different thread the presence of MTRRs. AIUI on a CPU with MTRRs the
BIOS is likely to have programmed them before it boots an OS.
I would guess, based on that, that addresses which do not have RAM
behind them would be mapped as uncacheable. That won't affect the value
which would be read from such unconnected addresses but it would mean
that reading or writing a load of them would be unlikely to overfill and
thus flush the caches.
Post by Rod PembertonI know an older machine returned all ones for when reading the PS/2
port, which it doesn't have.
Me too. A good example is the Abit machine which you and I documented
before at
http://aodfaq.wikidot.com/mc-scpa
Incidentally, looking at those pages again it occurs to me that since
some port accesses may be trapped by SMM code, the results they return
will depend on code - possibly buggy code - rather than hardware. I
think we may have seen that in KBC tests we ran on some machines.
Another, related thought. We might be able to tell whether accesses to a
certain port trapped to SMM or not by timing them. Normally, all such
accesses are so fast we would never be able to tell whether they were
implemented by code or hardware unless we checked a high-resolution
timer like the TSC.
Post by Rod PembertonThe same machine has a BIOS that could create a memory hole at 1MB,
which I believe was for a video card (perhaps AGP?).
It also allowed you to copy ROM in RAM for speed. So, writing to the
BIOS address range is probably not a good idea. Maybe, the BIOS region
is protected from writes? I'm really not sure what happens here.
I doubt I have any machines old enough that would have a memory gap
between 640K and 1MB, i.e., assuming memory is probably back-filled
with RAM if no card is installed in the region, or a gap between 512K
and 640K.
Most likely your best best is to pull memory modules or chips to reduce
installed memory in a real machine below the peak address.
True, though that would provide data for only one machine. It would also
give data for only the limited addresses used in a test. It is possible,
for example, that there would be different zeroes-or-ones results from
* Addresses the MCH knows are not mapped to anything
* Addresses which are mapped to a 'local' bus
* Addresses which are mapped to graphics cards
* Addresses which end up on an ISA bus
--
James Harris