OSDN Git Service

uclinux-h8/linux.git
6 years agopowerpc/kernel: Change retrieval of pci_dn
Bryant G. Ly [Tue, 29 Aug 2017 13:11:51 +0000 (08:11 -0500)]
powerpc/kernel: Change retrieval of pci_dn

For a PCI device it's pci_dn can be retrieved from
pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list.
Thus, we should just use the existing function pci_get_pdn_by_devfn
to get the pci_dn.

Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Reviewed-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/mm/cxl: Add barrier when setting mm cpumask
Aneesh Kumar K.V [Mon, 28 Aug 2017 08:35:44 +0000 (14:05 +0530)]
powerpc/mm/cxl: Add barrier when setting mm cpumask

We need to add memory barrier so that the page table walk doesn't happen
before the cpumask is set and made visible to the other cpus. We need
to use a sync here instead of lwsync because lwsync is not sufficient for
store/load ordering.

We also need to add an if (mm) check so that we do the right thing when called
with a kernel context. For kernel context, we have mm = NULL. W.r.t kernel
address we can skip setting the mm cpumask.

Fixes: 0f4bc0932e ("powerpc/mm/cxl: Add the fault handling cpu to mm cpumask")
Cc: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define copy/paste interfaces
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:40 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define copy/paste interfaces

Define interfaces (wrappers) to the 'copy' and 'paste'
instructions (which are new in PowerISA 3.0). These are intended to be
used to by NX driver(s) to submit Coprocessor Request Blocks (CRBs) to
the NX hardware engines.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define vas_tx_win_open()
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:39 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define vas_tx_win_open()

Define an interface to open a VAS send window. This interface is
intended to be used the Nest Accelerator (NX) driver(s) to open
a send window and use it to submit compression/encryption requests
to a VAS receive window.

The receive window, identified by the [vasid, cop] parameters, must
already be open in VAS (i.e connected to an NX engine).

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define vas_win_close() interface
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:38 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define vas_win_close() interface

Define the vas_win_close() interface which should be used to close a
send or receive windows.

While the hardware configurations required to open send and receive
windows differ, the configuration to close a window is the same for
both. So we use a single interface to close the window.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define vas_rx_win_open() interface
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:37 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define vas_rx_win_open() interface

Define the vas_rx_win_open() interface. This interface is intended to
be used by the Nest Accelerator (NX) driver(s) to setup receive
windows for one or more NX engines (which implement compression &
encryption algorithms in the hardware).

Follow-on patches will provide an interface to close the window and to
open a send window that kernel subsystems can use to access the NX
engines.

The interface to open a receive window is expected to be invoked for
each instance of VAS in the system.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define helpers to alloc/free windows
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:36 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define helpers to alloc/free windows

Define helpers to allocate/free VAS window objects. These will be used
in follow-on patches when opening/closing windows.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define helpers to init window context
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:35 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define helpers to init window context

Define helpers to initialize window context registers of the VAS
hardware. These will be used in follow-on patches when opening/closing
VAS windows.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define helpers to access MMIO regions
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:34 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define helpers to access MMIO regions

Define some helper functions to access the MMIO regions. We use these
in follow-on patches to read/write VAS hardware registers. They are
also used to later issue 'paste' instructions to submit requests to
the NX hardware engines.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define vas_init() and vas_exit()
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:33 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define vas_init() and vas_exit()

Implement vas_init() and vas_exit() functions for a new VAS module.
This VAS module is essentially a library for other device drivers
and kernel users of the NX coprocessors like NX-842 and NX-GZIP.
In the future this will be extended to add support for user space
to access the NX coprocessors.

VAS is currently only supported with 64K page size.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv: Move GET_FIELD/SET_FIELD to vas.h
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:32 +0000 (23:23 -0700)]
powerpc/powernv: Move GET_FIELD/SET_FIELD to vas.h

Move the GET_FIELD and SET_FIELD macros to vas.h as VAS and other
users of VAS, including NX-842 can use those macros.

There is a lot of related code between the VAS/NX kernel drivers
and skiboot. For consistency, switch the order of parameters in
SET_FIELD to match the order in skiboot.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Reviewed-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv/vas: Define macros, register fields and structures
Sukadev Bhattiprolu [Tue, 29 Aug 2017 06:23:31 +0000 (23:23 -0700)]
powerpc/powernv/vas: Define macros, register fields and structures

Define macros for the VAS hardware registers and bit-fields as well
as couple of data structures needed by the VAS driver.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
[mpe: Fixup include guard to use _ASM_POWERPC_VAS_H]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/xmon: Fix display of SPRs
Balbir Singh [Tue, 29 Aug 2017 07:22:36 +0000 (17:22 +1000)]
powerpc/xmon: Fix display of SPRs

Convert 0.16x to 0.16lx. Otherwise we lose the top 8 nibbles and
effectively print only the last 32 bits.

Fixes: 1846193b178d ("powerpc/xmon: Dump ISA 2.06 SPRs")
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/pci: Remove OF node back pointer from pci_dn
Alexey Kardashevskiy [Tue, 29 Aug 2017 07:34:04 +0000 (17:34 +1000)]
powerpc/pci: Remove OF node back pointer from pci_dn

The check_req() helper uses pci_get_pdn() to get an OF node pointer.
pci_get_pdn() returns a pci_dn pointer which either:
1) from the OF node returned by pci_device_to_OF_node();
2) from the parent child_list where entries don't have OF node pointers.
Since check_req() does not care about 2), it can call
pci_device_to_OF_node() directly, hence the change.

The find_pe_dn() helper uses embedded pci_dn to get an OF node which is
also stored in edev->pdev so let's take a shortcut and call
pci_device_to_OF_node() directly.

With these 2 changes, we can finally get rid of the OF node back pointer.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/eeh: Reduce use of pci_dn::node
Alexey Kardashevskiy [Tue, 29 Aug 2017 07:34:03 +0000 (17:34 +1000)]
powerpc/eeh: Reduce use of pci_dn::node

The pci_dn struct caches a OF device node pointer in order to access
the "ibm,loc-code" property when EEH is recovering.

However, when this happens in eeh_dev_check_failure(), we also have
a pci_dev pointer which should have a valid pointer to the device node
when pci_dn has one (both pointers are not NULL for physical functions
and are NULL for virtual functions).

This changes pci_remove_device_node_info() to look for a parent of
the node being removed, just like pci_add_device_node_info() does when it
references the parent node.

