From: Haren Myneni <haren@linux.ibm.com>
To: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,
npiggin@gmail.com, nathanl@linux.ibm.com
Subject: [RFC PATCH 3/3] powerpc/pseries/vas: Use migration_in_progress to disable DLPAR
Date: Mon, 27 Dec 2021 03:00:01 -0800 [thread overview]
Message-ID: <92d87ead72556e946d7fa6775c509de8b6d11935.camel@linux.ibm.com> (raw)
In-Reply-To: <af4574e7553a632884a2f00fcb96bd82fa063fe9.camel@linux.ibm.com>
Before migration starts, all secondary CPUs will be offline which
can invoke VAS DLPAR event. So disable VAS DLPAR event with
migration_in_progress flag during suspend and enable after resume
operations.
The current partition migration implementation does not freeze the
user space and the user space can continue open VAS windows. So
when migration_in_progress flag is enabled, VAS open window
API returns -EBUSY.
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
---
arch/powerpc/platforms/pseries/vas.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c
index d2d7202a4f4e..1a10c1904aaa 100644
--- a/arch/powerpc/platforms/pseries/vas.c
+++ b/arch/powerpc/platforms/pseries/vas.c
@@ -30,6 +30,7 @@ static bool copypaste_feat;
static struct vas_caps vascaps[VAS_MAX_FEAT_TYPE];
static DEFINE_MUTEX(vas_pseries_mutex);
+static bool migration_in_progress;
static long hcall_return_busy_check(long rc)
{
@@ -349,8 +350,11 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags,
* same fault IRQ is not freed by the OS before.
*/
mutex_lock(&vas_pseries_mutex);
- rc = allocate_setup_window(txwin, (u64 *)&domain[0],
- cop_feat_caps->win_type);
+ if (migration_in_progress)
+ rc = -EBUSY;
+ else
+ rc = allocate_setup_window(txwin, (u64 *)&domain[0],
+ cop_feat_caps->win_type);
mutex_unlock(&vas_pseries_mutex);
if (rc)
goto out;
@@ -771,6 +775,9 @@ int vas_reconfig_capabilties(u8 type)
return -ENOMEM;
mutex_lock(&vas_pseries_mutex);
+ if (migration_in_progress)
+ goto out;
+
rc = h_query_vas_capabilities(H_QUERY_VAS_CAPABILITIES, vcaps->feat,
(u64)virt_to_phys(hv_caps));
if (rc)
@@ -866,6 +873,11 @@ static int vas_migrate_windows(bool suspend)
mutex_lock(&vas_pseries_mutex);
+ if (suspend)
+ migration_in_progress = true;
+ else
+ migration_in_progress = false;
+
for (i = 0; i < VAS_MAX_FEAT_TYPE; i++) {
vcaps = &vascaps[i];
caps = &vcaps->caps;
--
2.27.0
next prev parent reply other threads:[~2021-12-27 11:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-27 10:56 [RFC PATCH 0/3] powerpc/pseries/vas: VAS/NXGZIP support with LPM Haren Myneni
2021-12-27 10:58 ` [RFC PATCH 1/3] powerpc/pseries/vas: Modify reconfig open/close functions for migration Haren Myneni
2021-12-27 10:59 ` [RFC PATCH 2/3] powerpc/pseries/vas: Add VAS suspend/resume notifier Haren Myneni
2021-12-27 11:00 ` Haren Myneni [this message]
2022-01-14 17:59 ` [RFC PATCH 3/3] powerpc/pseries/vas: Use migration_in_progress to disable DLPAR Nathan Lynch
2022-01-18 9:28 ` Haren Myneni
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=92d87ead72556e946d7fa6775c509de8b6d11935.camel@linux.ibm.com \
--to=haren@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nathanl@linux.ibm.com \
--cc=npiggin@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).