[PATCH v6] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2024-01-15 Thread Haren Myneni
sleep 10 msecs maximum, this patch allow more tasks can issue open/close VAS calls without any hung traces in the dmesg. Signed-off-by: Haren Myneni Suggested-by: Nathan Lynch --- v1 -> v2: - Use usleep_range instead of using RTAS sleep routine as suggested by Nathan v2 -> v3: - Sleep 1

Re: [PATCH v5] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2024-01-15 Thread Haren Myneni
On 1/11/24 9:27 AM, Nathan Lynch wrote: Haren Myneni writes: VAS allocate, modify and deallocate HCALLs returns H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC for busy delay and expects OS to reissue HCALL after that delay. But using msleep() will often sleep at least 20 msecs even

[PATCH v5] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2024-01-10 Thread Haren Myneni
sleep with the expected value before issuing HCALL again. Signed-off-by: Haren Myneni Suggested-by: Nathan Lynch --- v1 -> v2: - Use usleep_range instead of using RTAS sleep routine as suggested by Nathan v2 -> v3: - Sleep 10MSecs even for HCALL delay > 10MSecs and the other commit

[PATCH v4] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2023-12-27 Thread Haren Myneni
sleep with the expected value before issuing HCALL again. Signed-off-by: Haren Myneni Suggested-by: Nathan Lynch --- v1 -> v2: - Use usleep_range instead of using RTAS sleep routine as suggested by Nathan v2 -> v3: - Sleep 10MSecs even for HCALL delay > 10MSecs and the other commit

Re: [PATCH v3] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2023-12-05 Thread Haren Myneni
On 12/4/23 6:05 AM, Aneesh Kumar K.V (IBM) wrote: Haren Myneni writes: VAS allocate, modify and deallocate HCALLs returns H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC for busy delay and expects OS to reissue HCALL after that delay. But using msleep() will often sleep at least 20

[PATCH v3] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2023-12-02 Thread Haren Myneni
before issuing HCALL again. Signed-off-by: Haren Myneni Suggested-by: Nathan Lynch --- v1 -> v2: - Use usleep_range instead of using RTAS sleep routine as suggested by Nathan v2 -> v3: - Sleep 10MSecs even for HCALL delay > 10MSecs and the other commit / comemnt changes as suggested

Re: [PATCH v2] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2023-11-30 Thread Haren Myneni
On 11/29/23 6:07 PM, Michael Ellerman wrote: Haren Myneni writes: VAS allocate, modify and deallocate HCALLs returns H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC for busy delay and expects OS to reissue HCALL after that delay. But using msleep() will often sleep at least 20 msecs

Re: [PATCH v2] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2023-11-30 Thread Haren Myneni
On 11/29/23 5:43 PM, Nathan Lynch wrote: Haren Myneni writes: VAS allocate, modify and deallocate HCALLs returns H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC for busy delay and expects OS to reissue HCALL after that delay. But using msleep() will often sleep at least 20 msecs even

[PATCH v2] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2023-11-28 Thread Haren Myneni
or 10msecs. It might cause these HCALLs takes longer when multiple threads issue open or close VAS windows simultaneously. So instead of msleep(), use usleep_range() to ensure sleep with the expected value before issuing HCALL again. Signed-off-by: Haren Myneni Suggested-by: Nathan Lynch --- v1 ->

[PATCH 2/2] powerpc/pseries/vas: Call rtas_busy_sleep() to support HCALL delay

2023-11-27 Thread Haren Myneni
or 10msecs. It might cause these HCALLs takes longer when multiple threads issue open or close VAS windows simultaneously. So instead of using msleep(), call rtas_busy_sleep() which uses usleep_range() if the delay is <= 20msecs. Signed-off-by: Haren Myneni Suggested-by: Nathan Lynch --- arch/powe

[PATCH 1/2] powerpc/rtas: Create rtas_busy_sleep function

2023-11-27 Thread Haren Myneni
Move the RTAS delay sleep code to new rtas_busy_sleep(). It can be called from HCALL delay code that needs to support both usleep() or msleep() depends on delay value. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/rtas.h | 1 + arch/powerpc/kernel/rtas.c | 56

[PATCH v5] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-11-25 Thread Haren Myneni
return Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni --- v1 -> v2: - Do not define the migration_in_progress flag as atomic as suggested by Nathan v2 -> v3: - Use wait_event() instead of wait_event_in

