Closed
Conversation
This patch extends the GPE (General Purpose Event) handling to support the maximum number of interrupts available based on the machine's GPE register length, rather than being limited to the first 8 bits. This change is needed to support additional ACPI devices that will be introduced in subsequent patches (Battery, AC adapter, and button devices). These new devices require GPE event bits beyond the first 8, which were previously not being properly handled by the event sending and SCI (System Control Interrupt) update mechanisms. The actual number of available GPE interrupts varies by machine type: - PIIX4: GPE_LEN = 4 (32 bits total across status and enable registers) - ICH9: ICH9_PMIO_GPE0_LEN = 16 (128 bits total) The patch modifies: - acpi_send_gpe_event(): Now properly propagates status bits across all available GPE registers based on the machine's gpe.len value - acpi_update_sci(): Checks all GPE registers for pending interrupts, not just the first byte Note: A future enhancement could refactor the GPE handling to use the bitmap API from bitops.h instead of the current manual bit manipulation, which would provide a cleaner interface for these operations. Signed-off-by: Leonid Bloch <lb.workbox@gmail.com>
The battery device communicates battery state to the guest via ACPI. It supports two modes of operation: 1. QMP control mode (default): Battery state is controlled programmatically via QMP commands, making the device deterministic and migration-safe. 2. Host mirroring mode (optional): The device reflects the host's battery state from sysfs. Probing occurs on guest ACPI requests and at timed intervals (default 2 seconds, configurable via 'probe_interval' property in milliseconds). State changes trigger ACPI notifications to the guest. Properties: - 'use-qmp': Enable QMP control mode (default: true) - 'enable-sysfs': Enable host battery mirroring (default: false) - 'probe_interval': Probe interval in ms for sysfs mode (default: 2000) - 'sysfs_path': Override default sysfs path /sys/class/power_supply/ The device implements the ACPI_DEV_AML_IF interface to generate its own AML code, placing the BAT0 device directly under \_SB scope as per ACPI specification. QMP commands: - battery-set-state: Set battery state (present, charging, capacity, rate) - query-battery: Query current battery state This allows testing without host battery access and provides a stable interface for virtualization management systems. Signed-off-by: Leonid Bloch <lb.workbox@gmail.com> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
The AC adapter device communicates AC power state to the guest via ACPI. It supports two modes of operation: 1. QMP control mode (default): AC adapter state is controlled programmatically via QMP commands, ensuring deterministic behavior. 2. Host mirroring mode (optional): The device reflects the host's AC adapter state from sysfs. Probing occurs on guest ACPI requests and at timed intervals. State changes trigger ACPI notifications. Properties: - 'use-qmp': Enable QMP control mode (default: true) - 'enable-sysfs': Enable host AC adapter mirroring (default: false) - 'probe_interval': Probe interval in ms for sysfs mode (default: 2000) - 'sysfs_path': Override default sysfs path /sys/class/power_supply/ The device implements the ACPI_DEV_AML_IF interface to generate its own AML code, placing the ADP0 device directly under \_SB scope. QMP commands: - ac-adapter-set-state: Set AC adapter connection state - query-ac-adapter: Query current AC adapter state Signed-off-by: Leonid Bloch <lb.workbox@gmail.com>
The lid button device communicates laptop lid state to the guest via ACPI. It supports two modes of operation: 1. QMP control mode (default): Lid state is controlled programmatically via QMP commands for consistent behavior across environments. 2. Host mirroring mode (optional): The device reflects the host's lid button state from procfs (/proc/acpi/button/lid/*/state). State changes trigger ACPI notifications to the guest. Properties: - 'use-qmp': Enable QMP control mode (default: true) - 'enable-procfs': Enable host lid button mirroring (default: false) - 'probe_interval': Probe interval in ms for procfs mode (default: 2000) - 'procfs_path': Override default procfs path /proc/acpi/button The device implements the ACPI_DEV_AML_IF interface to generate its own AML code, placing the LID0 device directly under \_SB scope. QMP commands: - lid-button-set-state: Set lid open/closed state - query-lid-button: Query current lid state Signed-off-by: Leonid Bloch <lb.workbox@gmail.com>
|
Thank you for your interest in the QEMU project. This repository is a read-only mirror of the project's repostories hosted QEMU welcomes contributions of code (either fixing bugs or adding new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.