powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU
PATCH 1/1 powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU
The hypervisor assigns VAS (Virtual Accelerator Switchboard) windows depends on cores configured in LPAR. The kernel uses OF reconfig notifier to reconfig VAS windows for DLPAR CPU event. In the case of shared CPU mode partition, the hypervisor assigns VAS windows depends on CPU entitled capacity, not based on vcpus. When the user changes CPU entitled capacity for the partition, drmgr uses /proc/ppc64/lparcfg interface to notify the kernel.
This patch adds the following changes to update VAS resources for shared mode:
- Call vas reconfig windows from lparcfg_write()
- Ignore reconfig changes in the VAS notifier
--- arch/powerpc/platforms/pseries/lparcfg.c | 15 ++++++++ arch/powerpc/platforms/pseries/vas.c | 44 ++++++++++++++++-------- arch/powerpc/platforms/pseries/vas.h | 5 +++ 3 files changed, 50 insertions(+), 14 deletions(-)
arch/powerpc/platforms/pseries/lparcfg.c +15 -0
@@ -35,6 +35,7 @@#include <asm/drmem.h> #include "pseries.h" +#include "vas.h" /* pseries_vas_dlpar_cpu() */ /* * This isn't a module but we expose that to userspace
@@ -748,6 +749,20 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,return -EINVAL ; retval =update_ppp (new_entitled_ptr,NULL ); + +if (retval ==H_SUCCESS || retval ==H_CONSTRAINED ) { +/* +* The hypervisor assigns VAS resources based +* on entitled capacity for shared mode. +* Reconfig VAS windows based on DLPAR CPU events. +* Returns success, -EIO, -EINVAL, or -ENOMEM +*/ + retval =pseries_vas_dlpar_cpu (); +if (!retval) + retval = count; + +return retval; + } }else if (!strcmp (kbuf,"capacity_weight" )) {char *endp; *new_weight_ptr = (u8 )simple_strtoul (tmp, &endp,10 );
arch/powerpc/platforms/pseries/vas.c +30 -14
62 lines not on this page · raw message
arch/powerpc/platforms/pseries/vas.h +5 -0
@@ -141,10 +141,15 @@ int __init sysfs_pseries_vas_init(struct vas_all_caps *vas_caps);#ifdef CONFIG_PPC_VAS int vas_migration_handler (int action); +int pseries_vas_dlpar_cpu (void );#else static inline int vas_migration_handler (int action) {return 0 ; } +static inline int pseries_vas_dlpar_cpu (void ) +{ +return 0 ; +}#endif #endif /* _VAS_H */
Signature · 1 line
2.26.3
Michael Ellerman
AppliedQuoted 9 lines · Haren Myneni
The hypervisor assigns VAS (Virtual Accelerator Switchboard) windows depends on cores configured in LPAR. The kernel uses OF reconfig notifier to reconfig VAS windows for DLPAR CPU event. In the case of shared CPU mode partition, the hypervisor assigns VAS windows depends on CPU entitled capacity, not based on vcpus. When the user changes CPU entitled capacity for the partition, drmgr uses
/proc/ppc64/lparcfginterface to notify the kernel.[...]
Applied to powerpc/fixes.
[1/1] powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU
https://git.kernel.org/powerpc/c/2147783d6bf0b7ca14c72a25527dc5135bd17f65
cheers