mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 12:09:31 +00:00
Revert "direct_irq: Add support for host wakeup capable IRQs"
This reverts commit 0ac97979b6
.
Reason for revert: This static configuration for wakeup IRQs is
no longer needed since we have a mechanism for automatic dynamic
configuration of wakeup IRQs based on requests from ChromeOS VM.
BUG=b:228449597
TEST=Boot ManaTEE and verify wakeup from touchpad and other devices.
Change-Id: Ifce6919d3c3ab9e677ee0a6566aba4d720168db5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3593741
Reviewed-by: Tomasz Nowicki <tnowicki@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Micah Morton <mortonm@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Commit-Queue: Tomasz Nowicki <tnowicki@google.com>
This commit is contained in:
parent
8c97db443b
commit
d61e24be2c
6 changed files with 0 additions and 71 deletions
|
@ -27,8 +27,6 @@ pub enum DirectIrqError {
|
||||||
EnableGpe,
|
EnableGpe,
|
||||||
#[error("failed to enable direct sci irq")]
|
#[error("failed to enable direct sci irq")]
|
||||||
EnableSci,
|
EnableSci,
|
||||||
#[error("failed to enable wake irq")]
|
|
||||||
EnableWake,
|
|
||||||
#[error("failed to open /dev/plat-irq-forward: {0}")]
|
#[error("failed to open /dev/plat-irq-forward: {0}")]
|
||||||
Open(io::Error),
|
Open(io::Error),
|
||||||
}
|
}
|
||||||
|
@ -109,10 +107,6 @@ impl DirectIrq {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn irq_wake_enable(&self, irq_num: u32) -> Result<(), DirectIrqError> {
|
|
||||||
self.plat_irq_wake_ioctl(irq_num, PLAT_IRQ_WAKE_ENABLE)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Enable hardware triggered SCI interrupt handling for GPE.
|
/// Enable hardware triggered SCI interrupt handling for GPE.
|
||||||
///
|
///
|
||||||
/// Note: sci_irq_prepare() itself does not enable SCI forwarding yet
|
/// Note: sci_irq_prepare() itself does not enable SCI forwarding yet
|
||||||
|
@ -166,21 +160,6 @@ impl DirectIrq {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn plat_irq_wake_ioctl(&self, irq_num: u32, action: u32) -> Result<(), DirectIrqError> {
|
|
||||||
let mut irq_wake_set = vec_with_array_field::<plat_irq_wake_set, u32>(0);
|
|
||||||
irq_wake_set[0].argsz = (size_of::<plat_irq_wake_set>()) as u32;
|
|
||||||
irq_wake_set[0].action_flags = action;
|
|
||||||
irq_wake_set[0].irq_number_host = irq_num;
|
|
||||||
|
|
||||||
// Safe as we are the owner of plat_irq_wake_set and irq_wake_set which are valid value
|
|
||||||
let ret = unsafe { ioctl_with_ref(self, PLAT_IRQ_WAKE_SET(), &irq_wake_set[0]) };
|
|
||||||
if ret < 0 {
|
|
||||||
Err(DirectIrqError::EnableWake)
|
|
||||||
} else {
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Enable hardware triggered GPE handling via SCI interrupt forwarding.
|
/// Enable hardware triggered GPE handling via SCI interrupt forwarding.
|
||||||
/// Note: requires sci_irq_prepare() to be called beforehand.
|
/// Note: requires sci_irq_prepare() to be called beforehand.
|
||||||
///
|
///
|
||||||
|
|
|
@ -381,8 +381,6 @@ pub struct Config {
|
||||||
pub direct_mmio: Option<DirectIoOption>,
|
pub direct_mmio: Option<DirectIoOption>,
|
||||||
#[cfg(feature = "direct")]
|
#[cfg(feature = "direct")]
|
||||||
pub direct_pmio: Option<DirectIoOption>,
|
pub direct_pmio: Option<DirectIoOption>,
|
||||||
#[cfg(feature = "direct")]
|
|
||||||
pub direct_wake_irq: Vec<u32>,
|
|
||||||
pub disks: Vec<DiskOption>,
|
pub disks: Vec<DiskOption>,
|
||||||
pub display_window_keyboard: bool,
|
pub display_window_keyboard: bool,
|
||||||
pub display_window_mouse: bool,
|
pub display_window_mouse: bool,
|
||||||
|
@ -510,8 +508,6 @@ impl Default for Config {
|
||||||
direct_mmio: None,
|
direct_mmio: None,
|
||||||
#[cfg(feature = "direct")]
|
#[cfg(feature = "direct")]
|
||||||
direct_pmio: None,
|
direct_pmio: None,
|
||||||
#[cfg(feature = "direct")]
|
|
||||||
direct_wake_irq: Vec::new(),
|
|
||||||
disks: Vec::new(),
|
disks: Vec::new(),
|
||||||
display_window_keyboard: false,
|
display_window_keyboard: false,
|
||||||
display_window_mouse: false,
|
display_window_mouse: false,
|
||||||
|
|
|
@ -1282,13 +1282,6 @@ where
|
||||||
direct_irq
|
direct_irq
|
||||||
.irq_enable(*irq)
|
.irq_enable(*irq)
|
||||||
.context("failed to enable interrupt forwarding")?;
|
.context("failed to enable interrupt forwarding")?;
|
||||||
|
|
||||||
if cfg.direct_wake_irq.contains(&irq) {
|
|
||||||
direct_irq
|
|
||||||
.irq_wake_enable(*irq)
|
|
||||||
.context("failed to enable interrupt wake")?;
|
|
||||||
}
|
|
||||||
|
|
||||||
irqs.push(direct_irq);
|
irqs.push(direct_irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1304,13 +1297,6 @@ where
|
||||||
direct_irq
|
direct_irq
|
||||||
.irq_enable(*irq)
|
.irq_enable(*irq)
|
||||||
.context("failed to enable interrupt forwarding")?;
|
.context("failed to enable interrupt forwarding")?;
|
||||||
|
|
||||||
if cfg.direct_wake_irq.contains(&irq) {
|
|
||||||
direct_irq
|
|
||||||
.irq_wake_enable(*irq)
|
|
||||||
.context("failed to enable interrupt wake")?;
|
|
||||||
}
|
|
||||||
|
|
||||||
irqs.push(direct_irq);
|
irqs.push(direct_irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
17
src/main.rs
17
src/main.rs
|
@ -1816,21 +1816,6 @@ fn set_argument(cfg: &mut Config, name: &str, value: Option<&str>) -> argument::
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#[cfg(feature = "direct")]
|
#[cfg(feature = "direct")]
|
||||||
"direct-wake-irq" => {
|
|
||||||
cfg.direct_wake_irq
|
|
||||||
.push(
|
|
||||||
value
|
|
||||||
.unwrap()
|
|
||||||
.parse()
|
|
||||||
.map_err(|_| argument::Error::InvalidValue {
|
|
||||||
value: value.unwrap().to_owned(),
|
|
||||||
expected: String::from(
|
|
||||||
"this value for `direct-wake-irq` must be an unsigned integer",
|
|
||||||
),
|
|
||||||
})?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
#[cfg(feature = "direct")]
|
|
||||||
"direct-gpe" => {
|
"direct-gpe" => {
|
||||||
cfg.direct_gpe.push(value.unwrap().parse().map_err(|_| {
|
cfg.direct_gpe.push(value.unwrap().parse().map_err(|_| {
|
||||||
argument::Error::InvalidValue {
|
argument::Error::InvalidValue {
|
||||||
|
@ -2567,8 +2552,6 @@ iommu=on|off - indicates whether to enable virtio IOMMU for this device"),
|
||||||
Argument::value("direct-level-irq", "irq", "Enable interrupt passthrough"),
|
Argument::value("direct-level-irq", "irq", "Enable interrupt passthrough"),
|
||||||
#[cfg(feature = "direct")]
|
#[cfg(feature = "direct")]
|
||||||
Argument::value("direct-edge-irq", "irq", "Enable interrupt passthrough"),
|
Argument::value("direct-edge-irq", "irq", "Enable interrupt passthrough"),
|
||||||
#[cfg(feature = "direct")]
|
|
||||||
Argument::value("direct-wake-irq", "irq", "Enable wakeup interrupt for host"),
|
|
||||||
#[cfg(feature = "direct")]
|
#[cfg(feature = "direct")]
|
||||||
Argument::value("direct-gpe", "gpe", "Enable GPE interrupt and register access passthrough"),
|
Argument::value("direct-gpe", "gpe", "Enable GPE interrupt and register access passthrough"),
|
||||||
Argument::value("dmi", "DIR", "Directory with smbios_entry_point/DMI files"),
|
Argument::value("dmi", "DIR", "Directory with smbios_entry_point/DMI files"),
|
||||||
|
|
|
@ -50,12 +50,6 @@ ioctl_io_nr!(
|
||||||
PLAT_IRQ_FORWARD_BASE
|
PLAT_IRQ_FORWARD_BASE
|
||||||
);
|
);
|
||||||
|
|
||||||
ioctl_io_nr!(
|
|
||||||
PLAT_IRQ_WAKE_SET,
|
|
||||||
PLAT_IRQ_FORWARD_TYPE,
|
|
||||||
PLAT_IRQ_FORWARD_BASE + 1
|
|
||||||
);
|
|
||||||
|
|
||||||
ioctl_io_nr!(
|
ioctl_io_nr!(
|
||||||
ACPI_GPE_FORWARD_SET,
|
ACPI_GPE_FORWARD_SET,
|
||||||
PLAT_IRQ_FORWARD_TYPE,
|
PLAT_IRQ_FORWARD_TYPE,
|
||||||
|
|
|
@ -68,8 +68,6 @@ pub const PLAT_IRQ_FORWARD_SET_LEVEL_UNMASK_EVENTFD: u32 = 2;
|
||||||
pub const PLAT_IRQ_FORWARD_SET_EDGE_TRIGGER: u32 = 4;
|
pub const PLAT_IRQ_FORWARD_SET_EDGE_TRIGGER: u32 = 4;
|
||||||
pub const PLAT_IRQ_FORWARD_SET_LEVEL_SCI_FOR_GPE_TRIGGER_EVENTFD: u32 = 8;
|
pub const PLAT_IRQ_FORWARD_SET_LEVEL_SCI_FOR_GPE_TRIGGER_EVENTFD: u32 = 8;
|
||||||
pub const PLAT_IRQ_FORWARD_SET_LEVEL_SCI_FOR_GPE_UNMASK_EVENTFD: u32 = 16;
|
pub const PLAT_IRQ_FORWARD_SET_LEVEL_SCI_FOR_GPE_UNMASK_EVENTFD: u32 = 16;
|
||||||
pub const PLAT_IRQ_WAKE_ENABLE: u32 = 1;
|
|
||||||
pub const PLAT_IRQ_WAKE_DISABLE: u32 = 2;
|
|
||||||
pub const ACPI_GPE_FORWARD_SET_TRIGGER: u32 = 1;
|
pub const ACPI_GPE_FORWARD_SET_TRIGGER: u32 = 1;
|
||||||
pub const ACPI_GPE_FORWARD_CLEAR_TRIGGER: u32 = 2;
|
pub const ACPI_GPE_FORWARD_CLEAR_TRIGGER: u32 = 2;
|
||||||
pub type __s8 = ::std::os::raw::c_schar;
|
pub type __s8 = ::std::os::raw::c_schar;
|
||||||
|
@ -140,13 +138,6 @@ pub struct plat_irq_forward_set {
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Default, Copy, Clone)]
|
#[derive(Debug, Default, Copy, Clone)]
|
||||||
pub struct plat_irq_wake_set {
|
|
||||||
pub argsz: __u32,
|
|
||||||
pub action_flags: __u32,
|
|
||||||
pub irq_number_host: __u32,
|
|
||||||
}
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Debug, Default, Copy, Clone)]
|
|
||||||
pub struct gpe_forward_set {
|
pub struct gpe_forward_set {
|
||||||
pub argsz: __u32,
|
pub argsz: __u32,
|
||||||
pub action_flags: __u32,
|
pub action_flags: __u32,
|
||||||
|
|
Loading…
Reference in a new issue