[PATCH 1/1] powerpc: Update MAINTAINERS for ibmvnic and VAS

2022-04-13 Thread Sukadev Bhattiprolu
Signed-off-by: Sukadev Bhattiprolu --- MAINTAINERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 61d9f114c37f..cf96ac858cc3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9336,14 +9336,12 @@ F: drivers/pci/hotplug/rpaphp* IBM Power SRIOV Virtual NIC

Re: [5.16.0-rc5][ppc][net] kernel oops when hotplug remove of vNIC interface

2022-01-06 Thread Sukadev Bhattiprolu
ks like it, the disassembly is: > > not r9,r9 > clrldi r3,r9,63 > blr # end of previous function > nop > addis r2,r12,491 # function entry > addir2,r2,14816 > stdur1,-48(r1) # stack frame creation > li r5,-10 > l

Re: [PATCH V2 net] ibmvnic: Continue with reset if set link down failed

2021-04-22 Thread Sukadev Bhattiprolu
Lijun Pan [lijunp...@gmail.com] wrote: > > Now, sure we can attempt a "thorough hard reset" which also does > > the same hcalls to reestablish the connection. Is there any > > other magic in do_hard_reset()? But in addition, it also frees lot > > more Linux kernel buffers and reallocates them for

Re: [PATCH V2 net] ibmvnic: Continue with reset if set link down failed

2021-04-21 Thread Sukadev Bhattiprolu
Lijun Pan [l...@linux.vnet.ibm.com] wrote: > > > > On Apr 20, 2021, at 4:35 PM, Dany Madden wrote: > > > > When ibmvnic gets a FATAL error message from the vnicserver, it marks > > the Command Respond Queue (CRQ) inactive and resets the adapter. If this > > FATAL reset fails and a transmission

Re: [PATCH] ibmvnic: remove excessive irqsave

2021-03-04 Thread Sukadev Bhattiprolu
es flags from line 5404. > Thanks. Please add Fixes: 4a41c421f367 ("ibmvnic: serialize access to work queue on remove") > Signed-off-by: Junlin Yang Reviewed-by: Sukadev Bhattiprolu

Re: [PATCH] ibmvnic: Fix possibly uninitialized old_num_tx_queues variable warning.

2021-03-02 Thread Sukadev Bhattiprolu
re is no reason to > not initialize the variables unconditionally avoiding the warning. Yeah, its a false positive, but initializing doesn't hurt. > > Fixes: 635e442f4a48 ("ibmvnic: merge ibmvnic_reset_init and ibmvnic_init") > Signed-off-by: Michal Suchanek Reviewed-by: Sukadev Bhattiprolu

Re: [PATCH] vio: make remove callback return void

2021-01-28 Thread Sukadev Bhattiprolu
Uwe Kleine-König [u...@kleine-koenig.org] wrote: > The driver core ignores the return value of struct bus_type::remove() > because there is only little that can be done. To simplify the quest to > make this function return void, let struct vio_driver::remove() return > void, too. All users

Re: [PATCH net] ibmvnic: device remove has higher precedence over reset

2021-01-21 Thread Sukadev Bhattiprolu
Lijun Pan [lijunp...@gmail.com] wrote: > > > diff --git a/drivers/net/ethernet/ibm/ibmvnic.c > > > b/drivers/net/ethernet/ibm/ibmvnic.c > > > index aed985e08e8a..11f28fd03057 100644 > > > --- a/drivers/net/ethernet/ibm/ibmvnic.c > > > +++ b/drivers/net/ethernet/ibm/ibmvnic.c > > > @@ -2235,8

Re: CONFIG_PPC_VAS depends on 64k pages...?

2020-11-30 Thread Sukadev Bhattiprolu
Christophe Leroy [christophe.le...@csgroup.eu] wrote: > Hi, > > Le 19/11/2020 à 11:58, Will Springer a écrit : > > I learned about the POWER9 gzip accelerator a few months ago when the > > support hit upstream Linux 5.8. However, for some reason the Kconfig > > dictates that VAS depends on a

Re: [PATCH v2 1/8] powerpc/perf/hv-24x7: Fix inconsistent output values incase multiple hv-24x7 events run

2020-02-22 Thread Sukadev Bhattiprolu
Kajol Jain [kj...@linux.ibm.com] wrote: > Commit 2b206ee6b0df ("powerpc/perf/hv-24x7: Display change in counter > values")' added to print _change_ in the counter value rather then raw > value for 24x7 counters. Incase of transactions, the event count > is set to 0 at the beginning of the

[PATCH] powerpc/xmon: Fix compile error in print_insn* functions

2020-01-22 Thread Sukadev Bhattiprolu
>From 72a7497a8673c93a4b80aa4fc38b88a8e90aa650 Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Wed, 22 Jan 2020 18:57:18 -0600 Subject: [PATCH 1/1] powerpc/xmon: Fix compile error in print_insn* functions Fix couple of compile errors I stumbled upon with CONFIG_XMO

