On Tue, Jul 17, 2012 at 03:23:00PM +0800, Wen Congyang wrote:
Method(MESC, 0) {
// Local5 = active memdevice bitmap
Store (MES, Local5)
// Local2 = last read byte from bitmap
Store (Zero, Local2)
// Local0 = memory device iterator
Store (Zero, Local0)
While (LLess(Local0, SizeOf(MEON))) {
// Local1 = MEON flag for this memory device
Store(DerefOf(Index(MEON, Local0)), Local1)
If (And(Local0, 0x07)) {
// Shift down previously read bitmap byte
ShiftRight(Local2, 1, Local2)
} Else {
// Read next byte from memdevice bitmap
Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2)
}
// Local3 = active state for this memory device
Store(And(Local2, 1), Local3)
If (LNotEqual(Local1, Local3)) {
There are two ways to hot remove a memory device:
- dimm_del
- echo 1 >/sys/bus/acpi/devices/PNP0C80:XX/eject
In the 2nd case, we cannot hotplug this memory device again, because both Local1 and Local3 are 1.
So, I think MEON flag for this meory device should be set to 0 in method _EJ0 or implement method _PS3 for memory device.
good catch. Both internal seabios state (MEON) and the machine qemu bitmap (mems_sts in hw/acpi_piix4.c) have to be updated when the ejection comes from OSPM action. I will implement a _PS3 method that updates the MEON flag and also signals qemu to change the mems_sts bitmap.
thanks, - Vasilis