LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the mfd tree with the powerpc tree
From: Stephen Rothwell @ 2018-01-29  3:02 UTC (permalink / raw)
  To: Lee Jones, Michael Ellerman, Benjamin Herrenschmidt, PowerPC
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Frederic Barrat, Rui Feng

Hi Lee,

Today's linux-next merge of the mfd tree got conflicts in:

  drivers/misc/Kconfig
  drivers/misc/Makefile

between commit:

  b97f02246e0d ("ocxl: Add Makefile and Kconfig")

from the powerpc tree and commit:

  e455b69ddf9b ("misc: rtsx: Move Realtek Card Reader Driver to misc")

from the mfd tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/misc/Kconfig
index 0534f338c84a,7c0fa24f9067..000000000000
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@@ -508,5 -512,5 +512,6 @@@ source "drivers/misc/mic/Kconfig
  source "drivers/misc/genwqe/Kconfig"
  source "drivers/misc/echo/Kconfig"
  source "drivers/misc/cxl/Kconfig"
 +source "drivers/misc/ocxl/Kconfig"
+ source "drivers/misc/cardreader/Kconfig"
  endmenu
diff --cc drivers/misc/Makefile
index 73326d54e246,8d8cc096063b..000000000000
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@@ -55,7 -55,7 +55,8 @@@ obj-$(CONFIG_CXL_BASE)		+= cxl
  obj-$(CONFIG_ASPEED_LPC_CTRL)	+= aspeed-lpc-ctrl.o
  obj-$(CONFIG_ASPEED_LPC_SNOOP)	+= aspeed-lpc-snoop.o
  obj-$(CONFIG_PCI_ENDPOINT_TEST)	+= pci_endpoint_test.o
 +obj-$(CONFIG_OCXL)		+= ocxl/
+ obj-$(CONFIG_MISC_RTSX)	+= cardreader/
  
  lkdtm-$(CONFIG_LKDTM)		+= lkdtm_core.o
  lkdtm-$(CONFIG_LKDTM)		+= lkdtm_bugs.o

^ permalink raw reply

* Re: [v2] adb: properly mark continued kernel messages
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Andreas Schwab, Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <87oa0zpcvg.fsf_-_@linux-m68k.org>

On Mon, 2016-11-28 at 20:29:07 UTC, Andreas Schwab wrote:
> Use pr_cont where appropriate, and switch to pr_foo throughout.
> Additionally, lower messages in adb_probe_task to debug level.
> 
> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f2be6295684b0fe879a824ac974797

cheers

^ permalink raw reply

* Re: [v2,3/9] powerpc: mpc52xx_gpt: make use of raw_spinlock variants
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Julia Cartwright, Anatolij Gustschin, Benjamin Herrenschmidt,
	Paul Mackerras
  Cc: linuxppc-dev, linux-kernel, linux-rt-users
In-Reply-To: <2142489eb41f758b5d04919a8efbb16794f16b0f.1490135047.git.julia@ni.com>

On Tue, 2017-03-21 at 22:43:03 UTC, Julia Cartwright wrote:
> The mpc52xx_gpt code currently implements an irq_chip for handling
> interrupts; due to how irq_chip handling is done, it's necessary for the
> irq_chip methods to be invoked from hardirq context, even on a a
> real-time kernel.  Because the spinlock_t type becomes a "sleeping"
> spinlock w/ RT kernels, it is not suitable to be used with irq_chips.
> 
> A quick audit of the operations under the lock reveal that they do only
> minimal, bounded work, and are therefore safe to do under a raw spinlock.
> 
> Signed-off-by: Julia Cartwright <julia@ni.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/77720c82915a8b7797e0041af95707

cheers

^ permalink raw reply

* Re: rtc-opal: Fix handling of firmware error codes, prevent busy loops
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Stewart Smith, linuxppc-dev; +Cc: neelegup, Stewart Smith, stable
In-Reply-To: <1470102616-18346-1-git-send-email-stewart@linux.vnet.ibm.com>

On Tue, 2016-08-02 at 01:50:16 UTC, Stewart Smith wrote:
> According to the OPAL docs:
> https://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txt
> https://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
> OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and this
> indicates either a transient or permanent error.
> 
> Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a
> permanent error particularly well, in that you could end up in a busy
> loop.
> 
> This was not too hard to trigger on an AMI BMC based OpenPOWER machine
> doing a continuous "ipmitool mc reset cold" to the BMC, the result of
> that being that we'd get stuck in an infinite loop in opal_get_rtc_time.
> 
> We now retry a few times before returning the error higher up the stack.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5b8b58063029f02da573120ef4dc90

cheers

^ permalink raw reply

* Re: [kernel] powerpc/powernv/idoa: Remove unnecessary pcidev from pci_dn
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Alexey Kardashevskiy, linuxppc-dev; +Cc: Alexey Kardashevskiy
In-Reply-To: <20171023080702.23479-1-aik@ozlabs.ru>

On Mon, 2017-10-23 at 08:07:02 UTC, Alexey Kardashevskiy wrote:
> The pcidev value stored in pci_dn is only used for NPU/NPU2
> initialization. We can easily drop the cached pointer and
> use an ancient helper - pci_get_domain_bus_and_slot() instead in order
> to reduce complexity.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Acked-by: Russell Currey <ruscur@russell.cc>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/902bdc57451c2c64aa139bbe24067f

cheers

^ permalink raw reply

* Re: [1/3] powerpc/watchdog: Tweak watchdog printks
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: npiggin
In-Reply-To: <1507783474-28210-1-git-send-email-mpe@ellerman.id.au>

On Thu, 2017-10-12 at 04:44:32 UTC, Michael Ellerman wrote:
> Use pr_fmt() in the watchdog code, so we don't have to say "Watchdog"
> so many times.
> 
> Rather than "CPU:%d" just spell it "CPU %d", "Hard" doesn't need a
> capital in the middle of a sentence, and "LOCKUP other CPUS" should be
> "LOCKUP on other CPUS".
> 
> Also make it clear when a CPU self detects a lockup by spelling it
> out.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Series applied to powerpc next.

https://git.kernel.org/powerpc/c/d8fa82e0e2b1ad9c66aa76810615ad

cheers

^ permalink raw reply

* Re: powerpc/cell: Remove axonram driver
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev
In-Reply-To: <1509666992-4649-1-git-send-email-mpe@ellerman.id.au>