[PATCH v4] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-11-12 Thread Haren Myneni
- The migration handler waits for no in-progress open windows. Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni --- v1 -> v2: - Do not define the migration_in_progress flag as atomic as suggested by Nathan v2 -> v3: - Use wait

[PATCH v3] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-10-19 Thread Haren Myneni
- The migration handler waits for no in-progress open windows. Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni --- v1 -> v2: - Do not define the migration_in_progress flag as atomic as suggested by Nathan v2 -> v3: - Use wait

[PATCH v2] powerpc/vas: Limit open window failure messages in log bufffer

2023-10-19 Thread Haren Myneni
() and make the corresponding changes to have the consistencein prefix all pr_*() messages (vas-api.c). Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni --- arch/powerpc/platforms/book3s/vas-api.c | 34 - arch/powerpc

Re: [PATCH v2] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-10-19 Thread Haren Myneni
On 10/18/23 2:10 PM, Nathan Lynch wrote: Haren Myneni writes: The hypervisor returns migration failure if all VAS windows are not closed. During pre-migration stage, vas_migration_handler() sets migration_in_progress flag and closes all windows from the list. The allocate VAS window routine

[PATCH] powerpc/vas: Limit open window failure messages in log bufffer

2023-10-17 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/platforms/book3s/vas-api.c | 4 ++-- arch/powerpc/platforms/pseries/vas.c| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/book3s/vas-api.c b/arch/powerpc/platforms/book3s/vas-api.c index 77ea9335fd04..203cfc2fb8ff 100644

[PATCH v2] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-10-17 Thread Haren Myneni
is set and decrements nr_open_window_progress counter - The migration handler waits for no in-progress open windows. Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni --- Changes from v1: - Do not define the migration_in_progress flag

Re: [PATCH] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-10-16 Thread Haren Myneni
On 10/16/23 1:30 PM, Nathan Lynch wrote: Nathan Lynch writes: Haren Myneni writes: Haren Myneni writes: The hypervisor returns migration failure if all VAS windows are not closed. During pre-migration stage, vas_migration_handler() sets migration_in_progress flag and closes all windows

Re: [PATCH] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-10-13 Thread Haren Myneni
On 10/11/23 1:36 PM, Nathan Lynch wrote: Haren Myneni writes: Haren Myneni writes: The hypervisor returns migration failure if all VAS windows are not closed. During pre-migration stage, vas_migration_handler() sets migration_in_progress flag and closes all windows from the list

Re: [PATCH] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-10-10 Thread Haren Myneni
On 10/9/23 1:09 PM, Nathan Lynch wrote: Hi Haren, Haren Myneni writes: The hypervisor returns migration failure if all VAS windows are not closed. During pre-migration stage, vas_migration_handler() sets migration_in_progress flag and closes all windows from the list. The allocate VAS

[PATCH] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-09-26 Thread Haren Myneni
is set and decrements nr_open_window_progress counter - The migration handler waits for no in-progress open windows. Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 51 ++--

[PATCH] powerpc/pseries/vas: Migration suspend waits for no in-progress open windows

2023-09-26 Thread Haren Myneni
is set and decrements nr_open_window_progress counter - The migration handler waits for no in-progress open windows. Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 51 ++--

[PATCH v2] powerpc/pseries/vas: Hold mmap_mutex after mmap lock during window close

2023-07-16 Thread Haren Myneni
ries/vas: Close windows with DLPAR core removal") Signed-off-by: Haren Myneni --- Changes from v1: - Update commit log with more description on deadlock traces --- arch/powerpc/platforms/pseries/vas.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platfo

[PATCH] powerpc/pseries/vas: Hold mmap_mutex after mmap lock during window close

2023-06-22 Thread Haren Myneni
or VAS fault handler execution. So this patch adds changes to acquire mmap lock before holding mmap_mutex. Fixes: 8ef7b9e1765a ("powerpc/pseries/vas: Close windows with DLPAR core removal") Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 9 +++-- 1 file

[PATCH v2] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled

2023-03-20 Thread Haren Myneni
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: Ha

Re: [PATCH] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled

