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:
Dmytro Maluka 2022-04-19 15:12:26 +00:00 committed by Chromeos LUCI
parent 8c97db443b
commit d61e24be2c
6 changed files with 0 additions and 71 deletions

View file

@ -27,8 +27,6 @@ pub enum DirectIrqError {
EnableGpe,
#[error("failed to enable direct sci irq")]
EnableSci,
#[error("failed to enable wake irq")]
EnableWake,
#[error("failed to open /dev/plat-irq-forward: {0}")]
Open(io::Error),
}
@ -109,10 +107,6 @@ impl DirectIrq {
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.
///
/// 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.
/// Note: requires sci_irq_prepare() to be called beforehand.
///

View file

@ -381,8 +381,6 @@ pub struct Config {
pub direct_mmio: Option<DirectIoOption>,
#[cfg(feature = "direct")]
pub direct_pmio: Option<DirectIoOption>,
#[cfg(feature = "direct")]
pub direct_wake_irq: Vec<u32>,
pub disks: Vec<DiskOption>,
pub display_window_keyboard: bool,
pub display_window_mouse: bool,
@ -510,8 +508,6 @@ impl Default for Config {
direct_mmio: None,
#[cfg(feature = "direct")]
direct_pmio: None,
#[cfg(feature = "direct")]
direct_wake_irq: Vec::new(),
disks: Vec::new(),
display_window_keyboard: false,
display_window_mouse: false,

View file

@ -1282,13 +1282,6 @@ where
direct_irq
.irq_enable(*irq)
.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);
}
@ -1304,13 +1297,6 @@ where
direct_irq
.irq_enable(*irq)
.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);
}

View file

@ -1816,21 +1816,6 @@ fn set_argument(cfg: &mut Config, name: &str, value: Option<&str>) -> argument::
);
}
#[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" => {
cfg.direct_gpe.push(value.unwrap().parse().map_err(|_| {
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"),
#[cfg(feature = "direct")]
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")]
Argument::value("direct-gpe", "gpe", "Enable GPE interrupt and register access passthrough"),
Argument::value("dmi", "DIR", "Directory with smbios_entry_point/DMI files"),

View file

@ -50,12 +50,6 @@ ioctl_io_nr!(
PLAT_IRQ_FORWARD_BASE
);
ioctl_io_nr!(
PLAT_IRQ_WAKE_SET,
PLAT_IRQ_FORWARD_TYPE,
PLAT_IRQ_FORWARD_BASE + 1
);
ioctl_io_nr!(
ACPI_GPE_FORWARD_SET,
PLAT_IRQ_FORWARD_TYPE,

View file

@ -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_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_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_CLEAR_TRIGGER: u32 = 2;
pub type __s8 = ::std::os::raw::c_schar;
@ -140,13 +138,6 @@ pub struct plat_irq_forward_set {
}
#[repr(C)]
#[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 argsz: __u32,
pub action_flags: __u32,