Igor Mammedov <imammedo@...>
On Thu, 15 Aug 2019 18:24:53 +0200
Paolo Bonzini <email@example.com> wrote:
On 15/08/19 18:07, Igor Mammedov wrote:My impression was that QEMU/KVM's SMM address space is accessible only fromLooking at Q35 code and Seabios SMM relocation as example, if I see itNo, there could be real mode code using it.
CPU in SMM mode, so SMM CPU should access in-depended SMRAM at 0x30000 in
SMM address space while not SMM CPUs (including real mode) should access
0x30000 from normal system RAM.
What we _could_ do isAgreed, it's better to follow spec, that's one of the reasons why I was toying
with idea of using separate SMRAM at 0x30000 mapped only in SMM address space.
Practically we would be following spec: SDM: 34.4 SMRAM
System logic can use the SMI acknowledge transaction or the assertion of the SMIACT# pin to decode accesses to
the SMRAM and redirect them (if desired) to specific SMRAM memory. If a separate RAM memory is used for
SMRAM, system logic should provide a programmable method of mapping the SMRAM into system memory space
when the processor is not in SMM. This mechanism will enable start-up procedures to initialize the SMRAM space
(that is, load the SMI handler) before executing the SMI handler during SMM.
Another benefit that gives us, is that we won't have to pull in
all existing CPUs into SMM (essentially another stop_machine) to
guarantee exclusive access to 0x30000 in normal RAM.