2023-03-20 Thread Haren Myneni
On Tue, 2023-03-07 at 20:55 -0600, Nathan Lynch wrote: > 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 CPU > > event > > and the

[PATCH] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled

2023-03-06 Thread Haren Myneni
if the copy/paste feature is not enabled. Fixes: 2147783d6bf0 ("powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU") Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/platforms/pse

[PATCH v3] powerpc/pseries/vas: Add VAS IRQ primary handler

2022-10-09 Thread Haren Myneni
-by: Haren Myneni --- v3: Update pending_faults usage in changelog v2: Use the pending_faults counter for the second interrupt and process it with the previous interrupt handling if its thread handler is executing. arch/powerpc/platforms/pseries/vas.c | 40 +++- arch

[PATCH] powerpc/pseries: Use lparcfg to reconfig VAS windows for DLPAR CPU

2022-10-06 Thread Haren Myneni
changes in the VAS notifier Signed-off-by: Haren Myneni --- 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(-) diff --git

[PATCH v2] powerpc/pseries/vas: Add VAS IRQ primary handler

2022-10-05 Thread Haren Myneni
, the hypervisor will not deliver the fault interrupt to the partition and the user space may wait continuously for the CSB update. So use VAS specific IRQ handler instead of calling the default primary handler. Signed-off-by: Haren Myneni --- v2: Use the pending_faults counter for the second interrupt

[PATCH] powerpc/pseries/vas: Pass hw_cpu_id to node associativity HCALL

2022-09-28 Thread Haren Myneni
domain IDs for the current CPU, passing smp_processor_id() to node associativity HCALL which may return H_P2 (-55) error during DLPAR CPU event. This patch fixes this issue by passing hard_smp_processor_id() with VPHN_FLAG_VCPU flag (PAPR 14.11.6.1 H_HOME_NODE_ASSOCIATIVITY). Signed-off-by: Haren

[PATCH v3] powerpc: Ignore DSI error caused by the copy/paste instruction

2022-09-27 Thread Haren Myneni
-features property and ignore DSI error during page fault handling if MMU_FTR_NX_DSI is defined. Signed-off-by: Haren Myneni --- v2: Code cleanup as suggested by Christophe Leroy v3: Make NX DSI as MMU feature instead of CPU feature arch/powerpc/include/asm/mmu.h | 6 +- arch/powerpc/kernel

Re: [PATCH v2] powerpc: Ignore DSI error caused by the copy/paste instruction

2022-09-26 Thread Haren Myneni
On Mon, 2022-09-26 at 05:55 +, Christophe Leroy wrote: > > Le 25/09/2022 à 22:26, Haren Myneni a écrit : > > DSI error will be generated when the paste operation is issued on > > the suspended NX window due to NX state changes. The hypervisor > > expects the partit

[PATCH v2] powerpc: Ignore DSI error caused by the copy/paste instruction

2022-09-25 Thread Haren Myneni
fault handling if CPU_FTR_NX_DSI if defined. Signed-off-by: Haren Myneni --- v2: Code cleanup as suggested by Christophe Leroy arch/powerpc/include/asm/cputable.h | 5 ++-- arch/powerpc/kernel/prom.c | 36 + arch/powerpc/mm/fault.c | 17

Re: [PATCH] powerpc/pseries: Move vas_migration_handler early during migration

2022-09-23 Thread Haren Myneni
On Thu, 2022-09-22 at 07:14 -0500, Nathan Lynch wrote: > Haren Myneni writes: > > When the migration is initiated, the hypervisor changes VAS > > mappings as part of pre-migration event. Then the OS gets the > > migration event which closes all VAS windows before the mig

Re: [PATCH] powerpc: Ignore DSI error caused by the copy/paste instruction

2022-09-22 Thread Haren Myneni
On Thu, 2022-09-22 at 09:04 +, Christophe Leroy wrote: > > Le 22/09/2022 à 10:29, Haren Myneni a écrit : > > DSI error will be generated when the paste operation is issued on > > the suspended NX window due to NX state changes. The hypervisor > > expects the partit

[PATCH] powerpc: Ignore DSI error caused by the copy/paste instruction

2022-09-22 Thread Haren Myneni
-features” type value is defined. Byte 0, bit 3 of pi-attribute-specifier-type is now defined to indicate this DSI error. This patch adds changes to read ibm,pi-features property and ignore DSI error in the page fault handling if CPU_FTR_NX_DSI if defined. Signed-off-by: Haren Myneni --- arch

