[PATCH] TPM: Provide a tpm_tis OF driver

2010-03-09 Thread Jason Gunthorpe
This provides an open firwmare driver binding for tpm_tis. OF is useful on arches where PNP is not used. Allow the tpm_tis driver to be selected if PNP or OF are compiled in. Tested on a PPC405 with a winbond LPC TPM. Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- drivers

[PATCH] PPC32: Fixup pmd_page to work when ARCH_PFN_OFFSET is non-zero

2010-03-09 Thread Jason Gunthorpe
Instead of referencing mem_map directly, use pfn_to_page. Otherwise the kernel crashes when trying to start userspace if ARCH_PFN_OFFSET is non-zero and CONFIG_BOOKE is not defined Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- arch/powerpc/include/asm/pgtable-ppc32.h |2

Re: [PATCH] PPC: Skip over OF_DT_NOP when unflattening the device tree

2010-03-19 Thread Jason Gunthorpe
On Fri, Mar 19, 2010 at 04:50:38PM +1100, Benjamin Herrenschmidt wrote: On Tue, 2010-03-09 at 12:30 -0700, Jason Gunthorpe wrote: NOPs within the property section are skipped, but NOPs between OF_DT_END_NODE and OF_DT_BEGIN_NODE were not. My firmware NOPs out entire nodes depending

Re: [tpmdd-devel] [PATCH] TPM: Provide a tpm_tis OF driver

2010-03-24 Thread Jason Gunthorpe
On Thu, Mar 25, 2010 at 01:20:41AM -0300, Rajiv Andrade wrote: Why not +#ifdef CONFIG_OF + return of_register_platform_driver(tis_of_driver); +#elif CONFIG_PNP + return pnp_register_driver(tis_pnp_driver); +#endif ? AFAIK they are not exclusive options? I can't imagine anyone

Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes

2013-05-22 Thread Jason Gunthorpe
On Wed, May 22, 2013 at 09:10:10AM -0400, Jason Cooper wrote: iirc, our solution to this was to parse the ATAGs for the mac addr and update the appended dtb. This way, module load and unload would work without loosing the mac address. I believe Jason Gunthorpe has a patch to atags_to_fdt

Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes

2013-05-22 Thread Jason Gunthorpe
On Wed, May 22, 2013 at 07:32:51PM +0200, Sebastian Hesselbarth wrote: Not neccessary anyway, after talking Jason C in a Kirkwood-only workaround I prepared a patch that reads mac address registers early and stores it in the local-mac-address property. That sounds great, but, FWIW, our

Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs

2013-05-22 Thread Jason Gunthorpe
On Wed, May 22, 2013 at 10:04:02PM +0200, Sebastian Hesselbarth wrote: Ethernet controllers found on Kirkwood SoCs not only suffer from loosing MAC address register contents on clock gating but also some important registers are reset to values that would break ethernet. This patch FWIW, we

Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs

2013-05-23 Thread Jason Gunthorpe
On Thu, May 23, 2013 at 12:01:11PM -0400, Jason Cooper wrote: + /* Kirkwood resets some registers on gated clocks. Especially + * CLK125_BYPASS_EN must be cleared but is not available on + * all other SoCs/System Controllers using this driver. + */ + if

Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs

2013-05-23 Thread Jason Gunthorpe
On Thu, May 23, 2013 at 01:23:39PM -0400, Jason Cooper wrote: Shouldn't it rather be compatible = marvell,kirkwood-eth, marvell,orion-eth; Not sure about orion-eth? I'm inclined to go with of_machine_is_compatible() since the only concrete difference we know is that the tweak is

Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs

2013-05-23 Thread Jason Gunthorpe
On Thu, May 23, 2013 at 02:40:28PM -0400, Jason Cooper wrote: But there is a larger problem here then just this one bit. The PSC1 register must be set properly for the board layout, and today we rely on the bootloader to set it. In fact, even with Sebastian's change the ethernet port

Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs

2013-05-24 Thread Jason Gunthorpe
On Fri, May 24, 2013 at 12:46:36PM -0400, Jason Cooper wrote: Why are you not keen on this? It seems like normal device driver practice, that is what the data field of of_device_id is typically used for.. I'm not keen on it because we don't have a document saying All kirkwood SoCs need

Re: [tpmdd-devel] Has anyone a ATMEL TPM Chip on PPC64 (CONFIG_TCG_ATMEL)?

2013-10-28 Thread Jason Gunthorpe
On Mon, Oct 28, 2013 at 01:03:43PM -0500, Joel Schopp wrote: On 10/27/2013 05:06 PM, Peter H?we wrote: Hi, I was wondering if anyone here on this list still has a machine with an old ATMEL TPM (trusted platform module) lying around? From the kconfig entry it becomes evident that it

[PATCH] net: mv643xx_eth: Add missing phy_addr_set in DT mode

2013-11-04 Thread Jason Gunthorpe
is not called, and the bootloader has not set the correct address then the driver will fail to function. Tested on Kirkwood. Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- Cc: David Miller da...@davemloft.net Cc: Lennert Buytenhek buyt...@wantstofly.org Cc: Jason Cooper ja