[PATCH v4 1/2] powerpc/pseries/svm: Use FW_FEATURE to detect SVM

2020-01-21 Thread Sukadev Bhattiprolu
Use FW_FEATURE_SVM to detect a secure guest (SVM). This would be more efficient than calling mfmsr() frequently. Suggested-by: Michael Ellerman Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/include/asm/firmware.h | 3 ++- arch/powerpc/include/asm/svm.h| 6 +- arch

[PATCH v4 2/2] powerpc/pseries/svm: Disable BHRB/EBB/PMU access

2020-01-21 Thread Sukadev Bhattiprolu
mechanisms in Ultravisor. Some features, like BHRB or monitoring event counts in HV-mode (e.g: perf stat -e cycles:h) may still be restricted for the longer term. Signed-off-by: Sukadev Bhattiprolu Acked-by: Madhavan Srinivasan --- Changelog[v4] - [Paul Mackerras] Drop is_secure_guest() checks

[PATCH v3 1/2] powerpc/pseries/svm: Use FW_FEATURE to detect SVM

2020-01-09 Thread Sukadev Bhattiprolu
Use FW_FEATURE_SVM to detect a secure guest (SVM). This would be more efficient than calling mfmsr() frequently. Suggested-by: Michael Ellerman Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/include/asm/firmware.h | 3 ++- arch/powerpc/include/asm/svm.h| 6 +- arch

[PATCH v3 2/2] powerpc/pseries/svm: Disable BHRB/EBB/PMU access

2020-01-09 Thread Sukadev Bhattiprolu
Ultravisor disables some CPU features like BHRB, EBB and PMU in secure virtual machines (SVMs). Skip accessing those registers in SVMs to avoid getting a Program Interrupt. Signed-off-by: Sukadev Bhattiprolu Acked-by: Madhavan Srinivasan --- Changelog[v2] - [Michael Ellerman] Optimize

Re: [PATCH 2/2] powerpc/pseries/svm: Disable BHRB/EBB/PMU access

2020-01-09 Thread Sukadev Bhattiprolu
maddy [ma...@linux.ibm.com] wrote: > > > __init_PMU: > > +#ifdef CONFIG_PPC_SVM > > + /* > > +* SVM's are restricted from accessing PMU, so skip. > > +*/ > > + mfmsr r5 > > + rldicl r5, r5, 64-MSR_S_LG, 62 > > + cmpwi r5,1 > > + beq skip1 > > I know all MMCR* are

powerpc/xmon: don't access ASDR in VMs

2020-01-06 Thread Sukadev Bhattiprolu
>From 91a77dbea3c909ff15c66cded37f1334304a293d Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Mon, 6 Jan 2020 13:50:02 -0600 Subject: [PATCH 1/1] powerpc/xmon: don't access ASDR in VMs ASDR is HV-privileged and must only be accessed in HV-mode. Fixes a Program Check (0x700) when x