This is the first step to get rid of pci_dn::node.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/eeh: Remove unnecessary config_addr from eeh_dev
Alexey Kardashevskiy [Tue, 29 Aug 2017 07:34:02 +0000 (17:34 +1000)]
powerpc/eeh: Remove unnecessary config_addr from eeh_dev

The eeh_dev struct hold a config space address of an associated node
and the very same address is also stored in the pci_dn struct which
is always present during the eeh_dev lifetime.

This uses bus:devfn directly from pci_dn instead of cached and packed
config_addr.

Since config_addr is made from device's bus:dev.fn, there is no point
in keeping it in the debugfs either so remove that too.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/eeh: Remove unnecessary pointer to phb from eeh_dev
Alexey Kardashevskiy [Tue, 29 Aug 2017 07:34:01 +0000 (17:34 +1000)]
powerpc/eeh: Remove unnecessary pointer to phb from eeh_dev

The eeh_dev struct already holds a pointer to pci_dn which it does not
exist without and pci_dn itself holds the very same pointer so just
use it.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/eeh: Reduce to one the number of places where edev is allocated
Alexey Kardashevskiy [Tue, 29 Aug 2017 07:34:00 +0000 (17:34 +1000)]
powerpc/eeh: Reduce to one the number of places where edev is allocated

arch/powerpc/kernel/eeh_dev.c:57 is the only legit place where edev
is allocated; other 2 places allocate it on stack and in the heap for
a very short period of time to use eeh_pe_get() as takes edev.

This changes eeh_pe_get() to receive required parameters explicitly.

This removes unnecessary temporary allocation of edev.

This uses the "pe_no" name instead of the "pe_config_addr" name as
it actually is a PE number and not a config space address as it seemed.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/pci: Remove unused parameter from add_one_dev_pci_data()
Alexey Kardashevskiy [Tue, 29 Aug 2017 07:33:59 +0000 (17:33 +1000)]
powerpc/pci: Remove unused parameter from add_one_dev_pci_data()

pdev is always NULL, remove it.

To make checkpatch.pl happy, this also removes the "out of memory"
message.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/512x: Constify clk_div_tables
Arvind Yadav [Mon, 28 Aug 2017 06:05:15 +0000 (11:35 +0530)]
powerpc/512x: Constify clk_div_tables

clk_div_tables are not supposed to change at runtime.
mpc512x_clk_divtable function working with const clk_div_table. So
mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/44x: Fix mask and shift to zero bug
Dan Carpenter [Fri, 25 Aug 2017 10:33:40 +0000 (13:33 +0300)]
powerpc/44x: Fix mask and shift to zero bug

My static checker complains that 0x00001800 >> 13 is zero. Looking at
the context, it seems like a copy and paste bug from the line below
and probably 0x3 << 13 or 0x00006000 was intended.

Fixes: 2af59f7d5c3e ("[POWERPC] 4xx: Add 405GPr and 405EP support in boot wrapper")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/83xx: Use sizeof correct type when ioremapping
Dan Carpenter [Wed, 28 Jun 2017 11:49:07 +0000 (14:49 +0300)]
powerpc/83xx: Use sizeof correct type when ioremapping

There is a cut and paste error here so we use sizeof(struct mpc83xx_pmc)
to remap the memory for "clock_regs". That sizeof() is 20 bytes and we
only need to remap 12 bytes. It presumably doesn't affect run time too
much...

I changed them to both use sizeof(*variable_name) because that's the
preferred kernel style these days.