[PATCH] PPC: Do not make the entire heap executable

2012-09-30 Thread Jason Gunthorpe
are RW BSS sections, which is not the case for PPC. Teach the ELF loader to check the X bit in the relevant load header and create 0 filled anonymous mappings that are executable if the load header requests that. Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- arch/powerpc/include

[PATCH] PPC: Correct the tophys/tovirt macros

2012-09-30 Thread Jason Gunthorpe
asm/page.h discusses the calculation for v2p and p2v, it should be: va = pa + KERNELBASE - PHYSICAL_START which is the same as: va = pa + LOAD_OFFSET tophys/tovirt were using PAGE_OFFSET, which as page.h says, is almost always the same thing. Signed-off-by: Jason Gunthorpe jguntho

[PATCH] PPC: Enable the Watchdog vector for 405

2012-09-30 Thread Jason Gunthorpe
Move the body of the PIT exception out of line to make room. Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- arch/powerpc/kernel/head_40x.S | 26 +- arch/powerpc/kernel/traps.c|2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff

Re: [PATCH] PPC: Enable the Watchdog vector for 405

2012-10-01 Thread Jason Gunthorpe
On Mon, Oct 01, 2012 at 08:16:29AM -0400, Josh Boyer wrote: On Sun, Sep 30, 2012 at 7:27 PM, Jason Gunthorpe jguntho...@obsidianresearch.com wrote: Move the body of the PIT exception out of line to make room. What boards did you test this on? What driver are you using for the watchdog

Re: [PATCH] PPC: Enable the Watchdog vector for 405

2012-10-01 Thread Jason Gunthorpe
On Mon, Oct 01, 2012 at 01:32:47PM -0400, Josh Boyer wrote: On Mon, Oct 1, 2012 at 12:25 PM, Jason Gunthorpe Please leave this wrapped in CONFIG_BOOKE_WDT. I don't agree with unconditionally enabling this for every 405 chip out there. What are you concerned with? If some core varient

Re: [PATCH] PPC: Correct the tophys/tovirt macros

2012-10-04 Thread Jason Gunthorpe
On Thu, Oct 04, 2012 at 09:19:04PM +1000, Benjamin Herrenschmidt wrote: On Sun, 2012-09-30 at 17:28 -0600, Jason Gunthorpe wrote: asm/page.h discusses the calculation for v2p and p2v, it should be: va = pa + KERNELBASE - PHYSICAL_START which is the same as: va = pa + LOAD_OFFSET

RE: [PATCH v2] PPC: Do not make the entire heap executable

2012-10-04 Thread Jason Gunthorpe
are RW BSS sections, which is not the case for PPC. Teach the ELF loader to check the X bit in the relevant load header and create 0 filled anonymous mappings that are executable if the load header requests that. Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- arch/powerpc/include

Re: [PATCHv2] PPC: Enable the Watchdog vector for 405

2012-10-05 Thread Jason Gunthorpe
for them. Tested that the WDT vector works on a 405F6 core. Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- arch/powerpc/kernel/head_40x.S | 47 --- arch/powerpc/kernel/traps.c|2 +- 2 files changed, 30 insertions(+), 19 deletions

[PATCH v2] NTP: Add a CONFIG_RTC_SYSTOHC configuration

2012-12-14 Thread Jason Gunthorpe
kirkwood and PPC405 Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- arch/powerpc/kernel/time.c |2 +- drivers/rtc/Kconfig|9 + drivers/rtc/Makefile |1 + drivers/rtc/systohc.c | 44 include/linux

[PATCH v3] NTP: Add a CONFIG_RTC_SYSTOHC configuration

2012-12-17 Thread Jason Gunthorpe
kirkwood and PPC405 Signed-off-by: Jason Gunthorpe jguntho...@obsidianresearch.com --- arch/powerpc/kernel/time.c |2 +- drivers/rtc/Kconfig| 10 +- drivers/rtc/Makefile |1 + drivers/rtc/systohc.c | 44 include

Re: [PATCH 5/5] mv643xx_eth: convert to use the Marvell Orion MDIO driver

2013-01-29 Thread Jason Gunthorpe
On Tue, Jan 29, 2013 at 04:24:08PM +0100, Florian Fainelli wrote: This patch converts the Marvell MV643XX ethernet driver to use the Marvell Orion MDIO driver. As a result, PowerPC and ARM platforms registering the Marvell MV643XX ethernet driver are also updated to register a Marvell Orion

Re: [PATCH 4/5] net: mvmdio: allow Device Tree and platform device to coexist