Re: [PATCH v4 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2020-01-06 Thread Sukadev Bhattiprolu
0:00:00 2001 From: Sukadev Bhattiprolu Date: Fri, 27 Sep 2019 14:30:36 -0500 Subject: [PATCH 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall Implement the H_SVM_INIT_ABORT hcall which the Ultravisor can use to abort an SVM after it has issued the H_SVM_INIT_START and before the H_SVM_INIT

Re: [PATCH V3 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2020-01-02 Thread Sukadev Bhattiprolu
Ram Pai [linux...@us.ibm.com] wrote: > > +unsigned long kvmppc_h_svm_init_abort(struct kvm *kvm) > > +{ > > + int i; > > + > > + if (!(kvm->arch.secure_guest & KVMPPC_SECURE_INIT_START)) > > + return H_UNSUPPORTED; > > It should also return H_UNSUPPORTED when >

Re: [PATCH 2/2] powerpc/pseries/svm: Disable BHRB/EBB/PMU access

2019-12-26 Thread Sukadev Bhattiprolu
Sukadev Bhattiprolu [suka...@linux.ibm.com] wrote: > Ultravisor disables some CPU features like BHRB, EBB and PMU in > secure virtual machines (SVMs). Skip accessing those registers > in SVMs to avoid getting a Program Interrupt. Here is an updated patch that explicitly includes in in s

[PATCH 2/2] powerpc/pseries/svm: Disable BHRB/EBB/PMU access

2019-12-24 Thread Sukadev Bhattiprolu
Ultravisor disables some CPU features like BHRB, EBB and PMU in secure virtual machines (SVMs). Skip accessing those registers in SVMs to avoid getting a Program Interrupt. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v2] - [Michael Ellerman] Optimize the code using FW_FEATURE_SVM

[PATCH 1/2] powerpc/pseries/svm: Use FW_FEATURE to detect SVM

2019-12-24 Thread Sukadev Bhattiprolu
Use FW_FEATURE_SVM to detect a secure guest (SVM). This would be more efficient than calling mfmsr() frequently. Suggested-by: Michael Ellerman Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/include/asm/firmware.h | 3 ++- arch/powerpc/include/asm/svm.h| 6 +- arch

[PATCH v4 1/2] KVM: PPC: Add skip_page_out parameter

2019-12-19 Thread Sukadev Bhattiprolu
Add 'skip_page_out' parameter to kvmppc_uvmem_drop_pages() so the callers can specify whetheter or not to skip paging out pages. This will be needed in a follow-on patch that implements H_SVM_INIT_ABORT hcall Reviewed-by: Paul Mackerras Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc

[PATCH v4 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2019-12-19 Thread Sukadev Bhattiprolu
and Bharata Rao. Signed-off-by: Ram Pai Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Bharata B Rao --- Changelog[v4]: - [Bharata Rao] Add missing rcu locking - [Paul Mackerras] simplify code that walks memslots - Add a check to ensure that H_SVM_INIT_ABORT is called

Re: [PATCH V3 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2019-12-19 Thread Sukadev Bhattiprolu
Paul Mackerras [pau...@ozlabs.org] wrote: > On Sat, Dec 14, 2019 at 06:12:08PM -0800, Sukadev Bhattiprolu wrote: > > > > Implement the H_SVM_INIT_ABORT hcall which the Ultravisor can use to > > abort an SVM after it has issued the H_SVM_INIT_START and before the >

Re: [PATCH V3 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2019-12-19 Thread Sukadev Bhattiprolu
Bharata B Rao [bhar...@linux.ibm.com] wrote: > On Sat, Dec 14, 2019 at 06:12:08PM -0800, Sukadev Bhattiprolu wrote: > > +unsigned long kvmppc_h_svm_init_abort(struct kvm *kvm) > > +{ > > + int i; > > + > > + if (!(kvm->arch.secure_guest & KVMPPC_SE

Re: [PATCH 1/2] powerpc/pseries/svm: Don't access some SPRs

2019-12-18 Thread Sukadev Bhattiprolu
Michael Ellerman [m...@ellerman.id.au] wrote: > > eg. here. > > This is the fast path of context switch. > > That expands to: > > if (!(mfmsr() & MSR_S)) > asm volatile("mfspr %0, SPRN_BESCR" : "=r" (rval)); > if (!(mfmsr() & MSR_S)) > asm

[PATCH 2/2] powerpc/pseries/svm: Disable PMUs in SVMs

2019-12-17 Thread Sukadev Bhattiprolu
-metal HV the syscall and performance counters work Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/kernel/cpu_setup_power.S | 22 ++ arch/powerpc/perf/core-book3s.c | 6 ++ 2 files changed, 28 insertions(+) diff --git a/arch/powerpc/kernel/cpu_setup_power.S b

[PATCH 1/2] powerpc/pseries/svm: Don't access some SPRs

2019-12-17 Thread Sukadev Bhattiprolu
Ultravisor disables some CPU features like EBB and BHRB in the HFSCR for secure virtual machines (SVMs). If the SVMs attempt to access related registers, they will get a Program Interrupt. Use macros/wrappers to skip accessing EBB and BHRB registers in secure VMs. Signed-off-by: Sukadev

[PATCH V3 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2019-12-14 Thread Sukadev Bhattiprolu
and Bharata Rao. Signed-off-by: Ram Pai Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Bharata B Rao --- Changelog[v3]: - Rather than pass the NIP/MSR as parameters, load them into SRR0/SRR1 (like we do with other registers) and terminate the VM after paging out

[PATCH V3 1/2] KVM: PPC: Add skip_page_out parameter

2019-12-14 Thread Sukadev Bhattiprolu
This patch is based on Bharata's v11 KVM patches for secure guests: https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-November/200918.html --- From: Sukadev Bhattiprolu Date: Fri, 13 Dec 2019 15:06:16 -0600 Subject: [PATCH V3 1/2] KVM: PPC: Add skip_page_out parameter Add 'skip_page_out

[PATCH v2 1/1] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2019-12-12 Thread Sukadev Bhattiprolu
This patch is based on Bharata's v11 KVM patches for secure guests: https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-November/200918.html --- >From c0826bac72a658312f3d87e0bb18ecaf08ac2b2e Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Fri, 27 Sep 2019 14:30:36 -0500 Subj

Re: [PATCH v8 8/8] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-09-17 Thread Sukadev Bhattiprolu
ed-off-by: Claudio Carvalho Except for one question in Patch 2, the patch series looks good to me. Reviewed-by: Sukadev Bhattiprolu

Re: [PATCH v8 4/8] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2019-09-17 Thread Sukadev Bhattiprolu
> +unsigned long kvmppc_h_svm_init_done(struct kvm *kvm) > +{ > + if (!(kvm->arch.secure_guest & KVMPPC_SECURE_INIT_START)) Minor: Should we also check if KVMPPC_SECURE_INIT_DONE is set here (since both can be set)?

Re: [PATCH v8 3/8] kvmppc: Shared pages support for secure guests

2019-09-17 Thread Sukadev Bhattiprolu
> A secure guest will share some of its pages with hypervisor (Eg. virtio > bounce buffers etc). Support sharing of pages between hypervisor and > ultravisor. A brief note about what a shared page is would help (a page belonging to the SVM but in normal memory and with decrypted contents)?

Re: [PATCH v8 2/8] kvmppc: Movement of pages between normal and secure memory

2019-09-17 Thread Sukadev Bhattiprolu
In the subject line s/Movement of/Move/? Some minor comments below. Bharata B Rao [bhar...@linux.ibm.com] wrote: > Manage migration of pages betwen normal and secure memory of secure > guest by implementing H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. > > H_SVM_PAGE_IN: Move the content of a

Re: [PATCH v8 7/8] kvmppc: Support reset of secure guest

2019-09-17 Thread Sukadev Bhattiprolu
) > - Release all device pages of the secure guest. > > After these steps, guest is ready to issue UV_ESM call once again > to switch to secure mode. > > Signed-off-by: Bharata B Rao > Signed-off-by: Sukadev Bhattiprolu > [Implementation of uv_svm_terminate() and its call

Re: [RFC PATCH 00/11] Secure Virtual Machine Enablement

2019-09-03 Thread Sukadev Bhattiprolu
> use to request certain pages to be made accessible (aka shared). I would like to piggy-back on this series (since it provides the context) to add another patch we need for SVMs :-) Appreciate any comments. --- >From ed93a0e36ec886483a72fdb8d99380bbe6607f37 Mon Sep 17 00:00:00 2001 F

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-29 Thread Sukadev Bhattiprolu
Bharata B Rao [bhar...@linux.ibm.com] wrote: > On Wed, Aug 28, 2019 at 08:02:19PM -0700, Sukadev Bhattiprolu wrote: > > Some minor comments/questions below. Overall, the patches look > > fine to me. > > > > > +#include > > > +#include > > > +

Re: [PATCH v7 5/7] kvmppc: Radix changes for secure guest

2019-08-28 Thread Sukadev Bhattiprolu
> - After the guest becomes secure, when we handle a page fault of a page > belonging to SVM in HV, send that page to UV via UV_PAGE_IN. > - Whenever a page is unmapped on the HV side, inform UV via UV_PAGE_INVAL. > - Ensure all those routines that walk the secondary page tables of > the guest

Re: [PATCH v7 2/7] kvmppc: Shared pages support for secure guests

2019-08-28 Thread Sukadev Bhattiprolu
> A secure guest will share some of its pages with hypervisor (Eg. virtio > bounce buffers etc). Support sharing of pages between hypervisor and > ultravisor. > > Once a secure page is converted to shared page, the device page is > unmapped from the HV side page tables. > > Signed-off-by:

Re: [PATCH v7 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-28 Thread Sukadev Bhattiprolu
Some minor comments/questions below. Overall, the patches look fine to me. > +#include > +#include > +#include > +#include > + > +static struct dev_pagemap kvmppc_devm_pgmap; > +static unsigned long *kvmppc_devm_pfn_bitmap; > +static DEFINE_SPINLOCK(kvmppc_devm_pfn_lock); Is this lock

Re: [PATCH v5 4/7] powerpc/mm: Use UV_WRITE_PATE ucall to register a PATE

2019-08-20 Thread Sukadev Bhattiprolu
Michael Ellerman [m...@ellerman.id.au] wrote: > Hi Claudio, > > Claudio Carvalho writes: > > From: Michael Anderson > > > > In ultravisor enabled systems, the ultravisor creates and maintains the > > partition table in secure memory where the hypervisor cannot access, and >

Re: [PATCH v4 7/8] KVM: PPC: Ultravisor: Enter a secure guest

2019-07-17 Thread Sukadev Bhattiprolu
Michael Ellerman [m...@ellerman.id.au] wrote: > Claudio Carvalho writes: > > From: Sukadev Bhattiprolu > > > > To enter a secure guest, we have to go through the ultravisor, therefore > > we do a ucall when we are entering a secure guest. > > > > This

MAINTAINERS: Remove non-existent VAS file

2019-04-10 Thread Sukadev Bhattiprolu
The file arch/powerpc/include/uapi/asm/vas.h was considered but never merged and should be removed from the MAINTAINERS file. While here, add missing email address. Reported-by: Joe Perches Signed-off-by: Sukadev Bhattiprolu --- MAINTAINERS | 3 +-- 1 file changed, 1 insertion(+), 2

Re: [PATCH v2 3/7] powerpc: use task_pid_nr() for TID allocation

2018-04-24 Thread Sukadev Bhattiprolu
Andrew Donnellan [andrew.donnel...@au1.ibm.com] wrote: > [+ Sukadev, Christophe] > > On 18/04/18 11:08, Alastair D'Silva wrote: > > From: Alastair D'Silva > > > > The current implementation of TID allocation, using a global IDR, may > > result in an errant process starving

[GIT PULL] Please pull JSON files for POWR9 PMU events

2018-03-13 Thread Sukadev Bhattiprolu
://github.com/sukadev/linux/ p9-json-v5 for you to fetch changes up to 99c9dff949f2502964005f9afa8d60c89b446f2c: perf vendor events: Update POWER9 events (2018-03-13 16:48:12 -0500) Sukadev Bhattiprolu (1): perf vendor events

[PATCH] Fix cleanup when VAS is not configured

2018-02-13 Thread Sukadev Bhattiprolu
From: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> Date: Fri, 9 Feb 2018 11:49:06 -0600 Subject: [PATCH 1/1] powerpc/vas: Fix cleanup when VAS is not configured When VAS is not configured, unregister the platform driver. Also simplify cleanup by delaying vas debugfs init until we kn

Re: [PATCH 2/4] powerpc/vas: Fix cleanup when VAS is not configured

2018-02-12 Thread Sukadev Bhattiprolu
Michael Ellerman [m...@ellerman.id.au] wrote: > Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> writes: > > > When VAS is not configured in the system, make sure to remove > > the VAS debugfs directory and unregister the platform driver. > > > > Sign

Re: [PATCH] powerpc/vas: do not set uses_vas for kernel windows

2018-02-09 Thread Sukadev Bhattiprolu
If VM_DONCOPY is set, then we can clear it. > > Cc: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> > Signed-off-by: Nicholas Piggin <npig...@gmail.com> Reviewed-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com>

[PATCH 4/4] powerpc/vas: Add a couple of trace points

2018-02-09 Thread Sukadev Bhattiprolu
Add a couple of trace points in the VAS driver Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Changelog [v2] - Make TRACE_INCLUDE_PATH relative to --- arch/powerpc/platforms/powernv/vas-trace.h | 112 arch/powerpc/platforms/power

[PATCH RESEND 3/4] powerpc/vas: Remove a stray line in Makefile

2018-02-09 Thread Sukadev Bhattiprolu
Remove a bogus line from arch/powerpc/platforms/powernv/Makefile that was added by commit ece4e51 ("powerpc/vas: Export HVWC to debugfs"). Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/Makefile | 1 - 1 file changed, 1 deletio

[PATCH 2/4] powerpc/vas: Fix cleanup when VAS is not configured

2018-02-09 Thread Sukadev Bhattiprolu
When VAS is not configured in the system, make sure to remove the VAS debugfs directory and unregister the platform driver. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-debug.c | 5 + arch/powerpc/platforms/powernv/vas.c

[PATCH RESEND 1/4] powerpc/vas: Fix order of cleanup in debugfs dir

2018-02-09 Thread Sukadev Bhattiprolu
Fix the order of cleanup to ensure we free the name buffer in case of an error creating 'hvwc' or 'info' files. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-debug.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

Re: [PATCH 5/5] powerpc/ftw: Document FTW API/usage

2018-01-24 Thread Sukadev Bhattiprolu
Randy Dunlap [rdun...@infradead.org] wrote: > > +struct ftw_setup_attr ftwattr; > > + > > +fd = open("/dev/ftw", O_RDWR); > > + > > +memset(, 0, sizeof(rxattr)); > > Is that supposed to be ftwattr (2x above)? Yes. I agree with your other comments as well and will send a

Re: [PATCH 3/5] powerpc/ftw: Implement a simple FTW driver

2018-01-18 Thread Sukadev Bhattiprolu
; + break; > > + } > > return -EINVAL; > > +} > > Do you expect to implement more ioctls? If not, just change the switch to > an if (). Maybe a couple more but changed it to an 'if' for now (and fixed an error handling issue in ftw_file_init()). Here i

Re: [PATCH 2/5] powerpc/ftw: Define FTW_SETUP ioctl API

2018-01-18 Thread Sukadev Bhattiprolu
. Here is the updated patch. Thanks for the review. Sukadev --- >From 1f347c199a0b1bbc528705c8e9ddd11c825a80fc Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> Date: Thu, 2 Feb 2017 06:20:07 -0500 Subject: [PATCH 2/5] powerpc/ftw: Define FTW_SETUP ioctl API

Re: [PATCH 1/2] powerpc: export thread-tidr interfaces

2018-01-17 Thread Sukadev Bhattiprolu
counter. Yes the FTW driver avoids calling clear_thread_tidr() for the same reasons. I don't have a strong case for exporting clear_thread_tidr(). Here is the updated patch, exporting just the set_thread_tidr(). Thanks, Sukadev --- >From 204ee3c918f8dad46c1e40d2d3730b07c10a87a3 Mon Sep 17 00:00:0

[PATCH 5/5] powerpc/ftw: Document FTW API/usage

2018-01-16 Thread Sukadev Bhattiprolu
Document the usage of the VAS Fast thread-wakeup API and add an entry in MAINTAINERS file. Thanks for input/comments from Benjamin Herrenschmidt, Michael Neuling, Michael Ellerman, Robert Blackmore, Ian Munsie, Haren Myneni and Paul Mackerras. Signed-off-by: Sukadev Bhattiprolu <s

[PATCH 4/5] powerpc/ftw: Add a couple of trace points

2018-01-16 Thread Sukadev Bhattiprolu
Add a couple of trace points in the FTW driver Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- drivers/misc/ftw/ftw-trace.h | 75 drivers/misc/ftw/ftw.c | 6 2 files changed, 81 insertions(+) create mode 100644 d

[PATCH 3/5] powerpc/ftw: Implement a simple FTW driver

2018-01-16 Thread Sukadev Bhattiprolu
/wake up. PATCH 5/5 documents the API and includes an example of the usage. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Changelog[v2] - [Michael Neuling] Rename from drop "nx" from name "nx-ftw". - [Michael Neuling] Use a single VAS_F

[PATCH 2/5] powerpc/ftw: Define FTW_SETUP ioctl API

2018-01-16 Thread Sukadev Bhattiprolu
Define the FTW_SETUP ioctl interface for fast thread wakeup (FTW). A follow-on patch will implement the FTW driver and ioctl. Thanks to input from Ben Herrenschmidt, Michael Neuling, Michael Ellerman. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Change

[PATCH 1/5] powerpc/vas: Remove a stray line in Makefile

2018-01-16 Thread Sukadev Bhattiprolu
Remove a bogus line from arch/powerpc/platforms/powernv/Makefile that was added by commit ece4e51 ("powerpc/vas: Export HVWC to debugfs"). Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/Makefile | 1 - 1 file changed, 1 deletio

[PATCH 0/5] Implement FTW driver

2018-01-16 Thread Sukadev Bhattiprolu
https://github.com/sukadev/linux/tree/ftw-next Thanks to input from Ben Herrenschmidt, Michael Ellerman, Michael Neuling and Robert Blackmore. Sukadev Bhattiprolu (5): powerpc/vas: Remove a stray line in Makefile powerpc/ftw: Define FTW_SETUP ioctl API powerpc/ftw: Implement a si

[PATCH 1/1] powerpc/vas: Add a couple of trace points

2018-01-16 Thread Sukadev Bhattiprolu
Add a couple of trace points in the VAS driver. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-trace.h | 112 arch/powerpc/platforms/powernv/vas-window.c | 9 +++ 2 files changed, 121 insertions(+)

[PATCH 2/2] powerpc: export set_thread_uses_vas()

2018-01-16 Thread Sukadev Bhattiprolu
Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/kernel/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index f20c1ad..d22055b 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/p

[PATCH 1/2] powerpc: export thread-tidr interfaces

2018-01-16 Thread Sukadev Bhattiprolu
Export set_thread_tidr() and clear_thread_tidr() interfaces so they can be used by external modules. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/kernel/process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/process.c

[PATCH 1/1] powerpc: Emulate paste instruction

2017-12-19 Thread Sukadev Bhattiprolu
thread reconfiguration doesn't occur. Signed-off-by: Michael Neuling <mi...@neuling.org> Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Changelog[v4]: - We need to disable pagefaults after all when modifying the thread reconfig registers. Use a mutex, rath

[PATCH 1/1] vas: vas_window_init_dbgdir: fix order of cleanup.

2017-12-19 Thread Sukadev Bhattiprolu
Fix the order of cleanup to ensure we free the name buffer in case of an error creating 'hvwc' or 'info' files. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-debug.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH 1/1]: powerpc: block interrupts when updating TIDR

2017-12-01 Thread Sukadev Bhattiprolu
From: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> Date: Tue, 28 Nov 2017 13:39:43 -0600 Subject: [PATCH 1/1]: powerpc: block interrupts when updating TIDR clear_thread_tidr() is called in interrupt context as a part of delayed put of the task structure (i.e as a part of timer int

Re: [PATCH v3] powerpc: Avoid signed to unsigned conversion in set_thread_tidr()

2017-11-27 Thread Sukadev Bhattiprolu
Vaibhav Jain [vaib...@linux.vnet.ibm.com] wrote: > There is an unsafe signed to unsigned conversion in set_thread_tidr() > that may cause an error value to be assigned to SPRN_TIDR register and > used as thread-id. Thanks for fixing this. I have a comment below > > The issue happens as

[PATCH] powerpc/vas, export chip_to_vas_id()

2017-11-20 Thread Sukadev Bhattiprolu
>From 958f8db089f4b89407fc4b89bccd3eaef585aa96 Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> Date: Mon, 20 Nov 2017 12:53:15 -0600 Subject: [PATCH 1/1] powerpc/vas, export chip_to_vas_id() Export the symbol chip_to_vas_id() to fix a build fai

[GIT PULL] Please pull JSON files for POWR9 PMU events

2017-11-08 Thread Sukadev Bhattiprolu
://github.com/sukadev/linux p9-json-v4 for you to fetch changes up to 4afb062d7d306bf56dbae9b5291e3515ccfede4c: perf vendor events powerpc: Update POWER9 events (2017-11-08 18:42:03 -0500) Sukadev Bhattiprolu (1): perf vendor

[PATCH v3 18/18] powerpc/vas: Add support for user receive window

2017-11-07 Thread Sukadev Bhattiprolu
Add support for user space receive window (for the Fast thread-wakeup coprocessor type) Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Changelog[v3] - [Nick Piggin] Drop CP_ABORT since set_thread_uses_vas() does that now (in earlier patch) and add a

[PATCH v3 16/18] powerpc/vas: Define vas_win_paste_addr()

2017-11-07 Thread Sukadev Bhattiprolu
into their address space and then use copy and paste instructions to submit the CRBs to the NX engine. Note that kernel drivers will use vas_paste_crb() directly and don't need this interface. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/include/asm

[PATCH v3 17/18] powerpc/vas: Define vas_win_id()

2017-11-07 Thread Sukadev Bhattiprolu
refers to this system-wide unique id as a Partition Send Window ID which is expected to be used during fault handling. Hence the "pswid" in the function names. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/vas.h | 5 +++

[PATCH v3 15/18] powerpc: Emulate paste instruction

2017-11-07 Thread Sukadev Bhattiprolu
thread reconfiguration doesn't occur. Cc: Aneesh Kumar K.V <aneesh.ku...@linux.vnet.ibm.com> Signed-off-by: Michael Neuling <mi...@neuling.org> Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Changlog[v3]: - [Michael Ellerman] We don't need to disable/enable p

[PATCH v3 14/18] powerpc: Define set_thread_uses_vas()

2017-11-07 Thread Sukadev Bhattiprolu
d_uses_vas(), that VAS can use to indicate that the current process opened a send window. During context switch, issue CP_ABORT only for processes that have the flag set. Thanks for input from Nick Piggin, Michael Ellerman. Cc: Nicholas Piggin <npig...@gmail.com> Signed-off-by: Sukadev B

[PATCH v3 13/18] powerpc: Add support for setting SPRN_TIDR

2017-11-07 Thread Sukadev Bhattiprolu
-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> Signed-off-by: Philippe Bergheaud <fe...@linux.vnet.ibm.com> Signed-off-by: Christophe Lombard <clomb...@linux.vnet.ibm.com> --- Changelog[v3] - Merge changes with and address comments to Christophe's patch. (i.e d

[PATCH v3 12/18] powerpc: have copy depend on CONFIG_BOOK3S_64

2017-11-07 Thread Sukadev Bhattiprolu
Have the COPY/PASTE instructions depend on CONFIG_BOOK3S_64 rather than CONFIG_PPC_STD_MMU_64. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/kernel/process.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/pro

[PATCH v3 11/18] powerpc/vas: Export HVWC to debugfs

2017-11-07 Thread Sukadev Bhattiprolu
nly relevant to a receive window so we were not setting it for a send window (which is is paired to a receive window anyway). But to simplify reporting in debugfs, set the 'cop' field for the send window also. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Cha

[PATCH v3 10/18] powerpc/vas, nx-842: Define and use chip_to_vas_id()

2017-11-07 Thread Sukadev Bhattiprolu
will be useful if a thread running on one chip wants to open a window on another chip (like the NX-842 driver does during start up). Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/vas.h | 9 + arch/powerpc/platforms/powernv/vas.

[PATCH v3 09/18] powerpc/vas: Create cpu to vas id mapping

2017-11-07 Thread Sukadev Bhattiprolu
Create a cpu to vasid mapping so callers can specify -1 instead of trying to find a VAS id. Changelog[v2] [Michael Ellerman] Use per-cpu variables to simplify code. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas.

[PATCH v3 08/18] powerpc/vas: poll for return of window credits

2017-11-07 Thread Sukadev Bhattiprolu
Normally, the NX driver waits for the CRBs to be processed before closing the window. But it is better to ensure that the credits are returned before the window gets reassigned later. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-wi

[PATCH v3 07/18] powerpc/vas: Save configured window credits

2017-11-07 Thread Sukadev Bhattiprolu
Save the configured max window credits for a window in the vas_window structure. We will need this when polling for return of window credits. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-window.c | 6 -- arch/powerpc/platforms/p

[PATCH v3 06/18] powerpc/vas: Reduce polling interval for busy state

2017-11-07 Thread Sukadev Bhattiprolu
A VAS window is normally in "busy" state for only a short duration. Reduce the time we wait for the window to go to "not-busy" state to speed-up vas_win_close() a bit. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms

[PATCH v3 04/18] powerpc/vas: Drop poll_window_cast_out().

2017-11-07 Thread Sukadev Bhattiprolu
Polling for window cast out is listed in the spec, but turns out that it is not strictly necessary and slows down window close. Making it a stub for now. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-window.

[PATCH v3 05/18] powerpc/vas: Use helper to unpin/close window

2017-11-07 Thread Sukadev Bhattiprolu
Use a helper to have the hardware unpin and mark a window closed. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-window.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/pla

[PATCH v3 03/18] powerpc/vas: Cleanup some debug code

2017-11-07 Thread Sukadev Bhattiprolu
Clean up vas.h and the debug code around ifdef vas_debug. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Changelog[v3] - Minor tweak to a debug message --- arch/powerpc/platforms/powernv/vas-window.c | 8 +++-- arch/powerpc/platforms/powernv/vas.h

[PATCH v3 02/18] powerpc/vas: Validate window credits

2017-11-07 Thread Sukadev Bhattiprolu
NX-842, the only user of VAS, sets the window credits to default values but VAS should check the credits against the possible max values. The VAS_WCREDS_MIN is not needed and can be dropped. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/power

[PATCH v3 01/18] powerpc/vas: init missing fields from [rt]xattr

2017-11-07 Thread Sukadev Bhattiprolu
Initialize a few missing window context fields from the window attributes specified by the caller. These fields are currently set to their default values by the caller (NX-842), but would be good to apply them anyway. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> ---

[PATCH v3 00/18] powerpc/vas: Add support for FTW

2017-11-07 Thread Sukadev Bhattiprolu
): powerpc: Emulate paste instruction Sukadev Bhattiprolu (17): powerpc/vas: init missing fields from [rt]xattr powerpc/vas: Validate window credits powerpc/vas: Cleanup some debug code powerpc/vas: Drop poll_window_cast_out(). powerpc/vas: Use helper to unpin/close window powerpc/vas: Reduce

[PATCH v2 18/18] powerpc/vas: Add support for user receive window

2017-10-06 Thread Sukadev Bhattiprolu
Add support for user space receive window (for the Fast thread-wakeup coprocessor type) Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/vas-window.c | 59 + 1 file changed, 52 insertions(+), 7 deletions(-) diff

[PATCH v2 17/18] powerpc/vas: Define vas_win_id()

2017-10-06 Thread Sukadev Bhattiprolu
refers to this system-wide unique id as a Partition Send Window ID which is expected to be used during fault handling. Hence the "pswid" in the function names. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/vas.h | 5 +++

[PATCH v2 16/18] powerpc/vas: Define vas_win_paste_addr()

2017-10-06 Thread Sukadev Bhattiprolu
into their address space and then use copy and paste instructions to submit the CRBs to the NX engine. Note that kernel drivers will use vas_paste_crb() directly and don't need this interface. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/include/asm

[PATCH v2 15/18] powerpc: Emulate paste instruction

2017-10-06 Thread Sukadev Bhattiprolu
thread reconfiguration doesn't occur. Signed-off-by: Michael Neuling <mi...@neuling.org> Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- Edit by Sukadev: Use PPC_PASTE() rather than the paste instruction since in older versions the instruction required a third parameter.

[PATCH v2 14/18] powerpc: Define set_thread_used_vas()

2017-10-06 Thread Sukadev Bhattiprolu
d_used_vas(), that VAS can use to indicate that the current process opened a send window. During context switch, issue CP_ABORT only for processes that have the flag set. Thanks for input from Nick Piggin, Michael Ellerman. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch

[PATCH v2 13/18] powerpc: Add support for setting SPRN_TIDR

2017-10-06 Thread Sukadev Bhattiprolu
-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> Signed-off-by: Philippe Bergheaud <fe...@linux.vnet.ibm.com> Signed-off-by: Christophe Lombard <clomb...@linux.vnet.ibm.com> --- Changelog[v3] - Merge changes with and address comments to Christophe's patch. (i.e d

[PATCH v2 12/18] powerpc: have copy depend on CONFIG_BOOK3S_64

2017-10-06 Thread Sukadev Bhattiprolu
Have the COPY/PASTE instructions depend on CONFIG_BOOK3S_64 rather than CONFIG_PPC_STD_MMU_64. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/kernel/process.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/pro

[PATCH v2 11/18] powerpc/vas: Export HVWC to debugfs

2017-10-06 Thread Sukadev Bhattiprolu
nly relevant to a receive window so we were not setting it for a send window (which is is paired to a receive window anyway). But to simplify reporting in debugfs, set the 'cop' field for the send window also. Signed-off-by: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com> --- arch/powerpc/

  1   2   3   4   5   6   7   8   9   >