toggle quoted messageShow quoted text
It is my understanding that real HW hot plug uses the SDM defined
methods. Meaning the initial SMI is to 3000:8000 and they rebase
to TSEG in the first SMI. They must have chipset specific methods
to protect 3000:8000 from DMA.
Can we add a chipset feature to prevent DMA to 64KB range from
0x30000-0x3FFFF and the UEFI Memory Map and ACPI content can be
updated so the Guest OS knows to not use that range for DMA?
From: Paolo Bonzini [mailto:email@example.com]
Sent: Thursday, August 22, 2019 3:18 PM
To: Kinney, Michael D <firstname.lastname@example.org>;
Laszlo Ersek <email@example.com>; firstname.lastname@example.org;
Yao, Jiewen <email@example.com>
Cc: Alex Williamson <firstname.lastname@example.org>;
email@example.com; qemu devel list <qemu-
firstname.lastname@example.org>; Igor Mammedov <email@example.com>;
Chen, Yingwen <firstname.lastname@example.org>; Nakajima, Jun
<email@example.com>; Boris Ostrovsky
<firstname.lastname@example.org>; Joao Marcal Lemos Martins
<email@example.com>; Phillip Goerl
Subject: Re: [edk2-rfc] [edk2-devel] CPU hotplug using
SMM with QEMU+OVMF
On 22/08/19 22:06, Kinney, Michael D wrote:
The SMBASE register is internal and cannot be directlyaccessed by any
CPU. There is an SMBASE field that is member of theSMM Save State
area and can only be modified from SMM and requires theexecution of
an RSM instruction from SMM for the SMBASE register tobe updated from
the current SMBASE field value. The new SMBASEregister value is only
used on the next SMI.Actually there is also an SMBASE MSR, even though in
current silicon it's read-only and its use is
theoretically limited to SMM-transfer monitors. If that
MSR could be made accessible somehow outside SMM, that
would be great.
Once all the CPUs have been initialized for SMM, theCPUs that are not
needed can be hot removed. As noted above, the SMBASEvalue does not
change on an INIT. So as long as the hot add operationdoes not do a
RESET, the SMBASE value must be preserved.IIRC, hot-remove + hot-add will unplugs/plugs a
completely different CPU.
Another idea is to emulate this behavior. If the hotplug controller
provide registers (only accessible from SMM) to assignthe SMBASE
address for every CPU. When a CPU is hot added, QEMUcan set the
internal SMBASE register value from the hot plugcontroller register
value. If the SMM Monarch sends an INIT or an SMI fromthe Local APIC
to the hot added CPU, then the SMBASE register shouldnot be modified
and the CPU starts execution within TSEG the first timeit receives an SMI.
Yes, this would work. But again---if the issue is real
on current hardware too, I'd rather have a matching
solution for virtual platforms.
If the current hardware for example remembers INIT-
preserved across hot-remove/hot-add, we could emulate
I guess the fundamental question is: how do bare metal
platforms avoid this issue, or plan to avoid this issue?
Once we know that, we can use that information to find a
way to implement it in KVM. Only if it is impossible
we'll have a different strategy that is specific to our
Jiewen and I can collect specific questions on thistopic and continue
the discussion here. For example, I do not think thereis any method
other than what I referenced above to program theSMBASE register, but
I can ask if there are any other methods.