2013-01-29 Thread Jason Gunthorpe
On Tue, Jan 29, 2013 at 04:24:07PM +0100, Florian Fainelli wrote: - dev-err_interrupt = irq_of_parse_and_map(pdev-dev.of_node, 0); + if (pdev-dev.of_node) { + dev-regs = of_iomap(pdev-dev.of_node, 0); + if (!dev-regs) { +

Re: [PATCH 2/2] of: use platform_device_add

2013-02-19 Thread Jason Gunthorpe
On Sun, Feb 17, 2013 at 10:49:08AM +, Grant Likely wrote: The patch introduce a regression on imx6q boot. The IOMUXC block on imx6q is special. It acts not only a pin controller but also a system controller with a bunch of system level registers in there. That's why we currently

Re: [PATCH V2] powerpc/infiniband: Use cache inhibitted and guarded mapping on powerpc

2016-04-22 Thread Jason Gunthorpe
On Fri, Apr 22, 2016 at 08:47:56AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2016-04-20 at 03:58 -0400, Aneesh Kumar K.V wrote: > > The driver was requesting for a writethrough mapping. But with thoses > > flags we will end up with a SAO mapping because we now have memory > > conherence

Re: [PATCH] powerpc: Do not make the entire heap executable

2016-08-02 Thread Jason Gunthorpe
On Mon, Aug 01, 2016 at 11:07:21PM +0200, Denys Vlasenko wrote: > On 32-bit powerps the ELF PLT sections of binaries (built with --bss-plt, > or with a toolchain which defaults to it) look like this: Hi Denys, Thanks for resurrecting this, I am still interested here, we have been using this

Re: ibmvtpm byteswapping inconsistency

2017-01-26 Thread Jason Gunthorpe
On Thu, Jan 26, 2017 at 09:22:48PM +0100, Michal Such??nek wrote: > This is repeated a few times in the driver so I added memset to quiet > gcc and make behavior deterministic in case the unused fields get some > meaning in the future. Yep, reserved certainly needs to be zeroed.. Can you send a

Re: [PATCH v4] powerpc: Do not make the entire heap executable

2016-08-22 Thread Jason Gunthorpe
On Mon, Aug 22, 2016 at 08:37:05PM +0200, Denys Vlasenko wrote: > >Is this going to break any application ? I am asking because you > >mentioned the patch is lightly tested. > > I booted powerpc64 machine with RHEL7 installation, > it did not catch fire. When I authored the original patch my

Re: [PATCH v5] powerpc: Do not make the entire heap executable

2016-09-27 Thread Jason Gunthorpe
On Wed, Sep 28, 2016 at 11:42:11AM +1000, Michael Ellerman wrote: > But this is not really a powerpc patch, and I'm not an ELF expert. So > I'm not comfortable merging it via the powerpc tree. It doesn't look > like we really have a maintainer for binfmt_elf.c, so I'm not sure who > should be

Re: [PATCH v6] powerpc: Do not make the entire heap executable

2016-10-20 Thread Jason Gunthorpe
hat.com> wrote: > >>> On 32-bit powerpc the ELF PLT sections of binaries (built with --bss-plt, > >>> or with a toolchain which defaults to it) look like this: > > ... > >>> > >>> Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresea

Re: [PATCH v7] powerpc: Do not make the entire heap executable

2016-12-12 Thread Jason Gunthorpe
On Wed, Dec 07, 2016 at 02:15:27PM -0800, Kees Cook wrote: > Can you resend this patch with /proc/$pid/maps output showing the > before/after effects of this change also included here? Showing that > reduction in executable mapping should illustrate the benefit of > avoiding having the execute bit

Re: [PATCH] tpm: vtpm: constify vio_device_id

2017-08-18 Thread Jason Gunthorpe
On Fri, Aug 18, 2017 at 09:32:46PM +1000, Michael Ellerman wrote: > >> drivers/char/tpm/tpm_ibmvtpm.c | 2 +- > > Who merges changes for this driver? I assume it's Jarkko? Yes Jason

Re: [PATCH] tpm: vtpm: constify vio_device_id

2017-08-17 Thread Jason Gunthorpe
v <arvind.yadav...@gmail.com> Reviewed-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> > drivers/char/tpm/tpm_ibmvtpm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c > index f0

Regression from patch 'tty: hvc: hvc_poll() break hv read loop'

2018-09-04 Thread Jason Gunthorpe
Hi Nicholas, I am testing 4.19-rc2 and I see bad behavior with my qemu hvc0 console.. Running interactive with qemu (qemu-2.11.2-1.fc28) on the console providing hvc0, using options like: -nographic -chardev stdio,id=stdio,mux=on,signal=off -mon chardev=stdio

Re: Regression from patch 'tty: hvc: hvc_poll() break hv read loop'

2018-09-04 Thread Jason Gunthorpe
On Wed, Sep 05, 2018 at 07:15:29AM +1000, Nicholas Piggin wrote: > On Tue, 4 Sep 2018 11:48:08 -0600 > Jason Gunthorpe wrote: > > > Hi Nicholas, > > > > I am testing 4.19-rc2 and I see bad behavior with my qemu hvc0 > > console.. > > > > Runn

Re: [PATCH 0/3] tty: hvc: latency break regression fixes

2018-09-05 Thread Jason Gunthorpe
th another. > > I think those went upstream via Michael's tree, but he's away > at the moment so if you would be able to consider them for > the tty tree that would be appreciated. Series works for me too, thanks. Tested-by: Jason Gunthorpe Jason

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Tue, Mar 27, 2018 at 10:59:40AM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2018-03-26 at 16:50 -0600, Jason Gunthorpe wrote: > > On Tue, Mar 27, 2018 at 09:36:11AM +1100, Benjamin Herrenschmidt wrote: > > > On Mon, 2018-03-26 at 16:27 -0600, Jason Gunthorpe wrote: > >

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Jason Gunthorpe
On Tue, Mar 27, 2018 at 10:42:00AM +0100, Will Deacon wrote: > On Tue, Mar 27, 2018 at 09:56:47AM +0200, Arnd Bergmann wrote: > > On Tue, Mar 27, 2018 at 12:27 AM, Jason Gunthorpe <j...@ziepe.ca> wrote: > > > On Tue, Mar 27, 2018 at 09:01:57AM +1100, Benjamin Herrenschm

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Jason Gunthorpe
On Tue, Mar 27, 2018 at 08:22:55AM -0400, ok...@codeaurora.org wrote: > On 2018-03-27 07:23, Benjamin Herrenschmidt wrote: > >On Tue, 2018-03-27 at 11:44 +0200, Arnd Bergmann wrote: > >>> The interesting thing is that we do seem to have a whole LOT of these > >>> spurrious wmb before writel all

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Jason Gunthorpe
On Tue, Mar 27, 2018 at 09:56:47AM +0200, Arnd Bergmann wrote: > On Tue, Mar 27, 2018 at 12:27 AM, Jason Gunthorpe <j...@ziepe.ca> wrote: > > On Tue, Mar 27, 2018 at 09:01:57AM +1100, Benjamin Herrenschmidt wrote: > >> On Mon, 2018-03-26 at 17:46 -0400, Sinan Kaya wrote: &g

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Jason Gunthorpe
On Wed, Mar 28, 2018 at 11:13:45AM +0100, Will Deacon wrote: > On Wed, Mar 28, 2018 at 09:01:27PM +1100, Benjamin Herrenschmidt wrote: > > On Wed, 2018-03-28 at 11:55 +0200, Arnd Bergmann wrote: > > > > powerpc and ARM can't quite make them synchronous I think, but at least > > > > they should

Re: RFC on writel and writel_relaxed

2018-03-29 Thread Jason Gunthorpe
On Thu, Mar 29, 2018 at 02:58:34PM +, David Laight wrote: > From: Jason Gunthorpe > > Sent: 29 March 2018 15:45 > ... > > > > When talking about ordering between the devices, the relevant question > > > > is what happens if the writel(DEVICE_BAR) tri

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Mon, Mar 26, 2018 at 11:08:45AM +, David Laight wrote: > > > This is a super performance critical operation for most drivers and > > > directly impacts network performance. > > Perhaps there ought to be writel_nobarrier() (etc) that never contain > any barriers at all. > This might mean

Re: RFC on writel and writel_relaxed

2018-03-29 Thread Jason Gunthorpe
On Thu, Mar 29, 2018 at 10:19:41AM +0100, Will Deacon wrote: > On Wed, Mar 28, 2018 at 10:57:32AM -0600, Jason Gunthorpe wrote: > > On Wed, Mar 28, 2018 at 11:13:45AM +0100, Will Deacon wrote: > > > On Wed, Mar 28, 2018 at 09:01:27PM +1100, Benjamin Herrenschmidt wrote: > >

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Tue, Mar 27, 2018 at 09:36:11AM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2018-03-26 at 16:27 -0600, Jason Gunthorpe wrote: > > > Otherwise almost all drivers out there are broken which I very much > > > doubt :-) > > > > But.. Sinan is right, you look an

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Tue, Mar 27, 2018 at 09:01:57AM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2018-03-26 at 17:46 -0400, Sinan Kaya wrote: > > On 3/26/2018 5:30 PM, Arnd Bergmann wrote: > > > > But that was never a requirement of writel(), > > > > Documentation/memory-barriers.txt gives an explicit example

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Mon, Mar 26, 2018 at 09:44:15PM +0200, Arnd Bergmann wrote: > On Mon, Mar 26, 2018 at 6:54 PM, Jason Gunthorpe <j...@ziepe.ca> wrote: > > On Mon, Mar 26, 2018 at 11:08:45AM +, David Laight wrote: > >> > > This is a super performance critical operation for most

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Mon, Mar 26, 2018 at 10:43:43PM +0200, Arnd Bergmann wrote: > On Mon, Mar 26, 2018 at 10:25 PM, Jason Gunthorpe <j...@ziepe.ca> wrote: > > On Mon, Mar 26, 2018 at 09:44:15PM +0200, Arnd Bergmann wrote: > >> On Mon, Mar 26, 2018 at 6:54 PM, Jason Gunthorpe <j...@zie

Re: RFC on writel and writel_relaxed

2018-03-23 Thread Jason Gunthorpe
On Fri, Mar 23, 2018 at 12:52:02AM +1100, Benjamin Herrenschmidt wrote: > > > - Make writel_relaxed() be a simple store without barriers, and > > > readl_relaxed() be "eieio, read, eieio", thus allowing write combining > > > to happen between successive writel_relaxed on WC space (no change on >

Re: [PATCH v3 18/18] infiniband: cxgb4: Eliminate duplicate barriers on weakly-ordered archs

2018-03-18 Thread Jason Gunthorpe
On Sat, Mar 17, 2018 at 02:30:10PM -0400, Sinan Kaya wrote: > Somebody also has to take a task and work very hard to get rid of > __raw_writeX() > APIs in drivers/net directory. It looked like a very common practice though > it clearly violates multiarch portability concerns Jason and Deve

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-24 Thread Jason Gunthorpe
On Mon, Sep 24, 2018 at 10:18:52PM +0200, Arnd Bergmann wrote: > On Tue, Sep 18, 2018 at 7:59 PM Jason Gunthorpe wrote: > > > > On Tue, Sep 18, 2018 at 10:51:08AM -0700, Darren Hart wrote: > > > On Fri, Sep 14, 2018 at 09:57:48PM +0100, Al Viro wrote: > > > >

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-05 Thread Jason Gunthorpe
On Fri, Jan 04, 2019 at 02:44:01PM +1100, David Gibson wrote: > On Thu, Dec 06, 2018 at 08:45:09AM +0200, Leon Romanovsky wrote: > > On Thu, Dec 06, 2018 at 03:19:51PM +1100, David Gibson wrote: > > > Mellanox ConnectX-5 IB cards (MT27800) seem to cause a call trace when > > > unbound from their

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-07 Thread Jason Gunthorpe
On Sun, Jan 06, 2019 at 09:43:46AM +1100, Benjamin Herrenschmidt wrote: > On Sat, 2019-01-05 at 10:51 -0700, Jason Gunthorpe wrote: > > > > > Interesting. I've investigated this further, though I don't have as > > > many new clues as I'd like. The problem occurs reli

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-09 Thread Jason Gunthorpe
On Wed, Jan 09, 2019 at 04:09:02PM +1100, Benjamin Herrenschmidt wrote: > > POWER 8 firmware is good? If the link does eventually come back, is > > the POWER8's D3 resumption timeout long enough? > > > > If this doesn't lead to an obvious conclusion you'll probably need to > > connect to IBM's

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-12 Thread Jason Gunthorpe
const struct file_operations uverbs_mmap_fops = { > .release = ib_uverbs_close, > .llseek = no_llseek, > .unlocked_ioctl = ib_uverbs_ioctl, > - .compat_ioctl = ib_uverbs_ioctl, > + .compat_ioctl = generic_compat_ioctl_ptrarg, > }; > > static struct ib_client uverbs_client = { For uverbs: Acked-by: Jason Gunthorpe It is very strange, this patch did not appear in the RDMA patchworks, I almost missed it :| Jason

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-18 Thread Jason Gunthorpe
On Tue, Sep 18, 2018 at 10:51:08AM -0700, Darren Hart wrote: > On Fri, Sep 14, 2018 at 09:57:48PM +0100, Al Viro wrote: > > On Fri, Sep 14, 2018 at 01:35:06PM -0700, Darren Hart wrote: > > > > > Acked-by: Darren Hart (VMware) > > > > > > As for a longer term solution, would it be possible to

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Jason Gunthorpe
On Mon, Mar 25, 2019 at 01:42:26AM -0700, Ira Weiny wrote: > On Fri, Mar 22, 2019 at 03:12:55PM -0700, Dan Williams wrote: > > On Sun, Mar 17, 2019 at 7:36 PM wrote: > > > > > > From: Ira Weiny > > > > > > DAX pages were previously unprotected from longterm pins when users > > > called

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Jason Gunthorpe
On Mon, Mar 25, 2019 at 02:23:15AM -0700, Ira Weiny wrote: > > > Unfortunately holding the lock is required to support FOLL_LONGTERM (to > > > check > > > the VMAs) but we don't want to hold the lock to be optimal (specifically > > > allow > > > FAULT_FOLL_ALLOW_RETRY). So I'm maintaining the

Re: [PATCH 1/5] vfio/type1: use pinned_vm instead of locked_vm to account pinned pages

2019-02-13 Thread Jason Gunthorpe
On Wed, Feb 13, 2019 at 01:03:30PM -0700, Alex Williamson wrote: > > PeterZ posted an RFC that addresses this point[1]. It kept pinned_vm and > > locked_vm accounting separate, but allowed the two to be added safely to be > > compared against RLIMIT_MEMLOCK. > > Unless I'm incorrect in the

Re: [PATCH V2 3/7] mm/gup: Change GUP fast to use flags rather than a write 'bool'

2019-02-13 Thread Jason Gunthorpe
On Wed, Feb 13, 2019 at 03:04:51PM -0800, ira.we...@intel.com wrote: > From: Ira Weiny > > To facilitate additional options to get_user_pages_fast() change the > singular write parameter to be gup_flags. So now we have: long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,

Re: [PATCH 0/5] use pinned_vm instead of locked_vm to account pinned pages

2019-02-14 Thread Jason Gunthorpe
On Thu, Feb 14, 2019 at 11:33:53AM -0800, Ira Weiny wrote: > > I think it had to do with double accounting pinned and mlocked pages > > and thus delivering a lower than expected limit to userspace. > > > > vfio has this bug, RDMA does not. RDMA has a bug where it can > > overallocate locked

Re: [PATCH 0/5] use pinned_vm instead of locked_vm to account pinned pages

2019-02-14 Thread Jason Gunthorpe
On Thu, Feb 14, 2019 at 01:46:51PM -0800, Ira Weiny wrote: > > > > Really unclear how to fix this. The pinned/locked split with two > > > > buckets may be the right way. > > > > > > Are you suggesting that we have 2 user limits? > > > > This is what RDMA has done since CL's patch. > > I don't

Re: [PATCH 0/5] use pinned_vm instead of locked_vm to account pinned pages

2019-02-11 Thread Jason Gunthorpe
On Mon, Feb 11, 2019 at 05:44:32PM -0500, Daniel Jordan wrote: > Hi, > > This series converts users that account pinned pages with locked_vm to > account with pinned_vm instead, pinned_vm being the correct counter to > use. It's based on a similar patch I posted recently[0]. > > The patches are

Re: [PATCH 1/5] vfio/type1: use pinned_vm instead of locked_vm to account pinned pages

2019-02-11 Thread Jason Gunthorpe
On Mon, Feb 11, 2019 at 05:44:33PM -0500, Daniel Jordan wrote: > Beginning with bc3e53f682d9 ("mm: distinguish between mlocked and pinned > pages"), locked and pinned pages are accounted separately. Type1 > accounts pinned pages to locked_vm; use pinned_vm instead. > > pinned_vm recently became

Re: [PATCH 11/16] mm: consolidate the get_user_pages* implementations

2019-06-25 Thread Jason Gunthorpe
On Tue, Jun 25, 2019 at 09:56:50AM +0200, Christoph Hellwig wrote: > On Fri, Jun 21, 2019 at 11:41:31AM -0300, Jason Gunthorpe wrote: > > > static bool gup_fast_permitted(unsigned long start, unsigned long end) > > > { > > > - return true; > > > + return

Re: [PATCH 01/16] mm: use untagged_addr() for get_user_pages_fast addresses

2019-06-21 Thread Jason Gunthorpe
On Tue, Jun 11, 2019 at 04:40:47PM +0200, Christoph Hellwig wrote: > This will allow sparc64 to override its ADI tags for > get_user_pages and get_user_pages_fast. > > Signed-off-by: Christoph Hellwig > mm/gup.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

Re: [PATCH 03/16] mm: lift the x86_32 PAE version of gup_get_pte to common code

2019-06-21 Thread Jason Gunthorpe
| 51 --- > 5 files changed, 52 insertions(+), 52 deletions(-) Yep, the sh and mips conversions look right too. Reviewed-by: Jason Gunthorpe > diff --git a/mm/Kconfig b/mm/Kconfig > index f0c76ba47695..fe51f104a9e0 100644 > --- a/mm/Kconfig > +++ b/mm/Kc

Re: [PATCH 01/16] mm: use untagged_addr() for get_user_pages_fast addresses

2019-06-21 Thread Jason Gunthorpe
eletions(-) Reviewed-by: Jason Gunthorpe

Re: [PATCH 11/16] mm: consolidate the get_user_pages* implementations

2019-06-21 Thread Jason Gunthorpe
On Tue, Jun 11, 2019 at 04:40:57PM +0200, Christoph Hellwig wrote: > @@ -2168,7 +2221,7 @@ static void gup_pgd_range(unsigned long addr, unsigned > long end, > */ > static bool gup_fast_permitted(unsigned long start, unsigned long end) > { > - return true; > + return

Re: [PATCH 02/16] mm: simplify gup_fast_permitted

2019-06-21 Thread Jason Gunthorpe
> --- > arch/s390/include/asm/pgtable.h | 8 +--- > arch/x86/include/asm/pgtable_64.h | 8 +--- > mm/gup.c | 17 +++-- > 3 files changed, 9 insertions(+), 24 deletions(-) Much cleaner Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 10/16] mm: rename CONFIG_HAVE_GENERIC_GUP to CONFIG_HAVE_FAST_GUP

2019-06-21 Thread Jason Gunthorpe
On Tue, Jun 11, 2019 at 04:40:56PM +0200, Christoph Hellwig wrote: > We only support the generic GUP now, so rename the config option to > be more clear, and always use the mm/Kconfig definition of the > symbol and select it from the arch Kconfigs. Looks OK to me Reviewed-by: Jason

Re: [PATCH 04/16] MIPS: use the generic get_user_pages_fast code

2019-06-21 Thread Jason Gunthorpe
(!cpu_has_dc_aliases) > + Today this check is only being done on the get_user_pages_fast() - after this patch it is also done for __get_user_pages_fast(). Which means __get_user_pages_fast is now non-functional on a range of MIPS CPUs, but that seems OK as far as I can tell, so: Reviewed-by:

Re: [PATCH 01/16] mm: use untagged_addr() for get_user_pages_fast addresses

2019-06-21 Thread Jason Gunthorpe
On Fri, Jun 21, 2019 at 09:35:11AM -0600, Khalid Aziz wrote: > On 6/21/19 7:39 AM, Jason Gunthorpe wrote: > > On Tue, Jun 11, 2019 at 04:40:47PM +0200, Christoph Hellwig wrote: > >> This will allow sparc64 to override its ADI tags for > >> get_user_pages and get_user_p

Re: switch the remaining architectures to use generic GUP v3

2019-06-21 Thread Jason Gunthorpe
On Tue, Jun 11, 2019 at 04:40:46PM +0200, Christoph Hellwig wrote: > Hi Linus and maintainers, > > below is a series to switch mips, sh and sparc64 to use the generic > GUP code so that we only have one codebase to touch for further > improvements to this code. I don't have hardware for any of

Re: [PATCH] mm: add account_locked_vm utility function

2019-05-03 Thread Jason Gunthorpe
> Signed-off-by: Daniel Jordan > Cc: Alan Tull > Cc: Alexey Kardashevskiy > Cc: Alex Williamson > Cc: Andrew Morton > Cc: Benjamin Herrenschmidt > Cc: Christoph Lameter > Cc: Christophe Leroy > Cc: Davidlohr Bueso > Cc: Jason Gunthorpe > Cc: Mark Rutland >

Re: [PATCH v5 1/7] kvmppc: HMM backend driver to manage pages of secure guest

2019-07-10 Thread Jason Gunthorpe
On Tue, Jul 09, 2019 at 01:55:28PM -0500, janani wrote: > > +int kvmppc_hmm_init(void) > > +{ > > + int ret = 0; > > + unsigned long size; > > + > > + size = kvmppc_get_secmem_size(); > > + if (!size) { > > + ret = -ENODEV; > > + goto out; > > + } > > + > > +

Re: [PATCH v5 7/7] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-07-10 Thread Jason Gunthorpe
On Wed, Jul 10, 2019 at 08:24:56AM -0500, janani wrote: > On 2019-07-09 05:25, Bharata B Rao wrote: > > From: Anshuman Khandual > > > > CONFIG_PPC_UV adds support for ultravisor. > > > > Signed-off-by: Anshuman Khandual > > Signed-off-by: Bharata B Rao > > Signed-off-by: Ram Pai > > [ Update

Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-08 Thread Jason Gunthorpe
On Mon, Jul 08, 2019 at 06:24:04PM -0400, Mimi Zohar wrote: > Hi Jarkko, > > On Mon, 2019-07-08 at 18:11 +0300, Jarkko Sakkinen wrote: > > On Sat, 2019-07-06 at 20:18 -0400, Nayna Jain wrote: > > > +/* > > > + * tpm_get_pcr_allocation() - initialize the chip allocated banks for > > > PCRs > > >

Re: [PATCH 5/6] powerpc/mmu: drop mmap_sem now that locked_vm is atomic

2019-04-24 Thread Jason Gunthorpe
On Tue, Apr 23, 2019 at 07:15:44PM -0700, Davidlohr Bueso wrote: > On Wed, 03 Apr 2019, Daniel Jordan wrote: > > > On Wed, Apr 03, 2019 at 06:58:45AM +0200, Christophe Leroy wrote: > > > Le 02/04/2019 à 22:41, Daniel Jordan a écrit : > > > > With locked_vm now an atomic, there is no need to take

Re: [PATCH v2 07/18] infiniband: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-11-04 Thread Jason Gunthorpe
On Mon, Nov 04, 2019 at 12:48:13PM -0800, John Hubbard wrote: > On 11/4/19 12:33 PM, Jason Gunthorpe wrote: > ... > >> diff --git a/drivers/infiniband/core/umem.c > >> b/drivers/infiniband/core/umem.c > >> index 24244a2f68cc..c5a78d3e674b 100644 > >

Re: [PATCH v2 07/18] infiniband: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-11-04 Thread Jason Gunthorpe
On Sun, Nov 03, 2019 at 01:18:02PM -0800, John Hubbard wrote: > Convert infiniband to use the new wrapper calls, and stop > explicitly setting FOLL_LONGTERM at the call sites. > > The new pin_longterm_*() calls replace get_user_pages*() > calls, and set both FOLL_LONGTERM and a new FOLL_PIN >

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jason Gunthorpe
On Mon, Nov 04, 2019 at 03:31:53PM -0500, Jerome Glisse wrote: > > Note for Jason: the (a) or (b) items are talking about the vfio case, which > > is > > one of the two call sites that now use pin_longterm_pages_remote(), and the > > other one is infiniband: > > > >

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jason Gunthorpe
On Mon, Nov 04, 2019 at 12:57:59PM -0800, John Hubbard wrote: > On 11/4/19 12:37 PM, Jason Gunthorpe wrote: > > On Mon, Nov 04, 2019 at 03:31:53PM -0500, Jerome Glisse wrote: > >>> Note for Jason: the (a) or (b) items are talking about the vfio case, > >>> which i

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jason Gunthorpe
On Mon, Nov 04, 2019 at 12:09:05PM -0800, John Hubbard wrote: > Note for Jason: the (a) or (b) items are talking about the vfio case, which is > one of the two call sites that now use pin_longterm_pages_remote(), and the > other one is infiniband: > > drivers/infiniband/core/umem_odp.c:646:

Re: [PATCH v2 07/18] infiniband: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-11-04 Thread Jason Gunthorpe
On Mon, Nov 04, 2019 at 02:03:43PM -0800, John Hubbard wrote: > On 11/4/19 12:57 PM, Jason Gunthorpe wrote: > > On Mon, Nov 04, 2019 at 12:48:13PM -0800, John Hubbard wrote: > >> On 11/4/19 12:33 PM, Jason Gunthorpe wrote: > >> ... > >>>> diff --git

Re: [PATCH v4 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-13 Thread Jason Gunthorpe
ch in turn > calls check_dax_vmas(). It's lightly explained in the comments as well. > > Thanks to Jason Gunthorpe for pointing out a clean way to fix this, > and to Dan Williams for helping clarify the DAX refactoring. > > Suggested-by: Jason Gunthorpe > Cc: Dan Williams >

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Jason Gunthorpe
gt; to take advantage of this, fixing a bug as a result: the VFIO caller > is logically a FOLL_LONGTERM user. > > Thanks to Jason Gunthorpe for pointing out a clean way to fix this. > > Suggested-by: Jason Gunthorpe > Cc: Jerome Glisse > Cc: Ira Weiny > Signed-

Re: [PATCH v3 00/23] mm/gup: track dma-pinned pages: FOLL_PIN, FOLL_LONGTERM

2019-11-12 Thread Jason Gunthorpe
On Mon, Nov 11, 2019 at 04:06:37PM -0800, John Hubbard wrote: > Hi, > > The cover letter is long, so the more important stuff is first: > > * Jason, if you or someone could look at the the VFIO cleanup (patch 8) > and conversion to FOLL_PIN (patch 18), to make sure it's use of > remote and

Re: [PATCH v3 11/23] IB/{core,hw,umem}: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-11-12 Thread Jason Gunthorpe
On Mon, Nov 11, 2019 at 04:06:48PM -0800, John Hubbard wrote: > @@ -542,7 +541,7 @@ static int ib_umem_odp_map_dma_single_page( > } > > out: > - put_user_page(page); > + put_page(page); > > if (remove_existing_mapping) { >

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Jason Gunthorpe
On Tue, Nov 12, 2019 at 02:45:51PM -0800, Dan Williams wrote: > On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > > ... > > >> -} > > >> +ret = get_user_pages_remote(NULL

Re: [PATCH v5 09/24] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-15 Thread Jason Gunthorpe
ch in turn > calls check_dax_vmas(). It's lightly explained in the comments as well. > > Thanks to Jason Gunthorpe for pointing out a clean way to fix this, > and to Dan Williams for helping clarify the DAX refactoring. > > Suggested-by: Jason Gunthorpe > Cc: Dan Williams >

Re: [PATCH v5 12/24] IB/{core,hw,umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP

2019-11-15 Thread Jason Gunthorpe
| 2 +- > 8 files changed, 13 insertions(+), 14 deletions(-) Ok Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH v7 07/24] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-11-21 Thread Jason Gunthorpe
locked(), which takes the mmap_sem as needed. > > > > Reviewed-by: Jan Kara > > Reviewed-by: Jason Gunthorpe > > Reviewed-by: Ira Weiny > > Signed-off-by: John Hubbard > > Looks fine, > > Reviewed-by: Christoph Hellwig > > Jason, can you que

Re: [PATCH v7 07/24] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-11-24 Thread Jason Gunthorpe
return -EINVAL; While we think this WARN_ON is probably bogus, resolving this will have to wait. Signed-off-by: Jason Gunthorpe --- drivers/infiniband/core/umem.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/core/umem.c b/dri

Re: [PATCH v9 2/8] KVM: PPC: Move pages between normal and secure memory

2019-09-25 Thread Jason Gunthorpe
On Wed, Sep 25, 2019 at 10:36:43AM +0530, Bharata B Rao 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 normal page to secure page > H_SVM_PAGE_OUT: Move the

Re: [PATCH v9 0/8] KVM: PPC: Driver to manage pages of secure guest

2019-09-25 Thread Jason Gunthorpe
On Wed, Sep 25, 2019 at 10:36:41AM +0530, Bharata B Rao wrote: > [The main change in this version is the introduction of new > locking to prevent concurrent page-in and page-out calls. More > details about this are present in patch 2/8] > > Hi, > > A pseries guest can be run as a secure guest on

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-19 Thread Jason Gunthorpe
On Thu, Dec 19, 2019 at 12:30:31PM -0800, John Hubbard wrote: > On 12/19/19 5:26 AM, Leon Romanovsky wrote: > > On Mon, Dec 16, 2019 at 02:25:12PM -0800, John Hubbard wrote: > > > Hi, > > > > > > This implements an API naming change (put_user_page*() --> > > > unpin_user_page*()), and also

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-20 Thread Jason Gunthorpe
On Thu, Dec 19, 2019 at 01:13:54PM -0800, John Hubbard wrote: > On 12/19/19 1:07 PM, Jason Gunthorpe wrote: > > On Thu, Dec 19, 2019 at 12:30:31PM -0800, John Hubbard wrote: > > > On 12/19/19 5:26 AM, Leon Romanovsky wrote: > > > > On Mon, Dec 16, 2019 at 02:25:

  1   2   >