LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] powerpc/pkeys: Remove unused code
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: mpe, Sandipan Das; +Cc: linuxram, linuxppc-dev, aneesh.kumar
In-Reply-To: <20210202150050.75335-1-sandipan@linux.ibm.com>

On Tue, 2 Feb 2021 20:30:50 +0530, Sandipan Das wrote:
> This removes arch_supports_pkeys(), arch_usable_pkeys() and
> thread_pkey_regs_*() which are remnants from the following:
> 
> commit 06bb53b33804 ("powerpc: store and restore the pkey state across context switches")
> commit 2cd4bd192ee9 ("powerpc/pkeys: Fix handling of pkey state across fork()")
> commit cf43d3b26452 ("powerpc: Enable pkey subsystem")
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/pkeys: Remove unused code
      https://git.kernel.org/powerpc/c/266d8f7586533a4c473ccb392204e32df99b72b5

cheers

^ permalink raw reply

* Re: [PATCH v2] powerpc/powernv/pci: Drop pnv_phb->initialized
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Oliver O'Halloran
In-Reply-To: <20200902013657.1753830-1-oohall@gmail.com>

On Wed, 2 Sep 2020 11:36:57 +1000, Oliver O'Halloran wrote:
> The pnv_phb->initialized flag is an odd beast. It was added back in 2012 in
> commit db1266c85261 ("powerpc/powernv: Skip check on PE if necessary") to
> allow devices to be enabled even if the device had not yet been assigned to
> a PE. Allowing the device to be enabled before the PE is configured may
> cause spurious EEH events since none of the IOMMU context has been setup.
> 
> I'm not entirely sure why this was ever necessary. My best guess is that it
> was an workaround for a bug or some other undesireable behaviour from the
> PCI core. Either way, it's unnecessary now since as of commit dc3d8f85bb57
> ("powerpc/powernv/pci: Re-work bus PE configuration") we can guarantee that
> the PE will be configured before the PCI core will allow drivers to bind to
> the device.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/powernv/pci: Drop pnv_phb->initialized
      https://git.kernel.org/powerpc/c/24b4c6b1a7fc79fe8142d50cb439944b81b659ff

cheers

^ permalink raw reply

