From: Anchal Agarwal <anchalag@amazon.com>
To: <tglx@linutronix.de>, <mingo@redhat.com>, <hpa@zytor.com>,
<x86@kernel.org>
Cc: <boris.ostrovsky@oracle.com>, <konrad.wilk@oracle.com>,
<roger.pau@citrix.com>, <netdev@vger.kernel.org>,
<jgross@suse.com>, <xen-devel@lists.xenproject.org>,
<linux-kernel@vger.kernel.org>, <kamatam@amazon.com>,
<anchalag@amazon.com>, <fllinden@amazon.com>,
<vallish@amazon.com>, <guruanb@amazon.com>, <eduval@amazon.com>,
<rjw@rjwysocki.net>, <pavel@ucw.cz>, <len.brown@intel.com>,
<linux-pm@vger.kernel.org>, <cyberax@amazon.com>
Subject: [RFC PATCH 11/12] x86/xen: close event channels for PIRQs in system core suspend callback
Date: Tue, 12 Jun 2018 20:56:18 +0000 [thread overview]
Message-ID: <20180612205619.28156-12-anchalag@amazon.com> (raw)
In-Reply-To: <20180612205619.28156-1-anchalag@amazon.com>
From: Munehisa Kamata <kamatam@amazon.com>
Close event channels allocated for devices which are backed by PIRQ and
still active when suspending the system core. Normally, the devices are
emulated legacy devices, e.g. PS/2 keyboard, floppy controller and etc.
Without this, in PM hibernation, information about the event channel
remains in hibernation image, but there is no guarantee that the same
event channel numbers are assigned to the devices when restoring the
system. This may cause conflict like the following and prevent some
devices from being restored correctly.
[ 102.330821] ------------[ cut here ]------------
[ 102.333264] WARNING: CPU: 0 PID: 2324 at
drivers/xen/events/events_base.c:878 bind_evtchn_to_irq+0x88/0xf0
...
[ 102.348057] Call Trace:
[ 102.348057] [<ffffffff813001df>] dump_stack+0x63/0x84
[ 102.348057] [<ffffffff81071811>] __warn+0xd1/0xf0
[ 102.348057] [<ffffffff810718fd>] warn_slowpath_null+0x1d/0x20
[ 102.348057] [<ffffffff8139a1f8>] bind_evtchn_to_irq+0x88/0xf0
[ 102.348057] [<ffffffffa00cd420>] ? blkif_copy_from_grant+0xb0/0xb0 [xen_blkfront]
[ 102.348057] [<ffffffff8139a307>] bind_evtchn_to_irqhandler+0x27/0x80
[ 102.348057] [<ffffffffa00cc785>] talk_to_blkback+0x425/0xcd0 [xen_blkfront]
[ 102.348057] [<ffffffff811e0c8a>] ? __kmalloc+0x1ea/0x200
[ 102.348057] [<ffffffffa00ce84d>] blkfront_restore+0x2d/0x60 [xen_blkfront]
[ 102.348057] [<ffffffff813a0078>] xenbus_dev_restore+0x58/0x100
[ 102.348057] [<ffffffff813a1ff0>] ? xenbus_frontend_delayed_resume+0x20/0x20
[ 102.348057] [<ffffffff813a200e>] xenbus_dev_cond_restore+0x1e/0x30
[ 102.348057] [<ffffffff813f797e>] dpm_run_callback+0x4e/0x130
[ 102.348057] [<ffffffff813f7f17>] device_resume+0xe7/0x210
[ 102.348057] [<ffffffff813f7810>] ? pm_dev_dbg+0x80/0x80
[ 102.348057] [<ffffffff813f9374>] dpm_resume+0x114/0x2f0
[ 102.348057] [<ffffffff810c00cf>] hibernation_snapshot+0x15f/0x380
[ 102.348057] [<ffffffff810c0ac3>] hibernate+0x183/0x290
[ 102.348057] [<ffffffff810be1af>] state_store+0xcf/0xe0
[ 102.348057] [<ffffffff813020bf>] kobj_attr_store+0xf/0x20
[ 102.348057] [<ffffffff8127c88a>] sysfs_kf_write+0x3a/0x50
[ 102.348057] [<ffffffff8127c3bb>] kernfs_fop_write+0x10b/0x190
[ 102.348057] [<ffffffff81200008>] __vfs_write+0x28/0x120
[ 102.348057] [<ffffffff81200c19>] ? rw_verify_area+0x49/0xb0
[ 102.348057] [<ffffffff81200e62>] vfs_write+0xb2/0x1b0
[ 102.348057] [<ffffffff81202196>] SyS_write+0x46/0xa0
[ 102.348057] [<ffffffff81520cf7>] entry_SYSCALL_64_fastpath+0x1a/0xa9
[ 102.423005] ---[ end trace b8d6718e22e2b107 ]---
[ 102.425031] genirq: Flags mismatch irq 6. 00000000 (blkif) vs. 00000000 (floppy)
Note that we don't explicitly re-allocate event channels for such
devices in the resume callback. Re-allocation will occur when PM core
re-enable IRQs for the devices at later point.
Signed-off-by: Munehisa Kamata <kamatam@amazon.com>
Signed-off-by: Anchal Agarwal <anchalag@amazon.com>
Reviewed-by: Munehisa Kamata <kamatam@amazon.com>
Reviewed-by: Eduardo Valentin <eduval@amazon.com>
---
arch/x86/xen/suspend.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index dae0f74..affa63d 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -105,6 +105,8 @@ static int xen_syscore_suspend(void)
xen_save_steal_clock(cpu);
}
+ xen_shutdown_pirqs();
+
xrfp.domid = DOMID_SELF;
xrfp.gpfn = __pa(HYPERVISOR_shared_info) >> PAGE_SHIFT;
--
2.7.4
next prev parent reply other threads:[~2018-06-12 20:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 20:56 [RFC PATCH 00/12] Enable PM hibernation on guest VMs Anchal Agarwal
2018-06-12 20:56 ` [RFC PATCH 01/12] xen/manage: keep track of the on-going suspend mode Anchal Agarwal
2018-06-13 16:42 ` Balbir Singh
2018-06-12 20:56 ` [RFC PATCH 02/12] xen/manage: introduce helper function to know " Anchal Agarwal
2018-06-13 17:41 ` Balbir Singh
2018-06-12 20:56 ` [RFC PATCH 03/12] xenbus: add freeze/thaw/restore callbacks support Anchal Agarwal
2018-06-12 20:56 ` [RFC PATCH 04/12] x86/xen: Introduce new function to map HYPERVISOR_shared_info on Resume Anchal Agarwal
2018-06-12 20:56 ` [RFC PATCH 05/12] x86/xen: add system core suspend and resume callbacks Anchal Agarwal
2018-06-12 20:56 ` [RFC PATCH 06/12] xen-blkfront: add callbacks for PM suspend and hibernation Anchal Agarwal
2018-06-13 8:24 ` Roger Pau Monné
[not found] ` <20180613222048.GB33296@kaos-source-ops-60001.pdx1.amazon.com>
2018-06-14 8:43 ` Roger Pau Monné
2018-06-12 20:56 ` [RFC PATCH 07/12] xen-netfront: add callbacks for PM suspend and hibernation support Anchal Agarwal
2018-06-12 20:56 ` [RFC PATCH 08/12] xen-time-introduce-xen_-save-restore-_steal_clock Anchal Agarwal
2018-06-12 20:56 ` [RFC PATCH 09/12] x86/xen: save and restore steal clock Anchal Agarwal
2018-06-12 20:56 ` [RFC PATCH 10/12] xen/events: add xen_shutdown_pirqs helper function Anchal Agarwal
2018-06-12 20:56 ` Anchal Agarwal [this message]
2018-06-12 20:56 ` [RFC PATCH 12/12] PM / hibernate: update the resume offset on SNAPSHOT_SET_SWAP_AREA Anchal Agarwal
2018-06-14 19:45 ` Pavel Machek
2018-06-14 19:50 ` Besogonov, Aleksei
2018-06-12 21:09 ` [RFC PATCH 00/12] Enable PM hibernation on guest VMs Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180612205619.28156-12-anchalag@amazon.com \
--to=anchalag@amazon.com \
--cc=boris.ostrovsky@oracle.com \
--cc=cyberax@amazon.com \
--cc=eduval@amazon.com \
--cc=fllinden@amazon.com \
--cc=guruanb@amazon.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=kamatam@amazon.com \
--cc=konrad.wilk@oracle.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=roger.pau@citrix.com \
--cc=tglx@linutronix.de \
--cc=vallish@amazon.com \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox