To keep consistency between HV and DM about PM1A_CNT_ADDR,
it is better to replace the PM1A_CNT related MACROs used in DM
with VIRTUAL_PM1A_CNT related MACROs in acrn_common.h.
Tracked-On: #2865
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
check the power button acpi driver firstly, then find input event
corresponding to the power button.
Tracked-On: #2695
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Followed ACPI spec 4.8.2.5, if SCI_EN is set, the interrupt will be
routed to SCI interrupt logic. If SCI_EN is not set, the interrupt
will be routed to SMI interrupt logic.
ACRN does not support SMI for now, so check SCI_EN before trigger
SCI.
Tracked-On: #2560
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
when UOS is running, "acrnctl suspend vm" and "acrnctl stop vm" commands are
able to trigger a SCI interrupt, then UOS enters sleep or shutdown according
to the default behavior of the power button. The default behavior is based on
UOS power button setting.
Tracked-On: #2560
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Listen to power button state via /dev/input/event0. When the power
button is pressed, then set PWRBTN_STS bit. If PWRBTN_EN is set, the
sci interrupt is triggered.
For suspend or shutdown of UOS by power button, needs UOS to configure
the default behavior of the power button.
Tracked-On: #2560
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Clear Linux complains about not being able to write the bit to PM1A:
ACPI Error: Could not enable RealTimeClock event (20180531/evxfevnt-184)
Tracked-On: #2176
Signed-off-by: Peter Fang <peter.fang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
There is one race issue between mevent callback (which is called
in mevent_dispatch thread) and mevent_delete (which could be called
in dev thread). And the callback is called after mevent_delete.
libevent have the exactly same issue. The issue is decripted here:
https://github.com/libevent/libevent/blob/master/whatsnew-2.1.txt
The fixing is:
We introduce a teardown callback to mevent and make sure there is
no race issue between callback and teardown call.
This patch updates the mevent API and the caller as well.
Tracked-On: #1877
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
- remove ASSERT & DEASSET IRQ line IOCTLs
- remove PULSE IRQ line IOCTLs, use set/clear
IRQ line instead.
- Use IC_SET_IRQLINE to set or clear IRQ line
Tracked-On: #861
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
According to ACPI spec, when system back to working mode from
S3, WAK_STS bit (15) should be set.
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
We do:
- pause target vm
- suspend all virtual devices
- wait for resume notification
- resume all virtual devices
- reset target vm
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Then, acrnctl could send command to monitor module of DM and call
functions defined in pm ops. One example is: acrnctl resume UOS
after UOS enter S3.
Also add general pm.c and move pm related function to this file.
Signed-off-by: Yan Like <like.yan@intel.com>
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Guest has erquirement to support system/full reboot and S3. Which could
trigger different reset path in guest
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
The current dm, all non-pci and non-acpi related files are put into
hw/platform directory. This is actually disturbed the meaning of
*platform*. The platform devices are mean of board and SoC specific
non-PCI devices, like usb devices, etc.
This patch refines the ACRN dm directory architecture.
For some common device logic files, likes block_if.c/uart_core.c or
usb_core.c. They will move to hw/ directly.
For platform architecture depended files, create arch/ under root dir.
And create sub-dir arch/x86 for x86 architecture, will create more
architectures in future. The pm.c will move to this new dir.
The hw/acpi will be moved to hw/platform/acpi due to acpi also be
considered as part of platform.
Signed-off-by: Yu Wang <yu1.wang@intel.com>