xend, hvmloader: Allow any unused PCI device to be used for pass-through
cover xend, hvmloader: Allow any unused PCI device to be used for pass-through
The current limit of 2 pass-through devices seems to be rather small. These patches remove that limit and allow any unused PCI device to be used for pass-through, including hotplug.
It seems that the first few (4) devices will be used for other purposes by HVM domains. However, it seems to me to be clean to make this code generic and cope with any device on the bus - saving the need for subsequent changes if the number of devices HVM domains use by default ever changes.
There are also qemu-dm patches required for this change. I will submit them separately.
Signature · 3 lines
Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en
RFC 1/2 hvmloader: Allow any unused PCI device to be used for PCI hotplug
Allow any unused PCI device to be used for PCI pass-through hotplug.
This requires a patch to qemu-dm which will be submitted spearately.
---
tools/firmware/hvmloader/acpi/dsdt.asl | 1142 +++++++++++++++++++++++++++++++- 1 file changed, 1116 insertions(+), 26 deletions(-)
tools/firmware/hvmloader/acpi/dsdt.asl +1116 -26
@@ -981,60 +981,1027 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, * handle the hotplug action and status, which is beyond the ACPI * scope. */ + Device(S00) + { + Name (_ADR, 0x00000000) /* Dev 0, Func 0 */ + Name (_SUN, 0x00000000) + + Method (_PS0, 0) + { + Store (0x00, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x00, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x00, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH00) /* eject php slot 0x00 */ + } + + Method (_STA, 0) + { + Store (0x00, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH00) /* IN status as the _STA */ + } + } + + Device(S01) + { + Name (_ADR, 0x00010000) /* Dev 1, Func 0 */ + Name (_SUN, 0x00000001) + + Method (_PS0, 0) + { + Store (0x01, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x01, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x01, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH01) /* eject php slot 0x01 */ + } + + Method (_STA, 0) + { + Store (0x01, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH01) /* IN status as the _STA */ + } + } + + Device(S02) + { + Name (_ADR, 0x00020000) /* Dev 2, Func 0 */ + Name (_SUN, 0x00000002) + + Method (_PS0, 0) + { + Store (0x02, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x02, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x02, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH02) /* eject php slot 0x02 */ + } + + Method (_STA, 0) + { + Store (0x02, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH02) /* IN status as the _STA */ + } + } + + Device(S03) + { + Name (_ADR, 0x00030000) /* Dev 3, Func 0 */ + Name (_SUN, 0x00000003) + + Method (_PS0, 0) + { + Store (0x03, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x03, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x03, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH03) /* eject php slot 0x03 */ + } + + Method (_STA, 0) + { + Store (0x03, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH03) /* IN status as the _STA */ + } + } + + Device(S04) + { + Name (_ADR, 0x00040000) /* Dev 4, Func 0 */ + Name (_SUN, 0x00000004) + + Method (_PS0, 0) + { + Store (0x04, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x04, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x04, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH04) /* eject php slot 0x04 */ + } + + Method (_STA, 0) + { + Store (0x04, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH04) /* IN status as the _STA */ + } + } + + Device(S05) + { + Name (_ADR, 0x00050000) /* Dev 5, Func 0 */ + Name (_SUN, 0x00000005) + + Method (_PS0, 0) + { + Store (0x05, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x05, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x05, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH05) /* eject php slot 0x05 */ + } + + Method (_STA, 0) + { + Store (0x05, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH05) /* IN status as the _STA */ + } + } + + Device(S06) + { + Name (_ADR, 0x00060000) /* Dev 6, Func 0 */ + Name (_SUN, 0x00000006) + + Method (_PS0, 0) + { + Store (0x06, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x06, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x06, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH06) /* eject php slot 0x06 */ + } + + Method (_STA, 0) + { + Store (0x06, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH06) /* IN status as the _STA */ + } + } + + Device(S07) + { + Name (_ADR, 0x00070000) /* Dev 7, Func 0 */ + Name (_SUN, 0x00000007) + + Method (_PS0, 0) + { + Store (0x07, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x07, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x07, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH07) /* eject php slot 0x07 */ + } + + Method (_STA, 0) + { + Store (0x07, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH07) /* IN status as the _STA */ + } + } + + Device(S08) + { + Name (_ADR, 0x00080000) /* Dev 8, Func 0 */ + Name (_SUN, 0x00000008) + + Method (_PS0, 0) + { + Store (0x08, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x08, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x08, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH08) /* eject php slot 0x08 */ + } + + Method (_STA, 0) + { + Store (0x08, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH08) /* IN status as the _STA */ + } + } + + Device(S09) + { + Name (_ADR, 0x00090000) /* Dev 9, Func 0 */ + Name (_SUN, 0x00000009) + + Method (_PS0, 0) + { + Store (0x09, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x09, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x09, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH09) /* eject php slot 0x09 */ + } + + Method (_STA, 0) + { + Store (0x09, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH09) /* IN status as the _STA */ + } + } + + Device(S0A) + { + Name (_ADR, 0x000a0000) /* Dev 10, Func 0 */ + Name (_SUN, 0x0000000a) + + Method (_PS0, 0) + { + Store (0x0a, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0a, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0a, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0A) /* eject php slot 0x0a */ + } + + Method (_STA, 0) + { + Store (0x0a, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0A) /* IN status as the _STA */ + } + } + + Device(S0B) + { + Name (_ADR, 0x000b0000) /* Dev 11, Func 0 */ + Name (_SUN, 0x0000000b) + + Method (_PS0, 0) + { + Store (0x0b, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0b, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0b, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0B) /* eject php slot 0x0b */ + } + + Method (_STA, 0) + { + Store (0x0b, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0B) /* IN status as the _STA */ + } + } + + Device(S0C) + { + Name (_ADR, 0x000c0000) /* Dev 12, Func 0 */ + Name (_SUN, 0x0000000c) + + Method (_PS0, 0) + { + Store (0x0c, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0c, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0c, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0C) /* eject php slot 0x0c */ + } + + Method (_STA, 0) + { + Store (0x0c, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0C) /* IN status as the _STA */ + } + } + + Device(S0D) + { + Name (_ADR, 0x000d0000) /* Dev 13, Func 0 */ + Name (_SUN, 0x0000000d) + + Method (_PS0, 0) + { + Store (0x0d, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0d, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0d, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0D) /* eject php slot 0x0d */ + } + + Method (_STA, 0) + { + Store (0x0d, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0D) /* IN status as the _STA */ + } + } + + Device(S0E) + { + Name (_ADR, 0x000e0000) /* Dev 14, Func 0 */ + Name (_SUN, 0x0000000e) + + Method (_PS0, 0) + { + Store (0x0e, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0e, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0e, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0E) /* eject php slot 0x0e */ + } + + Method (_STA, 0) + { + Store (0x0e, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0E) /* IN status as the _STA */ + } + } + + Device(S0F) + { + Name (_ADR, 0x000f0000) /* Dev 15, Func 0 */ + Name (_SUN, 0x0000000f) + + Method (_PS0, 0) + { + Store (0x0f, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0f, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0f, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0F) /* eject php slot 0x0f */ + } + + Method (_STA, 0) + { + Store (0x0f, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0F) /* IN status as the _STA */ + } + } + + Device(S10) + { + Name (_ADR, 0x00100000) /* Dev 16, Func 0 */ + Name (_SUN, 0x00000010) + + Method (_PS0, 0) + { + Store (0x10, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x10, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x10, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH10) /* eject php slot 0x10 */ + } + + Method (_STA, 0) + { + Store (0x10, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH10) /* IN status as the _STA */ + } + } + + Device(S11) + { + Name (_ADR, 0x00110000) /* Dev 17, Func 0 */ + Name (_SUN, 0x00000011) + + Method (_PS0, 0) + { + Store (0x11, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x11, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x11, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH11) /* eject php slot 0x11 */ + } + + Method (_STA, 0) + { + Store (0x11, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH11) /* IN status as the _STA */ + } + } + + Device(S12) + { + Name (_ADR, 0x00120000) /* Dev 18, Func 0 */ + Name (_SUN, 0x00000012) + + Method (_PS0, 0) + { + Store (0x12, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x12, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x12, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH12) /* eject php slot 0x12 */ + } + + Method (_STA, 0) + { + Store (0x12, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH12) /* IN status as the _STA */ + } + } + + Device(S13) + { + Name (_ADR, 0x00130000) /* Dev 19, Func 0 */ + Name (_SUN, 0x00000013) + + Method (_PS0, 0) + { + Store (0x13, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x13, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x13, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH13) /* eject php slot 0x13 */ + } + + Method (_STA, 0) + { + Store (0x13, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH13) /* IN status as the _STA */ + } + } + + Device(S14) + { + Name (_ADR, 0x00140000) /* Dev 20, Func 0 */ + Name (_SUN, 0x00000014) + + Method (_PS0, 0) + { + Store (0x14, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x14, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x14, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH14) /* eject php slot 0x14 */ + } - Device (S1F0) + Method (_STA, 0) + { + Store (0x14, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH14) /* IN status as the _STA */ + } + } + + Device(S15) { - Name (_ADR, 0x00060000) /* Dev 6, Func 0 */ - Name (_SUN, 0x00000001) + Name (_ADR, 0x00150000) /* Dev 21, Func 0 */ + Name (_SUN, 0x00000015) Method (_PS0, 0) { + Store (0x15, \_GPE.DPT1) Store (0x80, \_GPE.DPT2) } Method (_PS3, 0) { + Store (0x15, \_GPE.DPT1) Store (0x83, \_GPE.DPT2) } Method (_EJ0, 1) { + Store (0x15, \_GPE.DPT1) Store (0x88, \_GPE.DPT2) - Store (0x1, \_GPE.PHP1) /* eject php slot 1*/ + Store (0x1, \_GPE.PH15) /* eject php slot 0x15 */ } Method (_STA, 0) { + Store (0x15, \_GPE.DPT1) Store (0x89, \_GPE.DPT2) - Return ( \_GPE.PHP1 ) /* IN status as the _STA */ + Return (\_GPE.PH15) /* IN status as the _STA */ } } - Device (S2F0) + Device(S16) { - Name (_ADR, 0x00070000) /* Dev 7, Func 0 */ - Name (_SUN, 0x00000002) + Name (_ADR, 0x00160000) /* Dev 22, Func 0 */ + Name (_SUN, 0x00000016) + + Method (_PS0, 0) + { + Store (0x16, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x16, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x16, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH16) /* eject php slot 0x16 */ + } + + Method (_STA, 0) + { + Store (0x16, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH16) /* IN status as the _STA */ + } + } + + Device(S17) + { + Name (_ADR, 0x00170000) /* Dev 23, Func 0 */ + Name (_SUN, 0x00000017) + + Method (_PS0, 0) + { + Store (0x17, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x17, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x17, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH17) /* eject php slot 0x17 */ + } + + Method (_STA, 0) + { + Store (0x17, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH17) /* IN status as the _STA */ + } + } + + Device(S18) + { + Name (_ADR, 0x00180000) /* Dev 24, Func 0 */ + Name (_SUN, 0x00000018) + + Method (_PS0, 0) + { + Store (0x18, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x18, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x18, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH18) /* eject php slot 0x18 */ + } + + Method (_STA, 0) + { + Store (0x18, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH18) /* IN status as the _STA */ + } + } + + Device(S19) + { + Name (_ADR, 0x00190000) /* Dev 25, Func 0 */ + Name (_SUN, 0x00000019) + + Method (_PS0, 0) + { + Store (0x19, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x19, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x19, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH19) /* eject php slot 0x19 */ + } + + Method (_STA, 0) + { + Store (0x19, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH19) /* IN status as the _STA */ + } + } + + Device(S1A) + { + Name (_ADR, 0x001a0000) /* Dev 26, Func 0 */ + Name (_SUN, 0x0000001a) + + Method (_PS0, 0) + { + Store (0x1a, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1a, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1a, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1A) /* eject php slot 0x1a */ + } + + Method (_STA, 0) + { + Store (0x1a, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1A) /* IN status as the _STA */ + } + } + + Device(S1B) + { + Name (_ADR, 0x001b0000) /* Dev 27, Func 0 */ + Name (_SUN, 0x0000001b) + + Method (_PS0, 0) + { + Store (0x1b, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1b, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1b, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1B) /* eject php slot 0x1b */ + } + + Method (_STA, 0) + { + Store (0x1b, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1B) /* IN status as the _STA */ + } + } + + Device(S1C) + { + Name (_ADR, 0x001c0000) /* Dev 28, Func 0 */ + Name (_SUN, 0x0000001c) + + Method (_PS0, 0) + { + Store (0x1c, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1c, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1c, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1C) /* eject php slot 0x1c */ + } + + Method (_STA, 0) + { + Store (0x1c, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1C) /* IN status as the _STA */ + } + } + + Device(S1D) + { + Name (_ADR, 0x001d0000) /* Dev 29, Func 0 */ + Name (_SUN, 0x0000001d) + + Method (_PS0, 0) + { + Store (0x1d, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1d, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1d, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1D) /* eject php slot 0x1d */ + } + + Method (_STA, 0) + { + Store (0x1d, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1D) /* IN status as the _STA */ + } + } + + Device(S1E) + { + Name (_ADR, 0x001e0000) /* Dev 30, Func 0 */ + Name (_SUN, 0x0000001e) + + Method (_PS0, 0) + { + Store (0x1e, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1e, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1e, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1E) /* eject php slot 0x1e */ + } + + Method (_STA, 0) + { + Store (0x1e, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1E) /* IN status as the _STA */ + } + } + + Device(S1F) + { + Name (_ADR, 0x001f0000) /* Dev 31, Func 0 */ + Name (_SUN, 0x0000001f) Method (_PS0, 0) { - Store (0x90, \_GPE.DPT2) + Store (0x1f, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) } Method (_PS3, 0) { - Store (0x93, \_GPE.DPT2) + Store (0x1f, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) } Method (_EJ0, 1) { - Store (0x98, \_GPE.DPT2) - Store (0x1, \_GPE.PHP2) /* eject php slot 1*/ + Store (0x1f, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1F) /* eject php slot 0x1f */ } Method (_STA, 0) { - Store (0x99, \_GPE.DPT2) - Return ( \_GPE.PHP2 ) /* IN status as the _STA */ + Store (0x1f, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1F) /* IN status as the _STA */ } } }
@@ -1042,13 +2009,44 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Scope (\_GPE) { - OperationRegion (PHP, SystemIO, 0x10c0, 0x03) + OperationRegion (PHP, SystemIO, 0x10c0, 0x22) Field (PHP, ByteAcc, NoLock, Preserve) { - PSTA, 8, /* hotplug controller status reg */ - PHP1, 8, /* hotplug slot 1 control reg */ - PHP2, 8 /* hotplug slot 2 control reg */ - } + PSTA, 8, /* hotplug controller event reg */ + PSTB, 8, /* hotplug controller slot reg */ + PH00, 8, /* hotplug slot 0x00 control reg */ + PH01, 8, /* hotplug slot 0x01 control reg */ + PH02, 8, /* hotplug slot 0x02 control reg */ + PH03, 8, /* hotplug slot 0x03 control reg */ + PH04, 8, /* hotplug slot 0x04 control reg */ + PH05, 8, /* hotplug slot 0x05 control reg */ + PH06, 8, /* hotplug slot 0x06 control reg */ + PH07, 8, /* hotplug slot 0x07 control reg */ + PH08, 8, /* hotplug slot 0x08 control reg */ + PH09, 8, /* hotplug slot 0x09 control reg */ + PH0A, 8, /* hotplug slot 0x0a control reg */ + PH0B, 8, /* hotplug slot 0x0b control reg */ + PH0C, 8, /* hotplug slot 0x0c control reg */ + PH0D, 8, /* hotplug slot 0x0d control reg */ + PH0E, 8, /* hotplug slot 0x0e control reg */ + PH0F, 8, /* hotplug slot 0x0f control reg */ + PH10, 8, /* hotplug slot 0x10 control reg */ + PH11, 8, /* hotplug slot 0x11 control reg */ + PH12, 8, /* hotplug slot 0x12 control reg */ + PH13, 8, /* hotplug slot 0x13 control reg */ + PH14, 8, /* hotplug slot 0x14 control reg */ + PH15, 8, /* hotplug slot 0x15 control reg */ + PH16, 8, /* hotplug slot 0x16 control reg */ + PH17, 8, /* hotplug slot 0x17 control reg */ + PH18, 8, /* hotplug slot 0x18 control reg */ + PH19, 8, /* hotplug slot 0x19 control reg */ + PH1A, 8, /* hotplug slot 0x1a control reg */ + PH1B, 8, /* hotplug slot 0x1b control reg */ + PH1C, 8, /* hotplug slot 0x1c control reg */ + PH1D, 8, /* hotplug slot 0x1d control reg */ + PH1E, 8, /* hotplug slot 0x1e control reg */ + PH1F, 8 /* hotplug slot 0x1f control reg */ + } OperationRegion (DG1, SystemIO, 0xb044, 0x04) Field (DG1, ByteAcc, NoLock, Preserve) {
@@ -1061,20 +2059,112 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Name (SLT, 0x0) Name (EVT, 0x0) Store (PSTA, Local1) - ShiftRight (Local1, 0x4, SLT) And (Local1, 0xf, EVT) + Store (PSTB, Local1) /* XXX: Store (PSTB, SLT) ? */ + And (Local1, 0xff, SLT) /* debug */ Store (SLT, DPT1) Store (EVT, DPT2) - If ( LEqual(SLT, 0x1) ) - { - Notify (\_SB.PCI0.S1F0, EVT) - } - ElseIf ( LEqual(SLT, 0x2) ) + Switch (SLT) { - Notify (\_SB.PCI0.S2F0, EVT) + Case (0x00) { + Notify (\_SB.PCI0.S00, EVT) + } + Case (0x01) { + Notify (\_SB.PCI0.S01, EVT) + } + Case (0x02) { + Notify (\_SB.PCI0.S02, EVT) + } + Case (0x03) { + Notify (\_SB.PCI0.S03, EVT) + } + Case (0x04) { + Notify (\_SB.PCI0.S04, EVT) + } + Case (0x05) { + Notify (\_SB.PCI0.S05, EVT) + } + Case (0x06) { + Notify (\_SB.PCI0.S06, EVT) + } + Case (0x07) { + Notify (\_SB.PCI0.S07, EVT) + } + Case (0x08) { + Notify (\_SB.PCI0.S08, EVT) + } + Case (0x09) { + Notify (\_SB.PCI0.S09, EVT) + } + Case (0x0a) { + Notify (\_SB.PCI0.S0A, EVT) + } + Case (0x0b) { + Notify (\_SB.PCI0.S0B, EVT) + } + Case (0x0c) { + Notify (\_SB.PCI0.S0C, EVT) + } + Case (0x0d) { + Notify (\_SB.PCI0.S0D, EVT) + } + Case (0x0e) { + Notify (\_SB.PCI0.S0E, EVT) + } + Case (0x0f) { + Notify (\_SB.PCI0.S0F, EVT) + } + Case (0x10) { + Notify (\_SB.PCI0.S10, EVT) + } + Case (0x11) { + Notify (\_SB.PCI0.S11, EVT) + } + Case (0x12) { + Notify (\_SB.PCI0.S12, EVT) + } + Case (0x13) { + Notify (\_SB.PCI0.S13, EVT) + } + Case (0x14) { + Notify (\_SB.PCI0.S14, EVT) + } + Case (0x15) { + Notify (\_SB.PCI0.S15, EVT) + } + Case (0x16) { + Notify (\_SB.PCI0.S16, EVT) + } + Case (0x17) { + Notify (\_SB.PCI0.S17, EVT) + } + Case (0x18) { + Notify (\_SB.PCI0.S18, EVT) + } + Case (0x19) { + Notify (\_SB.PCI0.S19, EVT) + } + Case (0x1a) { + Notify (\_SB.PCI0.S1A, EVT) + } + Case (0x1b) { + Notify (\_SB.PCI0.S1B, EVT) + } + Case (0x1c) { + Notify (\_SB.PCI0.S1C, EVT) + } + Case (0x1d) { + Notify (\_SB.PCI0.S1D, EVT) + } + Case (0x1e) { + Notify (\_SB.PCI0.S1E, EVT) + } + Case (0x1f) { + Notify (\_SB.PCI0.S1F, EVT) + } } } }
Signature · 4 lines
-- Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en
Re: [rfc 1/2 v2] hvmloader: Allow any unused PCI device to be used for PCI hotplug
Allow any unused PCI device to be used for PCI pass-through hotplug.
This requires a patch to qemu-dm which will be submitted spearately.
---
tools/firmware/hvmloader/acpi/dsdt.asl | 1142 +++++++++++++++++++++++++++++++- tools/firmware/hvmloader/acpi/dsdt.c | 960 +++++++++++++++++++++++++- 2 files changed, 2010 insertions(+), 92 deletions(-)
* Fri, 13 Mar 2009 18:07:35 +1100
Initial public release
* Mon, 16 Mar 2009 10:10:25 +1100
Add dsdt.c changes.
dsdt.c is a target of dst.asl but both are stored in the hg repository
tools/firmware/hvmloader/acpi/dsdt.asl +1116 -26
@@ -981,60 +981,1027 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, * handle the hotplug action and status, which is beyond the ACPI * scope. */ + Device(S00) + { + Name (_ADR, 0x00000000) /* Dev 0, Func 0 */ + Name (_SUN, 0x00000000) + + Method (_PS0, 0) + { + Store (0x00, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x00, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x00, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH00) /* eject php slot 0x00 */ + } + + Method (_STA, 0) + { + Store (0x00, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH00) /* IN status as the _STA */ + } + } + + Device(S01) + { + Name (_ADR, 0x00010000) /* Dev 1, Func 0 */ + Name (_SUN, 0x00000001) + + Method (_PS0, 0) + { + Store (0x01, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x01, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x01, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH01) /* eject php slot 0x01 */ + } + + Method (_STA, 0) + { + Store (0x01, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH01) /* IN status as the _STA */ + } + } + + Device(S02) + { + Name (_ADR, 0x00020000) /* Dev 2, Func 0 */ + Name (_SUN, 0x00000002) + + Method (_PS0, 0) + { + Store (0x02, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x02, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x02, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH02) /* eject php slot 0x02 */ + } + + Method (_STA, 0) + { + Store (0x02, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH02) /* IN status as the _STA */ + } + } + + Device(S03) + { + Name (_ADR, 0x00030000) /* Dev 3, Func 0 */ + Name (_SUN, 0x00000003) + + Method (_PS0, 0) + { + Store (0x03, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x03, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x03, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH03) /* eject php slot 0x03 */ + } + + Method (_STA, 0) + { + Store (0x03, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH03) /* IN status as the _STA */ + } + } + + Device(S04) + { + Name (_ADR, 0x00040000) /* Dev 4, Func 0 */ + Name (_SUN, 0x00000004) + + Method (_PS0, 0) + { + Store (0x04, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x04, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x04, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH04) /* eject php slot 0x04 */ + } + + Method (_STA, 0) + { + Store (0x04, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH04) /* IN status as the _STA */ + } + } + + Device(S05) + { + Name (_ADR, 0x00050000) /* Dev 5, Func 0 */ + Name (_SUN, 0x00000005) + + Method (_PS0, 0) + { + Store (0x05, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x05, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x05, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH05) /* eject php slot 0x05 */ + } + + Method (_STA, 0) + { + Store (0x05, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH05) /* IN status as the _STA */ + } + } + + Device(S06) + { + Name (_ADR, 0x00060000) /* Dev 6, Func 0 */ + Name (_SUN, 0x00000006) + + Method (_PS0, 0) + { + Store (0x06, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x06, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x06, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH06) /* eject php slot 0x06 */ + } + + Method (_STA, 0) + { + Store (0x06, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH06) /* IN status as the _STA */ + } + } + + Device(S07) + { + Name (_ADR, 0x00070000) /* Dev 7, Func 0 */ + Name (_SUN, 0x00000007) + + Method (_PS0, 0) + { + Store (0x07, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x07, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x07, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH07) /* eject php slot 0x07 */ + } + + Method (_STA, 0) + { + Store (0x07, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH07) /* IN status as the _STA */ + } + } + + Device(S08) + { + Name (_ADR, 0x00080000) /* Dev 8, Func 0 */ + Name (_SUN, 0x00000008) + + Method (_PS0, 0) + { + Store (0x08, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x08, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x08, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH08) /* eject php slot 0x08 */ + } + + Method (_STA, 0) + { + Store (0x08, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH08) /* IN status as the _STA */ + } + } + + Device(S09) + { + Name (_ADR, 0x00090000) /* Dev 9, Func 0 */ + Name (_SUN, 0x00000009) + + Method (_PS0, 0) + { + Store (0x09, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x09, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x09, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH09) /* eject php slot 0x09 */ + } + + Method (_STA, 0) + { + Store (0x09, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH09) /* IN status as the _STA */ + } + } + + Device(S0A) + { + Name (_ADR, 0x000a0000) /* Dev 10, Func 0 */ + Name (_SUN, 0x0000000a) + + Method (_PS0, 0) + { + Store (0x0a, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0a, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0a, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0A) /* eject php slot 0x0a */ + } + + Method (_STA, 0) + { + Store (0x0a, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0A) /* IN status as the _STA */ + } + } + + Device(S0B) + { + Name (_ADR, 0x000b0000) /* Dev 11, Func 0 */ + Name (_SUN, 0x0000000b) + + Method (_PS0, 0) + { + Store (0x0b, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0b, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0b, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0B) /* eject php slot 0x0b */ + } + + Method (_STA, 0) + { + Store (0x0b, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0B) /* IN status as the _STA */ + } + } + + Device(S0C) + { + Name (_ADR, 0x000c0000) /* Dev 12, Func 0 */ + Name (_SUN, 0x0000000c) + + Method (_PS0, 0) + { + Store (0x0c, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0c, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0c, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0C) /* eject php slot 0x0c */ + } + + Method (_STA, 0) + { + Store (0x0c, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0C) /* IN status as the _STA */ + } + } + + Device(S0D) + { + Name (_ADR, 0x000d0000) /* Dev 13, Func 0 */ + Name (_SUN, 0x0000000d) + + Method (_PS0, 0) + { + Store (0x0d, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0d, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0d, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0D) /* eject php slot 0x0d */ + } + + Method (_STA, 0) + { + Store (0x0d, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0D) /* IN status as the _STA */ + } + } + + Device(S0E) + { + Name (_ADR, 0x000e0000) /* Dev 14, Func 0 */ + Name (_SUN, 0x0000000e) + + Method (_PS0, 0) + { + Store (0x0e, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0e, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0e, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0E) /* eject php slot 0x0e */ + } + + Method (_STA, 0) + { + Store (0x0e, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0E) /* IN status as the _STA */ + } + } + + Device(S0F) + { + Name (_ADR, 0x000f0000) /* Dev 15, Func 0 */ + Name (_SUN, 0x0000000f) + + Method (_PS0, 0) + { + Store (0x0f, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x0f, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x0f, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH0F) /* eject php slot 0x0f */ + } + + Method (_STA, 0) + { + Store (0x0f, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH0F) /* IN status as the _STA */ + } + } + + Device(S10) + { + Name (_ADR, 0x00100000) /* Dev 16, Func 0 */ + Name (_SUN, 0x00000010) + + Method (_PS0, 0) + { + Store (0x10, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x10, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x10, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH10) /* eject php slot 0x10 */ + } + + Method (_STA, 0) + { + Store (0x10, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH10) /* IN status as the _STA */ + } + } + + Device(S11) + { + Name (_ADR, 0x00110000) /* Dev 17, Func 0 */ + Name (_SUN, 0x00000011) + + Method (_PS0, 0) + { + Store (0x11, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x11, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x11, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH11) /* eject php slot 0x11 */ + } + + Method (_STA, 0) + { + Store (0x11, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH11) /* IN status as the _STA */ + } + } + + Device(S12) + { + Name (_ADR, 0x00120000) /* Dev 18, Func 0 */ + Name (_SUN, 0x00000012) + + Method (_PS0, 0) + { + Store (0x12, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x12, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x12, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH12) /* eject php slot 0x12 */ + } + + Method (_STA, 0) + { + Store (0x12, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH12) /* IN status as the _STA */ + } + } + + Device(S13) + { + Name (_ADR, 0x00130000) /* Dev 19, Func 0 */ + Name (_SUN, 0x00000013) + + Method (_PS0, 0) + { + Store (0x13, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x13, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x13, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH13) /* eject php slot 0x13 */ + } + + Method (_STA, 0) + { + Store (0x13, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH13) /* IN status as the _STA */ + } + } + + Device(S14) + { + Name (_ADR, 0x00140000) /* Dev 20, Func 0 */ + Name (_SUN, 0x00000014) + + Method (_PS0, 0) + { + Store (0x14, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x14, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x14, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH14) /* eject php slot 0x14 */ + } - Device (S1F0) + Method (_STA, 0) + { + Store (0x14, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH14) /* IN status as the _STA */ + } + } + + Device(S15) { - Name (_ADR, 0x00060000) /* Dev 6, Func 0 */ - Name (_SUN, 0x00000001) + Name (_ADR, 0x00150000) /* Dev 21, Func 0 */ + Name (_SUN, 0x00000015) Method (_PS0, 0) { + Store (0x15, \_GPE.DPT1) Store (0x80, \_GPE.DPT2) } Method (_PS3, 0) { + Store (0x15, \_GPE.DPT1) Store (0x83, \_GPE.DPT2) } Method (_EJ0, 1) { + Store (0x15, \_GPE.DPT1) Store (0x88, \_GPE.DPT2) - Store (0x1, \_GPE.PHP1) /* eject php slot 1*/ + Store (0x1, \_GPE.PH15) /* eject php slot 0x15 */ } Method (_STA, 0) { + Store (0x15, \_GPE.DPT1) Store (0x89, \_GPE.DPT2) - Return ( \_GPE.PHP1 ) /* IN status as the _STA */ + Return (\_GPE.PH15) /* IN status as the _STA */ } } - Device (S2F0) + Device(S16) { - Name (_ADR, 0x00070000) /* Dev 7, Func 0 */ - Name (_SUN, 0x00000002) + Name (_ADR, 0x00160000) /* Dev 22, Func 0 */ + Name (_SUN, 0x00000016) + + Method (_PS0, 0) + { + Store (0x16, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x16, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x16, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH16) /* eject php slot 0x16 */ + } + + Method (_STA, 0) + { + Store (0x16, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH16) /* IN status as the _STA */ + } + } + + Device(S17) + { + Name (_ADR, 0x00170000) /* Dev 23, Func 0 */ + Name (_SUN, 0x00000017) + + Method (_PS0, 0) + { + Store (0x17, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x17, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x17, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH17) /* eject php slot 0x17 */ + } + + Method (_STA, 0) + { + Store (0x17, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH17) /* IN status as the _STA */ + } + } + + Device(S18) + { + Name (_ADR, 0x00180000) /* Dev 24, Func 0 */ + Name (_SUN, 0x00000018) + + Method (_PS0, 0) + { + Store (0x18, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x18, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x18, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH18) /* eject php slot 0x18 */ + } + + Method (_STA, 0) + { + Store (0x18, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH18) /* IN status as the _STA */ + } + } + + Device(S19) + { + Name (_ADR, 0x00190000) /* Dev 25, Func 0 */ + Name (_SUN, 0x00000019) + + Method (_PS0, 0) + { + Store (0x19, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x19, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x19, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH19) /* eject php slot 0x19 */ + } + + Method (_STA, 0) + { + Store (0x19, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH19) /* IN status as the _STA */ + } + } + + Device(S1A) + { + Name (_ADR, 0x001a0000) /* Dev 26, Func 0 */ + Name (_SUN, 0x0000001a) + + Method (_PS0, 0) + { + Store (0x1a, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1a, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1a, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1A) /* eject php slot 0x1a */ + } + + Method (_STA, 0) + { + Store (0x1a, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1A) /* IN status as the _STA */ + } + } + + Device(S1B) + { + Name (_ADR, 0x001b0000) /* Dev 27, Func 0 */ + Name (_SUN, 0x0000001b) + + Method (_PS0, 0) + { + Store (0x1b, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1b, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1b, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1B) /* eject php slot 0x1b */ + } + + Method (_STA, 0) + { + Store (0x1b, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1B) /* IN status as the _STA */ + } + } + + Device(S1C) + { + Name (_ADR, 0x001c0000) /* Dev 28, Func 0 */ + Name (_SUN, 0x0000001c) + + Method (_PS0, 0) + { + Store (0x1c, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1c, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1c, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1C) /* eject php slot 0x1c */ + } + + Method (_STA, 0) + { + Store (0x1c, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1C) /* IN status as the _STA */ + } + } + + Device(S1D) + { + Name (_ADR, 0x001d0000) /* Dev 29, Func 0 */ + Name (_SUN, 0x0000001d) + + Method (_PS0, 0) + { + Store (0x1d, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1d, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1d, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1D) /* eject php slot 0x1d */ + } + + Method (_STA, 0) + { + Store (0x1d, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1D) /* IN status as the _STA */ + } + } + + Device(S1E) + { + Name (_ADR, 0x001e0000) /* Dev 30, Func 0 */ + Name (_SUN, 0x0000001e) + + Method (_PS0, 0) + { + Store (0x1e, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) + } + + Method (_PS3, 0) + { + Store (0x1e, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) + } + + Method (_EJ0, 1) + { + Store (0x1e, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1E) /* eject php slot 0x1e */ + } + + Method (_STA, 0) + { + Store (0x1e, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1E) /* IN status as the _STA */ + } + } + + Device(S1F) + { + Name (_ADR, 0x001f0000) /* Dev 31, Func 0 */ + Name (_SUN, 0x0000001f) Method (_PS0, 0) { - Store (0x90, \_GPE.DPT2) + Store (0x1f, \_GPE.DPT1) + Store (0x80, \_GPE.DPT2) } Method (_PS3, 0) { - Store (0x93, \_GPE.DPT2) + Store (0x1f, \_GPE.DPT1) + Store (0x83, \_GPE.DPT2) } Method (_EJ0, 1) { - Store (0x98, \_GPE.DPT2) - Store (0x1, \_GPE.PHP2) /* eject php slot 1*/ + Store (0x1f, \_GPE.DPT1) + Store (0x88, \_GPE.DPT2) + Store (0x1, \_GPE.PH1F) /* eject php slot 0x1f */ } Method (_STA, 0) { - Store (0x99, \_GPE.DPT2) - Return ( \_GPE.PHP2 ) /* IN status as the _STA */ + Store (0x1f, \_GPE.DPT1) + Store (0x89, \_GPE.DPT2) + Return (\_GPE.PH1F) /* IN status as the _STA */ } } }
@@ -1042,13 +2009,44 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Scope (\_GPE) { - OperationRegion (PHP, SystemIO, 0x10c0, 0x03) + OperationRegion (PHP, SystemIO, 0x10c0, 0x22) Field (PHP, ByteAcc, NoLock, Preserve) { - PSTA, 8, /* hotplug controller status reg */ - PHP1, 8, /* hotplug slot 1 control reg */ - PHP2, 8 /* hotplug slot 2 control reg */ - } + PSTA, 8, /* hotplug controller event reg */ + PSTB, 8, /* hotplug controller slot reg */ + PH00, 8, /* hotplug slot 0x00 control reg */ + PH01, 8, /* hotplug slot 0x01 control reg */ + PH02, 8, /* hotplug slot 0x02 control reg */ + PH03, 8, /* hotplug slot 0x03 control reg */ + PH04, 8, /* hotplug slot 0x04 control reg */ + PH05, 8, /* hotplug slot 0x05 control reg */ + PH06, 8, /* hotplug slot 0x06 control reg */ + PH07, 8, /* hotplug slot 0x07 control reg */ + PH08, 8, /* hotplug slot 0x08 control reg */ + PH09, 8, /* hotplug slot 0x09 control reg */ + PH0A, 8, /* hotplug slot 0x0a control reg */ + PH0B, 8, /* hotplug slot 0x0b control reg */ + PH0C, 8, /* hotplug slot 0x0c control reg */ + PH0D, 8, /* hotplug slot 0x0d control reg */ + PH0E, 8, /* hotplug slot 0x0e control reg */ + PH0F, 8, /* hotplug slot 0x0f control reg */ + PH10, 8, /* hotplug slot 0x10 control reg */ + PH11, 8, /* hotplug slot 0x11 control reg */ + PH12, 8, /* hotplug slot 0x12 control reg */ + PH13, 8, /* hotplug slot 0x13 control reg */ + PH14, 8, /* hotplug slot 0x14 control reg */ + PH15, 8, /* hotplug slot 0x15 control reg */ + PH16, 8, /* hotplug slot 0x16 control reg */ + PH17, 8, /* hotplug slot 0x17 control reg */ + PH18, 8, /* hotplug slot 0x18 control reg */ + PH19, 8, /* hotplug slot 0x19 control reg */ + PH1A, 8, /* hotplug slot 0x1a control reg */ + PH1B, 8, /* hotplug slot 0x1b control reg */ + PH1C, 8, /* hotplug slot 0x1c control reg */ + PH1D, 8, /* hotplug slot 0x1d control reg */ + PH1E, 8, /* hotplug slot 0x1e control reg */ + PH1F, 8 /* hotplug slot 0x1f control reg */ + } OperationRegion (DG1, SystemIO, 0xb044, 0x04) Field (DG1, ByteAcc, NoLock, Preserve) {
@@ -1061,20 +2059,112 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Name (SLT, 0x0) Name (EVT, 0x0) Store (PSTA, Local1) - ShiftRight (Local1, 0x4, SLT) And (Local1, 0xf, EVT) + Store (PSTB, Local1) /* XXX: Store (PSTB, SLT) ? */ + And (Local1, 0xff, SLT) /* debug */ Store (SLT, DPT1) Store (EVT, DPT2) - If ( LEqual(SLT, 0x1) ) - { - Notify (\_SB.PCI0.S1F0, EVT) - } - ElseIf ( LEqual(SLT, 0x2) ) + Switch (SLT) { - Notify (\_SB.PCI0.S2F0, EVT) + Case (0x00) { + Notify (\_SB.PCI0.S00, EVT) + } + Case (0x01) { + Notify (\_SB.PCI0.S01, EVT) + } + Case (0x02) { + Notify (\_SB.PCI0.S02, EVT) + } + Case (0x03) { + Notify (\_SB.PCI0.S03, EVT) + } + Case (0x04) { + Notify (\_SB.PCI0.S04, EVT) + } + Case (0x05) { + Notify (\_SB.PCI0.S05, EVT) + } + Case (0x06) { + Notify (\_SB.PCI0.S06, EVT) + } + Case (0x07) { + Notify (\_SB.PCI0.S07, EVT) + } + Case (0x08) { + Notify (\_SB.PCI0.S08, EVT) + } + Case (0x09) { + Notify (\_SB.PCI0.S09, EVT) + } + Case (0x0a) { + Notify (\_SB.PCI0.S0A, EVT) + } + Case (0x0b) { + Notify (\_SB.PCI0.S0B, EVT) + } + Case (0x0c) { + Notify (\_SB.PCI0.S0C, EVT) + } + Case (0x0d) { + Notify (\_SB.PCI0.S0D, EVT) + } + Case (0x0e) { + Notify (\_SB.PCI0.S0E, EVT) + } + Case (0x0f) { + Notify (\_SB.PCI0.S0F, EVT) + } + Case (0x10) { + Notify (\_SB.PCI0.S10, EVT) + } + Case (0x11) { + Notify (\_SB.PCI0.S11, EVT) + } + Case (0x12) { + Notify (\_SB.PCI0.S12, EVT) + } + Case (0x13) { + Notify (\_SB.PCI0.S13, EVT) + } + Case (0x14) { + Notify (\_SB.PCI0.S14, EVT) + } + Case (0x15) { + Notify (\_SB.PCI0.S15, EVT) + } + Case (0x16) { + Notify (\_SB.PCI0.S16, EVT) + } + Case (0x17) { + Notify (\_SB.PCI0.S17, EVT) + } + Case (0x18) { + Notify (\_SB.PCI0.S18, EVT) + } + Case (0x19) { + Notify (\_SB.PCI0.S19, EVT) + } + Case (0x1a) { + Notify (\_SB.PCI0.S1A, EVT) + } + Case (0x1b) { + Notify (\_SB.PCI0.S1B, EVT) + } + Case (0x1c) { + Notify (\_SB.PCI0.S1C, EVT) + } + Case (0x1d) { + Notify (\_SB.PCI0.S1D, EVT) + } + Case (0x1e) { + Notify (\_SB.PCI0.S1E, EVT) + } + Case (0x1f) { + Notify (\_SB.PCI0.S1F, EVT) + } } } }
tools/firmware/hvmloader/acpi/dsdt.c +894 -66
993 lines not on this page · raw message
RFC 2/2 xend: Use AUTO_PHP_SLOT_STR=0xff rather than 0x0 for auto slot allocation
In reply to Simon HormanRather than use "0x0" to signify that the hotplug slot should be automatically selected by qemu-dm, define AUTO_PHP_SLOT_STR.
At the same time, change the magic value form 0x0 to 0xff, in line with changes made to qemu-dm to allow any unused PCI device to be used for hotplug.
tools/python/xen/xend/XendDomainInfo.py +2 -2
@@ -793,7 +793,7 @@ class XendDomainInfo: existing_dev_uuid = sxp.child_value(existing_dev_info, 'uuid') existing_pci_conf = self.info['devices'][existing_dev_uuid][1] existing_pci_devs = existing_pci_conf['devs'] - vslt = '0x0' + vslt = xsconstants.AUTO_PHP_SLOT_STR for x in existing_pci_devs: if ( int(x['domain'], 16) == int(dev['domain'], 16) and int(x['bus'], 16) == int(dev['bus'], 16) and
@@ -801,7 +801,7 @@ class XendDomainInfo: int(x['func'], 16) == int(dev['func'], 16) ): vslt = x['vslt'] break - if vslt == '0x0': + if vslt == xsconstants.AUTO_PHP_SLOT_STR: raise VmError("Device %04x:%02x:%02x.%01x is not connected" % (int(dev['domain'],16), int(dev['bus'],16), int(dev['slot'],16), int(dev['func'],16)))
tools/python/xen/xend/server/pciif.py +2 -1
@@ -37,6 +37,7 @@ import re from xen.xend.server.pciquirk import * from xen.xend.xenstore.xstransact import xstransact from xen.xend.xenstore.xswatch import xswatch +from xen.util import xsconstants xc = xen.lowlevel.xc.xc()
@@ -216,7 +217,7 @@ class PciController(DevController): try: dev_dict['vslt'] = slot_list[i] except IndexError: - dev_dict['vslt'] = '0x0' + dev_dict['vslt'] = xsconstatns.AUTO_PHP_SLOT_STR pci_devs.append(dev_dict)
tools/python/xen/xm/main.py +2 -1
@@ -55,6 +55,7 @@ from xen.util.xmlrpcclient import Server import xen.util.xsm.xsm as security from xen.util.xsm.xsm import XSMError from xen.util.acmpolicy import ACM_LABEL_UNLABELED_DISPLAY +from xen.util import xsconstants import XenAPI
@@ -2440,7 +2441,7 @@ def parse_pci_configuration(args, state, if len(args) == 3: vslt = args[2] else: - vslt = '0x0' #chose a free virtual PCI slot + vslt = xsconstants.AUTO_PHP_SLOT_STR pci=['pci'] pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \ r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
tools/python/xen/util/xsconstants.py +4 -0
@@ -112,3 +112,7 @@ INVALID_POLICY_PREFIX = 'INV_' INVALID_SSIDREF = 0xFFFFFFFFL XS_INACCESSIBLE_LABEL = '__INACCESSIBLE__' + +NR_PCI_DEV = 32 +AUTO_PHP_SLOT = NR_PCI_DEV +AUTO_PHP_SLOT_STR = "%02x" % NR_PCI_DEV
Signature · 4 lines
-- Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en
Re: [rfc 2/2] xend: Use AUTO_PHP_SLOT_STR=0xff rather than0x0 for auto slot allocation
Hi Simon,
Quoted 5 lines
Index:
xen-unstable.hg/tools/python/xen/util/xsconstants.py
===================================================================
---xen-unstable.hg.orig/tools/python/xen/util/xsconstants.py2009-03-13 16
:55:50.000000000 +1100
+++xen-unstable.hg/tools/python/xen/util/xsconstants.py2009-03-13 16:
57:
tools/python/xen/util/xsconstants.py INVALID_POLICY_PREFIX = 'INV_' · line 118
Quoted 10 lines
57.000000000 +1100
(quoted diff) +0
-0@@ -112,3 +112,7 @@ INVALID_POLICY_PREFIX = 'INV_'
INVALID_SSIDREF=0xFFFFFFFFL
XS_INACCESSIBLE_LABEL= '__INACCESSIBLE__'tools/python/xen/util/xsconstants.py +4
-0+ +NR_PCI_DEV = 32 +AUTO_PHP_SLOT = NR_PCI_DEV +AUTO_PHP_SLOT_STR = "%02x" % NR_PCI_DEV
In xsconstants.py, constants for Xen Security Policies are defined. I think that the following files are better than xsconstants.py.
- tools/python/xen/util/pci.py
- tools/python/xen/xend/server/DevConstants.py
- tools/python/xen/xend/XendConstants.py
Best regards,
Kan
Re: [rfc 2/2] xend: Use AUTO_PHP_SLOT_STR=0xff rather than0x0 for auto slot allocation
Quoted 22 lines · Masaki Kanno
Hi Simon,
Quoted 5 lines
Index:
xen-unstable.hg/tools/python/xen/util/xsconstants.py
===================================================================
---xen-unstable.hg.orig/tools/python/xen/util/xsconstants.py2009-03-13 16
:55:50.000000000 +1100
+++xen-unstable.hg/tools/python/xen/util/xsconstants.py2009-03-13 16:57:
tools/python/xen/util/xsconstants.py INVALID_POLICY_PREFIX = 'INV_' · line 118
Quoted 10 lines
57.000000000 +1100
(quoted diff) +0
-0@@ -112,3 +112,7 @@ INVALID_POLICY_PREFIX = 'INV_'
INVALID_SSIDREF=0xFFFFFFFFL
XS_INACCESSIBLE_LABEL= '__INACCESSIBLE__'tools/python/xen/util/xsconstants.py +4
-0+ +NR_PCI_DEV = 32 +AUTO_PHP_SLOT = NR_PCI_DEV +AUTO_PHP_SLOT_STR = "%02x" % NR_PCI_DEVIn
xsconstants.py, constants for Xen Security Policies are defined. I think that the following files are better thanxsconstants.py.
Quoted 3 lines
-
tools/python/xen/util/pci.py
-tools/python/xen/xend/server/DevConstants.py
-tools/python/xen/xend/XendConstants.py
Thanks, I was unsure of where a good place to define these constants once would be.
Signature · 3 lines
Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en
Re: [rfc 2/2 v2] xend: Use AUTO_PHP_SLOT_STR=0xff rather than0x0 for auto slot allocation
Rather than use "0x0" to signify that the hotplug slot should be automatically selected by qemu-dm, define AUTO_PHP_SLOT_STR.
At the same time, change the magic value form 0x0 to 0xff, in line with changes made to qemu-dm to allow any unused PCI device to be used for hotplug.
---
tools/python/xen/xend/XendConstants.py | 3 +++ tools/python/xen/xend/XendDomainInfo.py | 4 ++-- tools/python/xen/xend/server/pciif.py | 3 ++- tools/python/xen/xm/main.py | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
* Fri, 13 Mar 2009 18:07:36 +1100
Initial public release
* Mon, 16 Mar 2009 10:59:53 +1100
Put constancs in python/xen/xend/XendConstants.py instead
of tools/python/xen/util/xsconstants.py which is for security constants.
As suggested by Masaki Kanno along with other possible locations:
tools/python/xen/util/pci.py tools/python/xen/xend/server/DevConstants.py
XendConstants.py seemed most appropriate to me.
tools/python/xen/xend/XendDomainInfo.py +2 -2
@@ -793,7 +793,7 @@ class XendDomainInfo: existing_dev_uuid = sxp.child_value(existing_dev_info, 'uuid') existing_pci_conf = self.info['devices'][existing_dev_uuid][1] existing_pci_devs = existing_pci_conf['devs'] - vslt = '0x0' + vslt = AUTO_PHP_SLOT_STR for x in existing_pci_devs: if ( int(x['domain'], 16) == int(dev['domain'], 16) and int(x['bus'], 16) == int(dev['bus'], 16) and
@@ -801,7 +801,7 @@ class XendDomainInfo: int(x['func'], 16) == int(dev['func'], 16) ): vslt = x['vslt'] break - if vslt == '0x0': + if vslt == AUTO_PHP_SLOT_STR: raise VmError("Device %04x:%02x:%02x.%01x is not connected" % (int(dev['domain'],16), int(dev['bus'],16), int(dev['slot'],16), int(dev['func'],16)))
tools/python/xen/xend/server/pciif.py +2 -1
@@ -24,6 +24,7 @@ from xen.xend import sxp from xen.xend import arch from xen.xend.XendError import VmError from xen.xend.XendLogging import log +from xen.xend.XendConstants import * from xen.xend.server.DevController import DevController from xen.xend.server.DevConstants import xenbusState
@@ -218,7 +219,7 @@ class PciController(DevController): try: dev_dict['vslt'] = slot_list[i] except IndexError: - dev_dict['vslt'] = '0x0' + dev_dict['vslt'] = AUTO_PHP_SLOT_STR pci_devs.append(dev_dict)
tools/python/xen/xm/main.py +1 -1
@@ -2456,7 +2456,7 @@ def parse_pci_configuration(args, state, if len(args) == 3: vslt = args[2] else: - vslt = '0x0' #chose a free virtual PCI slot + vslt = AUTO_PHP_SLOT_STR pci=['pci'] pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \ r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
tools/python/xen/xend/XendConstants.py +3 -0
@@ -135,3 +135,6 @@ VTPM_DELETE_SCRIPT = '/etc/xen/scripts/v XS_VMROOT = "/vm/" +NR_PCI_DEV = 32 +AUTO_PHP_SLOT = NR_PCI_DEV +AUTO_PHP_SLOT_STR = "%02x" % NR_PCI_DEV