1 QEMU<->ACPI BIOS memory hotplug interface
2 =========================================
4 ACPI BIOS GPE.3 handler is dedicated for notifying OS about memory hot-add
7 Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access)
8 ----------------------------------------------------------------
14 Lo part of memory device phys address
16 Hi part of memory device phys address
18 Lo part of memory device size in bytes
20 Hi part of memory device size in bytes
22 Memory device proximity domain
24 Memory device status fields
29 Device is enabled and may be used by guest
31 Device insert event, used to distinguish device for which
32 no device check event to OSPM was issued.
33 It's valid only when bit 1 is set.
35 Device remove event, used to distinguish device for which
36 no device eject request to OSPM was issued.
38 reserved and should be ignored by OSPM
48 Memory device slot selector, selects active memory device.
49 All following accesses to other registers in 0xa00-0xa17
50 region will read/store data from/to selected memory device.
52 OST event code reported by OSPM
54 OST status code reported by OSPM
56 reserved, writes into it are ignored
58 Memory device control fields
63 reserved, OSPM must clear it before writing to register.
64 Due to BUG in versions prior 2.4 that field isn't cleared
65 when other fields are written. Keep it reserved and don't
68 if set to 1 clears device insert event, set by OSPM
69 after it has emitted device check event for the
70 selected memory device
72 if set to 1 clears device remove event, set by OSPM
73 after it has emitted device eject request for the
74 selected memory device
76 if set to 1 initiates device eject, set by OSPM when it
77 triggers memory device removal and calls _EJ0 method
79 reserved, OSPM must clear them before writing to register
81 Selecting memory device slot beyond present range has no effect on platform:
83 - write accesses to memory hot-plug registers not documented above are ignored
84 - read accesses to memory hot-plug registers not documented above return
87 Memory hot remove process diagram
88 ---------------------------------
92 +-------------+ +-----------------------+ +------------------+
93 | 1. QEMU | | 2. QEMU | |3. QEMU |
94 | device_del +---->+ device unplug request +----->+Send SCI to guest,|
95 | | | cb | |return control to |
97 +-------------+ +-----------------------+ +------------------+
99 +---------------------------------------------------------------------+
101 +---------------------+ +-------------------------+
102 | OSPM: | remove event | OSPM: |
103 | send Eject Request, | | Scan memory devices |
104 | clear remove event +<-------------+ for event flags |
106 +---------------------+ +-------------------------+
109 +---------v--------+ +-----------------------+
110 | Guest OS: | success | OSPM: |
111 | process Ejection +----------->+ Execute _EJ0 method, |
112 | request | | set eject bit in flags|
113 +------------------+ +-----------------------+
116 +------------------------+ +-----------------------+
118 | set OST event & status | | call device unplug cb |
120 +------------------------+ +-----------------------+
123 +------------------+ +-------------------+
125 |Send OST QMP event| |Send device deleted|
127 +------------------+ | |
128 +-------------------+