linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Haren Myneni <haren@linux.ibm.com>
To: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com
Subject: [PATCH 03/10] powerpc/pseries/vas: Save LPID in pseries_vas_window struct
Date: Mon, 29 Nov 2021 09:48:11 -0800	[thread overview]
Message-ID: <a1b4ffd8f392101be193cd1920f241440d1667fa.camel@linux.ibm.com> (raw)
In-Reply-To: <a2187018b4e030fe6c7e408b3a73c37c85472e10.camel@linux.ibm.com>


The kernel sets the VAS window with partition PID when is opened in
the hypervisor. During DLPAR operation, windows can be closed and
reopened in the hypervisor when the credit is available. So saves
this PID in pseries_vas_window struct when the window is opened
initially and reuse it later during DLPAR operation.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/vas.c | 6 +++---
 arch/powerpc/platforms/pseries/vas.h | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c
index 04a6eee2301e..6b35f67d5175 100644
--- a/arch/powerpc/platforms/pseries/vas.c
+++ b/arch/powerpc/platforms/pseries/vas.c
@@ -107,7 +107,6 @@ static int h_deallocate_vas_window(u64 winid)
 static int h_modify_vas_window(struct pseries_vas_window *win)
 {
 	long rc;
-	u32 lpid = mfspr(SPRN_PID);
 
 	/*
 	 * AMR value is not supported in Linux VAS implementation.
@@ -115,7 +114,7 @@ static int h_modify_vas_window(struct pseries_vas_window *win)
 	 */
 	do {
 		rc = plpar_hcall_norets(H_MODIFY_VAS_WINDOW,
-					win->vas_win.winid, lpid, 0,
+					win->vas_win.winid, win->lpid, 0,
 					VAS_MOD_WIN_FLAGS, 0);
 
 		rc = hcall_return_busy_check(rc);
@@ -125,7 +124,7 @@ static int h_modify_vas_window(struct pseries_vas_window *win)
 		return 0;
 
 	pr_err("H_MODIFY_VAS_WINDOW error: %ld, winid %u lpid %u\n",
-			rc, win->vas_win.winid, lpid);
+			rc, win->vas_win.winid, win->lpid);
 	return -EIO;
 }
 
@@ -353,6 +352,7 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags,
 	if (rc)
 		goto out;
 
+	txwin->lpid = mfspr(SPRN_PID);
 	/*
 	 * Modify window and it is ready to use.
 	 */
diff --git a/arch/powerpc/platforms/pseries/vas.h b/arch/powerpc/platforms/pseries/vas.h
index fa7ce74f1e49..0538760d13be 100644
--- a/arch/powerpc/platforms/pseries/vas.h
+++ b/arch/powerpc/platforms/pseries/vas.h
@@ -115,6 +115,7 @@ struct pseries_vas_window {
 	u64 domain[6];		/* Associativity domain Ids */
 				/* this window is allocated */
 	u64 util;
+	u32 lpid;
 
 	/* List of windows opened which is used for LPM */
 	struct list_head win_list;
-- 
2.27.0



  parent reply	other threads:[~2021-11-29 17:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 17:44 [PATCH 00/10] powerpc/pseries/vas: NXGZIP support with DLPAR Haren Myneni
2021-11-29 17:46 ` [PATCH 01/10] powerpc/pseries/vas: Use common names in VAS capability structure Haren Myneni
2021-11-29 17:47 ` [PATCH 02/10] powerpc/pseries/vas: Add notifier for DLPAR core removal/add Haren Myneni
2021-11-29 17:48 ` Haren Myneni [this message]
2021-11-29 17:49 ` [PATCH 04/10] powerpc/pseries/vas: Reopen windows with DLPAR core add Haren Myneni
2021-11-29 17:50 ` [PATCH 05/10] powerpc/pseries/vas: Close windows with DLPAR core removal Haren Myneni
2021-11-29 17:51 ` [PATCH 06/10] powerpc/vas: Map paste address only if window is active Haren Myneni
2021-11-29 17:52 ` [PATCH 07/10] powerpc/vas: Add paste address mmap fault handler Haren Myneni
2021-11-29 17:53 ` [PATCH 08/10] powerpc/vas: Return paste instruction failure if no active window Haren Myneni
2021-11-29 17:54 ` [PATCH 09/10] powerpc/pseries/vas: sysfs interface to export capabilities Haren Myneni
2021-11-29 17:55 ` [PATCH 10/10] powerpc/pseries/vas: Write 'target_creds' for QoS credits change 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=a1b4ffd8f392101be193cd1920f241440d1667fa.camel@linux.ibm.com \
    --to=haren@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --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).