On Thu, 2017-11-02 at 23:56:32 UTC, Michael Ellerman wrote:
> The QS21/22 IBM Cell blades had a southbridge chip called Axon. This
> could have DDR DIMMs attached to it, though they were not directly
> usable as RAM, instead they could be used as some sort of buffer, if
> applications were written specifically to use the block device
> provided by the driver.
> 
> Although the driver supposedly had direct access support, it was
> apparently never tested (see commit 91117a20245b ("axonram: Fix bug in
> direct_access")).
> 
> These machines have not been available for over 5 years, and were
> never widely in use. It seems highly unlikely anyone is using this
> driver.
> 
> In general we're happy to leave old drivers in the tree, but because
> DAX is involved this driver is caught up in the ongoing work in that
> area, but none of the DAX folks are able to test it.
> 
> So remove the driver, if any one *is* using it, we'll be happy to put
> it back.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/1d65b1c886be6111f2347bd1a548be

cheers

^ permalink raw reply

* Re: [V8,1/3] powerpc/nodes: Ensure enough nodes avail for operations
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Michael Bringmann, linuxppc-dev; +Cc: Nathan Fontenot, Michael Bringmann
In-Reply-To: <4faec177-a704-1404-c7ae-7f064153de2b@linux.vnet.ibm.com>

On Tue, 2017-11-28 at 22:58:36 UTC, Michael Bringmann wrote:
> On powerpc systems which allow 'hot-add' of CPU or memory resources,
> it may occur that the new resources are to be inserted into nodes
> that were not used for these resources at bootup.  In the kernel,
> any node that is used must be defined and initialized.  These empty
> nodes may occur when,
> 
> * Dedicated vs. shared resources.  Shared resources require
>   information such as the VPHN hcall for CPU assignment to nodes.
>   Associativity decisions made based on dedicated resource rules,
>   such as associativity properties in the device tree, may vary
>   from decisions made using the values returned by the VPHN hcall.
> * memoryless nodes at boot.  Nodes need to be defined as 'possible'
>   at boot for operation with other code modules.  Previously, the
>   powerpc code would limit the set of possible nodes to those which
>   have memory assigned at boot, and were thus online.  Subsequent
>   add/remove of CPUs or memory would only work with this subset of
>   possible nodes.
> * memoryless nodes with CPUs at boot.  Due to the previous restriction
>   on nodes, nodes that had CPUs but no memory were being collapsed
>   into other nodes that did have memory at boot.  In practice this
>   meant that the node assignment presented by the runtime kernel
>   differed from the affinity and associativity attributes presented
>   by the device tree or VPHN hcalls.  Nodes that might be known to
>   the pHyp were not 'possible' in the runtime kernel because they did
>   not have memory at boot.
> 
> This patch ensures that sufficient nodes are defined to support
> configuration requirements after boot, as well as at boot.  This
> patch set fixes a couple of problems.
> 
> * Nodes known to powerpc to be memoryless at boot, but to have
>   CPUs in them are allowed to be 'possible' and 'online'.  Memory
>   allocations for those nodes are taken from another node that does
>   have memory until and if memory is hot-added to the node.
> * Nodes which have no resources assigned at boot, but which may still
>   be referenced subsequently by affinity or associativity attributes,
>   are kept in the list of 'possible' nodes for powerpc.  Hot-add of
>   memory or CPUs to the system can reference these nodes and bring
>   them online instead of redirecting to one of the set of nodes that
>   were known to have memory at boot.
> 
> This patch extracts the value of the lowest domain level (number of
> allocable resources) from the device tree property
> "ibm,max-associativity-domains" to use as the maximum number of nodes
> to setup as possibly available in the system.  This new setting will
> override the instruction,
> 
>     nodes_and(node_possible_map, node_possible_map, node_online_map);
> 
> presently seen in the function arch/powerpc/mm/numa.c:initmem_init().
> 
> If the "ibm,max-associativity-domains" property is not present at boot,
> no operation will be performed to define or enable additional nodes, or
> enable the above 'nodes_and()'.
> 
> Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
> Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a346137e9142b039fd13af2e59696e

cheers

^ permalink raw reply

* Re: [1/1] : powerpc: block interrupts when updating TIDR
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: felix, linuxppc-dev, clombard, linux-kernel, vaibhav
In-Reply-To: <20171201213140.GA2776@us.ibm.com>

On Fri, 2017-12-01 at 21:31:40 UTC, Sukadev Bhattiprolu wrote:
> From: Sukadev Bhattiprolu <sukadev@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 interrupt). To prevent
> a deadlock, block interrupts when holding vas_thread_id_lock to set/
> clear TIDR for a task.
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/384dfd627f1ee67d028e6f14c6e9bf

cheers

^ permalink raw reply

* Re: [2/2] powerpc/pseries, ps3: panic flush kernel messages before halting system
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin, David Gibson
In-Reply-To: <20171223164923.10587-3-npiggin@gmail.com>

On Sat, 2017-12-23 at 16:49:23 UTC, Nicholas Piggin wrote:
> Platforms with a panic handler that halts the system can have problems
> getting kernel messages out, because the panic notifiers are called
> before kernel/panic.c does its flushing of printk buffers an console
> etc.
> 
> This was attempted to be solved with commit a3b2cb30f252 ("powerpc: Do
> not call ppc_md.panic in fadump panic notifier"), but that wasn't the
> right approach and caused other problems, and was reverted by commit
> ab9dbf771ff9.
> 
> Instead, the powernv shutdown paths have already had a similar
> problem, fixed by taking the message flushing sequence from
> kernel/panic.c. That's a little bit ugly, but while we have the code
> duplicated, it will work for this case as well. So have ppc panic
> handlers do the same flushing before they terminate.
> 
> Without this patch, a qemu pseries_le_defconfig guest stops silently
> when issued the nmi command when xmon is off and no crash dumpers
> enabled. Afterwards, an oops is printed by each CPU as expected.
> 
> Fixes: ab9dbf771ff9 ("Revert "powerpc: Do not call ppc_md.panic in fadump panic notifier"")
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/35adacd6fc48d658419522f192a3c8

cheers

^ permalink raw reply

* Re: [v4,7/7] pseries/setup: Add Initialization of VF Bars
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Bryant G. Ly, benh, paulus
  Cc: jjalvare, aik, linux-pci, eli, saeedm, alex.williamson, helgaas,
	seroyer, Bryant G. Ly, linuxppc-dev, bodong
In-Reply-To: <20180105164552.36371-8-bryantly@linux.vnet.ibm.com>

On Fri, 2018-01-05 at 16:45:52 UTC, "Bryant G. Ly" wrote:
> When enabling SR-IOV in pseries platform,
> the VF bar properties for a PF are reported on
> the device node in the device tree.
> 
> This patch adds the IOV Bar resources to Linux
> structures from the device tree for later use
> when configuring SR-IOV by PF driver.
> 
> Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
> Signed-off-by: Juan J. Alvarez <jjalvare@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/fc5f622163637308a3d520a3155274

cheers

^ permalink raw reply

* Re: [v4,1/7] platform/pseries: Update VF config space after EEH
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Bryant G. Ly, benh, paulus
  Cc: jjalvare, aik, linux-pci, eli, saeedm, alex.williamson, helgaas,
	seroyer, Bryant G. Ly, linuxppc-dev, bodong
In-Reply-To: <20180105164552.36371-2-bryantly@linux.vnet.ibm.com>

On Fri, 2018-01-05 at 16:45:46 UTC, "Bryant G. Ly" wrote:
> Add EEH platform operations for pseries to update VF
> config space. With this change after EEH, the VF
> will have updated config space for pseries platform.
> 
> Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
> Signed-off-by: Juan J. Alvarez <jjalvare@linux.vnet.ibm.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/64ba3dc7bf7cb0cbc89821db54edfe

cheers

^ permalink raw reply

* Re: powerpc/64s: Improve RFI L1-D cache flush fallback
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20180117135818.10241-1-npiggin@gmail.com>

On Wed, 2018-01-17 at 13:58:18 UTC, Nicholas Piggin wrote:
> The fallback RFI flush is used when firmware does not provide a way
> to flush the cache. It's a "displacement flush" that evicts useful
> data by displacing it with an uninteresting buffer.
> 
> The flush has to take care to work with implementation specific cache
> replacment policies, so the recipe has been in flux. The initial
> slow but conservative approach is to touch all lines of a congruence
> class, with dependencies between each load. It has since been
> determined that a linear pattern of loads without dependencies is
> sufficient, and is significantly faster.
> 
> Measuring the speed of a null syscall with RFI fallback flush enabled
> gives the relative improvement:
> 
> P8 - 1.83x
> P9 - 1.75x
> 
> The flush also becomes simpler and more adaptable to different cache
> geometries.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/bdcb1aefc5b3f7d0f1dc8b02673602

cheers

^ permalink raw reply

* Re: [v2, 01/13] powerpc/powernv: Introduce new PHB type for opencapi links
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Frederic Barrat, linuxppc-dev, linux-kernel
  Cc: gregkh, alastair, andrew.donnellan, arnd
In-Reply-To: <20180123113148.6024-2-fbarrat@linux.vnet.ibm.com>

On Tue, 2018-01-23 at 11:31:36 UTC, Frederic Barrat wrote:
> The NPU was already abstracted by opal as a virtual PHB for nvlink,
> but it helps to be able to differentiate between a nvlink or opencapi
> PHB, as it's not completely transparent to linux. In particular, PE
> assignment differs and we'll also need the information in later
> patches.
> 
> So rename existing PNV_PHB_NPU type to PNV_PHB_NPU_NVLINK and add a
> new type PNV_PHB_NPU_OCAPI.
> 
> Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/7f2c39e91f61fcd2abed3b39c14e70

cheers

^ permalink raw reply

* Re: macintosh: change some data types from int to bool
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Colin Leroy, Benjamin Herrenschmidt
  Cc: Gustavo A. R. Silva, linuxppc-dev, linux-kernel
In-Reply-To: <20180124014228.GA26899@embeddedgus>

On Wed, 2018-01-24 at 01:42:28 UTC, "Gustavo A. R. Silva" wrote:
> Change the data type of the following variables from int to bool
> across all macintosh drivers:
> 
> started
> slots_started
> pm121_started
> wf_smu_started
> 
> Some of these issues were detected with the help of Coccinelle.
> 
> Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/4f256d561447c6e1bf8b70e19daae0

cheers

^ permalink raw reply

* Re: powerpc/mm/nohash: do not flush the entire mm when range is a single page
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Scott Wood
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20180123132250.4A2BD6EF69@localhost.localdomain>

On Tue, 2018-01-23 at 13:22:50 UTC, Christophe Leroy wrote:
> Most of the time, flush_tlb_range() is called on single pages.
> At the time being, flush_tlb_range() inconditionnaly calls
> flush_tlb_mm() which flushes at least the entire PID pages and on
> older CPUs like 4xx or 8xx it flushes the entire TLB table.
> 
> This patch calls flush_tlb_page() instead of flush_tlb_mm() when
> the range is a single page.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5c8136fa1af7c0e9b4aec89cf2832f

cheers

^ permalink raw reply

* Re: macintosh/ams-input: Use true and false for boolean values
From: Michael Ellerman @ 2018-01-29  4:13 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Michael Hanselmann, Benjamin Herrenschmidt
  Cc: Gustavo A. R. Silva, linuxppc-dev, linux-kernel
In-Reply-To: <20180124014846.GA27664@embeddedgus>

On Wed, 2018-01-24 at 01:48:46 UTC, "Gustavo A. R. Silva" wrote:
> Assign true or false to boolean variables instead of an integer value.
> 
> This issue was detected with the help of Coccinelle
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Reviewed-by: Michael Hanselmann <public@hansmi.ch>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/516c32f64f144721ca05b881737e44

cheers

^ permalink raw reply

* linux-next: manual merge of the nvdimm tree with the powerpc tree
From: Stephen Rothwell @ 2018-01-29  6:01 UTC (permalink / raw)
  To: Dan Williams, Michael Ellerman, Benjamin Herrenschmidt, PowerPC
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List

Hi Dan,

Today's linux-next merge of the nvdimm tree got a conflict in:

  arch/powerpc/platforms/Kconfig

between commit:

  1d65b1c886be ("powerpc/cell: Remove axonram driver")

from the powerpc tree and commit:

  569d0365f571 ("dax: require 'struct page' by default for filesystem dax")

from the nvdimm tree.

I fixed it up (I just used the former version) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply

* linux-next: manual merge of the nvdimm tree with the powerpc tree
From: Stephen Rothwell @ 2018-01-29  6:04 UTC (permalink / raw)
  To: Dan Williams, Michael Ellerman, Benjamin Herrenschmidt, PowerPC
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List

Hi Dan,

Today's linux-next merge of the nvdimm tree got a conflict in:

  arch/powerpc/sysdev/axonram.c

between commit:

  1d65b1c886be ("powerpc/cell: Remove axonram driver")

from the powerpc tree and commit:

  785a3fab4adb ("mm, dax: introduce pfn_t_special()")

from the nvdimm tree.

I fixed it up (I just removed the file) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply

* Re: [PATCH v3 1/5] powerpc/mm: Remove intermediate bitmap copy in 'slices'
From: Aneesh Kumar K.V @ 2018-01-29  6:17 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Scott Wood
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <6920f6efe2dcdabf59350b2d31ee6bd4bdef57f4.1516783089.git.christophe.leroy@c-s.fr>

Christophe Leroy <christophe.leroy@c-s.fr> writes:

> bitmap_or() and bitmap_andnot() can work properly with dst identical
> to src1 or src2. There is no need of an intermediate result bitmap
> that is copied back to dst in a second step.
>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>  v2: New in v2
>  v3: patch moved up front of the serie to avoid ephemeral slice_bitmap_copy() function in following patch
>
>  arch/powerpc/mm/slice.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
> index 23ec2c5e3b78..98b53d48968f 100644
> --- a/arch/powerpc/mm/slice.c
> +++ b/arch/powerpc/mm/slice.c
> @@ -388,21 +388,17 @@ static unsigned long slice_find_area(struct mm_struct *mm, unsigned long len,
>  
>  static inline void slice_or_mask(struct slice_mask *dst, struct slice_mask *src)
>  {
> -	DECLARE_BITMAP(result, SLICE_NUM_HIGH);
> -
>  	dst->low_slices |= src->low_slices;
> -	bitmap_or(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH);
> -	bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH);
> +	bitmap_or(dst->high_slices, dst->high_slices, src->high_slices,
> +		  SLICE_NUM_HIGH);
>  }
>  
>  static inline void slice_andnot_mask(struct slice_mask *dst, struct slice_mask *src)
>  {
> -	DECLARE_BITMAP(result, SLICE_NUM_HIGH);
> -
>  	dst->low_slices &= ~src->low_slices;
>  
> -	bitmap_andnot(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH);
> -	bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH);
> +	bitmap_andnot(dst->high_slices, dst->high_slices, src->high_slices,
> +		      SLICE_NUM_HIGH);
>  }
>  
>  #ifdef CONFIG_PPC_64K_PAGES
> -- 
> 2.13.3

^ permalink raw reply

* Re: [PATCH v3 4/5] powerpc/mm: Allow up to 64 low slices
From: Aneesh Kumar K.V @ 2018-01-29  6:29 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Scott Wood
  Cc: linux-kernel, linuxppc-dev
In-Reply-To: <5dfafb3f0e2438e43f44917ffcf70e3daa4f37ee.1516783089.git.christophe.leroy@c-s.fr>

Christophe Leroy <christophe.leroy@c-s.fr> writes:

> While the implementation of the "slices" address space allows
> a significant amount of high slices, it limits the number of
> low slices to 16 due to the use of a single u64 low_slices_psize
> element in struct mm_context_t
>
> On the 8xx, the minimum slice size is the size of the area
> covered by a single PMD entry, ie 4M in 4K pages mode and 64M in
> 16K pages mode. This means we could have at least 64 slices.
>
> In order to override this limitation, this patch switches the
> handling of low_slices_psize to char array as done already for
> high_slices_psize. This allows to increase the number of low
> slices to 64 on the 8xx.
>

Maybe update the subject to "make low slice also a bitmap".Also indicate
that the bitmap functions optimize the operation if the bitmapsize les
<= long ?

Also switch the 8xx to higher value in the another patch?

> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>  v2: Usign slice_bitmap_xxx() macros instead of bitmap_xxx() functions.
>  v3: keep low_slices as a u64, this allows 64 slices which is enough.
>  
>  arch/powerpc/include/asm/book3s/64/mmu.h |  3 +-
>  arch/powerpc/include/asm/mmu-8xx.h       |  7 +++-
>  arch/powerpc/include/asm/paca.h          |  2 +-
>  arch/powerpc/include/asm/slice.h         |  1 -
>  arch/powerpc/include/asm/slice_32.h      |  2 ++
>  arch/powerpc/include/asm/slice_64.h      |  2 ++
>  arch/powerpc/kernel/paca.c               |  3 +-
>  arch/powerpc/mm/hash_utils_64.c          | 13 ++++----
>  arch/powerpc/mm/slb_low.S                |  8 +++--
>  arch/powerpc/mm/slice.c                  | 57 +++++++++++++++++---------------
>  10 files changed, 56 insertions(+), 42 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h
> index c9448e19847a..b076a2d74c69 100644
> --- a/arch/powerpc/include/asm/book3s/64/mmu.h
> +++ b/arch/powerpc/include/asm/book3s/64/mmu.h
> @@ -91,7 +91,8 @@ typedef struct {
>  	struct npu_context *npu_context;
>  
>  #ifdef CONFIG_PPC_MM_SLICES
> -	u64 low_slices_psize;	/* SLB page size encodings */
> +	 /* SLB page size encodings*/
> +	unsigned char low_slices_psize[BITS_PER_LONG / BITS_PER_BYTE];
>  	unsigned char high_slices_psize[SLICE_ARRAY_SIZE];
>  	unsigned long slb_addr_limit;
>  #else
> diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h
> index 5f89b6010453..5f37ba06b56c 100644
> --- a/arch/powerpc/include/asm/mmu-8xx.h
> +++ b/arch/powerpc/include/asm/mmu-8xx.h
> @@ -164,6 +164,11 @@
>   */
>  #define SPRN_M_TW	799
>  
> +#ifdef CONFIG_PPC_MM_SLICES
> +#include <asm/slice_32.h>
> +#define SLICE_ARRAY_SIZE	(1 << (32 - SLICE_LOW_SHIFT - 1))
> +#endif
> +
>  #ifndef __ASSEMBLY__
>  typedef struct {
>  	unsigned int id;
> @@ -171,7 +176,7 @@ typedef struct {
>  	unsigned long vdso_base;
>  #ifdef CONFIG_PPC_MM_SLICES
>  	u16 user_psize;		/* page size index */
> -	u64 low_slices_psize;	/* page size encodings */
> +	unsigned char low_slices_psize[SLICE_ARRAY_SIZE];
>  	unsigned char high_slices_psize[0];
>  	unsigned long slb_addr_limit;
>  #endif
> diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
> index 23ac7fc0af23..a3e531fe9ac7 100644
> --- a/arch/powerpc/include/asm/paca.h
> +++ b/arch/powerpc/include/asm/paca.h
> @@ -141,7 +141,7 @@ struct paca_struct {
>  #ifdef CONFIG_PPC_BOOK3S
>  	mm_context_id_t mm_ctx_id;
>  #ifdef CONFIG_PPC_MM_SLICES
> -	u64 mm_ctx_low_slices_psize;
> +	unsigned char mm_ctx_low_slices_psize[BITS_PER_LONG / BITS_PER_BYTE];
>  	unsigned char mm_ctx_high_slices_psize[SLICE_ARRAY_SIZE];
>  	unsigned long mm_ctx_slb_addr_limit;
>  #else
> diff --git a/arch/powerpc/include/asm/slice.h b/arch/powerpc/include/asm/slice.h
> index 2b4b70de7e71..b67ba8faa507 100644
> --- a/arch/powerpc/include/asm/slice.h
> +++ b/arch/powerpc/include/asm/slice.h
> @@ -16,7 +16,6 @@
>  #define HAVE_ARCH_UNMAPPED_AREA
>  #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
>  
> -#define SLICE_LOW_SHIFT		28
>  #define SLICE_LOW_TOP		(0x100000000ull)
>  #define SLICE_NUM_LOW		(SLICE_LOW_TOP >> SLICE_LOW_SHIFT)
>  #define GET_LOW_SLICE_INDEX(addr)	((addr) >> SLICE_LOW_SHIFT)
> diff --git a/arch/powerpc/include/asm/slice_32.h b/arch/powerpc/include/asm/slice_32.h
> index 7e27c0dfb913..349187c20100 100644
> --- a/arch/powerpc/include/asm/slice_32.h
> +++ b/arch/powerpc/include/asm/slice_32.h
> @@ -2,6 +2,8 @@
>  #ifndef _ASM_POWERPC_SLICE_32_H
>  #define _ASM_POWERPC_SLICE_32_H
>  
> +#define SLICE_LOW_SHIFT		26	/* 64 slices */
> +
>  #define SLICE_HIGH_SHIFT	0
>  #define SLICE_NUM_HIGH		0ul
>  #define GET_HIGH_SLICE_INDEX(addr)	(addr & 0)
> diff --git a/arch/powerpc/include/asm/slice_64.h b/arch/powerpc/include/asm/slice_64.h
> index 9d1c97b83010..0959475239c6 100644
> --- a/arch/powerpc/include/asm/slice_64.h
> +++ b/arch/powerpc/include/asm/slice_64.h
> @@ -2,6 +2,8 @@
>  #ifndef _ASM_POWERPC_SLICE_64_H
>  #define _ASM_POWERPC_SLICE_64_H
>  
> +#define SLICE_LOW_SHIFT		28
> +

You are moving the LOW_SHIFT here, may be you can fix that up in earlier
patch as reviewed there.

>  #define SLICE_HIGH_SHIFT	40
>  #define SLICE_NUM_HIGH		(H_PGTABLE_RANGE >> SLICE_HIGH_SHIFT)
>  #define GET_HIGH_SLICE_INDEX(addr)	((addr) >> SLICE_HIGH_SHIFT)
> diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
> index d6597038931d..8e1566bf82b8 100644
> --- a/arch/powerpc/kernel/paca.c
> +++ b/arch/powerpc/kernel/paca.c
> @@ -264,7 +264,8 @@ void copy_mm_to_paca(struct mm_struct *mm)
>  #ifdef CONFIG_PPC_MM_SLICES
>  	VM_BUG_ON(!mm->context.slb_addr_limit);
>  	get_paca()->mm_ctx_slb_addr_limit = mm->context.slb_addr_limit;
> -	get_paca()->mm_ctx_low_slices_psize = context->low_slices_psize;
> +	memcpy(&get_paca()->mm_ctx_low_slices_psize,
> +	       &context->low_slices_psize, sizeof(context->low_slices_psize));
>  	memcpy(&get_paca()->mm_ctx_high_slices_psize,
>  	       &context->high_slices_psize, TASK_SLICE_ARRAY_SZ(mm));
>  #else /* CONFIG_PPC_MM_SLICES */
> diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
> index 655a5a9a183d..da696565b969 100644
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -1097,19 +1097,18 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
>  #ifdef CONFIG_PPC_MM_SLICES
>  static unsigned int get_paca_psize(unsigned long addr)
>  {
> -	u64 lpsizes;
> -	unsigned char *hpsizes;
> +	unsigned char *psizes;
>  	unsigned long index, mask_index;
>  
>  	if (addr < SLICE_LOW_TOP) {
> -		lpsizes = get_paca()->mm_ctx_low_slices_psize;
> +		psizes = get_paca()->mm_ctx_low_slices_psize;
>  		index = GET_LOW_SLICE_INDEX(addr);
> -		return (lpsizes >> (index * 4)) & 0xF;
> +	} else {
> +		psizes = get_paca()->mm_ctx_high_slices_psize;
> +		index = GET_HIGH_SLICE_INDEX(addr);
>  	}
> -	hpsizes = get_paca()->mm_ctx_high_slices_psize;
> -	index = GET_HIGH_SLICE_INDEX(addr);
>  	mask_index = index & 0x1;
> -	return (hpsizes[index >> 1] >> (mask_index * 4)) & 0xF;
> +	return (psizes[index >> 1] >> (mask_index * 4)) & 0xF;
>  }
>  
>  #else
> diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
> index 2cf5ef3fc50d..2c7c717fd2ea 100644
> --- a/arch/powerpc/mm/slb_low.S
> +++ b/arch/powerpc/mm/slb_low.S
> @@ -200,10 +200,12 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEGMENT)
>  5:
>  	/*
>  	 * Handle lpsizes
> -	 * r9 is get_paca()->context.low_slices_psize, r11 is index
> +	 * r9 is get_paca()->context.low_slices_psize[index], r11 is mask_index
>  	 */
> -	ld	r9,PACALOWSLICESPSIZE(r13)
> -	mr	r11,r10
> +	srdi    r11,r10,1 /* index */
> +	addi	r9,r11,PACALOWSLICESPSIZE
> +	lbzx	r9,r13,r9		/* r9 is lpsizes[r11] */
> +	rldicl	r11,r10,0,63		/* r11 = r10 & 0x1 */
>  6:
>  	sldi	r11,r11,2  /* index * 4 */
>  	/* Extract the psize and multiply to get an array offset */
> diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
> index 549704dfa777..3d573a038d42 100644
> --- a/arch/powerpc/mm/slice.c
> +++ b/arch/powerpc/mm/slice.c
> @@ -148,18 +148,20 @@ static void slice_mask_for_free(struct mm_struct *mm, struct slice_mask *ret,
>  static void slice_mask_for_size(struct mm_struct *mm, int psize, struct slice_mask *ret,
>  				unsigned long high_limit)
>  {
> -	unsigned char *hpsizes;
> +	unsigned char *hpsizes, *lpsizes;
>  	int index, mask_index;
>  	unsigned long i;
> -	u64 lpsizes;
>  
>  	ret->low_slices = 0;
>  	slice_bitmap_zero(ret->high_slices, SLICE_NUM_HIGH);
>  
>  	lpsizes = mm->context.low_slices_psize;
> -	for (i = 0; i < SLICE_NUM_LOW; i++)
> -		if (((lpsizes >> (i * 4)) & 0xf) == psize)
> +	for (i = 0; i < SLICE_NUM_LOW; i++) {
> +		mask_index = i & 0x1;
> +		index = i >> 1;
> +		if (((lpsizes[index] >> (mask_index * 4)) & 0xf) == psize)
>  			ret->low_slices |= 1u << i;
> +	}
>  
>  	if (high_limit <= SLICE_LOW_TOP)
>  		return;
> @@ -211,8 +213,7 @@ static void slice_convert(struct mm_struct *mm, struct slice_mask mask, int psiz
>  {
>  	int index, mask_index;
>  	/* Write the new slice psize bits */
> -	unsigned char *hpsizes;
> -	u64 lpsizes;
> +	unsigned char *hpsizes, *lpsizes;
>  	unsigned long i, flags;
>  
>  	slice_dbg("slice_convert(mm=%p, psize=%d)\n", mm, psize);
> @@ -225,12 +226,13 @@ static void slice_convert(struct mm_struct *mm, struct slice_mask mask, int psiz
>  
>  	lpsizes = mm->context.low_slices_psize;
>  	for (i = 0; i < SLICE_NUM_LOW; i++)
> -		if (mask.low_slices & (1u << i))
> -			lpsizes = (lpsizes & ~(0xful << (i * 4))) |
> -				(((unsigned long)psize) << (i * 4));
> -
> -	/* Assign the value back */
> -	mm->context.low_slices_psize = lpsizes;
> +		if (mask.low_slices & (1u << i)) {
> +			mask_index = i & 0x1;
> +			index = i >> 1;
> +			lpsizes[index] = (lpsizes[index] &
> +					  ~(0xf << (mask_index * 4))) |
> +				(((unsigned long)psize) << (mask_index * 4));
> +		}
>  
>  	hpsizes = mm->context.high_slices_psize;
>  	for (i = 0; i < GET_HIGH_SLICE_INDEX(mm->context.slb_addr_limit); i++) {
> @@ -629,7 +631,7 @@ unsigned long arch_get_unmapped_area_topdown(struct file *filp,
>  
>  unsigned int get_slice_psize(struct mm_struct *mm, unsigned long addr)
>  {
> -	unsigned char *hpsizes;
> +	unsigned char *psizes;
>  	int index, mask_index;
>  
>  	/*
> @@ -643,15 +645,14 @@ unsigned int get_slice_psize(struct mm_struct *mm, unsigned long addr)
>  #endif
>  	}
>  	if (addr < SLICE_LOW_TOP) {
> -		u64 lpsizes;
> -		lpsizes = mm->context.low_slices_psize;
> +		psizes = mm->context.low_slices_psize;
>  		index = GET_LOW_SLICE_INDEX(addr);
> -		return (lpsizes >> (index * 4)) & 0xf;
> +	} else {
> +		psizes = mm->context.high_slices_psize;
> +		index = GET_HIGH_SLICE_INDEX(addr);
>  	}
> -	hpsizes = mm->context.high_slices_psize;
> -	index = GET_HIGH_SLICE_INDEX(addr);
>  	mask_index = index & 0x1;
> -	return (hpsizes[index >> 1] >> (mask_index * 4)) & 0xf;
> +	return (psizes[index >> 1] >> (mask_index * 4)) & 0xf;
>  }
>  EXPORT_SYMBOL_GPL(get_slice_psize);
>  
> @@ -672,8 +673,8 @@ EXPORT_SYMBOL_GPL(get_slice_psize);
>  void slice_set_user_psize(struct mm_struct *mm, unsigned int psize)
>  {
>  	int index, mask_index;
> -	unsigned char *hpsizes;
> -	unsigned long flags, lpsizes;
> +	unsigned char *hpsizes, *lpsizes;
> +	unsigned long flags;
>  	unsigned int old_psize;
>  	int i;
>  
> @@ -691,12 +692,14 @@ void slice_set_user_psize(struct mm_struct *mm, unsigned int psize)
>  	wmb();
>  
>  	lpsizes = mm->context.low_slices_psize;
> -	for (i = 0; i < SLICE_NUM_LOW; i++)
> -		if (((lpsizes >> (i * 4)) & 0xf) == old_psize)
> -			lpsizes = (lpsizes & ~(0xful << (i * 4))) |
> -				(((unsigned long)psize) << (i * 4));
> -	/* Assign the value back */
> -	mm->context.low_slices_psize = lpsizes;
> +	for (i = 0; i < SLICE_NUM_LOW; i++) {
> +		mask_index = i & 0x1;
> +		index = i >> 1;
> +		if (((lpsizes[index] >> (mask_index * 4)) & 0xf) == old_psize)
> +			lpsizes[index] = (lpsizes[index] &
> +					  ~(0xf << (mask_index * 4))) |
> +				(((unsigned long)psize) << (mask_index * 4));
> +	}
>  
>  	hpsizes = mm->context.high_slices_psize;
>  	for (i = 0; i < SLICE_NUM_HIGH; i++) {
> -- 
> 2.13.3

^ permalink raw reply

* [PATCH 0/3] perf trace powerpc: Remove libaudit dependency for syscalls
From: Ravi Bangoria @ 2018-01-29  8:34 UTC (permalink / raw)
  To: acme
  Cc: alexander.shishkin, jolsa, namhyung, linux-kernel, brueckner,
	tmricht, linuxppc-dev, mpe, Ravi Bangoria

This is almost identical set of patches recently done for s390.

With this, user can run perf trace without libaudit on powerpc
as well. Ex,

  $ make
    ...     libaudit: [ OFF ]

  $ ./perf trace ls
    0.221 ( 0.005 ms): ls/43330 open(filename: 0xac1e2778, flags: CLOEXEC   ) = 3
    0.227 ( 0.003 ms): ls/43330 read(fd: 3, buf: 0x3ffff9c4d678, count: 832 ) = 832
    0.233 ( 0.002 ms): ls/43330 fstat(fd: 3, statbuf: 0x3ffff9c4d4b0        ) = 0
    ...

  $ ./perf trace -e "open*" ls
    0.000 ( 0.014 ms): ls/43342 open(filename: 0x793d8978, flags: CLOEXEC   ) = 3
    0.038 ( 0.006 ms): ls/43342 open(filename: 0x793f2778, flags: CLOEXEC   ) = 3
    ...

Ravi Bangoria (3):
  tools include powerpc: Grab a copy of
    arch/powerpc/include/uapi/asm/unistd.h
  perf powerpc: Generate system call table from asm/unistd.h
  perf trace powerpc: Use generated syscall table

 tools/arch/powerpc/include/uapi/asm/unistd.h       | 399 +++++++++++++++++++++
 tools/perf/Makefile.config                         |   2 +
 tools/perf/arch/powerpc/Makefile                   |  21 ++
 .../perf/arch/powerpc/entry/syscalls/mksyscalltbl  |  35 ++
 tools/perf/check-headers.sh                        |   1 +
 tools/perf/util/syscalltbl.c                       |   4 +
 6 files changed, 462 insertions(+)
 create mode 100644 tools/arch/powerpc/include/uapi/asm/unistd.h
 create mode 100755 tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl

-- 
1.8.3.1

^ permalink raw reply

* [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h
From: Ravi Bangoria @ 2018-01-29  8:34 UTC (permalink / raw)
  To: acme
  Cc: alexander.shishkin, jolsa, namhyung, linux-kernel, brueckner,
	tmricht, linuxppc-dev, mpe, Ravi Bangoria
In-Reply-To: <20180129083417.31240-1-ravi.bangoria@linux.vnet.ibm.com>

Will be used for generating the syscall id/string translation table.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
 tools/arch/powerpc/include/uapi/asm/unistd.h | 399 +++++++++++++++++++++++++++
 tools/perf/check-headers.sh                  |   1 +
 2 files changed, 400 insertions(+)
 create mode 100644 tools/arch/powerpc/include/uapi/asm/unistd.h

diff --git a/tools/arch/powerpc/include/uapi/asm/unistd.h b/tools/arch/powerpc/include/uapi/asm/unistd.h
new file mode 100644
index 0000000..df8684f3
--- /dev/null
+++ b/tools/arch/powerpc/include/uapi/asm/unistd.h
@@ -0,0 +1,399 @@
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+/*
+ * This file contains the system call numbers.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_ASM_POWERPC_UNISTD_H_
+#define _UAPI_ASM_POWERPC_UNISTD_H_
+
+
+#define __NR_restart_syscall	  0
+#define __NR_exit		  1
+#define __NR_fork		  2
+#define __NR_read		  3
+#define __NR_write		  4
+#define __NR_open		  5
+#define __NR_close		  6
+#define __NR_waitpid		  7
+#define __NR_creat		  8
+#define __NR_link		  9
+#define __NR_unlink		 10
+#define __NR_execve		 11
+#define __NR_chdir		 12
+#define __NR_time		 13
+#define __NR_mknod		 14
+#define __NR_chmod		 15
+#define __NR_lchown		 16
+#define __NR_break		 17
+#define __NR_oldstat		 18
+#define __NR_lseek		 19
+#define __NR_getpid		 20
+#define __NR_mount		 21
+#define __NR_umount		 22
+#define __NR_setuid		 23
+#define __NR_getuid		 24
+#define __NR_stime		 25
+#define __NR_ptrace		 26
+#define __NR_alarm		 27
+#define __NR_oldfstat		 28
+#define __NR_pause		 29
+#define __NR_utime		 30
+#define __NR_stty		 31
+#define __NR_gtty		 32
+#define __NR_access		 33
+#define __NR_nice		 34
+#define __NR_ftime		 35
+#define __NR_sync		 36
+#define __NR_kill		 37
+#define __NR_rename		 38
+#define __NR_mkdir		 39
+#define __NR_rmdir		 40
+#define __NR_dup		 41
+#define __NR_pipe		 42
+#define __NR_times		 43
+#define __NR_prof		 44
+#define __NR_brk		 45
+#define __NR_setgid		 46
+#define __NR_getgid		 47
+#define __NR_signal		 48
+#define __NR_geteuid		 49
+#define __NR_getegid		 50
+#define __NR_acct		 51
+#define __NR_umount2		 52
+#define __NR_lock		 53
+#define __NR_ioctl		 54
+#define __NR_fcntl		 55
+#define __NR_mpx		 56
+#define __NR_setpgid		 57
+#define __NR_ulimit		 58
+#define __NR_oldolduname	 59
+#define __NR_umask		 60
+#define __NR_chroot		 61
+#define __NR_ustat		 62
+#define __NR_dup2		 63
+#define __NR_getppid		 64
+#define __NR_getpgrp		 65
+#define __NR_setsid		 66
+#define __NR_sigaction		 67
+#define __NR_sgetmask		 68
+#define __NR_ssetmask		 69
+#define __NR_setreuid		 70
+#define __NR_setregid		 71
+#define __NR_sigsuspend		 72
+#define __NR_sigpending		 73
+#define __NR_sethostname	 74
+#define __NR_setrlimit		 75
+#define __NR_getrlimit		 76
+#define __NR_getrusage		 77
+#define __NR_gettimeofday	 78
+#define __NR_settimeofday	 79
+#define __NR_getgroups		 80
+#define __NR_setgroups		 81
+#define __NR_select		 82
+#define __NR_symlink		 83
+#define __NR_oldlstat		 84
+#define __NR_readlink		 85
+#define __NR_uselib		 86
+#define __NR_swapon		 87
+#define __NR_reboot		 88
+#define __NR_readdir		 89
+#define __NR_mmap		 90
+#define __NR_munmap		 91
+#define __NR_truncate		 92
+#define __NR_ftruncate		 93
+#define __NR_fchmod		 94
+#define __NR_fchown		 95
+#define __NR_getpriority	 96
+#define __NR_setpriority	 97
+#define __NR_profil		 98
+#define __NR_statfs		 99
+#define __NR_fstatfs		100
+#define __NR_ioperm		101
+#define __NR_socketcall		102
+#define __NR_syslog		103
+#define __NR_setitimer		104
+#define __NR_getitimer		105
+#define __NR_stat		106
+#define __NR_lstat		107
+#define __NR_fstat		108
+#define __NR_olduname		109
+#define __NR_iopl		110
+#define __NR_vhangup		111
+#define __NR_idle		112
+#define __NR_vm86		113
+#define __NR_wait4		114
+#define __NR_swapoff		115
+#define __NR_sysinfo		116
+#define __NR_ipc		117
+#define __NR_fsync		118
+#define __NR_sigreturn		119
+#define __NR_clone		120
+#define __NR_setdomainname	121
+#define __NR_uname		122
+#define __NR_modify_ldt		123
+#define __NR_adjtimex		124
+#define __NR_mprotect		125
+#define __NR_sigprocmask	126
+#define __NR_create_module	127
+#define __NR_init_module	128
+#define __NR_delete_module	129
+#define __NR_get_kernel_syms	130
+#define __NR_quotactl		131
+#define __NR_getpgid		132
+#define __NR_fchdir		133
+#define __NR_bdflush		134
+#define __NR_sysfs		135
+#define __NR_personality	136
+#define __NR_afs_syscall	137 /* Syscall for Andrew File System */
+#define __NR_setfsuid		138
+#define __NR_setfsgid		139
+#define __NR__llseek		140
+#define __NR_getdents		141
+#define __NR__newselect		142
+#define __NR_flock		143
+#define __NR_msync		144
+#define __NR_readv		145
+#define __NR_writev		146
+#define __NR_getsid		147
+#define __NR_fdatasync		148
+#define __NR__sysctl		149
+#define __NR_mlock		150
+#define __NR_munlock		151
+#define __NR_mlockall		152
+#define __NR_munlockall		153
+#define __NR_sched_setparam		154
+#define __NR_sched_getparam		155
+#define __NR_sched_setscheduler		156
+#define __NR_sched_getscheduler		157
+#define __NR_sched_yield		158
+#define __NR_sched_get_priority_max	159
+#define __NR_sched_get_priority_min	160
+#define __NR_sched_rr_get_interval	161
+#define __NR_nanosleep		162
+#define __NR_mremap		163
+#define __NR_setresuid		164
+#define __NR_getresuid		165
+#define __NR_query_module	166
+#define __NR_poll		167
+#define __NR_nfsservctl		168
+#define __NR_setresgid		169
+#define __NR_getresgid		170
+#define __NR_prctl		171
+#define __NR_rt_sigreturn	172
+#define __NR_rt_sigaction	173
+#define __NR_rt_sigprocmask	174
+#define __NR_rt_sigpending	175
+#define __NR_rt_sigtimedwait	176
+#define __NR_rt_sigqueueinfo	177
+#define __NR_rt_sigsuspend	178
+#define __NR_pread64		179
+#define __NR_pwrite64		180
+#define __NR_chown		181
+#define __NR_getcwd		182
+#define __NR_capget		183
+#define __NR_capset		184
+#define __NR_sigaltstack	185
+#define __NR_sendfile		186
+#define __NR_getpmsg		187	/* some people actually want streams */
+#define __NR_putpmsg		188	/* some people actually want streams */
+#define __NR_vfork		189
+#define __NR_ugetrlimit		190	/* SuS compliant getrlimit */
+#define __NR_readahead		191
+#ifndef __powerpc64__			/* these are 32-bit only */
+#define __NR_mmap2		192
+#define __NR_truncate64		193
+#define __NR_ftruncate64	194
+#define __NR_stat64		195
+#define __NR_lstat64		196
+#define __NR_fstat64		197
+#endif
+#define __NR_pciconfig_read	198
+#define __NR_pciconfig_write	199
+#define __NR_pciconfig_iobase	200
+#define __NR_multiplexer	201
+#define __NR_getdents64		202
+#define __NR_pivot_root		203
+#ifndef __powerpc64__
+#define __NR_fcntl64		204
+#endif
+#define __NR_madvise		205
+#define __NR_mincore		206
+#define __NR_gettid		207
+#define __NR_tkill		208
+#define __NR_setxattr		209
+#define __NR_lsetxattr		210
+#define __NR_fsetxattr		211
+#define __NR_getxattr		212
+#define __NR_lgetxattr		213
+#define __NR_fgetxattr		214
+#define __NR_listxattr		215
+#define __NR_llistxattr		216
+#define __NR_flistxattr		217
+#define __NR_removexattr	218
+#define __NR_lremovexattr	219
+#define __NR_fremovexattr	220
+#define __NR_futex		221
+#define __NR_sched_setaffinity	222
+#define __NR_sched_getaffinity	223
+/* 224 currently unused */
+#define __NR_tuxcall		225
+#ifndef __powerpc64__
+#define __NR_sendfile64		226
+#endif
+#define __NR_io_setup		227
+#define __NR_io_destroy		228
+#define __NR_io_getevents	229
+#define __NR_io_submit		230
+#define __NR_io_cancel		231
+#define __NR_set_tid_address	232
+#define __NR_fadvise64		233
+#define __NR_exit_group		234
+#define __NR_lookup_dcookie	235
+#define __NR_epoll_create	236
+#define __NR_epoll_ctl		237
+#define __NR_epoll_wait		238
+#define __NR_remap_file_pages	239
+#define __NR_timer_create	240
+#define __NR_timer_settime	241
+#define __NR_timer_gettime	242
+#define __NR_timer_getoverrun	243
+#define __NR_timer_delete	244
+#define __NR_clock_settime	245
+#define __NR_clock_gettime	246
+#define __NR_clock_getres	247
+#define __NR_clock_nanosleep	248
+#define __NR_swapcontext	249
+#define __NR_tgkill		250
+#define __NR_utimes		251
+#define __NR_statfs64		252
+#define __NR_fstatfs64		253
+#ifndef __powerpc64__
+#define __NR_fadvise64_64	254
+#endif
+#define __NR_rtas		255
+#define __NR_sys_debug_setcontext 256
+/* Number 257 is reserved for vserver */
+#define __NR_migrate_pages	258
+#define __NR_mbind		259
+#define __NR_get_mempolicy	260
+#define __NR_set_mempolicy	261
+#define __NR_mq_open		262
+#define __NR_mq_unlink		263
+#define __NR_mq_timedsend	264
+#define __NR_mq_timedreceive	265
+#define __NR_mq_notify		266
+#define __NR_mq_getsetattr	267
+#define __NR_kexec_load		268
+#define __NR_add_key		269
+#define __NR_request_key	270
+#define __NR_keyctl		271
+#define __NR_waitid		272
+#define __NR_ioprio_set		273
+#define __NR_ioprio_get		274
+#define __NR_inotify_init	275
+#define __NR_inotify_add_watch	276
+#define __NR_inotify_rm_watch	277
+#define __NR_spu_run		278
+#define __NR_spu_create		279
+#define __NR_pselect6		280
+#define __NR_ppoll		281
+#define __NR_unshare		282
+#define __NR_splice		283
+#define __NR_tee		284
+#define __NR_vmsplice		285
+#define __NR_openat		286
+#define __NR_mkdirat		287
+#define __NR_mknodat		288
+#define __NR_fchownat		289
+#define __NR_futimesat		290
+#ifdef __powerpc64__
+#define __NR_newfstatat		291
+#else
+#define __NR_fstatat64		291
+#endif
+#define __NR_unlinkat		292
+#define __NR_renameat		293
+#define __NR_linkat		294
+#define __NR_symlinkat		295
+#define __NR_readlinkat		296
+#define __NR_fchmodat		297
+#define __NR_faccessat		298
+#define __NR_get_robust_list	299
+#define __NR_set_robust_list	300
+#define __NR_move_pages		301
+#define __NR_getcpu		302
+#define __NR_epoll_pwait	303
+#define __NR_utimensat		304
+#define __NR_signalfd		305
+#define __NR_timerfd_create	306
+#define __NR_eventfd		307
+#define __NR_sync_file_range2	308
+#define __NR_fallocate		309
+#define __NR_subpage_prot	310
+#define __NR_timerfd_settime	311
+#define __NR_timerfd_gettime	312
+#define __NR_signalfd4		313
+#define __NR_eventfd2		314
+#define __NR_epoll_create1	315
+#define __NR_dup3		316
+#define __NR_pipe2		317
+#define __NR_inotify_init1	318
+#define __NR_perf_event_open	319
+#define __NR_preadv		320
+#define __NR_pwritev		321
+#define __NR_rt_tgsigqueueinfo	322
+#define __NR_fanotify_init	323
+#define __NR_fanotify_mark	324
+#define __NR_prlimit64		325
+#define __NR_socket		326
+#define __NR_bind		327
+#define __NR_connect		328
+#define __NR_listen		329
+#define __NR_accept		330
+#define __NR_getsockname	331
+#define __NR_getpeername	332
+#define __NR_socketpair		333
+#define __NR_send		334
+#define __NR_sendto		335
+#define __NR_recv		336
+#define __NR_recvfrom		337
+#define __NR_shutdown		338
+#define __NR_setsockopt		339
+#define __NR_getsockopt		340
+#define __NR_sendmsg		341
+#define __NR_recvmsg		342
+#define __NR_recvmmsg		343
+#define __NR_accept4		344
+#define __NR_name_to_handle_at	345
+#define __NR_open_by_handle_at	346
+#define __NR_clock_adjtime	347
+#define __NR_syncfs		348
+#define __NR_sendmmsg		349
+#define __NR_setns		350
+#define __NR_process_vm_readv	351
+#define __NR_process_vm_writev	352
+#define __NR_finit_module	353
+#define __NR_kcmp		354
+#define __NR_sched_setattr	355
+#define __NR_sched_getattr	356
+#define __NR_renameat2		357
+#define __NR_seccomp		358
+#define __NR_getrandom		359
+#define __NR_memfd_create	360
+#define __NR_bpf		361
+#define __NR_execveat		362
+#define __NR_switch_endian	363
+#define __NR_userfaultfd	364
+#define __NR_membarrier		365
+#define __NR_mlock2		378
+#define __NR_copy_file_range	379
+#define __NR_preadv2		380
+#define __NR_pwritev2		381
+#define __NR_kexec_file_load	382
+#define __NR_statx		383
+
+#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index 51abdb0..9dcc900 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -43,6 +43,7 @@ arch/parisc/include/uapi/asm/errno.h
 arch/powerpc/include/uapi/asm/errno.h
 arch/sparc/include/uapi/asm/errno.h
 arch/x86/include/uapi/asm/errno.h
+arch/powerpc/include/uapi/asm/unistd.h
 include/asm-generic/bitops/arch_hweight.h
 include/asm-generic/bitops/const_hweight.h
 include/asm-generic/bitops/__fls.h
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH 2/3] perf powerpc: Generate system call table from asm/unistd.h
From: Ravi Bangoria @ 2018-01-29  8:34 UTC (permalink / raw)
  To: acme
  Cc: alexander.shishkin, jolsa, namhyung, linux-kernel, brueckner,
	tmricht, linuxppc-dev, mpe, Ravi Bangoria
In-Reply-To: <20180129083417.31240-1-ravi.bangoria@linux.vnet.ibm.com>

This should speed up accessing new system calls introduced with
the kernel rather than waiting for libaudit updates to include
them.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
 tools/perf/arch/powerpc/Makefile                   | 21 +++++++++++++
 .../perf/arch/powerpc/entry/syscalls/mksyscalltbl  | 35 ++++++++++++++++++++++
 2 files changed, 56 insertions(+)
 create mode 100755 tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl

diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile
index 42dab7c..c93e8f4 100644
--- a/tools/perf/arch/powerpc/Makefile
+++ b/tools/perf/arch/powerpc/Makefile
@@ -6,3 +6,24 @@ endif
 HAVE_KVM_STAT_SUPPORT := 1
 PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
 PERF_HAVE_JITDUMP := 1
+
+#
+# Syscall table generation for perf
+#
+
+out    := $(OUTPUT)arch/powerpc/include/generated/asm
+header := $(out)/syscalls_64.c
+sysdef := $(srctree)/tools/arch/powerpc/include/uapi/asm/unistd.h
+sysprf := $(srctree)/tools/perf/arch/powerpc/entry/syscalls/
+systbl := $(sysprf)/mksyscalltbl
+
+# Create output directory if not already present
+_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)')
+
+$(header): $(sysdef) $(systbl)
+	$(Q)$(SHELL) '$(systbl)' '$(CC)' $(sysdef) > $@
+
+clean::
+	$(call QUIET_CLEAN, powerpc) $(RM) $(header)
+
+archheaders: $(header)
diff --git a/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl b/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl
new file mode 100755
index 0000000..975947c
--- /dev/null
+++ b/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl
@@ -0,0 +1,35 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+#
+# Generate system call table for perf. Derived from
+# s390 script.
+#
+# Copyright IBM Corp. 2017
+# Author(s):  Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
+# Changed by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
+
+gcc=$1
+input=$2
+
+if ! test -r $input; then
+	echo "Could not read input file" >&2
+	exit 1
+fi
+
+create_table()
+{
+	local max_nr
+
+	echo 'static const char *syscalltbl_powerpc_64[] = {'
+	while read sc nr; do
+		printf '\t[%d] = "%s",\n' $nr $sc
+		max_nr=$nr
+	done
+	echo '};'
+	echo "#define SYSCALLTBL_POWERPC_64_MAX_ID $max_nr"
+}
+
+$gcc -m64 -E -dM -x c  $input	       \
+	|sed -ne 's/^#define __NR_//p' \
+	|sort -t' ' -k2 -nu	       \
+	|create_table
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH 3/3] perf trace powerpc: Use generated syscall table
From: Ravi Bangoria @ 2018-01-29  8:34 UTC (permalink / raw)
  To: acme
  Cc: alexander.shishkin, jolsa, namhyung, linux-kernel, brueckner,
	tmricht, linuxppc-dev, mpe, Ravi Bangoria
In-Reply-To: <20180129083417.31240-1-ravi.bangoria@linux.vnet.ibm.com>

This should speed up accessing new system calls introduced with the
kernel rather than waiting for libaudit updates to include them.

It also enables users to specify wildcards, for example, perf trace -e
'open*', just like was already possible on x86 and s390.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
 tools/perf/Makefile.config   | 2 ++
 tools/perf/util/syscalltbl.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 0dfdaa9..577a5d2 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -27,6 +27,8 @@ NO_SYSCALL_TABLE := 1
 # Additional ARCH settings for ppc
 ifeq ($(SRCARCH),powerpc)
   NO_PERF_REGS := 0
+  NO_SYSCALL_TABLE := 0
+  CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated
   LIBUNWIND_LIBS := -lunwind -lunwind-ppc64
 endif
 
diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c
index 303bdb8..b12c5f5 100644
--- a/tools/perf/util/syscalltbl.c
+++ b/tools/perf/util/syscalltbl.c
@@ -30,6 +30,10 @@
 #include <asm/syscalls_64.c>
 const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID;
 static const char **syscalltbl_native = syscalltbl_s390_64;
+#elif defined(__powerpc64__)
+#include <asm/syscalls_64.c>
+const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_64_MAX_ID;
+static const char **syscalltbl_native = syscalltbl_powerpc_64;
 #endif
 
 struct syscall {
-- 
1.8.3.1

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox