Re: [PATCH 08/15] powerpc/powernv: implement opal_put_chars_atomic

2018-05-01 Thread Benjamin Herrenschmidt
On Tue, 2018-05-01 at 00:55 +1000, Nicholas Piggin wrote: > The RAW console does not need writes to be atomic, so relax > opal_put_chars to be able to do partial writes, and implement an > _atomic variant which does not take a spinlock. This API is used > in xmon, so the less locking that is used,

[PATCH v2 RFC 1/1] KVM: PPC: Book3S HV: pack VCORE IDs to access full VCPU ID space

2018-05-01 Thread Sam Bobroff
From: Sam Bobroff It is not currently possible to create the full number of possible VCPUs (KVM_MAX_VCPUS) on Power9 with KVM-HV when the guest uses less threads per core than it's core stride (or "VSMT mode"). This is because the VCORE ID and XIVE offsets to grow beyond KVM_MAX_VCPUS even though

Re: [PATCH 08/15] powerpc/powernv: implement opal_put_chars_atomic

2018-05-01 Thread Nicholas Piggin
On Tue, 01 May 2018 19:48:58 +1000 Benjamin Herrenschmidt wrote: > On Tue, 2018-05-01 at 00:55 +1000, Nicholas Piggin wrote: > > The RAW console does not need writes to be atomic, so relax > > opal_put_chars to be able to do partial writes, and implement an > > _atomic variant which does not take

Re: [PATCH 4/6] powerpc/64s: Enable barrier_nospec based on firmware settings

2018-05-01 Thread Michael Ellerman
Michal Suchánek writes: > Hello, > > On Tue, 24 Apr 2018 14:15:57 +1000 > Michael Ellerman wrote: > >> From: Michal Suchanek >> >> Check what firmware told us and enable/disable the barrier_nospec as >> appropriate. >> >> We err on the side of enabling the barrier, as it's no-op on older >> sy

Re: [PATCH 2/6] powerpc/64s: Add support for ori barrier_nospec patching

2018-05-01 Thread Michael Ellerman
Michal Suchánek writes: > On Tue, 24 Apr 2018 14:15:55 +1000 > Michael Ellerman wrote: > >> From: Michal Suchanek >> >> Based on the RFI patching. This is required to be able to disable the >> speculation barrier. > > why do you not patch the nospec barrier which is included as part of > the RF

Re: [PATCH v4 2/6] iommu: of: make of_pci_map_rid() available for other devices too

2018-05-01 Thread Rob Herring
On Mon, Apr 30, 2018 at 11:57:17AM +0530, Nipun Gupta wrote: > iommu-map property is also used by devices with fsl-mc. This > patch moves the of_pci_map_rid to generic location, so that it > can be used by other busses too. > > 'of_pci_map_rid' is renamed here to 'of_map_rid' and there is no > fun

Re: [PATCH v10 06/25] mm: make pte_unmap_same compatible with SPF

2018-05-01 Thread Minchan Kim
On Mon, Apr 30, 2018 at 04:07:30PM +0200, Laurent Dufour wrote: > On 23/04/2018 08:31, Minchan Kim wrote: > > On Tue, Apr 17, 2018 at 04:33:12PM +0200, Laurent Dufour wrote: > >> pte_unmap_same() is making the assumption that the page table are still > >> around because the mmap_sem is held. > >> T

Re: [PATCH] powerpc/watchdog: provide more data in watchdog messages

2018-05-01 Thread Balbir Singh
On Tue, 2018-05-01 at 12:22 +1000, Nicholas Piggin wrote: > Provide timebase and timebase of last heartbeat in watchdog lockup > messages. Also provide a stack trace of when a CPU becomes un-stuck, > which can be useful -- it could be where irqs are re-enabled, so it > may be the end of the critica

Re: [PATCH v10 08/25] mm: VMA sequence count

2018-05-01 Thread Minchan Kim
On Mon, Apr 30, 2018 at 05:14:27PM +0200, Laurent Dufour wrote: > > > On 23/04/2018 08:42, Minchan Kim wrote: > > On Tue, Apr 17, 2018 at 04:33:14PM +0200, Laurent Dufour wrote: > >> From: Peter Zijlstra > >> > >> Wrap the VMA modifications (vma_adjust/unmap_page_range) with sequence > >> counts

Re: [RFC] virtio: Use DMA MAP API for devices without an IOMMU

2018-05-01 Thread Ram Pai
On Wed, Apr 18, 2018 at 07:20:10PM +0300, Michael S. Tsirkin wrote: > On Wed, Apr 18, 2018 at 08:47:10AM +0530, Anshuman Khandual wrote: > > On 04/15/2018 05:41 PM, Christoph Hellwig wrote: > > > On Fri, Apr 06, 2018 at 06:37:18PM +1000, Benjamin Herrenschmidt wrote: > > implemented as DMA API

Re: [RESEND 2/3] powerpc/memcpy: Add memcpy_mcsafe for pmem

2018-05-01 Thread Dan Williams
On Thu, Apr 5, 2018 at 8:00 AM, Dan Williams wrote: > On Wed, Apr 4, 2018 at 11:45 PM, Nicholas Piggin wrote: [,,] >> What's the problem with just counting bytes copied like usercopy -- >> why is that harder than cacheline accuracy? >> >>> I'd rather implement the existing interface and port/supp

Re: [PATCHv2 0/3] post the event cpux add/remove besides online/offline during hotplug

2018-05-01 Thread Pingfan Liu
Maintainers, ping? Any suggestion? I encounter such issue on redhat RHEL and FEDORA On Mon, Apr 16, 2018 at 2:35 PM, Pingfan Liu wrote: > v1->v2: >-1.improve the commit log and explain the reproducing of bug in [3/3] >-2.re-fragment the series, and [3/3] is the motivation, while [1~2/3] a

[PATCH kernel 1/2] KVM: PPC: Use correct page shift in H_STUFF_TCE

2018-05-01 Thread Alexey Kardashevskiy
The other TCE handlers use page shift from the guest visible TCE table (described by kvmppc_spapr_tce_iommu_table) so let's make H_STUFF_TCE handlers do the same thing. This should cause no behavioral change now but soon we will allow the iommu_table::it_page_shift being different from from the em

[PATCH kernel 2/2] KVM: PPC: Allow backing bigger guest IOMMU pages with smaller physical pages

