Age | Commit message (Collapse) | Author | Files | Lines |
|
Move many C files from the src/ directory to the new src/fw/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This patch is purely cosmetic - no code changes should be observed.
Use a consistent indentation style with the ACPI DSDT code:
1 - Use spaces (no tabs) and 4 space indentation
2 - Place opening braces on same line as statement declaration
3 - Don't put a space between statement and opening parenthesis,
except for control statements (If, Else, While, Return) where a
space is always present
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
More than 1kb of data is taken by the 32 copies of the PCI hotplug SSDT
methods. We can build them from a single template like we do for CPUs
(wrapped in a Scope(\_SB.PCI0) block).
Three items differ for each slot: the device name, bits 16-23 of _ADR,
the _SUN value. On top of this we have to rename the eject method for
non-removable slots, like we already do in build_pcihp.
There is a small change in the ASL: instead of including the number of
the slot in the implementation of _EJ0, we just call _SUN. This is also
similar to what we do for CPU hotplug.
Once we do this, there is no need to keep a separate SSDT for PCI hotplug.
Everything can reside in the same table.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
We already build the CPU notification method in src/acpi.c, and we can
reuse most of the code for PCI hotplug.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Move the _S3/_S4/_S5 packages out of ssdt-pcihp.dsl and into a separate
file. Correspondingly, move the patching from build_pcihp to build_ssdt.
Place this part at the beginning of the SSDT. Offset computation is a
bit simpler, and anyway the packages do not need to be inside Scope(_SB).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
QEMU may want to disable guest's S3/S4 support and it wants to distinguish
between regular powerdown and S4 powerdown. To support that new fw_cfg
option was added that passes supported system states and what value should
guest use to enter each state. States are passed in 6 byte array. Each
byte represents one system state. If byte at offset X has its MSB set
it means that system state X is supported and to enter it guest should
use the value from lowest 7 bits. Patch also detects old QEMU and uses
values that work in backwards compatible way there.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
|
|
The macro gen_pci_device is used to add _RMV
method to a slot device so it is no longer needed:
presence of _EJ0 now indicates that the slot is ejectable.
It is also placing two devices with the same _ADR
on the same bus, which isn't defined by the ACPI spec.
So let's remove it.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Modify ACPI to only supply _EJ0 methods for PCI slots that support hotplug.
This is done by runtime patching:
- Instrument SSDT ASL code with ACPI_EXTRACT directives
tagging _EJ0 and _ADR fields.
- At compile time, tools/acpi_extract.py looks for these methods
in ASL source finds the matching AML, and stores the offsets
of these methods in tables named aml_ej0_name and aml_adr_dword.
- At run time, go over aml_ej0_name, use aml_adr_dword
to get slot information and check which slots support hotplug.
If hotplug is disabled, we patch the _EJ0 NameString in ACPI table,
replacing _EJ0 with EJ0_.
Note that this has the same checksum, but is ignored by OSPM.
Note: the method used is robust in that we don't need
to change any offsets manually in case of ASL code changes.
As all parsing is done at compile time, any unexpected input causes
build failure, not a runtime failure.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
The point of this split is to make runtime patching easier.
DSDT is required to supply: PCI0 - PCI root device object;
PCEJ - Method object to eject a PCI slot.
Additionally, SSDT is required to supply PCNT - Method object to notify
OSPM of a PCI slot event.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|