[PATCH] powerpc/pseries/vas: Add VAS IRQ primary handler

2022-09-22 Thread Haren Myneni
, the hypervisor will not deliver the fault interrupt to the partition and the user space may wait continuously for the CSB update. So use VAS specific IRQ handler instead of calling the default primary handler. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 19

[PATCH] powerpc/pseries: Move vas_migration_handler early during migration

2022-09-22 Thread Haren Myneni
these NX faults coming from the actual migration. So to reduce this time window, close VAS windows first in pseries_migrate_partition(). Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/mobility.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch

[PATCH] powerpc/pseries/vas: sysfs comments with the correct entries

2022-04-09 Thread Haren Myneni
VAS entry is created as a misc device and the sysfs comments should list the proper entries Reported-by: Matheus Castanho Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas-sysfs.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/powerpc

[PATCH] powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr

2022-04-09 Thread Haren Myneni
IRTUAL enabled. Fixes this issue by assigning only real address to rx_fifo in vas_rx_win_attr struct for both receive and fault windows. Reported-by: Michael Ellerman Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 2 +- arch/powerpc/platforms/powernv/vas-fault.c | 2 +-

[PATCH] powerpc/pseries/vas: Use QoS credits from the userspace

2022-03-19 Thread Haren Myneni
the update, the kernel is using the old total credits value from the hypervisor. Fix this issue by using the new QoS credits from the userspace instead of depending on VAS capabilities from the hypervisor. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas-sysfs.c | 19

[PATCH v4 3/3] powerpc/pseries/vas: Add VAS migration handler

2022-03-02 Thread Haren Myneni
copy/paste on these inactive windows. The current migration implementation does not freeze the user space and applications can continue to open VAS windows while migration is in progress. So when the migration_in_progress flag is set, VAS open window API returns -EBUSY. Signed-off-by: Haren Myneni

[PATCH v6 9/9] powerpc/pseries/vas: Add 'update_total_credits' entry for QoS capabilities

2022-02-28 Thread Haren Myneni
update_total_credits is updated to make sure sync with the QoS target credits in the hypervisor. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas-sysfs.c | 54 +++--- arch/powerpc/platforms/pseries/vas.c | 2 +- arch/powerpc/platforms/pseries/vas.h | 1 + 3

[PATCH v6 8/9] powerpc/pseries/vas: sysfs interface to export capabilities

2022-02-28 Thread Haren Myneni
*/ nr_used_credits /* Used credits */ /sys/devices/vas/vas0/gzip/qos_capabilities (QoS GZIP capabilities) nr_total_credits nr_used_credits Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/Makefile| 2 +- arch/powerpc/platforms