Fixes: d49747bdfb2d ("powerpc/mpc83xx: Power Management support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[mpe: It will map at least one page anyway, but still a good cleanup]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc: Machine check interrupt is a non-maskable interrupt
Nicholas Piggin [Wed, 19 Jul 2017 06:59:12 +0000 (16:59 +1000)]
powerpc: Machine check interrupt is a non-maskable interrupt

Use nmi_enter similarly to system reset interrupts. This uses NMI
printk NMI buffers and turns off various debugging facilities that
helps avoid tripping on ourselves or other CPUs.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv: Use kernel crash path for machine checks
Nicholas Piggin [Wed, 19 Jul 2017 06:59:11 +0000 (16:59 +1000)]
powerpc/powernv: Use kernel crash path for machine checks

There are quite a few machine check exceptions that can be caused by
kernel bugs. To make debugging easier, use the kernel crash path in
cases of synchronous machine checks that occur in kernel mode, if that
would not result in the machine going straight to panic or crash dump.

There is a downside here that die()ing the process in kernel mode can
still leave the system unstable. panic_on_oops will always force the
system to fail-stop, so systems where that behaviour is important will
still do the right thing.

As a test, when triggering an i-side 0111b error (ifetch from foreign
address) in kernel mode process context on POWER9, the kernel currently
dies quickly like this:

  Severe Machine check interrupt [Not recovered]
    NIP [ffff000000000000]: 0xffff000000000000
    Initiator: CPU
    Error type: Real address [Instruction fetch (foreign)]
  [  127.426651616,0] OPAL: Reboot requested due to Platform error.
      Effective[  127.426693712,3] OPAL: Reboot requested due to Platform error. address: ffff000000000000
  opal: Reboot type 1 not supported
  Kernel panic - not syncing: PowerNV Unrecovered Machine Check
  CPU: 56 PID: 4425 Comm: syscall Tainted: G   M            4.12.0-rc1-13857-ga4700a261072-dirty #35
  Call Trace:
  [  128.017988928,4] IPMI: BUG: Dropping ESEL on the floor due to
    buggy/mising code in OPAL for this BMC
    Rebooting in 10 seconds..
  Trying to free IRQ 496 from IRQ context!

After this patch, the process is killed and the kernel continues with
this message, which gives enough information to identify the offending
branch (i.e., with CFAR):

  Severe Machine check interrupt [Not recovered]
    NIP [ffff000000000000]: 0xffff000000000000
    Initiator: CPU
    Error type: Real address [Instruction fetch (foreign)]
      Effective address: ffff000000000000
  Oops: Machine check, sig: 7 [#1]
  SMP NR_CPUS=2048
  NUMA
  PowerNV
  Modules linked in: iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 ...
  CPU: 22 PID: 4436 Comm: syscall Tainted: G   M            4.12.0-rc1-13857-ga4700a261072-dirty #36
  task: c000000932300000 task.stack: c000000932380000
  NIP: ffff000000000000 LR: 00000000217706a4 CTR: ffff000000000000
  REGS: c00000000fc8fd80 TRAP: 0200   Tainted: G   M             (4.12.0-rc1-13857-ga4700a261072-dirty)
  MSR: 90000000001c1003 <SF,HV,ME,RI,LE>
    CR: 24000484  XER: 20000000
  CFAR: c000000000004c80 DAR: 0000000021770a90 DSISR: 0a000000 SOFTE: 1
  GPR00: 0000000000001ebe 00007fffce4818b0 0000000021797f00 0000000000000000
  GPR04: 00007fff8007ac24 0000000044000484 0000000000004000 00007fff801405e8
  GPR08: 900000000280f033 0000000024000484 0000000000000000 0000000000000030
  GPR12: 9000000000001003 00007fff801bc370 0000000000000000 0000000000000000
  GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  GPR28: 00007fff801b0000 0000000000000000 00000000217707a0 00007fffce481918
  NIP [ffff000000000000] 0xffff000000000000
  LR [00000000217706a4] 0x217706a4
  Call Trace:
  Instruction dump:
  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv: Flush console before platform error reboot
Nicholas Piggin [Wed, 19 Jul 2017 06:59:10 +0000 (16:59 +1000)]
powerpc/powernv: Flush console before platform error reboot

Unrecovered MCE and HMI errors are sent through a special restart OPAL
call to log the platform error. The downside is that they don't go
through normal Linux crash paths, so they don't give much information
to the Linux console.

Change this by providing a special crash function which does some of
the console flushing from the panic() path before calling firmware to
reboot.

The downside of this is a little more code to execute before reaching
the firmware reboot. However in practice, it's critical to get the
Linux console messages output in order to debug a problem. So this is
a desirable tradeoff.

Note on the implementation: It is difficult to plumb a custom reboot
handler into the panic path, because panic does a little bit too much
work. For example, it will try to delay with the timebase, but that
may be corrupted in some cases resulting in a hang without reaching
the platform reboot. Another problem is that panic can invoke the
crash dump code which is not what we want in the case of a hardware
platform error. Long-term the best solution will be to rework the
panic path so it can be suitable for this kind of panic, but for now
we just duplicate a bit of the code.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc: Do not send system reset request through the oops path
Nicholas Piggin [Wed, 5 Jul 2017 03:56:27 +0000 (13:56 +1000)]
powerpc: Do not send system reset request through the oops path

A system reset is a request to crash / debug the system rather than
necessarily caused by encountering a BUG. So there is no need to
serialize all CPUs behind the die lock, adding taints to all
subsequent traces beyond the first, breaking console locks, etc.

The system reset is NMI context which has its own printk buffers to
prevent output being interleaved. Then it's better to have all
secondaries print out their debug as quickly as possible and the
primary will flush out all printk buffers during panic().

So remove the 0x100 path from die, and move it into system_reset. Name
the crash/dump reasons "System Reset".

This gives "not tained" traces when crashing an untainted kernel. It
also gives the panic reason as "System Reset" as opposed to "Fatal
exception in interrupt" (or "die oops" for fadump).

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/pseries/le: Work around a firmware quirk
Nicholas Piggin [Wed, 5 Jul 2017 03:56:26 +0000 (13:56 +1000)]
powerpc/pseries/le: Work around a firmware quirk

Some PowerVM firmware when delivering a system reset interrupt to a
little endian OS will mess up SRR registers. They are byteswapped, and
SRR1 is incorrect. An example from a crash:

  NIP: 14dd0900000000c0
  MSR: 1000000200000080

It's possible to detect this pattern in SRR1 (that would never happen
in normal operation), and at least fix the NIP. After this patch, the
same interrupt reports NIP properly:

  NIP [c00000000009dd14] plpar_hcall_norets+0x1c/0x28

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc: Do not call ppc_md.panic in fadump panic notifier
Nicholas Piggin [Wed, 5 Jul 2017 03:56:25 +0000 (13:56 +1000)]
powerpc: Do not call ppc_md.panic in fadump panic notifier

If fadump is not registered, and no other crash or debug handlers are
registered, the powerpc panic handler stops the guest before the
generic panic code can push out debug information to the console.

Currently, system reset injection causes the guest to silently stop.

Stop calling ppc_md.panic in the panic notifier. crash_fadump already
does rtas_os_term() to terminate the guest if fadump is registered.

Remove ppc_md.panic. Move fadump panic notifier into fadump code.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64: Fix watchdog configuration regressions
Nicholas Piggin [Mon, 28 Aug 2017 04:27:19 +0000 (14:27 +1000)]
powerpc/64: Fix watchdog configuration regressions

This fixes a couple more bits of fallout from the new hard lockup watchdog
patch.

It restores the required hw_nmi_get_sample_period() function for the
perf watchdog, and removes some function declarations on 64e that are only
defined for 64s. This fixes the 64e build when the hardlockup detector is
enabled.

It restores the default behaviour of disabling the perf watchdog, and also
fixes disabling the 64s watchdog when running as a guest.

Fixes: 2104180a53 ("powerpc/64s: implement arch-specific hardlockup watchdog")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s/radix: Do not allocate SLB shadow structures
Nicholas Piggin [Sun, 13 Aug 2017 01:33:43 +0000 (11:33 +1000)]
powerpc/64s/radix: Do not allocate SLB shadow structures

These are unused in radix mode.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s/radix: Remove bolted-SLB address limit for per-cpu stacks
Nicholas Piggin [Sun, 13 Aug 2017 01:33:41 +0000 (11:33 +1000)]
powerpc/64s/radix: Remove bolted-SLB address limit for per-cpu stacks

Radix MMU does not take SLB or TLB interrupts when accessing kernel
linear address. Remove this restriction for radix mode.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv: powernv platform is not constrained by RMA
Nicholas Piggin [Sun, 13 Aug 2017 01:33:39 +0000 (11:33 +1000)]
powerpc/powernv: powernv platform is not constrained by RMA

Remove incorrect comment about real mode address restrictions on
powernv (bare metal), and unnecessary clamping to ppc64_rma_size.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s: idle POWER9 can execute stop in virtual mode
Nicholas Piggin [Fri, 25 Aug 2017 04:30:35 +0000 (14:30 +1000)]
powerpc/64s: idle POWER9 can execute stop in virtual mode

The hardware can execute stop in any context, and KVM does not
require real mode because siblings do not share MMU state. This
saves a switch to real-mode when going idle.

Acked-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s: Drop no longer used IDLE_STATE_ENTER_SEQ
Nicholas Piggin [Tue, 29 Aug 2017 11:40:35 +0000 (21:40 +1000)]
powerpc/64s: Drop no longer used IDLE_STATE_ENTER_SEQ

There are no longer any callers of IDLE_STATE_ENTER_SEQ, all callers
use IDLE_STATE_ENTER_SEQ_NORET. So drop the former.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Split out of larger patch, write change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s: POWER9 can execute stop without a sync sequence
Nicholas Piggin [Tue, 29 Aug 2017 11:34:40 +0000 (21:34 +1000)]
powerpc/64s: POWER9 can execute stop without a sync sequence

We don't need to use IDLE_STATE_ENTER_SEQ_NORET on Power9.

Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Split out of larger patch]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s: Move IDLE_STATE_ENTER_SEQ[_NORET] into idle_book3s.S
Nicholas Piggin [Tue, 29 Aug 2017 11:36:35 +0000 (21:36 +1000)]
powerpc/64s: Move IDLE_STATE_ENTER_SEQ[_NORET] into idle_book3s.S