* Re: [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs()
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Oliver O'Halloran; +Cc: Paul Mackerras
In-Reply-To: <20201103043523.916109-1-oohall@gmail.com>

On Tue, 3 Nov 2020 15:35:06 +1100, Oliver O'Halloran wrote:
> On many powerpc platforms the discovery and initalisation of
> pci_controllers (PHBs) happens inside of setup_arch(). This is very early
> in boot (pre-initcalls) and means that we're initialising the PHB long
> before many basic kernel services (slab allocator, debugfs, a real ioremap)
> are available.
> 
> On PowerNV this causes an additional problem since we map the PHB registers
> with ioremap(). As of commit d538aadc2718 ("powerpc/ioremap: warn on early
> use of ioremap()") a warning is printed because we're using the "incorrect"
> API to setup and MMIO mapping in searly boot. The kernel does provide
> early_ioremap(), but that is not intended to create long-lived MMIO
> mappings and a seperate warning is printed by generic code if
> early_ioremap() mappings are "leaked."
> 
> [...]

Applied to powerpc/next.

[01/18] powerpc/pci: Add ppc_md.discover_phbs()
        https://git.kernel.org/powerpc/c/5537fcb319d016ce387f818dd774179bc03217f5
[02/18] powerpc/pci: Move PHB discovery for PCI_DN using platforms
        https://git.kernel.org/powerpc/c/fbbefb320214db14c3e740fce98e2c95c9d0669b
[03/18] powerpc/maple: Move PHB discovery
        (squashed into 2)
[04/18] powerpc/512x: Move PHB discovery
        https://git.kernel.org/powerpc/c/893586ec949d3e48573a585c26bf04998fea6e1f
[05/18] powerpc/52xx/efika: Move PHB discovery
        https://git.kernel.org/powerpc/c/eab3166f4eac384b48ebd2ed7b61dc465c1912cf
[06/18] powerpc/52xx/lite5200: Move PHB discovery
        https://git.kernel.org/powerpc/c/e0bf9de2242a31a8f79015376ed08c4efe74774a
[07/18] powerpc/52xx/media5200: Move PHB discovery
        https://git.kernel.org/powerpc/c/ba5087622a0f11c8d3c6587392ebc70f96503e51
[08/18] powerpc/52xx/mpc5200_simple: Move PHB discovery
        https://git.kernel.org/powerpc/c/a760cfd9cfa2193961d7e599f46fbfe2498c400a
[09/18] powerpc/82xx/*: Move PHB discovery
        https://git.kernel.org/powerpc/c/3c82a6aecd367bbbe7876c406cd3e12b5b0e4204
[10/18] powerpc/83xx: Move PHB discovery
        https://git.kernel.org/powerpc/c/83f84041ff1cf6c23fc38861218af2d4ca2d9b38
[11/18] powerpc/amigaone: Move PHB discovery
        https://git.kernel.org/powerpc/c/053d58c870298d62b9c5154672ef2f1684c4ea43
[12/18] powerpc/chrp: Move PHB discovery
        https://git.kernel.org/powerpc/c/407d418f2fd4c20aa8ca1cf4168a414d77766852
[13/18] powerpc/embedded6xx/holly: Move PHB discovery
        https://git.kernel.org/powerpc/c/08c4738254b87117c69816d8033dd25f38185f92
[14/18] powerpc/embedded6xx/linkstation: Move PHB discovery
        https://git.kernel.org/powerpc/c/daa6c24780c15f4abcb76a9d426142beff9f62c6
[15/18] powerpc/embedded6xx/mpc7448: Move PHB discovery
        https://git.kernel.org/powerpc/c/748770aeb44108ecb4e09d273e7718611cd60a98
[16/18] powerpc/embedded6xx/mve5100: Move PHB discovery
        https://git.kernel.org/powerpc/c/d20a864f434b277b245ac6508920d90a48f6155d
[17/18] powerpc/pasemi: Move PHB discovery
        https://git.kernel.org/powerpc/c/c144bc719234500e292c0545de99822bd8a78a6b
[18/18] powerpc/powermac: Move PHB discovery
        (squashed into 2)

cheers

^ permalink raw reply

* Re: [PATCH v7 00/42] powerpc: interrupt wrappers
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Nicholas Piggin; +Cc: Athira Rajeev
In-Reply-To: <20210130130852.2952424-1-npiggin@gmail.com>

On Sat, 30 Jan 2021 23:08:10 +1000, Nicholas Piggin wrote:
> This adds interrupt handler wrapper functions, similar to the
> generic / x86 code, and moves several common operations into them
> from either asm or open coded in the individual handlers.
> 
> This series is based on powerpc fixes-test tree, there's another
> unrelated pending fix in patch 1 of the series which clashes a
> bit.
> 
> [...]

Patches 1-41 applied to powerpc/next.

[01/42] powerpc/64s: interrupt exit improve bounding of interrupt recursion
        https://git.kernel.org/powerpc/c/c0ef717305f51e29b5ce0c78a6bfe566b3283415
[02/42] KVM: PPC: Book3S HV: Context tracking exit guest context before enabling irqs
        https://git.kernel.org/powerpc/c/112665286d08c87e66d699e7cba43c1497ad165f
[03/42] powerpc/32s: move DABR match out of handle_page_fault
        https://git.kernel.org/powerpc/c/7a24ae2e172f770df07f8e48ed3ed2f3a6b17e37
[04/42] powerpc/64s: move DABR match out of handle_page_fault
        https://git.kernel.org/powerpc/c/36f0114140eef53e931592b65bdf8bb61ffac1f8
[05/42] powerpc/64s: move the hash fault handling logic to C
        https://git.kernel.org/powerpc/c/a4922f5442e7e6ce85da304e224d940edec2f1fb
[06/42] powerpc: remove arguments from fault handler functions
        https://git.kernel.org/powerpc/c/a01a3f2ddbcda83e8572787c0ec1dcbeba86915a
[07/42] powerpc/fsl_booke/32: CacheLockingException remove args
        https://git.kernel.org/powerpc/c/b4ced8031000b832d845dd17994e0fa1b8310496
[08/42] powerpc: do_break get registers from regs
        https://git.kernel.org/powerpc/c/18722ecf9efdc6a7ca933a3e5a83cc9dba375847
[09/42] powerpc: DebugException remove args
        https://git.kernel.org/powerpc/c/755d664174463791489dddf34c33308b61de68c3
[10/42] powerpc/32: transfer can avoid saving r4/r5 over trace call
        https://git.kernel.org/powerpc/c/73d7a97914f23397b012e851f6a1fe4061923a82
[11/42] powerpc: bad_page_fault get registers from regs
        https://git.kernel.org/powerpc/c/8458c628a53ba4311b2df12370be1a6f1870ff37
[12/42] powerpc/64s: add do_bad_page_fault_segv handler
        https://git.kernel.org/powerpc/c/71f47976fafc4375674bd0714153be10f878040a
[13/42] powerpc: rearrange do_page_fault error case to be inside exception_enter
        https://git.kernel.org/powerpc/c/4cb8428465148bcca0b6b8593d51f805818a70e0
[14/42] powerpc/64s: move bad_page_fault handling to C
        https://git.kernel.org/powerpc/c/f4c03b0e520c5f56e569a8da3fce5ddbd0696742
[15/42] powerpc/64s: split do_hash_fault
        https://git.kernel.org/powerpc/c/bf0e2374aa7b4f8b01fd59fcb0746a9b6b05326a
[16/42] powerpc/mm: Remove stale do_page_fault comment referring to SLB faults
        https://git.kernel.org/powerpc/c/31d6490ccb2868530300381d8079026cd4a9f7ad
[17/42] powerpc/64s: slb comment update
        https://git.kernel.org/powerpc/c/e44370abb2e99299678ec6b209f8aad574fa5f36
[18/42] powerpc/traps: add NOKPROBE_SYMBOL for sreset and mce
        https://git.kernel.org/powerpc/c/3a3138836bc35966d59742512b597997755878f7
[19/42] powerpc/perf: move perf irq/nmi handling details into traps.c
        https://git.kernel.org/powerpc/c/156b5371a9c2482a9ad23ec82d1a4f89a3ab430d
[20/42] powerpc/time: move timer_broadcast_interrupt prototype to asm/time.h
        https://git.kernel.org/powerpc/c/0440b8a22cc48922f7c6ae894abd221cf7cc4b64
[21/42] powerpc: add and use unknown_async_exception
        https://git.kernel.org/powerpc/c/6c6aee009ec34cb7f5ef76f910c1b9417c81efd8
[22/42] powerpc/cell: tidy up pervasive declarations
        https://git.kernel.org/powerpc/c/dcdb4f12963f3f4200e24e1dad78564a98736f67
[23/42] powerpc: introduce die_mce
        https://git.kernel.org/powerpc/c/209e9d500e25eada096b2c09a34093bc458166f3
[24/42] powerpc/mce: ensure machine check handler always tests RI
        https://git.kernel.org/powerpc/c/c538938fa2cfdc806c6304888e3876729e6939e0
[25/42] powerpc: improve handling of unrecoverable system reset
        https://git.kernel.org/powerpc/c/11cb0a25f71818ca7ab4856548ecfd83c169aa4d
[26/42] powerpc: interrupt handler wrapper functions
        https://git.kernel.org/powerpc/c/8d41fc618ab804657acd2df8e761ce1001f41513
[27/42] powerpc: add interrupt wrapper entry / exit stub functions
        https://git.kernel.org/powerpc/c/25b7e6bb743ca5a375bb89522a2c2bec840d5fc3
[28/42] powerpc: convert interrupt handlers to use wrappers
        https://git.kernel.org/powerpc/c/3a96570ffceb15c6ed9cc6f990f172dcdc8ac279
[29/42] powerpc: add interrupt_cond_local_irq_enable helper
        https://git.kernel.org/powerpc/c/e6f8a6c86ce7b2108c03c1cc014fdae278573df1
[30/42] powerpc/64: context tracking remove _TIF_NOHZ
        https://git.kernel.org/powerpc/c/2a06bf3e95cd93e3640d431960181b8e47415f33
[31/42] powerpc/64s/hash: improve context tracking of hash faults
        https://git.kernel.org/powerpc/c/a008f8f9fd67ffb13d906ef4ea6235a3d62dfdb6
[32/42] powerpc/64: context tracking move to interrupt wrappers
        https://git.kernel.org/powerpc/c/540d4d34bef4ec58aba12b159030492616d6f54e
[33/42] powerpc/64: add context tracking to asynchronous interrupts
        https://git.kernel.org/powerpc/c/6fdb0f410bb026ade092039a6c2655a53323c996
[34/42] powerpc: handle irq_enter/irq_exit in interrupt handler wrappers
        https://git.kernel.org/powerpc/c/1b1b6a6f4cc0ecc27745fa578cbaf912d76dbdda
[35/42] powerpc/64s: move context tracking exit to interrupt exit path
        https://git.kernel.org/powerpc/c/f821bc97dee4f3ee92c3668d495af49dfd720fe0
[36/42] powerpc/64s: reconcile interrupts in C
        https://git.kernel.org/powerpc/c/75b96950fddab6f1c59a10160b6bf38948bdb0e3
[37/42] powerpc/64: move account_stolen_time into its own function
        https://git.kernel.org/powerpc/c/2994e1babfc477a3101ec6841b9dc5b770c1ec18
[38/42] powerpc/64: entry cpu time accounting in C
        https://git.kernel.org/powerpc/c/56acfdd8bf9f75e83a1b2957bd415368f39b67b6
[39/42] powerpc: move NMI entry/exit code into wrapper
        https://git.kernel.org/powerpc/c/118178e62e2e0da39b394e812fef7179c8bdb3bc
[40/42] powerpc/64s: move NMI soft-mask handling to C
        https://git.kernel.org/powerpc/c/6ecbb582b6947f041832fff07c2f38791ae19287
[41/42] powerpc/64s: runlatch interrupt handling in C
        https://git.kernel.org/powerpc/c/86dbb39416493add2bdf5b7ad39a1276f2107b83

cheers

^ permalink raw reply

* Re: [PATCH 0/7] powerpc/64s: TLB flushing improvements
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Nicholas Piggin
In-Reply-To: <20201217134731.488135-1-npiggin@gmail.com>

On Thu, 17 Dec 2020 23:47:24 +1000, Nicholas Piggin wrote:
> Another round of reducing TLB flushing (mostly on radix).
> 
> Thanks,
> Nick
> 
> Nicholas Piggin (7):
>   powerpc/64s/radix: add warning and comments in mm_cpumask trim
>   powerpc/64s/radix: refactor TLB flush type selection
>   powerpc/64s/radix: Check for no TLB flush required
>   powerpc/64s/radix: Allow mm_cpumask trimming from external sources
>   powerpc/64s/radix: occasionally attempt to trim mm_cpumask
>   powerpc/64s/radix: serialize_against_pte_lookup IPIs trim mm_cpumask
>   powerpc/64s: Implement ptep_clear_flush_young that does not flush TLBs
> 
> [...]

Applied to powerpc/next.

[1/7] powerpc/64s/radix: add warning and comments in mm_cpumask trim
      https://git.kernel.org/powerpc/c/a2496049f1f1006178d0db706a8451dd03bd3ec6
[2/7] powerpc/64s/radix: refactor TLB flush type selection
      https://git.kernel.org/powerpc/c/26418b36a11f2eaf2556aa8cefe86132907e311f
[3/7] powerpc/64s/radix: Check for no TLB flush required
      https://git.kernel.org/powerpc/c/54bb503345b81399575e2b7a3a6497ae212ad827
[4/7] powerpc/64s/radix: Allow mm_cpumask trimming from external sources
      https://git.kernel.org/powerpc/c/780de40601aabeca41bc9aa717a329a77aa85e1a
[5/7] powerpc/64s/radix: occasionally attempt to trim mm_cpumask
      https://git.kernel.org/powerpc/c/9393544842d6c85ebfc387c43a5059f8171d598f
[6/7] powerpc/64s/radix: serialize_against_pte_lookup IPIs trim mm_cpumask
      https://git.kernel.org/powerpc/c/032b7f08932c9b212952d6d585e45b2941b3e8be
[7/7] powerpc/64s: Implement ptep_clear_flush_young that does not flush TLBs
      https://git.kernel.org/powerpc/c/3cb1aa7aa39402f4f2cb847b1f16ade3bce43a97

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Nathan Lynch; +Cc: tyreld, brking
In-Reply-To: <20210107025900.410369-1-nathanl@linux.ibm.com>

On Wed, 6 Jan 2021 20:59:00 -0600, Nathan Lynch wrote:
> dlpar_configure_connector() has two problems in its handling of
> ibm,configure-connector's return status:
> 
> 1. When the status is -2 (busy, call again), we call
>    ibm,configure-connector again immediately without checking whether
>    to schedule, which can result in monopolizing the CPU.
> 2. Extended delay status (9900..9905) goes completely unhandled,
>    causing the configuration to unnecessarily terminate.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/pseries/dlpar: handle ibm, configure-connector delay status
      https://git.kernel.org/powerpc/c/768d70e19ba525debd571b36e6d0ab19956c63d7

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/akebono: Fix unmet dependency errors
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Michael Ellerman; +Cc: f.fainelli, rdunlap, yury.norov
In-Reply-To: <20210201012503.940145-1-mpe@ellerman.id.au>

On Mon, 1 Feb 2021 12:25:03 +1100, Michael Ellerman wrote:
> The AKEBONO config has various selects under it, including some with
> user-selectable dependencies, which means those dependencies can be
> disabled. This leads to warnings from Kconfig.
> 
> This can be seen with eg:
> 
>   $ make allnoconfig
>   $ ./scripts/config --file build~/.config -k -e CONFIG_44x -k -e CONFIG_PPC_47x -e CONFIG_AKEBONO
>   $ make olddefconfig
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/akebono: Fix unmet dependency errors
      https://git.kernel.org/powerpc/c/665d8d58761cba41147fe7e98e2ceed1cbf603a2

cheers

^ permalink raw reply

* Re: [PATCH 1/2] powerpc/64: Make stack tracing work during very early boot
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Michael Ellerman
In-Reply-To: <20210202130207.1303975-1-mpe@ellerman.id.au>

On Wed, 3 Feb 2021 00:02:06 +1100, Michael Ellerman wrote:
> If we try to stack trace very early during boot, either due to a
> WARN/BUG or manual dump_stack(), we will oops in
> valid_emergency_stack() when we try to dereference the paca_ptrs
> array.
> 
> The fix is simple, we just return false if paca_ptrs isn't allocated
> yet. The stack pointer definitely isn't part of any emergency stack
> because we haven't allocated any yet.

Applied to powerpc/next.

[1/2] powerpc/64: Make stack tracing work during very early boot
      https://git.kernel.org/powerpc/c/0ecf6a9e47d825b7dddfebca738386b809e59a94
[2/2] powerpc/64s: Handle program checks in wrong endian during early boot
      https://git.kernel.org/powerpc/c/e7eb919057c3450cdd9d335e4a23a4da8da58db4

cheers

^ permalink raw reply

* Re: [PATCH] powerpc: remove unneeded semicolons
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: Chengyang Fan, mpe; +Cc: joe, linuxppc-dev
In-Reply-To: <20210125095338.1719405-1-cy.fan@huawei.com>

On Mon, 25 Jan 2021 17:53:38 +0800, Chengyang Fan wrote:
> Remove superfluous semicolons after function definitions.

Applied to powerpc/next.

[1/1] powerpc: remove unneeded semicolons
      https://git.kernel.org/powerpc/c/6c6fdbb2b7002aa04e418b5d2b26df1c5ba5ab80

cheers

^ permalink raw reply

* Re: [PATCH v2] powerpc64/idle: Fix SP offsets when saving GPRs
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: linuxppc-dev, Christopher M. Riedl
In-Reply-To: <20210206072342.5067-1-cmr@codefail.de>

On Sat, 6 Feb 2021 01:23:42 -0600, Christopher M. Riedl wrote:
> The idle entry/exit code saves/restores GPRs in the stack "red zone"
> (Protected Zone according to PowerPC64 ELF ABI v2). However, the offset
> used for the first GPR is incorrect and overwrites the back chain - the
> Protected Zone actually starts below the current SP. In practice this is
> probably not an issue, but it's still incorrect so fix it.
> 
> Also expand the comments to explain why using the stack "red zone"
> instead of creating a new stackframe is appropriate here.

Applied to powerpc/next.

[1/1] powerpc64/idle: Fix SP offsets when saving GPRs
      https://git.kernel.org/powerpc/c/73287caa9210ded6066833195f4335f7f688a46b

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/uaccess: Perform barrier_nospec() in KUAP allowance helpers
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: Michael Ellerman, cmr, Benjamin Herrenschmidt, Christophe Leroy,
	Paul Mackerras
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <c72f014730823b413528e90ab6c4d3bcb79f8497.1612692067.git.christophe.leroy@csgroup.eu>

On Sun, 7 Feb 2021 10:08:11 +0000 (UTC), Christophe Leroy wrote:
> barrier_nospec() in uaccess helpers is there to protect against
> speculative accesses around access_ok().
> 
> When using user_access_begin() sequences together with
> unsafe_get_user() like macros, barrier_nospec() is called for
> every single read although we know the access_ok() is done
> onece.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/uaccess: Perform barrier_nospec() in KUAP allowance helpers
      https://git.kernel.org/powerpc/c/8524e2e76441fc615a3b5c1415823e051cc79eae

cheers

^ permalink raw reply

* Re: [PATCH V2] powerpc/perf: Record counter overflow always if SAMPLE_IP is unset
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: Athira Rajeev, mpe; +Cc: maddy, linuxppc-dev
In-Reply-To: <1612516492-1428-1-git-send-email-atrajeev@linux.vnet.ibm.com>

On Fri, 5 Feb 2021 04:14:52 -0500, Athira Rajeev wrote:
> While sampling for marked events, currently we record the sample only
> if the SIAR valid bit of Sampled Instruction Event Register (SIER) is
> set. SIAR_VALID bit is used for fetching the instruction address from
> Sampled Instruction Address Register(SIAR). But there are some usecases,
> where the user is interested only in the PMU stats at each counter
> overflow and the exact IP of the overflow event is not required.
> Dropping SIAR invalid samples will fail to record some of the counter
> overflows in such cases.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/perf: Record counter overflow always if SAMPLE_IP is unset
      https://git.kernel.org/powerpc/c/d137845c973147a22622cc76c7b0bc16f6206323

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/8xx: Fix software emulation interrupt
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: npiggin, Michael Ellerman, Benjamin Herrenschmidt,
	Christophe Leroy, Paul Mackerras
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <ad782af87a222efc79cfb06079b0fd23d4224eaf.1612515180.git.christophe.leroy@csgroup.eu>

On Fri, 5 Feb 2021 08:56:13 +0000 (UTC), Christophe Leroy wrote:
> For unimplemented instructions or unimplemented SPRs, the 8xx triggers
> a "Software Emulation Exception" (0x1000). That interrupt doesn't set
> reason bits in SRR1 as the "Program Check Exception" does.
> 
> Go through emulation_assist_interrupt() to set REASON_ILLEGAL.

Applied to powerpc/next.

[1/1] powerpc/8xx: Fix software emulation interrupt
      https://git.kernel.org/powerpc/c/903178d0ce6bb30ef80a3604ab9ee2b57869fbc9

cheers

^ permalink raw reply

* Re: [PATCH 1/3] powerpc/32s: Change mfsrin() into a static inline function
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Michael Ellerman, Christophe Leroy,
	Paul Mackerras
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <72c7b9879e2e2e6f5c27dadda6486386c2b50f23.1612612022.git.christophe.leroy@csgroup.eu>

On Sat, 6 Feb 2021 11:47:26 +0000 (UTC), Christophe Leroy wrote:
> mfsrin() is a macro.
> 
> Change in into an inline function to avoid conflicts in KVM
> and make it more evolutive.

Applied to powerpc/next.

[1/3] powerpc/32s: Change mfsrin() into a static inline function
      https://git.kernel.org/powerpc/c/fd659e8f2c6d1e1e96fd5bdb515518801cd02012
[2/3] powerpc/32s: mfsrin()/mtsrin() become mfsr()/mtsr()
      https://git.kernel.org/powerpc/c/179ae57dbad1b9a83eec376aa44d54fc24352e37
[3/3] powerpc/32s: Allow constant folding in mtsr()/mfsr()
      https://git.kernel.org/powerpc/c/b842d131c7983f8f0b9c9572c073130b5f2bcf11

cheers

^ permalink raw reply

* Re: [PATCH 0/3] powerpc/perf: Add Performance Monitor Counters to extended regs
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
  To: acme, jolsa, Athira Rajeev, mpe; +Cc: kjain, maddy, linuxppc-dev
In-Reply-To: <1612335337-1888-1-git-send-email-atrajeev@linux.vnet.ibm.com>

On Wed, 3 Feb 2021 01:55:34 -0500, Athira Rajeev wrote:
> Patch set to add Performance Monitor Counter SPR's as
> part of extended regs in powerpc.
> 
> Patch 1/3 saves the PMC values in the perf interrupt
> handler as part of per-cpu array.
> Patch 2/3 adds PMC1 to PMC6 as part of the extended
> regs mask.
> Patch 3/3 includes perf tools side changes to add
> PMC1 to PMC6 to sample_reg_mask to use with -I? option.
> 
> [...]

Patches 1 & 2 applied to powerpc/next.

[1/3] powerpc/perf: Include PMCs as part of per-cpu cpuhw_events struct
      https://git.kernel.org/powerpc/c/91f3469a43fd1fb831649c2a2e684bf5ad4818b2
[2/3] powerpc/perf: Expose Performance Monitor Counter SPR's as part of extended regs
      https://git.kernel.org/powerpc/c/e79b76e03b712e42c58d9649c92571e346abc38b

cheers

^ permalink raw reply

* Re: [PATCH] selftests/powerpc: Fix L1D flushing tests for Power10
From: Michael Ellerman @ 2021-02-10 12:22 UTC (permalink / raw)
  To: Russell Currey, linuxppc-dev; +Cc: dja
In-Reply-To: <20210210052242.2862462-1-ruscur@russell.cc>

Russell Currey <ruscur@russell.cc> writes:
> The rfi_flush and entry_flush selftests work by using the PM_LD_MISS_L1
> perf event to count L1D misses.  The value of this event has changed
> over time:
>
> - Power7 uses 0x400f0
> - Power8 and Power9 use both 0x400f0 and 0x3e054
> - Power10 uses only 0x3e054
>
> Update these selftests to use the value 0x3e054 on P10 and later,
> fixing the tests from finding 0 events.

I wonder if we can just use the cache events that the kernel knows
about.

ie, switch the type to PERF_TYPE_HW_CACHE and the event to
PERF_COUNT_HW_CACHE_MISSES.

That would end up using the same event on power7 and power8:

$ git grep PERF_COUNT_HW_CACHE_MISSES arch/powerpc/perf/power{7,8,9,10}*.c
arch/powerpc/perf/power7-pmu.c: [PERF_COUNT_HW_CACHE_MISSES] =                  PM_LD_MISS_L1,
arch/powerpc/perf/power8-pmu.c: [PERF_COUNT_HW_CACHE_MISSES] =                  PM_LD_MISS_L1,
arch/powerpc/perf/power9-pmu.c: [PERF_COUNT_HW_CACHE_MISSES] =                  PM_LD_MISS_L1_FIN,
arch/powerpc/perf/power10-pmu.c:        [PERF_COUNT_HW_CACHE_MISSES] =                  PM_LD_MISS_L1,
arch/powerpc/perf/power10-pmu.c:        [PERF_COUNT_HW_CACHE_MISSES] =                  PM_LD_DEMAND_MISS_L1_FIN,

On power9 and power10 it's using slightly different events. But I think
it should still work, because these tests just counts misses
with/without the various flushes enabled.

The distinction between loads that miss at execute vs finish shouldn't
matter, but you'd need to test.

The advantage would be we wouldn't then need to update the test again
for future CPUs.

cheers

^ permalink raw reply

* Re: interrupt_exit_kernel_prepare() on booke/32 has a useless 'mfmsr' and two 'wrteei 0'
From: Nicholas Piggin @ 2021-02-10 11:45 UTC (permalink / raw)
  To: Christophe Leroy, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <f143d4a9-bb8f-82d6-8b17-c39aff486caa@csgroup.eu>

Excerpts from Christophe Leroy's message of February 10, 2021 7:21 pm:
> 44x/bamboo_defconfig
> 
> For the mfmsr, that's because mfmsr is defined as 'asm volatile'. Is that correct ? Reading MSR 
> doesn't have any side effects as far as I know, should we remove the volatile ?

Well I'm not really sure. It depends on the MSR value, so it must not 
assume it's unchanging.

If you just have asm ("mfmsr %0" : "=r"(msr)) then that's wrong because 
it will omit the second mfmsr in a mfmsr() ; mtmsr() ; mfmsr() sequence.

Adding a "memory" clobber there makes gcc produce the second mfmsr, but 
I don't know if that's really the right thing to do.

> 
> For the wrteei, that's because we are calling __hard_EE_RI_disable() after local_irq_save(). On 
> booke those two fonctions do exactly the same because RI doesn't exist. Could we replace that by a 
> __hard_RI_disable() that would be a nop on booke ?

Not on 64-bit because local_irq_disable() doesn't disable EE there.
You could have something like __hard_EE_RI_disable_irqoff() that is to 
be called only in irq disabled region. But is that just adding too much 
complexity to try to keep 32 and 64 bit unified?

Maybe just making different code paths for 32 and 64 would be best. 
32-bit seems fairly simple

	if (!arch_irq_disabled_regs(regs)) {
                /* Returning to a kernel context with local irqs enabled. */
                WARN_ON_ONCE(!(regs->msr & MSR_EE));

       		local_irq_disable();
                if (IS_ENABLED(CONFIG_PREEMPT)) {
                        /* Return to preemptible kernel context */
                        if (unlikely(*ti_flagsp & _TIF_NEED_RESCHED)) {
                                if (preempt_count() == 0)
                                        preempt_schedule_irq();
                        }
                }
		trace_hardirqs_on();
		__hard_RI_disable();
        } else {
		__hard_EE_RI_disable();
	}

You could get rid of that entirely if no preempt or irq tracing and just
have __hard_EE_RI_disable even AFAIKS.

Thanks,
Nick

^ permalink raw reply

* [powerpc:next-test 105/159] arch/powerpc/kernel/syscall_64.c:177:28: error: unused function 'prep_irq_for_enabled_exit'
From: kernel test robot @ 2021-02-10 11:42 UTC (permalink / raw)
  To: Nicholas Piggin; +Cc: clang-built-linux, kbuild-all, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 3086 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test
head:   5811244192fc4e18c001c69300044c2acf30bd91
commit: 2a06bf3e95cd93e3640d431960181b8e47415f33 [105/159] powerpc/64: context tracking remove _TIF_NOHZ
config: powerpc-randconfig-r022-20210209 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=2a06bf3e95cd93e3640d431960181b8e47415f33
        git remote add powerpc https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
        git fetch --no-tags powerpc next-test
        git checkout 2a06bf3e95cd93e3640d431960181b8e47415f33
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/powerpc/kernel/syscall_64.c:177:28: error: unused function 'prep_irq_for_enabled_exit' [-Werror,-Wunused-function]
   static notrace inline bool prep_irq_for_enabled_exit(bool clear_ri, bool irqs_enabled)
                              ^
   1 error generated.


vim +/prep_irq_for_enabled_exit +177 arch/powerpc/kernel/syscall_64.c

   176	
 > 177	static notrace inline bool prep_irq_for_enabled_exit(bool clear_ri, bool irqs_enabled)
   178	{
   179		if (__prep_irq_for_enabled_exit(clear_ri))
   180			return true;
   181	
   182		/*
   183		 * Must replay pending soft-masked interrupts now. Don't just
   184		 * local_irq_enabe(); local_irq_disable(); because if we are
   185		 * returning from an asynchronous interrupt here, another one
   186		 * might hit after irqs are enabled, and it would exit via this
   187		 * same path allowing another to fire, and so on unbounded.
   188		 *
   189		 * If interrupts were enabled when this interrupt exited,
   190		 * indicating a process context (synchronous) interrupt,
   191		 * local_irq_enable/disable can be used, which will enable
   192		 * interrupts rather than keeping them masked (unclear how
   193		 * much benefit this is over just replaying for all cases,
   194		 * because we immediately disable again, so all we're really
   195		 * doing is allowing hard interrupts to execute directly for
   196		 * a very small time, rather than being masked and replayed).
   197		 */
   198		if (irqs_enabled) {
   199			local_irq_enable();
   200			local_irq_disable();
   201		} else {
   202			replay_soft_interrupts();
   203		}
   204	
   205		return false;
   206	}
   207	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29433 bytes --]

