Re: [PATCH v2] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled
On Mon, 20 Mar 2023 19:50:08 -0700, Haren Myneni wrote: > 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. > > [...] Applied to powerpc/fixes. [1/1] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled https://git.kernel.org/powerpc/c/eca9f6e6f83b6725b84e1c76fdde19b003cff0eb cheers
Re: [PATCH v2] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled
Haren Myneni 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 Reviewed-by: Nathan Lynch > --- > 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(_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
[PATCH v2] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled
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. 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 --- 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(_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