This macro is only used in idle_book3s.S, move it in there and add a
more descriptive comment.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Split out of larger patch and write change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agoMerge branch 'topic/ppc-kvm' into next
Michael Ellerman [Tue, 29 Aug 2017 11:26:30 +0000 (21:26 +1000)]
Merge branch 'topic/ppc-kvm' into next

Merge Nicks commit to rework the KVM thread management, shared with the
KVM tree via the ppc-kvm topic branch.

6 years agoKVM: PPC: Book3S HV: POWER9 does not require secondary thread management
Nicholas Piggin [Fri, 25 Aug 2017 04:30:33 +0000 (14:30 +1000)]
KVM: PPC: Book3S HV: POWER9 does not require secondary thread management

POWER9 CPUs have independent MMU contexts per thread, so KVM does not
need to quiesce secondary threads, so the hwthread_req/hwthread_state
protocol does not have to be used. So patch it away on POWER9, and patch
away the branch from the Linux idle wakeup to kvm_start_guest that is
never used.

Add a warning and error out of kvmppc_grab_hwthread in case it is ever
called on POWER9.

This avoids a hwsync in the idle wakeup path on POWER9.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Paul Mackerras <paulus@ozlabs.org>
[mpe: Use WARN(...) instead of WARN_ON()/pr_err(...)]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Drop removed CONFIG_USB_LED
Michael Ellerman [Wed, 23 Aug 2017 05:38:06 +0000 (15:38 +1000)]
powerpc/configs/6xx: Drop removed CONFIG_USB_LED

In commit a335aaf3125c ("usb: misc: remove outdated USB LED driver")
CONFIG_USB_LED was removed, so drop it from our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Drop no longer selectable CONFIG_BT_HCIUART_LL
Michael Ellerman [Wed, 23 Aug 2017 05:38:05 +0000 (15:38 +1000)]
powerpc/configs/6xx: Drop no longer selectable CONFIG_BT_HCIUART_LL

Since commit 76c4969fecb1 ("Bluetooth: hci_uart: fix kconfig
dependency") we can no longer select CONFIG_BT_HCIUART_LL.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/c2k: Switch CONFIG_GEN_RTC from =m to =y
Michael Ellerman [Wed, 23 Aug 2017 05:38:04 +0000 (15:38 +1000)]
powerpc/configs/c2k: Switch CONFIG_GEN_RTC from =m to =y

In commit 835ea93e9d26 ("char/genrtc: remove powerpc support"),
CONFIG_GEN_RTC switch from tristate to bool, update the defconfig to
match.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Switch CONFIG_USB_EHCI_FSL to =m
Michael Ellerman [Wed, 23 Aug 2017 05:38:03 +0000 (15:38 +1000)]
powerpc/configs/6xx: Switch CONFIG_USB_EHCI_FSL to =m

In commit ca07e1c1e4a6 ("drivers:usb:fsl:Make fsl ehci drv an
independent driver module"), CONFIG_USB_EHCI_FSL was switched from
built-in to modular. Update the defconfig.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Drop no longer needed CONFIG_BT_HCIUART_H4
Michael Ellerman [Wed, 23 Aug 2017 05:38:02 +0000 (15:38 +1000)]
powerpc/configs/6xx: Drop no longer needed CONFIG_BT_HCIUART_H4

Since commit 943cc592195e ("Bluetooth: bpa10x: Use h4_recv_buf helper
for frame reassembly") we no longer need to set CONFIG_BT_HCIUART_H4
in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Drop no longer needed CONFIG_NETFILTER_XT_MATCH_SOCKET
Michael Ellerman [Wed, 23 Aug 2017 05:38:01 +0000 (15:38 +1000)]
powerpc/configs/6xx: Drop no longer needed CONFIG_NETFILTER_XT_MATCH_SOCKET

Since commit 8db4c5be88f6 ("netfilter: move socket lookup
infrastructure to nf_socket_ipv{4,6}.c") we no longer need to set
CONFIG_NETFILTER_XT_MATCH_SOCKET in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Reinstate CONFIG_CPU_FREQ_STAT
Michael Ellerman [Wed, 23 Aug 2017 05:38:00 +0000 (15:38 +1000)]
powerpc/configs/6xx: Reinstate CONFIG_CPU_FREQ_STAT

In commit 1aefc75b2449 ("cpufreq: stats: Make the stats code
non-modular"), the CPU_FREQ_STAT code was made non-modular. Our
defconfig still said =m though, which meant we no longer got the
code at all. Switch the defconfig to =y.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Drop no longer needed CONFIG_NF_CONNTRACK_PROC_COMPAT
Michael Ellerman [Wed, 23 Aug 2017 05:37:59 +0000 (15:37 +1000)]
powerpc/configs/6xx: Drop no longer needed CONFIG_NF_CONNTRACK_PROC_COMPAT

Since commit adf0516845bc ("netfilter: remove ip_conntrack* sysctl
compat code") we no longer need to set CONFIG_NF_CONNTRACK_PROC_COMPAT
in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Drop removed CONFIG_BLK_DEV_HD
Michael Ellerman [Wed, 23 Aug 2017 05:37:58 +0000 (15:37 +1000)]
powerpc/configs/6xx: Drop removed CONFIG_BLK_DEV_HD

In commit 8e14be53f470 ("remove the obsolete hd driver") the
CONFIG_BLK_DEV_HD symbol was removed, so drop it from the defconfig.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Clean up duplicate CONFIG_EXT4 values
Michael Ellerman [Wed, 23 Aug 2017 05:37:57 +0000 (15:37 +1000)]
powerpc/configs/6xx: Clean up duplicate CONFIG_EXT4 values

We had two values for CONFIG_EXT4, =m and =y, just use =y.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Drop no longer needed CONFIG_TIMER_STATS
Michael Ellerman [Wed, 23 Aug 2017 05:37:56 +0000 (15:37 +1000)]
powerpc/configs/6xx: Drop no longer needed CONFIG_TIMER_STATS

Since commit dfb4357da6dd ("time: Remove CONFIG_TIMER_STATS") we no
longer need to set CONFIG_TIMER_STATS in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/6xx: Turn CONFIG_DRM_RADEON back on
Michael Ellerman [Wed, 23 Aug 2017 05:37:55 +0000 (15:37 +1000)]
powerpc/configs/6xx: Turn CONFIG_DRM_RADEON back on

In commit d92d9c3a1448 ("drm: hide legacy drivers with CONFIG_DRM_LEGACY")
CONFIG_DRM_RADEON was moved behind CONFIG_DRM_LEGACY meaning it
stopped being enabled by ppc6xx_defconfig. Although no one has
noticed, given this is basically a legacy platform, it seems anyone
who is using it probably still wants this driver. So turn it back on
for now.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs/mpc5200: Drop no longer needed CONFIG_FB
Michael Ellerman [Wed, 23 Aug 2017 05:37:54 +0000 (15:37 +1000)]
powerpc/configs/mpc5200: Drop no longer needed CONFIG_FB

Since commit a03fdcb18632 ("drm: Add top level Kconfig option for DRM
fbdev emulation") we no longer need to set CONFIG_FB in our
defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Update for CONFIG_INPUT_MOUSEDEV=n
Michael Ellerman [Wed, 23 Aug 2017 05:37:52 +0000 (15:37 +1000)]
powerpc/configs: Update for CONFIG_INPUT_MOUSEDEV=n

In commit 73d8ef76006b ("Input: mousedev - stop offering PS/2 to
userspace by default") the symbol INPUT_MOUSEDEV went from being
'default y' to 'default n' (implied).

That means we no longer need to explicitly disable it in our
defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop removed CONFIG_LOGFS
Michael Ellerman [Wed, 23 Aug 2017 05:37:51 +0000 (15:37 +1000)]
powerpc/configs: Drop removed CONFIG_LOGFS

In commit 1d0fd57a50aa ("logfs: remove from tree"), logfs was removed
from the tree, so we can drop it from our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Turn CONFIG_R128 back in pmac32_defconfig
Michael Ellerman [Wed, 23 Aug 2017 05:37:50 +0000 (15:37 +1000)]
powerpc/configs: Turn CONFIG_R128 back in pmac32_defconfig

In commit d92d9c3a1448 ("drm: hide legacy drivers with
CONFIG_DRM_LEGACY") CONFIG_R128 was moved behind CONFIG_DRM_LEGACY
meaning it stopped being enabled by pmac32_defconfig. Although no one
has noticed, given this is basically a legacy platform, it seems
anyone who is using it probably still wants this driver. So turn it
back on for now.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_LIBCRC32C
Michael Ellerman [Wed, 23 Aug 2017 05:37:49 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_LIBCRC32C

Since commit 300ae149468f ("netfilter: select LIBCRC32C together with
SCTP conntrack") we no longer need to set CONFIG_LIBCRC32C in our
defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop unnecessary CONFIG_EDAC from ppc64e
Michael Ellerman [Wed, 23 Aug 2017 05:37:48 +0000 (15:37 +1000)]
powerpc/configs: Drop unnecessary CONFIG_EDAC from ppc64e

There are no EDAC drivers for ppc64e.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_SCSI
Michael Ellerman [Wed, 23 Aug 2017 05:37:47 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_SCSI

Since commit 67f6d6655993 ("powerpc: convert amigaone_defconfig to use
libata PATA drivers") we no longer need to set CONFIG_SCSI in our
defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_IPV6
Michael Ellerman [Wed, 23 Aug 2017 05:37:46 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_IPV6

Since commit de551f2eb22a ("net: Build IPv6 into kernel by default")
we no longer need to set CONFIG_IPV6 in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Add CONFIG_RAS now required for CONFIG_EDAC
Michael Ellerman [Wed, 23 Aug 2017 05:37:45 +0000 (15:37 +1000)]
powerpc/configs: Add CONFIG_RAS now required for CONFIG_EDAC

In commit e3c4ff6d8c94 ("EDAC: Remove EDAC_MM_EDAC") CONFIG_EDAC grew
a dependency on CONFIG_RAS. Some of our defconfigs don't have the
latter, which means we lose CONFIG_EDAC, so add CONFIG_RAS to fix
that.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_AUDITSYSCALL
Michael Ellerman [Wed, 23 Aug 2017 05:37:44 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_AUDITSYSCALL

Since commit cb74ed278f80 ("audit: always enable syscall auditing when
supported and audit is enabled") we no longer need to set
CONFIG_AUDITSYSCALL in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop CONFIG_SERIAL_TXX9_* from cell/ppc64
Michael Ellerman [Wed, 23 Aug 2017 05:37:43 +0000 (15:37 +1000)]
powerpc/configs: Drop CONFIG_SERIAL_TXX9_* from cell/ppc64

In commit bf4981a00636 ("powerpc: Remove the celleb support") we
dropped the celleb support, which made these symbols unselectable
because we no longer select HAS_TX99_SERIAL. So drop them from the
defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop MEMORY_HOTREMOVE from ppc64/cell
Michael Ellerman [Wed, 23 Aug 2017 05:37:42 +0000 (15:37 +1000)]
powerpc/configs: Drop MEMORY_HOTREMOVE from ppc64/cell

xxxx

In commit 577ec789a79e ("powerpc/cell: Drop select of MEMORY_HOTPLUG")
we removed the last traces of any dependency between

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop unnecessary CONFIG_POWERNV_OP_PANEL
Michael Ellerman [Wed, 23 Aug 2017 05:37:41 +0000 (15:37 +1000)]
powerpc/configs: Drop unnecessary CONFIG_POWERNV_OP_PANEL

In commit 43a1dd9b5fc6 ("powerpc/powernv: Add driver for operator
panel on FSP machines") we added CONFIG_POWERNV_OP_PANEL=m to the
powernv defconfig, but it's default m so that's no necessary.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed PCI_MSI on powernv
Michael Ellerman [Wed, 23 Aug 2017 05:37:40 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed PCI_MSI on powernv

In commit a311e738b6d8 ("powerpc/powernv: Make PCI non-optional") we
made PCI (and therefore PCI_MSI) non-optional on powernv, so it
doesn't need to be in the defconfig anymore.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_SMP for pseries/ppc64/powernv
Michael Ellerman [Wed, 23 Aug 2017 05:37:39 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_SMP for pseries/ppc64/powernv

In commit 40e275653e2c ("powerpc/powernv: Always enable SMP when
building powernv") and 270e2dc9b803 ("powerpc/pseries: Always enable
SMP when building pseries") we forced CONFIG_SMP on for some configs.
Therefore we don't need to set it in those configs anymore.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop unnecessary CONFIG_UPROBE_EVENT
Michael Ellerman [Wed, 23 Aug 2017 05:37:38 +0000 (15:37 +1000)]
powerpc/configs: Drop unnecessary CONFIG_UPROBE_EVENT

In commit 6b0b7551428e ("perf/core: Rename CONFIG_[UK]PROBE_EVENT to
CONFIG_[UK]PROBE_EVENTS") it was renamed to CONFIG_UPROBE_EVENTS.

Additionally it's default y, and we have the prerequisites enabled, so
we don't need it in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop unnecessary CONFIG_NUMA_BALANCING_DEFAULT_ENABLED
Michael Ellerman [Wed, 23 Aug 2017 05:37:37 +0000 (15:37 +1000)]
powerpc/configs: Drop unnecessary CONFIG_NUMA_BALANCING_DEFAULT_ENABLED

In commit 9654f95a081a ("powerpc: Enable NUMA balancing in
pseries[_le]_defconfig") we added CONFIG_NUMA_BALANCING_DEFAULT_ENABLED
to our defconfigs. But it's already enabled by default, so drop it.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_DEVPTS_MULTIPLE_INSTANCES
Michael Ellerman [Wed, 23 Aug 2017 05:37:36 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_DEVPTS_MULTIPLE_INSTANCES

Since commit eedf265aa003 ("devpts: Make each mount of devpts an
independent filesystem.") we no longer need to set
CONFIG_DEVPTS_MULTIPLE_INSTANCES in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_CRYPTO_GCM
Michael Ellerman [Wed, 23 Aug 2017 05:37:35 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_CRYPTO_GCM

Since commit 00b9cfa3ff38 ("mac80111: Add GCMP and GCMP-256 ciphers")
we no longer need to set CONFIG_CRYPTO_GCM in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_CRYPTO_NULL in g5 / c2k
Michael Ellerman [Wed, 23 Aug 2017 05:37:34 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_CRYPTO_NULL in g5 / c2k

Since commit 3491244c6298 ("crypto: echainiv - Set Kconfig default to
m") we no longer need to set CONFIG_CRYPTO_NULL in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_CRYPTO_NULL
Michael Ellerman [Wed, 23 Aug 2017 05:37:33 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_CRYPTO_NULL

Since commit 00b9cfa3ff38 ("mac80111: Add GCMP and GCMP-256 ciphers")
we no longer need to set CONFIG_CRYPTO_NULL in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_CRYPTO_SHA256
Michael Ellerman [Wed, 23 Aug 2017 05:37:32 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_CRYPTO_SHA256

Since commit 826775bbf38f ("crypto: drbg - Add select on sha256") we
no longer need to set CONFIG_CRYPTO_SHA256 in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_CRYPTO_ECB
Michael Ellerman [Wed, 23 Aug 2017 05:37:31 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_CRYPTO_ECB

Since commit 12cb3a1c4184 ("crypto: xts - Add ECB dependency") we no
longer need to set CONFIG_CRYPTO_ECB in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_CRYPTO_HMAC
Michael Ellerman [Wed, 23 Aug 2017 05:37:30 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_CRYPTO_HMAC

Since commit 401e4238f35c ("crypto: rng - Make DRBG the default RNG")
we no longer need to set CONFIG_CRYPTO_HMAC in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_CRYPTO_DEV_VMX_ENCRYPT
Michael Ellerman [Wed, 23 Aug 2017 05:37:29 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_CRYPTO_DEV_VMX_ENCRYPT

Since commit ccf5c442a1b8 ("crypto: vmx - Convert to CPU feature based
module autoloading") we no longer need to set
CONFIG_CRYPTO_DEV_VMX_ENCRYPT in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Update for CONFIG_NF_CT_PROTO_(SCTP|UDPLITE)=y
Michael Ellerman [Wed, 23 Aug 2017 05:37:28 +0000 (15:37 +1000)]
powerpc/configs: Update for CONFIG_NF_CT_PROTO_(SCTP|UDPLITE)=y

In commit a85406afeb3e ("netfilter: conntrack: built-in support for
SCTP"), NF_CT_PROTO_SCTP switched from tristate to bool and became
default y. Similarly in commit 9b91c96c5d1f ("netfilter: conntrack:
built-in support for UDPlite"), NF_CT_PROTO_UDPLITE switched from
tristate to bool and became default y.

We had a few configs which set them to =m, which is no longer valid.
We don't need to change them to =y because both symbols are default y
and are enabled automatically based on the other symbols in the
affected defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Update for CONFIG_FIXED_PHY being selected by CONFIG_OF_MDIO
Michael Ellerman [Wed, 23 Aug 2017 05:37:27 +0000 (15:37 +1000)]
powerpc/configs: Update for CONFIG_FIXED_PHY being selected by CONFIG_OF_MDIO

In commit a5e4bd991362 ("of_mdio: select fixed phy support
unconditionally"), CONFIG_OF_MDIO began selecting CONFIG_FIXED_PHY.

That means we no longer need to set it some of our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Update for CONFIG_DEBUG_FS being selected via CONFIG_RCU_TRACE
Michael Ellerman [Wed, 23 Aug 2017 05:37:26 +0000 (15:37 +1000)]
powerpc/configs: Update for CONFIG_DEBUG_FS being selected via CONFIG_RCU_TRACE

In commit 961518259b3b ("rcu: Enable RCU tracepoints by default to aid
in debugging"), CONFIG_RCU_TRACE was made default y (if CONFIG_TREE_RCU=y,
which it is for some of our configs).

That in turn causes CONFIG_TREE_RCU_TRACE to be enabled, which selects
CONFIG_DEBUG_FS. The end result is that CONFIG_DEBUG_FS is forced on,
meaning we don't have to enable it in some of our configs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_DEVKMEM
Michael Ellerman [Wed, 23 Aug 2017 05:37:25 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_DEVKMEM

Since commit e334cd69fa65 ("Move CONFIG_DEVKMEM default to n") we no
longer need to set CONFIG_DEVKMEM in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop no longer needed CONFIG_FHANDLE
Michael Ellerman [Wed, 23 Aug 2017 05:37:24 +0000 (15:37 +1000)]
powerpc/configs: Drop no longer needed CONFIG_FHANDLE

Since commit f76be61755c5 ("Make CONFIG_FHANDLE default y") we no
longer need to set CONFIG_FHANDLE in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Explicitly drop CONFIG_INPUT_MOUSEDEV
Michael Ellerman [Wed, 23 Aug 2017 05:37:23 +0000 (15:37 +1000)]
powerpc/configs: Explicitly drop CONFIG_INPUT_MOUSEDEV

In commit 73d8ef76006b ("Input: mousedev - stop offering PS/2 to userspace by
default") (Jan 2017), CONFIG_INPUT_MOUSEDEV was switched from default y to
default n, with the explanation:

  Evdev interface has been available for many years and by now everyone
  is switched to using it, so let's stop offering /dev/input/mouseN
  and /dev/psaux by default.

We had a number of configs which had it enabled, but going by the above
explanation probably don't need it enabled anymore.

So drop the last remnants of it from our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Drop unneeded CONFIG_CRYPTO_ANSI_CPRNG
Michael Ellerman [Wed, 23 Aug 2017 05:37:22 +0000 (15:37 +1000)]
powerpc/configs: Drop unneeded CONFIG_CRYPTO_ANSI_CPRNG

Since commit 401e4238f35c ("crypto: rng - Make DRBG the default RNG") we no longer need to set CONFIG_CRYPTO_ANSI_CPRNG in our defconfigs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/configs: Update for symbol movement only
Michael Ellerman [Wed, 23 Aug 2017 05:37:21 +0000 (15:37 +1000)]
powerpc/configs: Update for symbol movement only

Update defconfigs for symbols that have moved around, without their
value changing.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/oops: Line up NIP & MSR with other rows
Michael Ellerman [Wed, 23 Aug 2017 13:56:24 +0000 (23:56 +1000)]
powerpc/oops: Line up NIP & MSR with other rows

This is purely cosmetic, but does look nicer IMHO:

Before:

  task: c000000001453400 task.stack: c000000001c6c000
  NIP: c000000000a0fbfc LR: c000000000a0fbf4 CTR: c000000000ba6220
  REGS: c0000001fffef820 TRAP: 0300   Not tainted  (4.13.0-rc6-gcc-6.3.1-00234-g423af27f7d81)
  MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE>  CR: 88088242  XER: 00000000
  CFAR: c0000000000b3488 DAR: 0000000000000000 DSISR: 42000000 SOFTE: 0

After:
  task: c000000001453400 task.stack: c000000001c6c000
  NIP:  c000000000a0fbfc LR: c000000000a0fbf4 CTR: c000000000ba6220
  REGS: c0000001fffef820 TRAP: 0300   Not tainted  (4.13.0-rc6-gcc-6.3.1-00234-g423af27f7d81-dirty)
  MSR:  8000000000009033 <SF,EE,ME,IR,DR,RI,LE>  CR: 88088242  XER: 00000000
  CFAR: c0000000000b34a4 DAR: 0000000000000000 DSISR: 42000000 SOFTE: 0

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/oops: Print CR/XER on same line as MSR
Michael Ellerman [Wed, 23 Aug 2017 13:56:23 +0000 (23:56 +1000)]
powerpc/oops: Print CR/XER on same line as MSR

Somehow we missed this when the pr_cont() changes went in. Fix CR/XER
to go on the same line as MSR, as they have historically, eg:

  MSR: 8000000000009032 <SF,EE,ME,IR,DR,RI>  CR: 4804408a  XER: 20000000

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/oops: Use IS_ENABLED() for oops markers
Michael Ellerman [Wed, 23 Aug 2017 13:56:22 +0000 (23:56 +1000)]
powerpc/oops: Use IS_ENABLED() for oops markers

Just because it looks less gross.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/oops: Print the kernel's endian in the oops
Michael Ellerman [Wed, 23 Aug 2017 13:56:21 +0000 (23:56 +1000)]
powerpc/oops: Print the kernel's endian in the oops

Although the MSR tells you what endian you're in it's possible that
isn't the same endian the kernel was built for, and if that happens
you're usually having a very bad day. So print a marker to make
it 100% clear which endian the kernel was built for.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/oops: Fix the oops markers to use pr_cont()
Michael Ellerman [Wed, 23 Aug 2017 13:56:20 +0000 (23:56 +1000)]
powerpc/oops: Fix the oops markers to use pr_cont()

When we oops we print a few markers for significant config options
such as PREEMPT, SMP etc. Currently these appear on separate lines
because we're not using pr_cont() properly. Fix it.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv: Fix build error in opal-imc.c when NUMA=n
LABBE Corentin [Wed, 16 Aug 2017 12:34:44 +0000 (14:34 +0200)]
powerpc/powernv: Fix build error in opal-imc.c when NUMA=n

When building a random powerpc kernel I hit this build error:

  arch/powerpc/platforms/powernv/opal-imc.c:130:13: error : assignment
  discards « const » qualifier from pointer target type
  [-Werror=discarded-qualifiers]
     l_cpumask = cpumask_of_node(nid);
             ^

This happens because when CONFIG_NUMA=n cpumask_of_node() returns a
const pointer.

This patch simply adds const to l_cpumask to fix this issue.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
[mpe: Flesh out change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agoAdd documentation for the powerpc memtrace debugfs files
Rashmica Gupta [Thu, 1 Jun 2017 05:34:40 +0000 (15:34 +1000)]
Add documentation for the powerpc memtrace debugfs files

CONFIG_PPC_MEMTRACE must be set to use this feature. This can only be
used on powernv platforms.

Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
[mpe: Update dates and kernel versions, mention size is in bytes]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/powernv: Enable removal of memory for in memory tracing
Rashmica Gupta [Thu, 1 Jun 2017 05:34:38 +0000 (15:34 +1000)]
powerpc/powernv: Enable removal of memory for in memory tracing

The hardware trace macro feature requires access to a chunk of real
memory. This patch provides a debugfs interface to do this. By
writing an integer containing the size of memory to be unplugged into
/sys/kernel/debug/powerpc/memtrace/enable, the code will attempt to
remove that much memory from the end of each NUMA node.

This patch also adds additional debugsfs files for each node that
allows the tracer to interact with the removed memory, as well as
a trace file that allows userspace to read the generated trace.

Note that this patch does not invoke the hardware trace macro, it
only allows memory to be removed during runtime for the trace macro
to utilise.

Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
[mpe: Minor formatting etc fixups]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/uprobes: Implement arch_uretprobe_is_alive()
Naveen N. Rao [Wed, 14 Jun 2017 15:44:00 +0000 (21:14 +0530)]
powerpc/uprobes: Implement arch_uretprobe_is_alive()

This helper is used to detect if a uprobe'd function has returned
through a setjmp/longjmp, rather than branching to the LR that was
updated previously by us. This fixes a SIGSEGV that gets generated when
programs use setjmp/longjmp with uretprobes.

We use the arm64 model (arch/arm64/kernel/probes/uprobes.c:
arch_uretprobe_is_alive()) for detecting when stack frames have been
removed from under us.

Reference:
https://marc.info/?l=linux-kernel&m=143748610330073
commit 7b868e4802a86 ("uprobes/x86: Reimplement arch_uretprobe_is_alive()")
commit db087ef69a2b1 ("uprobes/x86: Make arch_uretprobe_is_alive(RP_CHECK_CALL) more
clever")

Tested with the test program from:
https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=blob;f=testsuite/systemtap.base/bz5274.c;hb=HEAD

And this script:
    $ cat test.sh
    #!/bin/bash

    perf probe -x ./bz5274 -a bz5274_main_return=main%return
    perf probe -x ./bz5274 -a bz5274_funca_return=funca%return
    perf probe -x ./bz5274 -a bz5274_funcb_return=funcb%return
    perf probe -x ./bz5274 -a bz5274_funcc_return=funcc%return
    perf probe -x ./bz5274 -a bz5274_funcd_return=funcd%return

    perf record -e 'probe_bz5274:*' -aR ./bz5274

Reported-by: Gustavo Luiz Duarte <gduarte@redhat.com>
Reported-by: zsun@redhat.com
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/kprobes: Don't save/restore DAR/DSISR to/from pt_regs for optprobes
Naveen N. Rao [Thu, 8 Jun 2017 19:16:55 +0000 (00:46 +0530)]
powerpc/kprobes: Don't save/restore DAR/DSISR to/from pt_regs for optprobes

We don't save/restore these across a trap, or with KPROBES_ON_FTRACE.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/xive: Fix the size of the cpumask used in xive_find_target_in_mask()
Cédric Le Goater [Tue, 8 Aug 2017 09:02:49 +0000 (11:02 +0200)]
powerpc/xive: Fix the size of the cpumask used in xive_find_target_in_mask()

When called from xive_irq_startup(), the size of the cpumask can be
larger than nr_cpu_ids. This can result in a WARN_ON such as:

  WARNING: CPU: 10 PID: 1 at ../arch/powerpc/sysdev/xive/common.c:476 xive_find_target_in_mask+0x110/0x2f0
  ...
  NIP [c00000000008a310] xive_find_target_in_mask+0x110/0x2f0
  LR [c00000000008a2e4] xive_find_target_in_mask+0xe4/0x2f0
  Call Trace:
    xive_find_target_in_mask+0x74/0x2f0 (unreliable)
    xive_pick_irq_target.isra.1+0x200/0x230
    xive_irq_startup+0x60/0x180
    irq_startup+0x70/0xd0
    __setup_irq+0x7bc/0x880
    request_threaded_irq+0x14c/0x2c0
    request_event_sources_irqs+0x100/0x180
    __machine_initcall_pseries_init_ras_IRQ+0x104/0x134
    do_one_initcall+0x68/0x1d0
    kernel_init_freeable+0x290/0x374
    kernel_init+0x24/0x170
    ret_from_kernel_thread+0x5c/0x74

This happens because we're being called with our affinity mask set to
irq_default_affinity. That in turn was populated using
cpumask_setall(), which sets NR_CPUs worth of bits, not nr_cpu_ids
worth. Finally cpumask_weight() will return > nr_cpu_ids when passed a
mask which has > nr_cpu_ids bits set.

Fix it by limiting the value returned by cpumask_weight().

Signed-off-by: Cédric Le Goater <clg@kaod.org>
[mpe: Add change log details on actual cause]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64: Optimise set/clear of CTRL[RUN] (runlatch)
Nicholas Piggin [Fri, 11 Aug 2017 16:39:07 +0000 (02:39 +1000)]
powerpc/64: Optimise set/clear of CTRL[RUN] (runlatch)

On modern CPUs the CTRL register is read-only except bit 63 which is
the run latch control. This means it can be updated with a mtspr
rather than mfspr/mtspr.

To accomodate older CPUs (Cell at least), where there are other bits
in the register, we still do a read/modify/write on pre 2.06 CPUs.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Update change log to mention 2.06 workaround]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s: Remove spurious IRQ reason in IRQ replay
Nicholas Piggin [Fri, 11 Aug 2017 16:39:06 +0000 (02:39 +1000)]
powerpc/64s: Remove spurious IRQ reason in IRQ replay

HVI interrupts have always used 0x500, so remove the dead branch.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64: Remove redundant instruction in interrupt replay
Nicholas Piggin [Fri, 11 Aug 2017 16:39:05 +0000 (02:39 +1000)]
powerpc/64: Remove redundant instruction in interrupt replay

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s: Use the HV handler for external IRQ replay in HV mode on POWER9
Nicholas Piggin [Fri, 11 Aug 2017 16:39:04 +0000 (02:39 +1000)]
powerpc/64s: Use the HV handler for external IRQ replay in HV mode on POWER9

POWER9 host external interrupts use the h_virt_irq_common handler, so
use that to replay them rather than using the hardware_interrupt_common
handler. Both call do_IRQ, but using the correct handler reduces
i-cache footprint.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64s: Merge HV and non-HV paths for doorbell IRQ replay
Nicholas Piggin [Fri, 11 Aug 2017 16:39:03 +0000 (02:39 +1000)]
powerpc/64s: Merge HV and non-HV paths for doorbell IRQ replay

This results in smaller code, and fewer branches. This relies on the
fact that both the 0xe80 and 0xa00 handlers call the same upper level
code, namely doorbell_exception().

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Mention we rely on the implementation of the 0xe80/0xa00 handlers]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agopowerpc/64: Cleanup __check_irq_replay()
Nicholas Piggin [Fri, 11 Aug 2017 16:39:02 +0000 (02:39 +1000)]
powerpc/64: Cleanup __check_irq_replay()

Move the clearing of irq_happened bits into the condition where they
were found to be set. This reduces instruction count slightly, and
reduces stores into irq_happened.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>