2018-05-01 Thread Alexey Kardashevskiy
At the moment we only support in the host the IOMMU page sizes which the guest is aware of, which is 4KB/64KB/16MB. However P9 does not support 16MB IOMMU pages, 2MB and 1GB pages are supported instead. We can still emulate bigger guest pages (for example 16MB) with smaller host pages (4KB/64KB/2MB

[PATCH kernel 0/2] KVM: PPC: Allow backing bigger guest IOMMU pages with smaller physical

2018-05-01 Thread Alexey Kardashevskiy
This is to allow the guest to use big host IOMMU pages even when the exact page size (i.e. 16MB) is not supported by the host (i.e.P9). Please comment. Thanks. Alexey Kardashevskiy (2): KVM: PPC: Use correct page shift in H_STUFF_TCE KVM: PPC: Allow backing bigger guest IOMMU pages with sm

Re: [resend] Revert "powerpc/powernv: Increase memory block size to 1GB on radix"

2018-05-01 Thread rashmica
Tested hot-unplugging dimm device on radix guest on p9 host with KVM. On 01/05/18 12:57, Balbir Singh wrote: > This commit was a stop-gap to prevent crashes on hotunplug, caused by > the mismatch between the 1G mappings used for the linear mapping and the > memory block size. Those issues are now

Re: [PATCH kernel 2/2] KVM: PPC: Allow backing bigger guest IOMMU pages with smaller physical pages

2018-05-01 Thread Balbir Singh
On Wed, 2 May 2018 14:07:23 +1000 Alexey Kardashevskiy wrote: > At the moment we only support in the host the IOMMU page sizes which > the guest is aware of, which is 4KB/64KB/16MB. However P9 does not support > 16MB IOMMU pages, 2MB and 1GB pages are supported instead. We can still > emulate bi

Re: [resend] Revert "powerpc/powernv: Increase memory block size to 1GB on radix"

2018-05-01 Thread Balbir Singh
On Wed, 2 May 2018 15:10:33 +1000 rashmica wrote: > Tested hot-unplugging dimm device on radix guest on p9 host with KVM. > > > On 01/05/18 12:57, Balbir Singh wrote: > > This commit was a stop-gap to prevent crashes on hotunplug, caused by > > the mismatch between the 1G mappings used for the

[PATCH kernel] powerpc/ioda: Use ibm, supported-tce-sizes for IOMMU page size mask

2018-05-01 Thread Alexey Kardashevskiy
At the moment we assume that IODA2 and newer PHBs can always do 4K/64K/16M IOMMU pages, however this is not the case for POWER9 and now skiboot advertises the supported sizes via the device so we use that instead of hard coding the mask. This falls back to the default mask if no "ibm,supported-tce

Re: [PATCH kernel 2/2] KVM: PPC: Allow backing bigger guest IOMMU pages with smaller physical pages

2018-05-01 Thread Alexey Kardashevskiy
On 2/5/18 3:53 pm, Balbir Singh wrote: > On Wed, 2 May 2018 14:07:23 +1000 > Alexey Kardashevskiy wrote: > >> At the moment we only support in the host the IOMMU page sizes which >> the guest is aware of, which is 4KB/64KB/16MB. However P9 does not support >> 16MB IOMMU pages, 2MB and 1GB pages

[PATCH 00/13] EEH refactoring 2

2018-05-01 Thread Sam Bobroff
Hello everyone, Here is a second, somewhat deeper, set of cleanups for the EEH code (mostly eeh_drver.c). These changes are not intended to significantly alter the actual processing, but rather to improve the readability and maintainability of the code. They are subjective by nature so I would ap

[PATCH 01/13] powerpc/eeh: Add eeh_max_freezes to initial EEH log line

2018-05-01 Thread Sam Bobroff
The current failure message includes the number of failures that have occurred in the last hour (for a device) but it does not indicate how many failures will be tolerated before the device is permanently disabled. Include the limit (eeh_max_freezes) to make this less surprising when it happens.

[PATCH 02/13] powerpc/eeh: Add final message for successful recovery

2018-05-01 Thread Sam Bobroff
Add a single log line at the end of successful EEH recovery, so that it's clear that event processing has finished. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_drive

[PATCH 03/13] powerpc/eeh: Fix use-after-release of EEH driver

2018-05-01 Thread Sam Bobroff
Correct two cases where eeh_pcid_get() is used to reference the driver's module but the reference is dropped before the driver pointer is used. In eeh_rmv_device() also refactor a little so that only two calls to eeh_pcid_put() are needed, rather than three and the reference isn't taken at all if

[PATCH 04/13] powerpc/eeh: Remove unused eeh_pcid_name()

2018-05-01 Thread Sam Bobroff
Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index 54333f6c9d67..ca9a73fe9cc5 100644 --- a/arch/powerpc/kernel/eeh_driver.c +++ b/arch/powerpc/

[PATCH 05/13] powerpc/eeh: Strengthen types of eeh traversal functions

2018-05-01 Thread Sam Bobroff
The traversal functions eeh_pe_traverse() and eeh_pe_dev_traverse() both provide their first argument as void * but every single user casts it to the expected type. Change the type of the first parameter from void * to the appropriate type, and clean up all uses. Signed-off-by: Sam Bobroff ---

[PATCH 06/13] powerpc/eeh: Add message when PE processing at parent

2018-05-01 Thread Sam Bobroff
To aid debugging, add a message to show when EEH processing for a PE will be done at the device's parent, rather than directly at the device. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/eeh.

[PATCH 07/13] powerpc/eeh: Clean up pci_ers_result handling

2018-05-01 Thread Sam Bobroff
As EEH event handling progresses, a cumulative result of type pci_ers_result is built up by (some of) the eeh_report_*() functions using either: if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; if (*res == PCI_ERS_RESULT_NONE) *res = rc; or: if ((*res == PCI_ERS_RESULT_NONE)

[PATCH 08/13] powerpc/eeh: Introduce eeh_for_each_pe()

2018-05-01 Thread Sam Bobroff
Add a for_each-style macro for iterating through PEs without the boilerplate required by a traversal function. eeh_pe_next() is now exported, as it is now used directly in place. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 4 arch/powerpc/kernel/eeh_pe.c | 7 +++ 2

[PATCH 09/13] powerpc/eeh: Introduce eeh_edev_actionable()

2018-05-01 Thread Sam Bobroff
The same test is done in every EEH report function, so factor it out. Since eeh_dev_removed() needs to be moved higher up in the file, simplify it a little while we're at it. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 30 -- 1 file changed, 16

[PATCH 10/13] powerpc/eeh: Introduce eeh_set_channel_state()

2018-05-01 Thread Sam Bobroff
To ease future refactoring, extract setting of the channel state from the report functions out into their own functions. This increases the amount of code that is identical across all of the report functions. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 19 --

[PATCH 11/13] powerpc/eeh: Introduce eeh_set_irq_state()

2018-05-01 Thread Sam Bobroff
To ease future refactoring, extract calls to eeh_enable_irq() and eeh_disable_irq() from the various report functions. This makes the report functions initial sequences more similar, as well as making the IRQ changes visible when reading eeh_handle_normal_event(). Signed-off-by: Sam Bobroff ---