^ permalink raw reply

* Re: linux-next: build failure after merge of the powerpc tree
From: Stephen Rothwell @ 2021-02-10 11:18 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: Linux Next Mailing List, PowerPC, Linux Kernel Mailing List
In-Reply-To: <1612945076.ng7h3tp2jn.astroid@bobo.none>

[-- Attachment #1: Type: text/plain, Size: 3420 bytes --]

Hi Nick,

On Wed, 10 Feb 2021 18:20:54 +1000 Nicholas Piggin <npiggin@gmail.com> wrote:
>
> Thanks for that, it's due to .noinstr section being put on the other 
> side of .text, so all our interrupt handler asm code can't reach them 
> directly anymore since the ppc interrupt wrappers patch added noinstr
> attribute.
> 
> That's not strictly required though, we've used NOKPROBE_SYMBOL okay
> until now. If you can take this patch for now, it should get 
> allyesconfig to build again. I'll fix it in the powerpc tree before the 
> merge window.
> 
> --
> 
> diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h
> index 4badb3e51c19..fee1e4dd1e84 100644
> --- a/arch/powerpc/include/asm/interrupt.h
> +++ b/arch/powerpc/include/asm/interrupt.h
> @@ -172,6 +172,8 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
>  #define DECLARE_INTERRUPT_HANDLER_RAW(func)				\
>  	__visible long func(struct pt_regs *regs)
>  
> +#define ppc_noinstr         noinline notrace __no_kcsan __no_sanitize_address
> +
>  /**
>   * DEFINE_INTERRUPT_HANDLER_RAW - Define raw interrupt handler function
>   * @func:	Function name of the entry point
> @@ -198,7 +200,7 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
>  #define DEFINE_INTERRUPT_HANDLER_RAW(func)				\
>  static __always_inline long ____##func(struct pt_regs *regs);		\
>  									\
> -__visible noinstr long func(struct pt_regs *regs)			\
> +__visible ppc_noinstr long func(struct pt_regs *regs)			\
>  {									\
>  	long ret;							\
>  									\
> @@ -228,7 +230,7 @@ static __always_inline long ____##func(struct pt_regs *regs)
>  #define DEFINE_INTERRUPT_HANDLER(func)					\
>  static __always_inline void ____##func(struct pt_regs *regs);		\
>  									\
> -__visible noinstr void func(struct pt_regs *regs)			\
> +__visible ppc_noinstr void func(struct pt_regs *regs)			\
>  {									\
>  	struct interrupt_state state;					\
>  									\
> @@ -262,7 +264,7 @@ static __always_inline void ____##func(struct pt_regs *regs)
>  #define DEFINE_INTERRUPT_HANDLER_RET(func)				\
>  static __always_inline long ____##func(struct pt_regs *regs);		\
>  									\
> -__visible noinstr long func(struct pt_regs *regs)			\
> +__visible ppc_noinstr long func(struct pt_regs *regs)			\
>  {									\
>  	struct interrupt_state state;					\
>  	long ret;							\
> @@ -297,7 +299,7 @@ static __always_inline long ____##func(struct pt_regs *regs)
>  #define DEFINE_INTERRUPT_HANDLER_ASYNC(func)				\
>  static __always_inline void ____##func(struct pt_regs *regs);		\
>  									\
> -__visible noinstr void func(struct pt_regs *regs)			\
> +__visible ppc_noinstr void func(struct pt_regs *regs)			\
>  {									\
>  	struct interrupt_state state;					\
>  									\
> @@ -331,7 +333,7 @@ static __always_inline void ____##func(struct pt_regs *regs)
>  #define DEFINE_INTERRUPT_HANDLER_NMI(func)				\
>  static __always_inline long ____##func(struct pt_regs *regs);		\
>  									\
> -__visible noinstr long func(struct pt_regs *regs)			\
> +__visible ppc_noinstr long func(struct pt_regs *regs)			\
>  {									\
>  	struct interrupt_nmi_state state;				\
>  	long ret;							\

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>  # allyesconfig build

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* interrupt_exit_kernel_prepare() on booke/32 has a useless 'mfmsr' and two 'wrteei 0'
From: Christophe Leroy @ 2021-02-10  9:21 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev@lists.ozlabs.org

44x/bamboo_defconfig

For the mfmsr, that's because mfmsr is defined as 'asm volatile'. Is that correct ? Reading MSR 
doesn't have any side effects as far as I know, should we remove the volatile ?

For the wrteei, that's because we are calling __hard_EE_RI_disable() after local_irq_save(). On 
booke those two fonctions do exactly the same because RI doesn't exist. Could we replace that by a 
__hard_RI_disable() that would be a nop on booke ?


00000364 <interrupt_exit_kernel_prepare>:
  364:	81 23 00 84 	lwz     r9,132(r3)
  368:	55 29 04 62 	rlwinm  r9,r9,0,17,17
  36c:	0f 09 00 00 	twnei   r9,0
  370:	81 22 00 4c 	lwz     r9,76(r2)
  374:	75 23 00 01 	andis.  r3,r9,1
  378:	40 82 00 14 	bne     38c <interrupt_exit_kernel_prepare+0x28>
  37c:	7d 20 00 a6 	mfmsr   r9
  380:	7c 00 01 46 	wrteei  0
  384:	7c 00 01 46 	wrteei  0
  388:	4e 80 00 20 	blr
  38c:	38 e2 00 4c 	addi    r7,r2,76
  390:	3d 20 00 01 	lis     r9,1
  394:	7c c0 38 28 	lwarx   r6,0,r7
  398:	7c c6 48 78 	andc    r6,r6,r9
  39c:	7c c0 39 2d 	stwcx.  r6,0,r7
  3a0:	40 a2 ff f4 	bne     394 <interrupt_exit_kernel_prepare+0x30>
  3a4:	38 60 00 01 	li      r3,1
  3a8:	4b ff ff d4 	b       37c <interrupt_exit_kernel_prepare+0x18>

^ permalink raw reply

* Re: [PATCH v5 20/22] powerpc/syscall: Avoid storing 'current' in another pointer
From: Christophe Leroy @ 2021-02-10  8:45 UTC (permalink / raw)
  To: Nicholas Piggin, David Laight, 'Segher Boessenkool'
  Cc: Paul Mackerras, msuchanek@suse.de, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <1612922312.mnpowzgd0r.astroid@bobo.none>



Le 10/02/2021 à 03:00, Nicholas Piggin a écrit :
> Excerpts from Christophe Leroy's message of February 10, 2021 3:03 am:
>>
>>
>> Le 09/02/2021 à 15:31, David Laight a écrit :
>>> From: Segher Boessenkool
>>>> Sent: 09 February 2021 13:51
>>>>
>>>> On Tue, Feb 09, 2021 at 12:36:20PM +1000, Nicholas Piggin wrote:
>>>>> What if you did this?
>>>>
>>>>> +static inline struct task_struct *get_current(void)
>>>>> +{
>>>>> +	register struct task_struct *task asm ("r2");
>>>>> +
>>>>> +	return task;
>>>>> +}
>>>>
>>>> Local register asm variables are *only* guaranteed to live in that
>>>> register as operands to an asm.  See
>>>>     https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html#Local-Register-Variables
>>>> ("The only supported use" etc.)
>>>>
>>>> You can do something like
>>>>
>>>> static inline struct task_struct *get_current(void)
>>>> {
>>>> 	register struct task_struct *task asm ("r2");
>>>>
>>>> 	asm("" : "+r"(task));
>>>>
>>>> 	return task;
>>>> }
>>>>
>>>> which makes sure that "task" actually is in r2 at the point of that asm.
>>>
>>> If "r2" always contains current (and is never assigned by the compiler)
>>> why not use a global register variable for it?
>>>
>>
>>
>> The change proposed by Nick doesn't solve the issue.
> 
> It seemed to change code generation in a simple test case, oh well.
> 
>>
>> The problem is that at the begining of the function we have:
>>
>> 	unsigned long *ti_flagsp = &current_thread_info()->flags;
>>
>> When the function uses ti_flagsp for the first time, it does use 112(r2)
>>
>> Then the function calls some other functions.
>>
>> Most likely because the function could update 'current', GCC copies r2 into r30, so that if r2 get
>> changed by the called function, ti_flagsp is still based on the previous value of current.
>>
>> Allthough we know r2 wont change, GCC doesn't know it. And in order to save r2 into r30, it needs to
>> save r30 in the stack.
>>
>>
>> By using &current_thread_info()->flags directly instead of this intermediaite ti_flagsp pointer, GCC
>> uses r2 instead instead of doing a copy.
>>
>>
>> Nick, I don't understand the reason why you need that 'ti_flagsp' local var.
> 
> Just to save typing, I don't mind your patch I was just wondering if
> current could be improved in general.
> 

Thanks,

I'll post v6 of it as a follow-up of yesterday's two remaining follow-up patches.

Christophe

^ permalink raw reply

* [PATCH v6 3/2] powerpc/syscall: Avoid storing 'current' in another pointer
From: Christophe Leroy @ 2021-02-10  8:44 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, npiggin,
	msuchanek
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1612898425.git.christophe.leroy@csgroup.eu>

By saving the pointer pointing to thread_info.flags, gcc copies r2
in a non-volatile register.

We know 'current' doesn't change, so avoid that intermediaite pointer.

Reduces null_syscall benchmark by 2 cycles (322 => 320 cycles)

On PPC64, gcc seems to know that 'current' is not changing, and it keeps
it in a non volatile register to avoid multiple read of 'current' in paca.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
v5: Also in interrupt exit prepare
v6: Removed change related to booke current->thread.debug
v7: Rebased on top of "powerpc/32: Handle bookE debugging in C in syscall entry/exit"
---
 arch/powerpc/kernel/interrupt.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index f93664ad4a5e..398cd86b6ada 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -241,7 +241,6 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
 					   struct pt_regs *regs,
 					   long scv)
 {
-	unsigned long *ti_flagsp = &current_thread_info()->flags;
 	unsigned long ti_flags;
 	unsigned long ret = 0;
 	bool is_not_scv = !IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !scv;
@@ -257,7 +256,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
 	/* Check whether the syscall is issued inside a restartable sequence */
 	rseq_syscall(regs);
 
-	ti_flags = *ti_flagsp;
+	ti_flags = current_thread_info()->flags;
 
 	if (unlikely(r3 >= (unsigned long)-MAX_ERRNO) && is_not_scv) {
 		if (likely(!(ti_flags & (_TIF_NOERROR | _TIF_RESTOREALL)))) {
@@ -271,7 +270,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
 			ret = _TIF_RESTOREALL;
 		else
 			regs->gpr[3] = r3;
-		clear_bits(_TIF_PERSYSCALL_MASK, ti_flagsp);
+		clear_bits(_TIF_PERSYSCALL_MASK, &current_thread_info()->flags);
 	} else {
 		regs->gpr[3] = r3;
 	}
@@ -284,7 +283,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
 	local_irq_disable();
 
 again:
-	ti_flags = READ_ONCE(*ti_flagsp);
+	ti_flags = READ_ONCE(current_thread_info()->flags);
 	while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) {
 		local_irq_enable();
 		if (ti_flags & _TIF_NEED_RESCHED) {
@@ -300,7 +299,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
 			do_notify_resume(regs, ti_flags);
 		}
 		local_irq_disable();
-		ti_flags = READ_ONCE(*ti_flagsp);
+		ti_flags = READ_ONCE(current_thread_info()->flags);
 	}
 
 	if (IS_ENABLED(CONFIG_PPC_BOOK3S) && IS_ENABLED(CONFIG_PPC_FPU)) {
@@ -357,7 +356,6 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
 #ifndef CONFIG_PPC_BOOK3E_64 /* BOOK3E not yet using this */
 notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned long msr)
 {
-	unsigned long *ti_flagsp = &current_thread_info()->flags;
 	unsigned long ti_flags;
 	unsigned long flags;
 	unsigned long ret = 0;
@@ -380,7 +378,7 @@ notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned
 	local_irq_save(flags);
 
 again:
-	ti_flags = READ_ONCE(*ti_flagsp);
+	ti_flags = READ_ONCE(current_thread_info()->flags);
 	while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) {
 		local_irq_enable(); /* returning to user: may enable */
 		if (ti_flags & _TIF_NEED_RESCHED) {
@@ -391,7 +389,7 @@ notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned
 			do_notify_resume(regs, ti_flags);
 		}
 		local_irq_disable();
-		ti_flags = READ_ONCE(*ti_flagsp);
+		ti_flags = READ_ONCE(current_thread_info()->flags);
 	}
 
 	if (IS_ENABLED(CONFIG_PPC_BOOK3S) && IS_ENABLED(CONFIG_PPC_FPU)) {
@@ -443,7 +441,6 @@ void preempt_schedule_irq(void);
 
 notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsigned long msr)
 {
-	unsigned long *ti_flagsp = &current_thread_info()->flags;
 	unsigned long flags;
 	unsigned long ret = 0;
 #ifdef CONFIG_PPC64
@@ -466,8 +463,8 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsign
 	amr = kuap_get_and_check_amr();
 #endif
 
-	if (unlikely(*ti_flagsp & _TIF_EMULATE_STACK_STORE)) {
-		clear_bits(_TIF_EMULATE_STACK_STORE, ti_flagsp);
+	if (unlikely(current_thread_info()->flags & _TIF_EMULATE_STACK_STORE)) {
+		clear_bits(_TIF_EMULATE_STACK_STORE, &current_thread_info()->flags);
 		ret = 1;
 	}
 
@@ -479,7 +476,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsign
 again:
 		if (IS_ENABLED(CONFIG_PREEMPT)) {
 			/* Return to preemptible kernel context */
-			if (unlikely(*ti_flagsp & _TIF_NEED_RESCHED)) {
+			if (unlikely(current_thread_info()->flags & _TIF_NEED_RESCHED)) {
 				if (preempt_count() == 0)
 					preempt_schedule_irq();
 			}
-- 
2.25.0


^ permalink raw reply related

* Re: linux-next: build failure after merge of the powerpc tree
From: Nicholas Piggin @ 2021-02-10  8:20 UTC (permalink / raw)
  To: PowerPC, Michael Ellerman, Stephen Rothwell
  Cc: Linux Next Mailing List, Linux Kernel Mailing List
In-Reply-To: <20210209211921.777e3053@canb.auug.org.au>

Excerpts from Stephen Rothwell's message of February 9, 2021 8:19 pm:
> Hi all,
> 
> After merging the powerpc tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> arch/powerpc/kernel/head_64.o:(__ftr_alt_97+0x0): relocation truncated to fit: R_PPC64_REL24 (OPD) against symbol `do_page_fault' defined in .opd section in arch/powerpc/mm/fault.o
> arch/powerpc/kernel/head_64.o:(__ftr_alt_97+0x8): relocation truncated to fit: R_PPC64_REL24 (OPD) against symbol `do_page_fault' defined in .opd section in arch/powerpc/mm/fault.o
> arch/powerpc/kernel/head_64.o:(__ftr_alt_97+0x28): relocation truncated to fit: R_PPC64_REL24 (OPD) against symbol `unknown_exception' defined in .opd section in arch/powerpc/kernel/traps.o
> 
> Not sure exactly which commit caused this, but it is most likkely part
> of a series in the powerpc tree.
> 
> I have left the allyesconfig build broken for today.

Hey Stephen,

Thanks for that, it's due to .noinstr section being put on the other 
side of .text, so all our interrupt handler asm code can't reach them 
directly anymore since the ppc interrupt wrappers patch added noinstr
attribute.

That's not strictly required though, we've used NOKPROBE_SYMBOL okay
until now. If you can take this patch for now, it should get 
allyesconfig to build again. I'll fix it in the powerpc tree before the 
merge window.

Thanks,
Nick
--

diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h
index 4badb3e51c19..fee1e4dd1e84 100644
--- a/arch/powerpc/include/asm/interrupt.h
+++ b/arch/powerpc/include/asm/interrupt.h
@@ -172,6 +172,8 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
 #define DECLARE_INTERRUPT_HANDLER_RAW(func)				\
 	__visible long func(struct pt_regs *regs)
 
+#define ppc_noinstr         noinline notrace __no_kcsan __no_sanitize_address
+
 /**
  * DEFINE_INTERRUPT_HANDLER_RAW - Define raw interrupt handler function
  * @func:	Function name of the entry point
@@ -198,7 +200,7 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
 #define DEFINE_INTERRUPT_HANDLER_RAW(func)				\
 static __always_inline long ____##func(struct pt_regs *regs);		\
 									\
-__visible noinstr long func(struct pt_regs *regs)			\
+__visible ppc_noinstr long func(struct pt_regs *regs)			\
 {									\
 	long ret;							\
 									\
@@ -228,7 +230,7 @@ static __always_inline long ____##func(struct pt_regs *regs)
 #define DEFINE_INTERRUPT_HANDLER(func)					\
 static __always_inline void ____##func(struct pt_regs *regs);		\
 									\
-__visible noinstr void func(struct pt_regs *regs)			\
+__visible ppc_noinstr void func(struct pt_regs *regs)			\
 {									\
 	struct interrupt_state state;					\
 									\
@@ -262,7 +264,7 @@ static __always_inline void ____##func(struct pt_regs *regs)
 #define DEFINE_INTERRUPT_HANDLER_RET(func)				\
 static __always_inline long ____##func(struct pt_regs *regs);		\
 									\
-__visible noinstr long func(struct pt_regs *regs)			\
+__visible ppc_noinstr long func(struct pt_regs *regs)			\
 {									\
 	struct interrupt_state state;					\
 	long ret;							\
@@ -297,7 +299,7 @@ static __always_inline long ____##func(struct pt_regs *regs)
 #define DEFINE_INTERRUPT_HANDLER_ASYNC(func)				\
 static __always_inline void ____##func(struct pt_regs *regs);		\
 									\
-__visible noinstr void func(struct pt_regs *regs)			\
+__visible ppc_noinstr void func(struct pt_regs *regs)			\
 {									\
 	struct interrupt_state state;					\
 									\
@@ -331,7 +333,7 @@ static __always_inline void ____##func(struct pt_regs *regs)
 #define DEFINE_INTERRUPT_HANDLER_NMI(func)				\
 static __always_inline long ____##func(struct pt_regs *regs);		\
 									\
-__visible noinstr long func(struct pt_regs *regs)			\
+__visible ppc_noinstr long func(struct pt_regs *regs)			\
 {									\
 	struct interrupt_nmi_state state;				\
 	long ret;							\

^ permalink raw reply related

* Re: [PATCH] crypto: powerpc: remove unneeded semicolon
From: Herbert Xu @ 2021-02-10  7:22 UTC (permalink / raw)
  To: Yang Li; +Cc: linux-kernel, paulus, linux-crypto, linuxppc-dev, davem
In-Reply-To: <1612235850-87446-1-git-send-email-yang.lee@linux.alibaba.com>

On Tue, Feb 02, 2021 at 11:17:30AM +0800, Yang Li wrote:
> Eliminate the following coccicheck warning:
> ./arch/powerpc/crypto/sha256-spe-glue.c:132:2-3: Unneeded
> semicolon
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  arch/powerpc/crypto/sha256-spe-glue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH 00/20] Rid W=1 warnings in Crypto
From: Herbert Xu @ 2021-02-10  6:51 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alexandre Belloni, Aymen Sghaier, Takashi Iwai, Kent Yoder,
	Ayush Sawal, Joakim Bech, Gustavo A. R. Silva, Paul Mackerras,
	Andreas Westin, Breno Leitão, Atul Gupta, Niklas Hernaeus,
	M R Gowda, Horia Geantă, Rohit Maheshwari, Nayna Jain,
	Manoj Malviya, Ludovic Desroches, Jonas Linde, Rob Rice, Zaibo Xu,
	Harsh Jain, Declan Murphy, Vinay Kumar Yadav, Tudor Ambarus,
	Nicolas Ferre, Shujuan Chen, Henrique Cerri,
	Daniele Alessandrelli, linux-arm-kernel, Jonathan Cameron,
	linux-kernel, Berne Hebark, linux-crypto, Jitendra Lulla,
	Paulo Flabiano Smorigo, linuxppc-dev, David S. Miller
In-Reply-To: <20210204111000.2800436-1-lee.jones@linaro.org>

On Thu, Feb 04, 2021 at 11:09:40AM +0000, Lee Jones wrote:
> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.
> 
> This is set 1 of 2 sets required to fully clean Crypto.
> 
> Lee Jones (20):
>   crypto: hisilicon: sec_drv: Supply missing description for
>     'sec_queue_empty()'s 'queue' param
>   crypto: bcm: util: Repair a couple of documentation formatting issues
>   crypto: chelsio: chcr_core: File headers are not good candidates for
>     kernel-doc
>   crypto: ux500: hash: hash_core: Fix worthy kernel-doc headers and
>     remove others
>   crypto: bcm: spu: Fix formatting and misspelling issues
>   crypto: keembay: ocs-hcu: Fix incorrectly named functions/structs
>   crypto: bcm: spu2: Fix a whole host of kernel-doc misdemeanours
>   crypto: ux500: cryp: Demote some conformant non-kernel headers fix
>     another
>   crypto: ux500: cryp_irq: File headers are not good kernel-doc
>     candidates
>   crypto: chelsio: chcr_algo: Fix a couple of kernel-doc issues caused
>     by doc-rot
>   crypto: ux500: cryp_core: Fix formatting issue and add description for
>     'session_id'
>   crypto: atmel-ecc: Struct headers need to start with keyword 'struct'
>   crypto: bcm: cipher: Provide description for 'req' and fix formatting
>     issues
>   crypto: caam: caampkc: Provide the name of the function
>   crypto: caam: caamalg_qi2: Supply a couple of 'fallback' related
>     descriptions
>   crypto: vmx: Source headers are not good kernel-doc candidates
>   crypto: nx: nx-aes-cbc: Headers comments should not be kernel-doc
>   crypto: nx: nx_debugfs: Header comments should not be kernel-doc
>   crypto: nx: Demote header comment and add description for 'nbytes'
>   crypto: cavium: nitrox_isr: Demote non-compliant kernel-doc headers

Thanks for doing this.  But please don't split the patches at the
file level.  Instead split them at the driver level.  For example,
all of your bcm changes should be one patch.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply


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