[PATCH v6 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add

2022-02-28 Thread Haren Myneni
successfully. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 91 +++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c index a297720bcdae..96178dd58adf 100644

[PATCH v6 6/9] powerpc/pseries/vas: Close windows with DLPAR core removal

2022-02-28 Thread Haren Myneni
if the system lost credits (core removal) and reopen windows in the hypervisor when the previously lost credits are available. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 2 + arch/powerpc/platforms/pseries/vas.c | 207 +-- arch/powerpc/platforms

[PATCH v6 5/9] powerpc/vas: Map paste address only if window is active

2022-02-28 Thread Haren Myneni
is not active, return mmap() failure with -EACCES and expects the user space reissue mmap() when the window is active or open a new window when the credit is available. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/book3s/vas-api.c | 23 ++- 1 file changed, 22 insertions

[PATCH v6 4/9] powerpc/vas: Return paste instruction failure if no active window

2022-02-28 Thread Haren Myneni
instruction that caused the fault was a paste. Signed-off-by: Nicholas Piggin Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/ppc-opcode.h | 2 + arch/powerpc/platforms/book3s/vas-api.c | 54 + 2 files changed, 56 insertions(+) diff --git a/arch/powerpc/include

[PATCH v6 3/9] powerpc/vas: Add paste address mmap fault handler

2022-02-28 Thread Haren Myneni
to handle NX request page faults if the user space issue NX requests. This handler maps the new paste address with the same VMA when the window is active again (due to core add with DLPAR). Otherwise returns paste failure. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc

[PATCH v6 2/9] powerpc/pseries/vas: Save PID in pseries_vas_window struct

2022-02-28 Thread Haren Myneni
DLPAR operation. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/vas.c | 9 + arch/powerpc/platforms/pseries/vas.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms

[PATCH v6 1/9] powerpc/pseries/vas: Use common names in VAS capability structure

2022-02-28 Thread Haren Myneni
nr_total/nr_used_credits provides credits usage to user space via sysfs and the same interface can be used on PowerNV in future. Changed with proper naming so that applicable on both pseries and PowerNV. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc/platforms

[PATCH v6 0/9] powerpc/pseries/vas: NXGZIP support with DLPAR

2022-02-28 Thread Haren Myneni
n v5: - Rebase on 5.17-rc5 - Add update_total_credits sysfs entry to update QoS target credits and other commit descriptions as suggested by Nicholas Piggin Changed in v6: - Build fix in "Add paste address mmap fault handler" patch as reported by kernel test robot Haren Myneni (9): p

[PATCH v5 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add

2022-02-27 Thread Haren Myneni
successfully. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 91 +++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c index a297720bcdae..96178dd58adf 100644

[PATCH v5 4/9] powerpc/vas: Return paste instruction failure if no active window

2022-02-27 Thread Haren Myneni
instruction that caused the fault was a paste. Signed-off-by: Nicholas Piggin Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/ppc-opcode.h | 2 + arch/powerpc/platforms/book3s/vas-api.c | 55 - 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH v4 3/3] powerpc/pseries/vas: Add VAS migration handler

2022-02-27 Thread Haren Myneni
implementation does not freeze the user space and applications can continue to open VAS windows while migration is in progress. So when the migration_in_progress flag is set, VAS open window API returns -EBUSY. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/mobility.c | 5 ++ arch

[PATCH v4 2/3] powerpc/pseries/vas: Modify reconfig open/close functions for migration

2022-02-27 Thread Haren Myneni
VAS_WIN_NO_CRED_CLOSE to the window status. Close window happens with the first event (migration or DLPAR) and Reopen window happens only with the last event (migration or DLPAR). Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 2 + arch/powerpc/platforms/pseries/vas.c | 88

[PATCH v4 1/3] powerpc/pseries/vas: Define global hv_cop_caps struct

2022-02-27 Thread Haren Myneni
disable copy/paste feature flag if any capabilities HCALL is failed. Signed-off-by: Haren Myneni Acked-by: Nathan Lynch Reviewed-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/vas.c | 47 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/arch

[PATCH v5 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add

2022-02-27 Thread Haren Myneni
successfully. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 91 +++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c index a297720bcdae..96178dd58adf 100644

[PATCH v4 0/3] powerpc/pseries/vas: VAS/NXGZIP support with LPM

2022-02-27 Thread Haren Myneni
n_progress enable patch in "VAS migration handler" and other changes as suggested by Nicholas Piggin Haren Myneni (3): powerpc/pseries/vas: Define global hv_cop_caps struct powerpc/pseries/vas: Modify reconfig open/close functions for migration powerpc/pseries/vas: Add V

[PATCH v5 9/9] powerpc/pseries/vas: Add 'update_total_credits' entry for QoS capabilities

2022-02-27 Thread Haren Myneni
update_total_credits is updated to make sure sync with the QoS target credits in the hypervisor. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas-sysfs.c | 54 +++--- arch/powerpc/platforms/pseries/vas.c | 2 +- arch/powerpc/platforms/pseries/vas.h | 1 + 3

[PATCH v5 8/9] powerpc/pseries/vas: sysfs interface to export capabilities

2022-02-27 Thread Haren Myneni
*/ nr_used_credits /* Used credits */ /sys/devices/vas/vas0/gzip/qos_capabilities (QoS GZIP capabilities) nr_total_credits nr_used_credits Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/Makefile| 2 +- arch/powerpc/platforms

[PATCH v5 6/9] powerpc/pseries/vas: Close windows with DLPAR core removal

2022-02-27 Thread Haren Myneni
if the system lost credits (core removal) and reopen windows in the hypervisor when the previously lost credits are available. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 2 + arch/powerpc/platforms/pseries/vas.c | 207 +-- arch/powerpc/platforms

[PATCH v5 5/9] powerpc/vas: Map paste address only if window is active

2022-02-27 Thread Haren Myneni
is not active, return mmap() failure with -EACCES and expects the user space reissue mmap() when the window is active or open a new window when the credit is available. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/book3s/vas-api.c | 23 ++- 1 file changed, 22 insertions

[PATCH v5 4/9] powerpc/vas: Return paste instruction failure if no active window

2022-02-27 Thread Haren Myneni
instruction that caused the fault was a paste. Signed-off-by: Nicholas Piggin Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/ppc-opcode.h | 2 + arch/powerpc/platforms/book3s/vas-api.c | 55 - 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH v5 3/9] powerpc/vas: Add paste address mmap fault handler

2022-02-27 Thread Haren Myneni
to handle NX request page faults if the user space issue NX requests. This handler maps the new paste address with the same VMA when the window is active again (due to core add with DLPAR). Otherwise returns paste failure. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc

[PATCH v5 2/9] powerpc/pseries/vas: Save PID in pseries_vas_window struct

2022-02-27 Thread Haren Myneni
DLPAR operation. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/vas.c | 9 + arch/powerpc/platforms/pseries/vas.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms

[PATCH v5 1/9] powerpc/pseries/vas: Use common names in VAS capability structure

2022-02-27 Thread Haren Myneni
nr_total/nr_used_credits provides credits usage to user space via sysfs and the same interface can be used on PowerNV in future. Changed with proper naming so that applicable on both pseries and PowerNV. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc/platforms

[PATCH v5 0/9] powerpc/pseries/vas: NXGZIP support with DLPAR

2022-02-27 Thread Haren Myneni
base on 5.17-rc5 - Add update_total_credits sysfs entry to update QoS target credits and other commit descriptions as suggested by Nicholas Piggin Haren Myneni (9): powerpc/pseries/vas: Use common names in VAS capability structure powerpc/pseries/vas: Save PID in pseries_vas_window struct pow

Re: [PATCH v3 3/4] powerpc/pseries/vas: Add VAS migration handler

2022-02-24 Thread Haren Myneni
ark them > > in-active and reopened after migration with this handler. > > During the migration, the user space receives paste instruction > > failure if it issues copy/paste on these in-active windows. > > > > Signed-off-by: Haren Myneni > > --- > > arch/pow

Re: [PATCH v3 2/4] powerpc/pseries/vas: Modify reconfig open/close functions for migration

2022-02-24 Thread Haren Myneni
> Why do you need two close window types, what if you finish > LPM and just open as many as possible regardless how they > are closed? Adding 2 different status bits to support DLPAR and LPM closed staus. As I mentioned above, windows will be active only after both bits are cleared.

Re: [PATCH v3 0/4] powerpc/pseries/vas: VAS/NXGZIP support with LPM

2022-02-23 Thread Haren Myneni
efine global hv_cop_caps struct" to eliminate > > memory allocation failure during migration (suggestion by > > Nathan Lynch) > > > > Changes in v3: > > - Rebase on 5.17-rc4 > > - Naming changes for VAS capability struct elemets based on the V4 > > DLPAR &

Re: [PATCH v4 9/9] powerpc/pseries/vas: Write 'nr_total_credits' for QoS credits change

2022-02-23 Thread Haren Myneni
and can write the > > new > > target QoS credits in sysfs. But the kernel gets the new QoS > > capabilities from the hypervisor whenever nr_total_credits is > > updated > > to make sure sync with the values in the hypervisor. > > > > Signed-off-by: Haren Myneni

Re: [PATCH v4 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add

2022-02-23 Thread Haren Myneni
es not retry, new mapping will not be done. From the OS point of view, this window is not used by the user space. Thanks Haren > > Thanks, > Nick > > > Signed-off-by: Haren Myneni > > --- > > arch/powerpc/platforms/pseries/vas.c | 91 > > +

Re: [PATCH v4 6/9] powerpc/pseries/vas: Close windows with DLPAR core removal

2022-02-23 Thread Haren Myneni
W compression if can. Added this comment in the fault hanlder patch. > > in-active can be one word, not hyphenated. > > > > This patch also adds the notifier for core removal/add to close > > windows in the hypervisor if the system lost credits (core > > removal) a

Re: [PATCH v4 5/9] powerpc/vas: Map paste address only if window is active

2022-02-23 Thread Haren Myneni
n which causes the corresponding > > window in-active. So if the window is not active, return mmap() > > failure with -EACCES and expects the user space reissue mmap() > > when the window is active or open a new window when the credit > > is available. > > >

Re: [PATCH v4 4/9] powerpc/vas: Return paste instruction failure if no active window

2022-02-22 Thread Haren Myneni
the SIGBUS thing, was that my > fault? I vaguely remember writing some of this patch :P Thanks for your reviews on all patches. No, it was my fault not handling the -EGAIN error. > > Thanks, > Nick > > > Signed-off-by: Nicholas Piggin > > Signed-off-by: Haren Myneni >

[PATCH v3 4/4] powerpc/pseries/vas: Disable window open during migration

2022-02-19 Thread Haren Myneni
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 --- arch/powerpc/platforms/pseries/vas.c | 13

[PATCH v3 3/4] powerpc/pseries/vas: Add VAS migration handler

2022-02-19 Thread Haren Myneni
after migration. All active windows for both default and QoS types will be closed and mark them in-active and reopened after migration with this handler. During the migration, the user space receives paste instruction failure if it issues copy/paste on these in-active windows. Signed-off-by: Haren

[PATCH v3 2/4] powerpc/pseries/vas: Modify reconfig open/close functions for migration

2022-02-19 Thread Haren Myneni
migration is in progress, set VAS_WIN_NO_CRED_CLOSE to the window status. Close window happens with the first event (migration or DLPAR) and Reopen window happens only with the last event (migration or DLPAR). Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 2 + arch

[PATCH v3 1/4] powerpc/pseries/vas: Define global hv_cop_caps struct

2022-02-19 Thread Haren Myneni
disable copy/paste feature flag if any capabilities HCALL is failed. Signed-off-by: Haren Myneni Acked-by: Nathan Lynch --- arch/powerpc/platforms/pseries/vas.c | 47 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/arch/powerpc/platforms/pseries/vas.c

[PATCH v3 0/4] powerpc/pseries/vas: VAS/NXGZIP support with LPM

2022-02-19 Thread Haren Myneni
_caps struct" to eliminate memory allocation failure during migration (suggestion by Nathan Lynch) Changes in v3: - Rebase on 5.17-rc4 - Naming changes for VAS capability struct elemets based on the V4 DLPAR support patch series. Haren Myneni (4): powerpc/pseries/vas: Define global h

[PATCH v4 9/9] powerpc/pseries/vas: Write 'nr_total_credits' for QoS credits change

2022-02-19 Thread Haren Myneni
-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas-sysfs.c | 33 +- arch/powerpc/platforms/pseries/vas.c | 2 +- arch/powerpc/platforms/pseries/vas.h | 1 + 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/vas-sysfs.c b

[PATCH v4 8/9] powerpc/pseries/vas: sysfs interface to export capabilities

2022-02-19 Thread Haren Myneni
*/ nr_used_credits /* Used credits */ /sys/devices/vas/vas0/gzip/qos_capabilities (QoS GZIP capabilities) nr_total_credits nr_used_credits Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/Makefile| 2 +- arch/powerpc/platforms/pseries/vas-sysfs.c | 226

[PATCH v4 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add

2022-02-19 Thread Haren Myneni
windows, it creates mapping on the new paste address. Then the user space can continue to use these windows and send HW compression requests to NX successfully. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 91 +++- 1 file changed, 90 insertions

[PATCH v4 6/9] powerpc/pseries/vas: Close windows with DLPAR core removal

2022-02-19 Thread Haren Myneni
are available. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 2 + arch/powerpc/platforms/pseries/vas.c | 207 +-- arch/powerpc/platforms/pseries/vas.h | 3 + 3 files changed, 204 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH v4 5/9] powerpc/vas: Map paste address only if window is active

2022-02-19 Thread Haren Myneni
which causes the corresponding window in-active. So if the window is not active, return mmap() failure with -EACCES and expects the user space reissue mmap() when the window is active or open a new window when the credit is available. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/book3s/vas

[PATCH v4 4/9] powerpc/vas: Return paste instruction failure if no active window

2022-02-19 Thread Haren Myneni
instruction that caused the fault was a paste. Signed-off-by: Nicholas Piggin Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/ppc-opcode.h | 2 + arch/powerpc/platforms/book3s/vas-api.c | 55 - 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH v4 3/9] powerpc/vas: Add paste address mmap fault handler

2022-02-19 Thread Haren Myneni
to handle NX request page faults if the user space issue NX requests. This handler maps the new paste address with the same VMA when the window is active again (due to core add with DLPAR). Otherwise returns paste failure. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h | 10

[PATCH v4 2/9] powerpc/pseries/vas: Save PID in pseries_vas_window struct

2022-02-19 Thread Haren Myneni
DLPAR operation. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas.c | 9 + arch/powerpc/platforms/pseries/vas.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c index

[PATCH v4 1/9] powerpc/pseries/vas: Use common names in VAS capability structure

2022-02-19 Thread Haren Myneni
nr_total/nr_used_credits provides credits usage to user space via sysfs and the same interface can be used on PowerNV in future. Changed with proper naming so that applicable on both pseries and PowerNV. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin --- arch/powerpc/platforms

[PATCH v4 0/9] powerpc/pseries/vas: NXGZIP support with DLPAR

2022-02-19 Thread Haren Myneni
VAS windows only for CPU hotplug events. Changes in v4: - Rebase on 5.17-rc4 - Changes based on comments from Nicholas Piggin - Included VAS DLPAR notifer code in 'Close windows with DLPAR' patch instead of as a separate patch - Patches reordering and other changes Haren Myneni (9): pow

Re: [PATCH v3 07/10] powerpc/vas: Add paste address mmap fault handler

2022-02-15 Thread Haren Myneni
r combined with) the patch that zaps > PTEs. Putting it afterwards is logically backward. Even if you don't > really expect the series to half work in a half bisected state, it > just makes the changes easier to follow. > > Thanks, > Nick > > > Signed-off-by: Haren M

