From 78dcb1862ca623306c68a23b5695565341b993ab Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 9 Jan 2020 15:15:18 +0000 Subject: [PATCH] vmm: device_manager: Store the type of notification in a local value When the value is read from the I/O port via the ACPI AML functions to determine what has been triggered the notifiction value is reset preventing a second read from exposing the value. If we need support multiple types of GED notification (such as memory hotplug) then we should avoid reading the value multiple times. Signed-off-by: Rob Bradford --- vmm/src/device_manager.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 577c663b5..ee694cc0a 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -1656,10 +1656,13 @@ fn create_ged_device(ged_irq: u32) -> Vec { "_EVT".into(), 1, true, - vec![&aml::If::new( - &aml::Equal::new(&aml::Path::new("GDAT"), &aml::ONE), - vec![&aml::MethodCall::new("\\_SB_.CPUS.CSCN".into(), vec![])], - )], + vec![ + &aml::Store::new(&aml::Local(0), &aml::Path::new("GDAT")), + &aml::If::new( + &aml::Equal::new(&aml::Local(0), &aml::ONE), + vec![&aml::MethodCall::new("\\_SB_.CPUS.CSCN".into(), vec![])], + ), + ], ), ], )