All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lynch <nathanl@linux.ibm.com>
To: Haren Myneni <haren@linux.ibm.com>,
	mpe@ellerman.id.au, npiggin@gmail.com,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled
Date: Thu, 23 Mar 2023 14:22:30 -0500	[thread overview]
Message-ID: <877cv76znt.fsf@linux.ibm.com> (raw)
In-Reply-To: <1d0e727e7dbd9a28627ef08ca9df9c86a50175e2.camel@linux.ibm.com>

Haren Myneni <haren@linux.ibm.com> writes:
> The hypervisor supports user-mode NX from Power10. pseries_vas_dlpar_cpu()
> is called from lparcfg_write() to update VAS windows for DLPAR event in
> shared processor mode and the kernel gets -ENOTSUPP for HCALLs if the
> user-mode NX is not supported. The current VAS implementation also
> supports only with Radix page tables. Whereas in dedicated processor
> mode, pseries_vas_notifier() is registered only if the copy/paste
> feature is enabled. So instead of displaying HCALL error messages,
> update VAS capabilities if the copy/paste feature is available.

OK, so this prevents the code from making inappropriate hcalls and
logging useless errors, looks good.

>
> This patch ignores updating VAS capabilities in pseries_vas_dlpar_cpu()
> and returns success if the copy/paste feature is not enabled.
> Then lparcfg_write() completes the processor DLPAR operations
> without any failures.
>
> Fixes: 2147783d6bf0 ("powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU")
> Signed-off-by: Haren Myneni <haren@linux.ibm.com>

Reviewed-by: Nathan Lynch <nathanl@linux.ibm.com>


> ---
> v2: Use bool for copypaste_feat and expand commit message on handling failures
>
>  arch/powerpc/platforms/pseries/vas.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c
> index 559112312810..513180467562 100644
> --- a/arch/powerpc/platforms/pseries/vas.c
> +++ b/arch/powerpc/platforms/pseries/vas.c
> @@ -856,6 +856,13 @@ int pseries_vas_dlpar_cpu(void)
>  {
>  	int new_nr_creds, rc;
>  
> +	/*
> +	 * NX-GZIP is not enabled. Nothing to do for DLPAR event
> +	 */
> +	if (!copypaste_feat)
> +		return 0;
> +
> +
>  	rc = h_query_vas_capabilities(H_QUERY_VAS_CAPABILITIES,
>  				      vascaps[VAS_GZIP_DEF_FEAT_TYPE].feat,
>  				      (u64)virt_to_phys(&hv_cop_caps));
> @@ -1012,6 +1019,7 @@ static int __init pseries_vas_init(void)
>  	 * Linux supports user space COPY/PASTE only with Radix
>  	 */
>  	if (!radix_enabled()) {
> +		copypaste_feat = false;
>  		pr_err("API is supported only with radix page tables\n");
>  		return -ENOTSUPP;
>  	}
> -- 
> 2.26.3

  reply	other threads:[~2023-03-23 19:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  2:50 [PATCH v2] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled Haren Myneni
2023-03-23 19:22 ` Nathan Lynch [this message]
2023-04-06  0:26 ` Michael Ellerman

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=877cv76znt.fsf@linux.ibm.com \
    --to=nathanl@linux.ibm.com \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.