Re: [PATCH v3 04/10] powerpc/pseries/vas: Reopen windows with DLPAR core add

2022-02-15 Thread Haren Myneni
y reason to put this before the close windows patch? It would be > more logical to put it afterwards AFAIKS. reconfig_open_windows() is just to reopen and set the status flag when windows are closed. I thought adding handler first before closing / unmap helps during git bisect. I

Re: [PATCH v3 06/10] powerpc/vas: Map paste address only if window is active

2022-02-15 Thread Haren Myneni
o core removal before mmap(). So if the window is not active, > > return mmap() failure with -EACCES and expects the user space > > reissue > > mmap() when the window is active or open new window when the credit > > is available. > > > > Signed-off-by: Haren Myn

Re: [PATCH v3 05/10] powerpc/pseries/vas: Close windows with DLPAR core removal

2022-02-15 Thread Haren Myneni
> > the kernel unmaps the paste address so that the user space receives > > paste > > failure until these windows are active with the later DLPAR (core > > add). > > The changelog needs work. Unmapping the window and the ramifications > of > that needs more

Re: [PATCH v3 03/10] powerpc/pseries/vas: Save LPID in pseries_vas_window struct

2022-02-15 Thread Haren Myneni
n PID" and "LPAR PID" is also confusing. I know the name > somewhat comes from the specifiction, but pid/PID would be fine, > it's clear we are talking about "this LPAR" when in pseries code. > > > Signed-off-by: Haren Myneni > > --- > > arch/power

Re: [PATCH v3 02/10] powerpc/pseries/vas: Add notifier for DLPAR core removal/add

2022-02-15 Thread Haren Myneni
that you previously lost? yes, reopen windows / re-use credits when the previously lost credits are available. > > > Signed-off-by: Haren Myneni > > --- > > arch/powerpc/platforms/pseries/vas.c | 37 > > > > 1 file changed, 37 inserti

Re: [PATCH v3 01/10] powerpc/pseries/vas: Use common names in VAS capability structure

2022-02-15 Thread Haren Myneni
fs patch. > > Reviewed-by: Nicholas Piggin > > > Signed-off-by: Haren Myneni > > --- > > arch/powerpc/platforms/pseries/vas.c | 10 +- > > arch/powerpc/platforms/pseries/vas.h | 6 +++--- > > 2 files changed, 8 insertions(+), 8 deletions(-) &g

  1   2   3   4   5   6   7   >