* [PATCH] net: marvell: Remove reference to CONFIG_MV64X60
From: Christophe Leroy @ 2021-03-18 17:25 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Sebastian Hesselbarth
Cc: netdev, linuxppc-dev, linux-kernel
In-Reply-To: <9c2952bcfaec3b1789909eaa36bbce2afbfab7ab.1616085654.git.christophe.leroy@csgroup.eu>
Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support")
removed last selector of CONFIG_MV64X60.
As it is not a user selectable config item, all references to it
are stale. Remove them.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
drivers/net/ethernet/marvell/Kconfig | 4 ++--
drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/Kconfig b/drivers/net/ethernet/marvell/Kconfig
index 7fe15a3286f4..fe0989c0fc25 100644
--- a/drivers/net/ethernet/marvell/Kconfig
+++ b/drivers/net/ethernet/marvell/Kconfig
@@ -6,7 +6,7 @@
config NET_VENDOR_MARVELL
bool "Marvell devices"
default y
- depends on PCI || CPU_PXA168 || MV64X60 || PPC32 || PLAT_ORION || INET || COMPILE_TEST
+ depends on PCI || CPU_PXA168 || PPC32 || PLAT_ORION || INET || COMPILE_TEST
help
If you have a network (Ethernet) card belonging to this class, say Y.
@@ -19,7 +19,7 @@ if NET_VENDOR_MARVELL
config MV643XX_ETH
tristate "Marvell Discovery (643XX) and Orion ethernet support"
- depends on MV64X60 || PPC32 || PLAT_ORION || COMPILE_TEST
+ depends on PPC32 || PLAT_ORION || COMPILE_TEST
depends on INET
select PHYLIB
select MVMDIO
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 90e6111ce534..3bfb659b5c99 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2684,7 +2684,7 @@ static const struct of_device_id mv643xx_eth_shared_ids[] = {
MODULE_DEVICE_TABLE(of, mv643xx_eth_shared_ids);
#endif
-#if defined(CONFIG_OF_IRQ) && !defined(CONFIG_MV64X60)
+#ifdef CONFIG_OF_IRQ
#define mv643xx_eth_property(_np, _name, _v) \
do { \
u32 tmp; \
--
2.25.0
^ permalink raw reply related
* [PATCH 1/1] powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE() to save TCEs
From: Leonardo Bras @ 2021-03-18 17:44 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Leonardo Bras, Alexey Kardashevskiy, Nicolin Chen,
Niklas Schnelle
Cc: linuxppc-dev, linux-kernel
Currently both iommu_alloc_coherent() and iommu_free_coherent() align the
desired allocation size to PAGE_SIZE, and gets system pages and IOMMU
mappings (TCEs) for that value.
When IOMMU_PAGE_SIZE < PAGE_SIZE, this behavior may cause unnecessary
TCEs to be created for mapping the whole system page.
Example:
- PAGE_SIZE = 64k, IOMMU_PAGE_SIZE() = 4k
- iommu_alloc_coherent() is called for 128 bytes
- 1 system page (64k) is allocated
- 16 IOMMU pages (16 x 4k) are allocated (16 TCEs used)
It would be enough to use a single TCE for this, so 15 TCEs are
wasted in the process.
Update iommu_*_coherent() to make sure the size alignment happens only
for IOMMU_PAGE_SIZE() before calling iommu_alloc() and iommu_free().
Also, on iommu_range_alloc(), replace ALIGN(n, 1 << tbl->it_page_shift)
with IOMMU_PAGE_ALIGN(n, tbl), which is easier to read and does the
same.
Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
arch/powerpc/kernel/iommu.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 5b69a6a72a0e..3329ef045805 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -851,6 +851,7 @@ void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
unsigned int order;
unsigned int nio_pages, io_order;
struct page *page;
+ size_t size_io = size;
size = PAGE_ALIGN(size);
order = get_order(size);
@@ -877,8 +878,9 @@ void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
memset(ret, 0, size);
/* Set up tces to cover the allocated range */
- nio_pages = size >> tbl->it_page_shift;
- io_order = get_iommu_order(size, tbl);
+ size_io = IOMMU_PAGE_ALIGN(size_io, tbl);
+ nio_pages = size_io >> tbl->it_page_shift;
+ io_order = get_iommu_order(size_io, tbl);
mapping = iommu_alloc(dev, tbl, ret, nio_pages, DMA_BIDIRECTIONAL,
mask >> tbl->it_page_shift, io_order, 0);
if (mapping == DMA_MAPPING_ERROR) {
@@ -893,10 +895,9 @@ void iommu_free_coherent(struct iommu_table *tbl, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
if (tbl) {
- unsigned int nio_pages;
+ size_t size_io = IOMMU_PAGE_ALIGN(size, tbl);
+ unsigned int nio_pages = size_io >> tbl->it_page_shift;
- size = PAGE_ALIGN(size);
- nio_pages = size >> tbl->it_page_shift;
iommu_free(tbl, dma_handle, nio_pages);
size = PAGE_ALIGN(size);
free_pages((unsigned long)vaddr, get_order(size));
--
2.29.2
^ permalink raw reply related
* [PATCH 1/1] powerpc/kernel/iommu: Use largepool as a last resort when !largealloc
From: Leonardo Bras @ 2021-03-18 17:44 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Leonardo Bras, Alexey Kardashevskiy, Niklas Schnelle,
Nicolin Chen
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20210318174414.684630-1-leobras.c@gmail.com>
As of today, doing iommu_range_alloc() only for !largealloc (npages <= 15)
will only be able to use 3/4 of the available pages, given pages on
largepool not being available for !largealloc.
This could mean some drivers not being able to fully use all the available
pages for the DMA window.
Add pages on largepool as a last resort for !largealloc, making all pages
of the DMA window available.
Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
arch/powerpc/kernel/iommu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 3329ef045805..ae6ad8dca605 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -255,6 +255,15 @@ static unsigned long iommu_range_alloc(struct device *dev,
pass++;
goto again;
+ } else if (pass == tbl->nr_pools + 1) {
+ /* Last resort: try largepool */
+ spin_unlock(&pool->lock);
+ pool = &tbl->large_pool;
+ spin_lock(&pool->lock);
+ pool->hint = pool->start;
+ pass++;
+ goto again;
+
} else {
/* Give up */
spin_unlock_irqrestore(&(pool->lock), flags);
--
2.29.2
^ permalink raw reply related
* Re: [PATCH 01/10] alpha: use libata instead of the legacy ide driver
From: Måns Rullgård @ 2021-03-18 18:03 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Thomas Bogendoerfer, linux-doc, linux-kernel,
Russell King, linux-mips, linux-ide, linux-m68k, Ivan Kokshaysky,
Al Viro, linux-alpha, Geert Uytterhoeven, Matt Turner,
linuxppc-dev, David S. Miller, linux-arm-kernel,
Richard Henderson
In-Reply-To: <yw1x1rccie35.fsf@mansr.com>
Måns Rullgård <mans@mansr.com> writes:
> Christoph Hellwig <hch@lst.de> writes:
>
>> On Thu, Mar 18, 2021 at 05:54:55AM +0000, Al Viro wrote:
>>> On Thu, Mar 18, 2021 at 05:56:57AM +0100, Christoph Hellwig wrote:
>>> > Switch the alpha defconfig from the legacy ide driver to libata.
>>>
>>> Umm... I don't have an IDE alpha box in a usable shape (fans on
>>> CPU module shat themselves), and it would take a while to resurrect
>>> it, but I remember the joy it used to cause in some versions.
>>>
>>> Do you have reports of libata variants of drivers actually tested on
>>> those?
>>
>> No, I haven't. The whole point is that we're not going to keep 40000
>> lines of code around despite notice for users that don't exist or
>> care. If there is a regression we'll fix it, but we're not going to
>> make life miserable just because we can.
>
> The pata_ali driver works fine on my UP1500 machine, unless something
> broke recently. I'll build the latest kernel and report back.
5.11.7 seems fine too.
--
Måns Rullgård
^ permalink raw reply
* Re: [PATCH] watchdog: Remove MV64x60 watchdog driver
From: Guenter Roeck @ 2021-03-18 18:32 UTC (permalink / raw)
To: Christophe Leroy, Wim Van Sebroeck, Sebastian Hesselbarth
Cc: netdev, linuxppc-dev, linux-kernel, linux-watchdog
In-Reply-To: <9c2952bcfaec3b1789909eaa36bbce2afbfab7ab.1616085654.git.christophe.leroy@csgroup.eu>
On 3/18/21 10:25 AM, Christophe Leroy wrote:
> Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support")
> removed the last selector of CONFIG_MV64X60.
>
> Therefore CONFIG_MV64X60_WDT cannot be selected anymore and
> can be removed.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/Kconfig | 4 -
> drivers/watchdog/Makefile | 1 -
> drivers/watchdog/mv64x60_wdt.c | 324 ---------------------------------
> include/linux/mv643xx.h | 8 -
> 4 files changed, 337 deletions(-)
> delete mode 100644 drivers/watchdog/mv64x60_wdt.c
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 1fe0042a48d2..178296bda151 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1831,10 +1831,6 @@ config 8xxx_WDT
>
> For BookE processors (MPC85xx) use the BOOKE_WDT driver instead.
>
> -config MV64X60_WDT
> - tristate "MV64X60 (Marvell Discovery) Watchdog Timer"
> - depends on MV64X60 || COMPILE_TEST
> -
> config PIKA_WDT
> tristate "PIKA FPGA Watchdog"
> depends on WARP || (PPC64 && COMPILE_TEST)
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index f3a6540e725e..752c6513f731 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -175,7 +175,6 @@ obj-$(CONFIG_PIC32_DMT) += pic32-dmt.o
> # POWERPC Architecture
> obj-$(CONFIG_GEF_WDT) += gef_wdt.o
> obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o
> -obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
> obj-$(CONFIG_PIKA_WDT) += pika_wdt.o
> obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o
> obj-$(CONFIG_MEN_A21_WDT) += mena21_wdt.o
> diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c
> deleted file mode 100644
> index 894aa63488d3..000000000000
> --- a/drivers/watchdog/mv64x60_wdt.c
> +++ /dev/null
> @@ -1,324 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -/*
> - * mv64x60_wdt.c - MV64X60 (Marvell Discovery) watchdog userspace interface
> - *
> - * Author: James Chapman <jchapman@katalix.com>
> - *
> - * Platform-specific setup code should configure the dog to generate
> - * interrupt or reset as required. This code only enables/disables
> - * and services the watchdog.
> - *
> - * Derived from mpc8xx_wdt.c, with the following copyright.
> - *
> - * 2002 (c) Florian Schirmer <jolt@tuxbox.org>
> - */
> -
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
> -#include <linux/fs.h>
> -#include <linux/init.h>
> -#include <linux/kernel.h>
> -#include <linux/miscdevice.h>
> -#include <linux/module.h>
> -#include <linux/watchdog.h>
> -#include <linux/platform_device.h>
> -#include <linux/mv643xx.h>
> -#include <linux/uaccess.h>
> -#include <linux/io.h>
> -
> -#define MV64x60_WDT_WDC_OFFSET 0
> -
> -/*
> - * The watchdog configuration register contains a pair of 2-bit fields,
> - * 1. a reload field, bits 27-26, which triggers a reload of
> - * the countdown register, and
> - * 2. an enable field, bits 25-24, which toggles between
> - * enabling and disabling the watchdog timer.
> - * Bit 31 is a read-only field which indicates whether the
> - * watchdog timer is currently enabled.
> - *
> - * The low 24 bits contain the timer reload value.
> - */
> -#define MV64x60_WDC_ENABLE_SHIFT 24
> -#define MV64x60_WDC_SERVICE_SHIFT 26
> -#define MV64x60_WDC_ENABLED_SHIFT 31
> -
> -#define MV64x60_WDC_ENABLED_TRUE 1
> -#define MV64x60_WDC_ENABLED_FALSE 0
> -
> -/* Flags bits */
> -#define MV64x60_WDOG_FLAG_OPENED 0
> -
> -static unsigned long wdt_flags;
> -static int wdt_status;
> -static void __iomem *mv64x60_wdt_regs;
> -static int mv64x60_wdt_timeout;
> -static int mv64x60_wdt_count;
> -static unsigned int bus_clk;
> -static char expect_close;
> -static DEFINE_SPINLOCK(mv64x60_wdt_spinlock);
> -
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -module_param(nowayout, bool, 0);
> -MODULE_PARM_DESC(nowayout,
> - "Watchdog cannot be stopped once started (default="
> - __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static int mv64x60_wdt_toggle_wdc(int enabled_predicate, int field_shift)
> -{
> - u32 data;
> - u32 enabled;
> - int ret = 0;
> -
> - spin_lock(&mv64x60_wdt_spinlock);
> - data = readl(mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
> - enabled = (data >> MV64x60_WDC_ENABLED_SHIFT) & 1;
> -
> - /* only toggle the requested field if enabled state matches predicate */
> - if ((enabled ^ enabled_predicate) == 0) {
> - /* We write a 1, then a 2 -- to the appropriate field */
> - data = (1 << field_shift) | mv64x60_wdt_count;
> - writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
> -
> - data = (2 << field_shift) | mv64x60_wdt_count;
> - writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
> - ret = 1;
> - }
> - spin_unlock(&mv64x60_wdt_spinlock);
> -
> - return ret;
> -}
> -
> -static void mv64x60_wdt_service(void)
> -{
> - mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE,
> - MV64x60_WDC_SERVICE_SHIFT);
> -}
> -
> -static void mv64x60_wdt_handler_enable(void)
> -{
> - if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_FALSE,
> - MV64x60_WDC_ENABLE_SHIFT)) {
> - mv64x60_wdt_service();
> - pr_notice("watchdog activated\n");
> - }
> -}
> -
> -static void mv64x60_wdt_handler_disable(void)
> -{
> - if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE,
> - MV64x60_WDC_ENABLE_SHIFT))
> - pr_notice("watchdog deactivated\n");
> -}
> -
> -static void mv64x60_wdt_set_timeout(unsigned int timeout)
> -{
> - /* maximum bus cycle count is 0xFFFFFFFF */
> - if (timeout > 0xFFFFFFFF / bus_clk)
> - timeout = 0xFFFFFFFF / bus_clk;
> -
> - mv64x60_wdt_count = timeout * bus_clk >> 8;
> - mv64x60_wdt_timeout = timeout;
> -}
> -
> -static int mv64x60_wdt_open(struct inode *inode, struct file *file)
> -{
> - if (test_and_set_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags))
> - return -EBUSY;
> -
> - if (nowayout)
> - __module_get(THIS_MODULE);
> -
> - mv64x60_wdt_handler_enable();
> -
> - return stream_open(inode, file);
> -}
> -
> -static int mv64x60_wdt_release(struct inode *inode, struct file *file)
> -{
> - if (expect_close == 42)
> - mv64x60_wdt_handler_disable();
> - else {
> - pr_crit("unexpected close, not stopping timer!\n");
> - mv64x60_wdt_service();
> - }
> - expect_close = 0;
> -
> - clear_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags);
> -
> - return 0;
> -}
> -
> -static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data,
> - size_t len, loff_t *ppos)
> -{
> - if (len) {
> - if (!nowayout) {
> - size_t i;
> -
> - expect_close = 0;
> -
> - for (i = 0; i != len; i++) {
> - char c;
> - if (get_user(c, data + i))
> - return -EFAULT;
> - if (c == 'V')
> - expect_close = 42;
> - }
> - }
> - mv64x60_wdt_service();
> - }
> -
> - return len;
> -}
> -
> -static long mv64x60_wdt_ioctl(struct file *file,
> - unsigned int cmd, unsigned long arg)
> -{
> - int timeout;
> - int options;
> - void __user *argp = (void __user *)arg;
> - static const struct watchdog_info info = {
> - .options = WDIOF_SETTIMEOUT |
> - WDIOF_MAGICCLOSE |
> - WDIOF_KEEPALIVEPING,
> - .firmware_version = 0,
> - .identity = "MV64x60 watchdog",
> - };
> -
> - switch (cmd) {
> - case WDIOC_GETSUPPORT:
> - if (copy_to_user(argp, &info, sizeof(info)))
> - return -EFAULT;
> - break;
> -
> - case WDIOC_GETSTATUS:
> - case WDIOC_GETBOOTSTATUS:
> - if (put_user(wdt_status, (int __user *)argp))
> - return -EFAULT;
> - wdt_status &= ~WDIOF_KEEPALIVEPING;
> - break;
> -
> - case WDIOC_GETTEMP:
> - return -EOPNOTSUPP;
> -
> - case WDIOC_SETOPTIONS:
> - if (get_user(options, (int __user *)argp))
> - return -EFAULT;
> -
> - if (options & WDIOS_DISABLECARD)
> - mv64x60_wdt_handler_disable();
> -
> - if (options & WDIOS_ENABLECARD)
> - mv64x60_wdt_handler_enable();
> - break;
> -
> - case WDIOC_KEEPALIVE:
> - mv64x60_wdt_service();
> - wdt_status |= WDIOF_KEEPALIVEPING;
> - break;
> -
> - case WDIOC_SETTIMEOUT:
> - if (get_user(timeout, (int __user *)argp))
> - return -EFAULT;
> - mv64x60_wdt_set_timeout(timeout);
> - fallthrough;
> -
> - case WDIOC_GETTIMEOUT:
> - if (put_user(mv64x60_wdt_timeout, (int __user *)argp))
> - return -EFAULT;
> - break;
> -
> - default:
> - return -ENOTTY;
> - }
> -
> - return 0;
> -}
> -
> -static const struct file_operations mv64x60_wdt_fops = {
> - .owner = THIS_MODULE,
> - .llseek = no_llseek,
> - .write = mv64x60_wdt_write,
> - .unlocked_ioctl = mv64x60_wdt_ioctl,
> - .compat_ioctl = compat_ptr_ioctl,
> - .open = mv64x60_wdt_open,
> - .release = mv64x60_wdt_release,
> -};
> -
> -static struct miscdevice mv64x60_wdt_miscdev = {
> - .minor = WATCHDOG_MINOR,
> - .name = "watchdog",
> - .fops = &mv64x60_wdt_fops,
> -};
> -
> -static int mv64x60_wdt_probe(struct platform_device *dev)
> -{
> - struct mv64x60_wdt_pdata *pdata = dev_get_platdata(&dev->dev);
> - struct resource *r;
> - int timeout = 10;
> -
> - bus_clk = 133; /* in MHz */
> - if (pdata) {
> - timeout = pdata->timeout;
> - bus_clk = pdata->bus_clk;
> - }
> -
> - /* Since bus_clk is truncated MHz, actual frequency could be
> - * up to 1MHz higher. Round up, since it's better to time out
> - * too late than too soon.
> - */
> - bus_clk++;
> - bus_clk *= 1000000; /* convert to Hz */
> -
> - r = platform_get_resource(dev, IORESOURCE_MEM, 0);
> - if (!r)
> - return -ENODEV;
> -
> - mv64x60_wdt_regs = devm_ioremap(&dev->dev, r->start, resource_size(r));
> - if (mv64x60_wdt_regs == NULL)
> - return -ENOMEM;
> -
> - mv64x60_wdt_set_timeout(timeout);
> -
> - mv64x60_wdt_handler_disable(); /* in case timer was already running */
> -
> - return misc_register(&mv64x60_wdt_miscdev);
> -}
> -
> -static int mv64x60_wdt_remove(struct platform_device *dev)
> -{
> - misc_deregister(&mv64x60_wdt_miscdev);
> -
> - mv64x60_wdt_handler_disable();
> -
> - return 0;
> -}
> -
> -static struct platform_driver mv64x60_wdt_driver = {
> - .probe = mv64x60_wdt_probe,
> - .remove = mv64x60_wdt_remove,
> - .driver = {
> - .name = MV64x60_WDT_NAME,
> - },
> -};
> -
> -static int __init mv64x60_wdt_init(void)
> -{
> - pr_info("MV64x60 watchdog driver\n");
> -
> - return platform_driver_register(&mv64x60_wdt_driver);
> -}
> -
> -static void __exit mv64x60_wdt_exit(void)
> -{
> - platform_driver_unregister(&mv64x60_wdt_driver);
> -}
> -
> -module_init(mv64x60_wdt_init);
> -module_exit(mv64x60_wdt_exit);
> -
> -MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
> -MODULE_DESCRIPTION("MV64x60 watchdog driver");
> -MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:" MV64x60_WDT_NAME);
> diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
> index 47e5679b48e1..000b126acfb6 100644
> --- a/include/linux/mv643xx.h
> +++ b/include/linux/mv643xx.h
> @@ -918,12 +918,4 @@
>
> extern void mv64340_irq_init(unsigned int base);
>
> -/* Watchdog Platform Device, Driver Data */
> -#define MV64x60_WDT_NAME "mv64x60_wdt"
> -
> -struct mv64x60_wdt_pdata {
> - int timeout; /* watchdog expiry in seconds, default 10 */
> - int bus_clk; /* bus clock in MHz, default 133 */
> -};
> -
> #endif /* __ASM_MV643XX_H */
>
^ permalink raw reply
* Re: [PATCH] powerpc/embedded6xx: Remove CONFIG_MV64X60
From: Wolfram Sang @ 2021-03-18 19:22 UTC (permalink / raw)
To: Christophe Leroy; +Cc: linux-kernel, Paul Mackerras, linux-i2c, linuxppc-dev
In-Reply-To: <19e57d16692dcd1ca67ba880d7273a57fab416aa.1616085654.git.christophe.leroy@csgroup.eu>
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
On Thu, Mar 18, 2021 at 05:25:07PM +0000, Christophe Leroy wrote:
> Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support")
> moved the last selector of CONFIG_MV64X60.
>
> As it is not a user selectable config, it can be removed.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Wolfram Sang <wsa@kernel.org> # for I2C
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH 3/3] powerpc/qspinlock: Use generic smp_cond_load_relaxed
From: Davidlohr Bueso @ 2021-03-18 20:02 UTC (permalink / raw)
To: Nicholas Piggin
Cc: will, Davidlohr Bueso, peterz, linux-kernel, mingo, paulus,
longman, linuxppc-dev
In-Reply-To: <1615870473.h7h4jetmjb.astroid@bobo.none>
On Tue, 16 Mar 2021, Nicholas Piggin wrote:
>One request, could you add a comment in place that references
>smp_cond_load_relaxed() so this commit can be found again if
>someone looks at it? Something like this
>
>/*
> * smp_cond_load_relaxed was found to have performance problems if
> * implemented with spin_begin()/spin_end().
> */
Sure, let me see where I can fit that in and send out a v2.
Similarly, but unrelated to this patch, is there any chance we could
remove the whole spin_until_cond() machinery and make it specific to
powerpc? This was introduced in 2017 and doesn't really have any users
outside of powerpc, except for these:
drivers/firmware/arm_scmi/driver.c: spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer, stop));
drivers/firmware/arm_scmi/shmem.c: spin_until_cond(ioread32(&shmem->channel_status) &
drivers/net/ethernet/xilinx/ll_temac_main.c: spin_until_cond(hard_acs_rdy_or_timeout(lp, timeout));
... which afaict only the xilinx one can actually build on powerpc.
Regardless, these could be converted to smp_cond_load_relaxed(), being
the more standard way to do optimized busy-waiting, caring more about
the family of barriers than ad-hoc SMT priorities. Of course, I have
no way of testing any of these changes.
>I wonder if it should have a Fixes: tag to the original commit as
>well.
I'm not sure either. I've actually been informed recently of other
workloads that benefit from the revert on large Power9 boxes. So I'll
go ahead and add it.
>
>Otherwise,
>
>Acked-by: Nicholas Piggin <npiggin@gmail.com>
Thanks,
Davidlohr
^ permalink raw reply
* [PATCH v2] powerpc/qspinlock: Use generic smp_cond_load_relaxed
From: Davidlohr Bueso @ 2021-03-18 20:47 UTC (permalink / raw)
To: npiggin
Cc: Davidlohr Bueso, will, dbueso, peterz, linux-kernel, mingo,
paulus, longman, linuxppc-dev
In-Reply-To: <1615870473.h7h4jetmjb.astroid@bobo.none>
49a7d46a06c3 (powerpc: Implement smp_cond_load_relaxed()) added
busy-waiting pausing with a preferred SMT priority pattern, lowering
the priority (reducing decode cycles) during the whole loop slowpath.
However, data shows that while this pattern works well with simple
spinlocks, queued spinlocks benefit more being kept in medium priority,
with a cpu_relax() instead, being a low+medium combo on powerpc.
Data is from three benchmarks on a Power9: 9008-22L 64 CPUs with
2 sockets and 8 threads per core.
1. locktorture.
This is data for the lowest and most artificial/pathological level,
with increasing thread counts pounding on the lock. Metrics are total
ops/minute. Despite some small hits in the 4-8 range, scenarios are
either neutral or favorable to this patch.
+=========+==========+==========+=======+
| # tasks | vanilla | dirty | %diff |
+=========+==========+==========+=======+
| 2 | 46718565 | 48751350 | 4.35 |
+---------+----------+----------+-------+
| 4 | 51740198 | 50369082 | -2.65 |
+---------+----------+----------+-------+
| 8 | 63756510 | 62568821 | -1.86 |
+---------+----------+----------+-------+
| 16 | 67824531 | 70966546 | 4.63 |
+---------+----------+----------+-------+
| 32 | 53843519 | 61155508 | 13.58 |
+---------+----------+----------+-------+
| 64 | 53005778 | 53104412 | 0.18 |
+---------+----------+----------+-------+
| 128 | 53331980 | 54606910 | 2.39 |
+=========+==========+==========+=======+
2. sockperf (tcp throughput)
Here a client will do one-way throughput tests to a localhost server, with
increasing message sizes, dealing with the sk_lock. This patch shows to put
the performance of the qspinlock back to par with that of the simple lock:
simple-spinlock vanilla dirty
Hmean 14 73.50 ( 0.00%) 54.44 * -25.93%* 73.45 * -0.07%*
Hmean 100 654.47 ( 0.00%) 385.61 * -41.08%* 771.43 * 17.87%*
Hmean 300 2719.39 ( 0.00%) 2181.67 * -19.77%* 2666.50 * -1.94%*
Hmean 500 4400.59 ( 0.00%) 3390.77 * -22.95%* 4322.14 * -1.78%*
Hmean 850 6726.21 ( 0.00%) 5264.03 * -21.74%* 6863.12 * 2.04%*
3. dbench (tmpfs)
Configured to run with up to ncpusx8 clients, it shows both latency and
throughput metrics. For the latency, with the exception of the 64 case,
there is really nothing to go by:
vanilla dirty
Amean latency-1 1.67 ( 0.00%) 1.67 * 0.09%*
Amean latency-2 2.15 ( 0.00%) 2.08 * 3.36%*
Amean latency-4 2.50 ( 0.00%) 2.56 * -2.27%*
Amean latency-8 2.49 ( 0.00%) 2.48 * 0.31%*
Amean latency-16 2.69 ( 0.00%) 2.72 * -1.37%*
Amean latency-32 2.96 ( 0.00%) 3.04 * -2.60%*
Amean latency-64 7.78 ( 0.00%) 8.17 * -5.07%*
Amean latency-512 186.91 ( 0.00%) 186.41 * 0.27%*
For the dbench4 Throughput (misleading but traditional) there's a small
but rather constant improvement:
vanilla dirty
Hmean 1 849.13 ( 0.00%) 851.51 * 0.28%*
Hmean 2 1664.03 ( 0.00%) 1663.94 * -0.01%*
Hmean 4 3073.70 ( 0.00%) 3104.29 * 1.00%*
Hmean 8 5624.02 ( 0.00%) 5694.16 * 1.25%*
Hmean 16 9169.49 ( 0.00%) 9324.43 * 1.69%*
Hmean 32 11969.37 ( 0.00%) 12127.09 * 1.32%*
Hmean 64 15021.12 ( 0.00%) 15243.14 * 1.48%*
Hmean 512 14891.27 ( 0.00%) 15162.11 * 1.82%*
Measuring the dbench4 Per-VFS Operation latency, shows some very minor
differences within the noise level, around the 0-1% ranges.
Fixes: 49a7d46a06c3 (powerpc: Implement smp_cond_load_relaxed())
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
Changes from v1:
Added small description and labeling smp_cond_load_relaxed requested by Nick.
Added Nick's ack.
arch/powerpc/include/asm/barrier.h | 16 ----------------
arch/powerpc/include/asm/qspinlock.h | 7 +++++++
2 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/include/asm/barrier.h b/arch/powerpc/include/asm/barrier.h
index aecfde829d5d..7ae29cfb06c0 100644
--- a/arch/powerpc/include/asm/barrier.h
+++ b/arch/powerpc/include/asm/barrier.h
@@ -80,22 +80,6 @@ do { \
___p1; \
})
-#ifdef CONFIG_PPC64
-#define smp_cond_load_relaxed(ptr, cond_expr) ({ \
- typeof(ptr) __PTR = (ptr); \
- __unqual_scalar_typeof(*ptr) VAL; \
- VAL = READ_ONCE(*__PTR); \
- if (unlikely(!(cond_expr))) { \
- spin_begin(); \
- do { \
- VAL = READ_ONCE(*__PTR); \
- } while (!(cond_expr)); \
- spin_end(); \
- } \
- (typeof(*ptr))VAL; \
-})
-#endif
-
#ifdef CONFIG_PPC_BOOK3S_64
#define NOSPEC_BARRIER_SLOT nop
#elif defined(CONFIG_PPC_FSL_BOOK3E)
diff --git a/arch/powerpc/include/asm/qspinlock.h b/arch/powerpc/include/asm/qspinlock.h
index b052b0624816..9da649e1a488 100644
--- a/arch/powerpc/include/asm/qspinlock.h
+++ b/arch/powerpc/include/asm/qspinlock.h
@@ -72,6 +72,13 @@ static inline void pv_spinlocks_init(void)
#endif
+/*
+ * Queued spinlocks rely heavily on smp_cond_load_relaxed to busy-wait,
+ * which was found that have performance problems if implemented with
+ * the preferred spin_begin()/spin_end() SMT priority pattern. Use the
+ * generic version instead.
+ */
+
#include <asm-generic/qspinlock.h>
#endif /* _ASM_POWERPC_QSPINLOCK_H */
--
2.26.2
^ permalink raw reply related
* Re: [PATCH] net: marvell: Remove reference to CONFIG_MV64X60
From: patchwork-bot+netdevbpf @ 2021-03-18 21:30 UTC (permalink / raw)
To: Christophe Leroy
Cc: netdev, linux-kernel, kuba, linuxppc-dev, davem,
sebastian.hesselbarth
In-Reply-To: <7fc233cfbda60b87894c3f4a3b0d1e63fdb24b37.1616085654.git.christophe.leroy@csgroup.eu>
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Thu, 18 Mar 2021 17:25:08 +0000 (UTC) you wrote:
> Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support")
> removed last selector of CONFIG_MV64X60.
>
> As it is not a user selectable config item, all references to it
> are stale. Remove them.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>
> [...]
Here is the summary with links:
- net: marvell: Remove reference to CONFIG_MV64X60
https://git.kernel.org/netdev/net/c/600cc3c9c62d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* [PATCH] powerpc/iommu/debug: fix ifnullfree.cocci warnings
From: kernel test robot @ 2021-03-18 23:44 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: kbuild-all, Niklas Schnelle, linux-kernel, Nicolin Chen,
Paul Mackerras, linuxppc-dev
In-Reply-To: <202103190721.joUfcBzf-lkp@intel.com>
From: kernel test robot <lkp@intel.com>
arch/powerpc/kernel/iommu.c:76:2-16: WARNING: NULL check before some freeing functions is not needed.
NULL check before some freeing functions is not needed.
Based on checkpatch warning
"kfree(NULL) is safe this check is probably not required"
and kfreeaddr.cocci by Julia Lawall.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
Fixes: 691602aab9c3 ("powerpc/iommu/debug: Add debugfs entries for IOMMU tables")
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 81aa0968b7ea6dbabcdcda37dc8434dca6e1565b
commit: 691602aab9c3cce31d3ff9529c09b7922a5f6224 powerpc/iommu/debug: Add debugfs entries for IOMMU tables
iommu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -72,8 +72,7 @@ static void iommu_debugfs_del(struct iom
sprintf(name, "%08lx", tbl->it_index);
liobn_entry = debugfs_lookup(name, iommu_debugfs_dir);
- if (liobn_entry)
- debugfs_remove(liobn_entry);
+ debugfs_remove(liobn_entry);
}
#else
static void iommu_debugfs_add(struct iommu_table *tbl){}
^ permalink raw reply
* Re: [PATCH] powerpc/mm: Revert "powerpc/mm: Remove DEBUG_VM_PGTABLE support on powerpc"
From: Michael Ellerman @ 2021-03-19 1:12 UTC (permalink / raw)
To: Aneesh Kumar K.V, linuxppc-dev; +Cc: Aneesh Kumar K.V
In-Reply-To: <20210318034855.74513-1-aneesh.kumar@linux.ibm.com>
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:
> This reverts commit 675bceb097e6 ("powerpc/mm: Remove DEBUG_VM_PGTABLE support on powerpc")
>
> All the related issues are fixed by the series
> https://lore.kernel.org/linux-mm/20200902114222.181353-1-aneesh.kumar@linux.ibm.com
Was that series merged?
If so this seems like this could be tagged as a Fix for the last commit
in that series.
cheers
> Hence enable it back
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
> Documentation/features/debug/debug-vm-pgtable/arch-support.txt | 2 +-
> arch/powerpc/Kconfig | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/features/debug/debug-vm-pgtable/arch-support.txt b/Documentation/features/debug/debug-vm-pgtable/arch-support.txt
> index 7aff505af706..fa83403b4aec 100644
> --- a/Documentation/features/debug/debug-vm-pgtable/arch-support.txt
> +++ b/Documentation/features/debug/debug-vm-pgtable/arch-support.txt
> @@ -21,7 +21,7 @@
> | nios2: | TODO |
> | openrisc: | TODO |
> | parisc: | TODO |
> - | powerpc: | TODO |
> + | powerpc: | ok |
> | riscv: | ok |
> | s390: | ok |
> | sh: | TODO |
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 386ae12d8523..982c87d5c051 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -119,6 +119,7 @@ config PPC
> #
> select ARCH_32BIT_OFF_T if PPC32
> select ARCH_HAS_DEBUG_VIRTUAL
> + select ARCH_HAS_DEBUG_VM_PGTABLE
> select ARCH_HAS_DEVMEM_IS_ALLOWED
> select ARCH_HAS_ELF_RANDOMIZE
> select ARCH_HAS_FORTIFY_SOURCE
> --
> 2.30.2
^ permalink raw reply
* Re: [PATCH v9 1/8] powerpc/mm: Implement set_memory() routines
From: Michael Ellerman @ 2021-03-19 1:19 UTC (permalink / raw)
To: Jordan Niethe, linuxppc-dev
Cc: christophe.leroy, ajd, Jordan Niethe, npiggin, naveen.n.rao, dja
In-Reply-To: <20210316031741.1004850-1-jniethe5@gmail.com>
Jordan Niethe <jniethe5@gmail.com> writes:
> From: Russell Currey <ruscur@russell.cc>
>
> The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX,
> and are generally useful primitives to have. This implementation is
> designed to be completely generic across powerpc's many MMUs.
>
> It's possible that this could be optimised to be faster for specific
> MMUs, but the focus is on having a generic and safe implementation for
> now.
This won't work for the linear mapping with HPT on book3s 64. Because
the linear mapping is not in the kernel page tables.
apply_to_existing_page_range() should work that out and return an error.
But I'm not sure if callers handle that well or at all.
We might want to add a WARN_ON_ONCE() in change_memory_attr(), at least
to begin with, to report those errors, so we know when we are failing to
set permissions. Rather than silently failing and then crashing some
time later due to the permissions being wrong for some mapping.
cheers
> This implementation does not handle cases where the caller is attempting
> to change the mapping of the page it is executing from, or if another
> CPU is concurrently using the page being altered. These cases likely
> shouldn't happen, but a more complex implementation with MMU-specific code
> could safely handle them, so that is left as a TODO for now.
>
> These functions do nothing if STRICT_KERNEL_RWX is not enabled.
>
> Reviewed-by: Daniel Axtens <dja@axtens.net>
> Signed-off-by: Russell Currey <ruscur@russell.cc>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> [jpn: rebase on next plus "powerpc/mm/64s: Allow STRICT_KERNEL_RWX again"]
> Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
> ---
> arch/powerpc/Kconfig | 1 +
> arch/powerpc/include/asm/set_memory.h | 32 +++++++++++
> arch/powerpc/mm/Makefile | 2 +-
> arch/powerpc/mm/pageattr.c | 81 +++++++++++++++++++++++++++
> 4 files changed, 115 insertions(+), 1 deletion(-)
> create mode 100644 arch/powerpc/include/asm/set_memory.h
> create mode 100644 arch/powerpc/mm/pageattr.c
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index fc7f5c5933e6..4498a27ac9db 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -135,6 +135,7 @@ config PPC
> select ARCH_HAS_MEMBARRIER_CALLBACKS
> select ARCH_HAS_MEMBARRIER_SYNC_CORE
> select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64
> + select ARCH_HAS_SET_MEMORY
> select ARCH_HAS_STRICT_KERNEL_RWX if ((PPC_BOOK3S_64 || PPC32) && !HIBERNATION)
> select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
> select ARCH_HAS_UACCESS_FLUSHCACHE
> diff --git a/arch/powerpc/include/asm/set_memory.h b/arch/powerpc/include/asm/set_memory.h
> new file mode 100644
> index 000000000000..64011ea444b4
> --- /dev/null
> +++ b/arch/powerpc/include/asm/set_memory.h
> @@ -0,0 +1,32 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_POWERPC_SET_MEMORY_H
> +#define _ASM_POWERPC_SET_MEMORY_H
> +
> +#define SET_MEMORY_RO 0
> +#define SET_MEMORY_RW 1
> +#define SET_MEMORY_NX 2
> +#define SET_MEMORY_X 3
> +
> +int change_memory_attr(unsigned long addr, int numpages, long action);
> +
> +static inline int set_memory_ro(unsigned long addr, int numpages)
> +{
> + return change_memory_attr(addr, numpages, SET_MEMORY_RO);
> +}
> +
> +static inline int set_memory_rw(unsigned long addr, int numpages)
> +{
> + return change_memory_attr(addr, numpages, SET_MEMORY_RW);
> +}
> +
> +static inline int set_memory_nx(unsigned long addr, int numpages)
> +{
> + return change_memory_attr(addr, numpages, SET_MEMORY_NX);
> +}
> +
> +static inline int set_memory_x(unsigned long addr, int numpages)
> +{
> + return change_memory_attr(addr, numpages, SET_MEMORY_X);
> +}
> +
> +#endif
> diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
> index 3b4e9e4e25ea..d8a08abde1ae 100644
> --- a/arch/powerpc/mm/Makefile
> +++ b/arch/powerpc/mm/Makefile
> @@ -5,7 +5,7 @@
>
> ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
>
> -obj-y := fault.o mem.o pgtable.o mmap.o maccess.o \
> +obj-y := fault.o mem.o pgtable.o mmap.o maccess.o pageattr.o \
> init_$(BITS).o pgtable_$(BITS).o \
> pgtable-frag.o ioremap.o ioremap_$(BITS).o \
> init-common.o mmu_context.o drmem.o
> diff --git a/arch/powerpc/mm/pageattr.c b/arch/powerpc/mm/pageattr.c
> new file mode 100644
> index 000000000000..2da3fbab6ff7
> --- /dev/null
> +++ b/arch/powerpc/mm/pageattr.c
> @@ -0,0 +1,81 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +/*
> + * MMU-generic set_memory implementation for powerpc
> + *
> + * Copyright 2019, IBM Corporation.
> + */
> +
> +#include <linux/mm.h>
> +#include <linux/set_memory.h>
> +
> +#include <asm/mmu.h>
> +#include <asm/page.h>
> +#include <asm/pgtable.h>
> +
> +
> +/*
> + * Updates the attributes of a page in three steps:
> + *
> + * 1. invalidate the page table entry
> + * 2. flush the TLB
> + * 3. install the new entry with the updated attributes
> + *
> + * This is unsafe if the caller is attempting to change the mapping of the
> + * page it is executing from, or if another CPU is concurrently using the
> + * page being altered.
> + *
> + * TODO make the implementation resistant to this.
> + *
> + * NOTE: can be dangerous to call without STRICT_KERNEL_RWX
> + */
> +static int change_page_attr(pte_t *ptep, unsigned long addr, void *data)
> +{
> + long action = (long)data;
> + pte_t pte;
> +
> + spin_lock(&init_mm.page_table_lock);
> +
> + /* invalidate the PTE so it's safe to modify */
> + pte = ptep_get_and_clear(&init_mm, addr, ptep);
> + flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
> +
> + /* modify the PTE bits as desired, then apply */
> + switch (action) {
> + case SET_MEMORY_RO:
> + pte = pte_wrprotect(pte);
> + break;
> + case SET_MEMORY_RW:
> + pte = pte_mkwrite(pte);
> + break;
> + case SET_MEMORY_NX:
> + pte = pte_exprotect(pte);
> + break;
> + case SET_MEMORY_X:
> + pte = pte_mkexec(pte);
> + break;
> + default:
> + WARN_ON_ONCE(1);
> + break;
> + }
> +
> + set_pte_at(&init_mm, addr, ptep, pte);
> + spin_unlock(&init_mm.page_table_lock);
> +
> + return 0;
> +}
> +
> +int change_memory_attr(unsigned long addr, int numpages, long action)
> +{
> + unsigned long start = ALIGN_DOWN(addr, PAGE_SIZE);
> + unsigned long sz = numpages * PAGE_SIZE;
> +
> + if (!IS_ENABLED(CONFIG_STRICT_KERNEL_RWX))
> + return 0;
> +
> + if (numpages <= 0)
> + return 0;
> +
> + return apply_to_existing_page_range(&init_mm, start, sz,
> + change_page_attr, (void *)action);
> +}
> --
> 2.25.1
^ permalink raw reply
* Re: [RFC PATCH 2/8] powerpc: check for support for -Wa, -m{power4, any}
From: Nicholas Piggin @ 2021-03-19 1:32 UTC (permalink / raw)
To: Daniel Axtens, linuxppc-dev, llvmlinux
In-Reply-To: <20210225031006.1204774-3-dja@axtens.net>
Excerpts from Daniel Axtens's message of February 25, 2021 1:10 pm:
> LLVM's integrated assembler does not like either -Wa,-mpower4
> or -Wa,-many. So just don't pass them if they're not supported.
>
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> ---
> arch/powerpc/Makefile | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 08cf0eade56a..3e2c72d20bb8 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -252,7 +252,9 @@ cpu-as-$(CONFIG_E500) += -Wa,-me500
> # When using '-many -mpower4' gas will first try and find a matching power4
> # mnemonic and failing that it will allow any valid mnemonic that GAS knows
> # about. GCC will pass -many to GAS when assembling, clang does not.
> -cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 -Wa,-many
> +# LLVM IAS doesn't understand either flag: https://github.com/ClangBuiltLinux/linux/issues/675
> +# but LLVM IAS only supports ISA >= 2.06 for Book3S 64 anyway...
> +cpu-as-$(CONFIG_PPC_BOOK3S_64) += $(call as-option,-Wa$(comma)-mpower4) $(call as-option,-Wa$(comma)-many)
> cpu-as-$(CONFIG_PPC_E500MC) += $(call as-option,-Wa$(comma)-me500mc)
>
> KBUILD_AFLAGS += $(cpu-as-y)
I'm wondering why we even have this now. Kbuild's "AS" command goes
through the C compiler now with relevant options like -mcpu. I assume it
used to be useful for cross compiling when as was called directly but
I'm not sure.
Thanks,
Nick
^ permalink raw reply
* Re: [RFC PATCH 3/8] powerpc/head-64: do less gas-specific stuff with sections
From: Nicholas Piggin @ 2021-03-19 1:35 UTC (permalink / raw)
To: Daniel Axtens, linuxppc-dev, llvmlinux
In-Reply-To: <20210225031006.1204774-4-dja@axtens.net>
Excerpts from Daniel Axtens's message of February 25, 2021 1:10 pm:
> Reopening the section without specifying the same flags breaks
> the llvm integrated assembler. Don't do it: just specify all the
> flags all the time.
I don't have a problem with this but llvm might want to track the issue
if it aims to be compatible with gas if you haven't alread opened an
issue.
When you fix the patch (perhaps add a quick comment as well?), then
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Thanks,
Nick
>
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> ---
> arch/powerpc/include/asm/head-64.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/head-64.h b/arch/powerpc/include/asm/head-64.h
> index 4cb9efa2eb21..7d8ccab47e86 100644
> --- a/arch/powerpc/include/asm/head-64.h
> +++ b/arch/powerpc/include/asm/head-64.h
> @@ -15,10 +15,10 @@
> .macro define_data_ftsec name
> .section ".head.data.\name\()","a",@progbits
> .endm
> -.macro use_ftsec name
> - .section ".head.text.\name\()"
> -.endm
> -
> +//.macro use_ftsec name
> +// .section ".head.text.\name\()"
> +//.endm
> +#define use_ftsec define_ftsec
> /*
> * Fixed (location) sections are used by opening fixed sections and emitting
> * fixed section entries into them before closing them. Multiple fixed sections
> --
> 2.27.0
>
>
^ permalink raw reply
* Re: [RFC PATCH 4/8] powerpc/ppc_asm: use plain numbers for registers
From: Nicholas Piggin @ 2021-03-19 1:39 UTC (permalink / raw)
To: Daniel Axtens, Segher Boessenkool; +Cc: llvmlinux, linuxppc-dev
In-Reply-To: <87tupzoffb.fsf@dja-thinkpad.axtens.net>
Excerpts from Daniel Axtens's message of February 26, 2021 10:12 am:
> Segher Boessenkool <segher@kernel.crashing.org> writes:
>
>> On Thu, Feb 25, 2021 at 02:10:02PM +1100, Daniel Axtens wrote:
>>> This is dumb but makes the llvm integrated assembler happy.
>>> https://github.com/ClangBuiltLinux/linux/issues/764
>>
>>> -#define r0 %r0
>>
>>> +#define r0 0
>>
>> This is a big step back (compare 9a13a524ba37).
>>
>> If you use a new enough GAS, you can use the -mregnames option and just
>> say "r0" directly (so not define it at all, or define it to itself).
>>
>> ===
>> addi 3,3,3
>> addi r3,r3,3
>> addi %r3,%r3,3
>>
>> addi 3,3,3
>> addi r3,r3,r3
>> addi %r3,%r3,%r3
>> ===
>>
>> $ as t.s -o t.o -mregnames
>> t.s: Assembler messages:
>> t.s:6: Warning: invalid register expression
>> t.s:7: Warning: invalid register expression
>>
>>
>> Many people do not like bare numbers. It is a bit like not wearing
>> seatbelts (but so is all assembler code really: you just have to pay
>> attention). A better argument is that it is harder to read for people
>> not used to assembler code like this.
>>
>> We used to have "#define r0 0" etc., and that was quite problematic.
>> Like that "addi r3,r3,r3" example, but also, people wrote "r0" where
>> only a plain 0 is allowed (like in "lwzx r3,0,r3": "r0" would be
>> misleading there!)
>
> So an overarching comment on all of these patches is that they're not
> intended to be ready to merge, nor are they necessarily what I think is
> the best solution. I'm just swinging a big hammer to see how far towards
> LLVM_IAS=1 I can get on powerpc, and I accept I'm going to have to come
> back and clean things up.
>
> Anyway, noted, I'll push harder on trying to get llvm to accept %rN:
> there was a patch that went in after llvm-11 that should help.
If you put it under ifdef CONFIG_CC_IS_CLANG in the meantime I think
that would be okay. Then we get error checking with gcc compiles and
llvm at least builds with its assembler which would be nice.
Thanks,
Nick
^ permalink raw reply
* Re: remove the legacy ide driver
From: Finn Thain @ 2021-03-19 1:43 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Thomas Bogendoerfer, linux-doc, Russell King,
linux-kernel, linux-ide, linux-m68k, Ivan Kokshaysky, linux-alpha,
Geert Uytterhoeven, Matt Turner, linux-mips, linuxppc-dev,
David S. Miller, linux-arm-kernel, Richard Henderson
In-Reply-To: <20210318045706.200458-1-hch@lst.de>
On Thu, 18 Mar 2021, Christoph Hellwig wrote:
> Hi all,
>
> we've been trying to get rid of the legacy ide driver for a while now,
> and finally scheduled a removal for 2021, which is three month old now.
>
> In general distros and most defconfigs have switched to libata long ago,
> but there are a few exceptions. This series first switches over all
> remaining defconfigs to use libata and then removes the legacy ide
> driver.
>
> libata mostly covers all hardware supported by the legacy ide driver.
> There are three mips drivers that are not supported, but the linux-mips
> list could not identify any users of those. There also are two m68k
> drivers that do not have libata equivalents, which might or might not
> have users, so we'll need some input and possibly help from the m68k
> community here.
>
A few months ago I wrote another patch to move some more platforms away
from macide but it has not been tested yet. That is not to say you should
wait. However, my patch does have some changes that are missing from your
patch series, relating to ide platform devices in arch/m68k/mac/config.c.
I hope to be able to test this patch before the 5.13 merge window closes.
^ permalink raw reply
* Re: [RFC PATCH 6/8] powerpc/mm/book3s64/hash: drop pre 2.06 tlbiel for clang
From: Nicholas Piggin @ 2021-03-19 2:01 UTC (permalink / raw)
To: Daniel Axtens, linuxppc-dev, llvmlinux
In-Reply-To: <20210225031006.1204774-7-dja@axtens.net>
Excerpts from Daniel Axtens's message of February 25, 2021 1:10 pm:
> The llvm integrated assembler does not recognise the ISA 2.05 tlbiel
> version. Eventually do this more smartly.
The whole thing with TLBIE and TLBIEL in this file seems a bit too
clever. We should have PPC_TLBIE* macros for all of them.
Thanks,
Nick
>
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> ---
> arch/powerpc/mm/book3s64/hash_native.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/powerpc/mm/book3s64/hash_native.c b/arch/powerpc/mm/book3s64/hash_native.c
> index 52e170bd95ae..c5937f69a452 100644
> --- a/arch/powerpc/mm/book3s64/hash_native.c
> +++ b/arch/powerpc/mm/book3s64/hash_native.c
> @@ -267,9 +267,14 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
> va |= ssize << 8;
> sllp = get_sllp_encoding(apsize);
> va |= sllp << 5;
> +#if 0
> asm volatile(ASM_FTR_IFSET("tlbiel %0", "tlbiel %0,0", %1)
> : : "r" (va), "i" (CPU_FTR_ARCH_206)
> : "memory");
> +#endif
> + asm volatile("tlbiel %0"
> + : : "r" (va)
> + : "memory");
> break;
> default:
> /* We need 14 to 14 + i bits of va */
> @@ -286,9 +291,14 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
> */
> va |= (vpn & 0xfe);
> va |= 1; /* L */
> +#if 0
> asm volatile(ASM_FTR_IFSET("tlbiel %0", "tlbiel %0,1", %1)
> : : "r" (va), "i" (CPU_FTR_ARCH_206)
> : "memory");
> +#endif
> + asm volatile("tlbiel %0"
> + : : "r" (va)
> + : "memory");
> break;
> }
> trace_tlbie(0, 1, va, 0, 0, 0, 0);
> --
> 2.27.0
>
>
^ permalink raw reply
* Re: [RFC PATCH 7/8] powerpc/purgatory: drop .machine specifier
From: Nicholas Piggin @ 2021-03-19 2:05 UTC (permalink / raw)
To: Daniel Axtens, Segher Boessenkool; +Cc: llvmlinux, linuxppc-dev
In-Reply-To: <20210225155836.GG28121@gate.crashing.org>
Excerpts from Segher Boessenkool's message of February 26, 2021 1:58 am:
> On Thu, Feb 25, 2021 at 02:10:05PM +1100, Daniel Axtens wrote:
>> It's ignored by future versions of llvm's integrated assembler (by not -11).
>> I'm not sure what it does for us in gas.
>
> It enables all insns that exist on 620 (the first 64-bit PowerPC CPU).
Same question for this, why do we have it at all?
Thanks,
Nick
^ permalink raw reply
* Re: [RFC PATCH 8/8] powerpc/64/asm: don't reassign labels
From: Nicholas Piggin @ 2021-03-19 2:15 UTC (permalink / raw)
To: Daniel Axtens, Segher Boessenkool; +Cc: llvmlinux, linuxppc-dev
In-Reply-To: <87lfbboeo9.fsf@dja-thinkpad.axtens.net>
Excerpts from Daniel Axtens's message of February 26, 2021 10:28 am:
> Segher Boessenkool <segher@kernel.crashing.org> writes:
>
>> On Thu, Feb 25, 2021 at 02:10:06PM +1100, Daniel Axtens wrote:
>>> The assembler really does not like us reassigning things to the same
>>> label:
>>>
>>> <instantiation>:7:9: error: invalid reassignment of non-absolute variable 'fs_label'
>>>
>>> This happens across a bunch of platforms:
>>> https://github.com/ClangBuiltLinux/linux/issues/1043
>>> https://github.com/ClangBuiltLinux/linux/issues/1008
>>> https://github.com/ClangBuiltLinux/linux/issues/920
>>> https://github.com/ClangBuiltLinux/linux/issues/1050
>>>
>>> There is no hope of getting this fixed in LLVM, so if we want to build
>>> with LLVM_IAS, we need to hack around it ourselves.
>>>
>>> For us the big problem comes from this:
>>>
>>> \#define USE_FIXED_SECTION(sname) \
>>> fs_label = start_##sname; \
>>> fs_start = sname##_start; \
>>> use_ftsec sname;
>>>
>>> \#define USE_TEXT_SECTION()
>>> fs_label = start_text; \
>>> fs_start = text_start; \
>>> .text
>>>
>>> and in particular fs_label.
>>
>> The "Setting Symbols" super short chapter reads:
>>
>> "A symbol can be given an arbitrary value by writing a symbol, followed
>> by an equals sign '=', followed by an expression. This is equivalent
>> to using the '.set' directive."
>>
>> And ".set" has
>>
>> "Set the value of SYMBOL to EXPRESSION. This changes SYMBOL's value and
>> type to conform to EXPRESSION. If SYMBOL was flagged as external, it
>> remains flagged.
>>
>> You may '.set' a symbol many times in the same assembly provided that
>> the values given to the symbol are constants. Values that are based on
>> expressions involving other symbols are allowed, but some targets may
>> restrict this to only being done once per assembly. This is because
>> those targets do not set the addresses of symbols at assembly time, but
>> rather delay the assignment until a final link is performed. This
>> allows the linker a chance to change the code in the files, changing the
>> location of, and the relative distance between, various different
>> symbols.
>>
>> If you '.set' a global symbol, the value stored in the object file is
>> the last value stored into it."
>>
>> So this really should be fixed in clang: it is basic assembler syntax.
>
> No doubt I have explained this poorly.
>
> LLVM does allow some things, this builds fine for example:
>
> .set foo, 8192
> addi %r3, %r3, foo
> .set foo, 1234
> addi %r3, %r3, foo
>
> However, this does not:
>
> a:
> .set foo, a
> addi %r3, %r3, foo@l
> b:
> .set foo, b
> addi %r3, %r3, foo-a
>
> clang -target ppc64le -integrated-as foo.s -o foo.o -c
> foo.s:5:11: error: invalid reassignment of non-absolute variable 'foo' in '.set' directive
> .set foo, b
> ^
So that does seem to be allowed by the specification.
I don't have a huge problem with the patch actually, doesn't seem too
bad.
Thanks,
Nick
^ permalink raw reply
* [for-stable-4.19 PATCH 1/2] vmlinux.lds.h: Create section for protection against instrumentation
From: Nicolas Boichat @ 2021-03-18 23:54 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, linux-arch, Nicolas Boichat, Alexandre Chartre,
Arnd Bergmann, linux-kbuild, Peter Zijlstra, Christopher Li,
linux-kernel, Nicholas Piggin, Masahiro Yamada, linux-sparse,
Michal Marek, Paul Mackerras, Greg Kroah-Hartman, Thomas Gleixner,
linuxppc-dev, Naveen N. Rao, Daniel Axtens
In-Reply-To: <20210318235416.794798-1-drinkcat@chromium.org>
From: Thomas Gleixner <tglx@linutronix.de>
commit 6553896666433e7efec589838b400a2a652b3ffa upstream.
Some code pathes, especially the low level entry code, must be protected
against instrumentation for various reasons:
- Low level entry code can be a fragile beast, especially on x86.
- With NO_HZ_FULL RCU state needs to be established before using it.
Having a dedicated section for such code allows to validate with tooling
that no unsafe functions are invoked.
Add the .noinstr.text section and the noinstr attribute to mark
functions. noinstr implies notrace. Kprobes will gain a section check
later.
Provide also a set of markers: instrumentation_begin()/end()
These are used to mark code inside a noinstr function which calls
into regular instrumentable text section as safe.
The instrumentation markers are only active when CONFIG_DEBUG_ENTRY is
enabled as the end marker emits a NOP to prevent the compiler from merging
the annotation points. This means the objtool verification requires a
kernel compiled with this option.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200505134100.075416272@linutronix.de
[Nicolas: context conflicts in:
arch/powerpc/kernel/vmlinux.lds.S
include/asm-generic/vmlinux.lds.h
include/linux/compiler.h
include/linux/compiler_types.h]
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
---
arch/powerpc/kernel/vmlinux.lds.S | 1 +
include/asm-generic/sections.h | 3 ++
include/asm-generic/vmlinux.lds.h | 10 ++++++
include/linux/compiler.h | 54 +++++++++++++++++++++++++++++++
include/linux/compiler_types.h | 4 +++
scripts/mod/modpost.c | 2 +-
6 files changed, 73 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 695432965f20..9b346f3d2814 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -99,6 +99,7 @@ SECTIONS
#endif
/* careful! __ftr_alt_* sections need to be close to .text */
*(.text.hot TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
+ NOINSTR_TEXT
SCHED_TEXT
CPUIDLE_TEXT
LOCK_TEXT
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 849cd8eb5ca0..ea5987bb0b84 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -53,6 +53,9 @@ extern char __ctors_start[], __ctors_end[];
/* Start and end of .opd section - used for function descriptors. */
extern char __start_opd[], __end_opd[];
+/* Start and end of instrumentation protected text section */
+extern char __noinstr_text_start[], __noinstr_text_end[];
+
extern __visible const void __nosave_begin, __nosave_end;
/* Function descriptor handling (if any). Override in asm/sections.h */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 2d632a74cc5e..88484ee023ca 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -482,6 +482,15 @@
__security_initcall_end = .; \
}
+/*
+ * Non-instrumentable text section
+ */
+#define NOINSTR_TEXT \
+ ALIGN_FUNCTION(); \
+ __noinstr_text_start = .; \
+ *(.noinstr.text) \
+ __noinstr_text_end = .;
+
/*
* .text section. Map to function alignment to avoid address changes
* during second ld run in second ld pass when generating System.map
@@ -496,6 +505,7 @@
*(TEXT_MAIN .text.fixup) \
*(.text.unlikely .text.unlikely.*) \
*(.text.unknown .text.unknown.*) \
+ NOINSTR_TEXT \
*(.text..refcount) \
*(.ref.text) \
MEM_KEEP(init.text*) \
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 6b6505e3b2c7..6a53300cbd1e 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -129,11 +129,65 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
".pushsection .discard.unreachable\n\t" \
".long 999b - .\n\t" \
".popsection\n\t"
+
+#ifdef CONFIG_DEBUG_ENTRY
+/* Begin/end of an instrumentation safe region */
+#define instrumentation_begin() ({ \
+ asm volatile("%c0:\n\t" \
+ ".pushsection .discard.instr_begin\n\t" \
+ ".long %c0b - .\n\t" \
+ ".popsection\n\t" : : "i" (__COUNTER__)); \
+})
+
+/*
+ * Because instrumentation_{begin,end}() can nest, objtool validation considers
+ * _begin() a +1 and _end() a -1 and computes a sum over the instructions.
+ * When the value is greater than 0, we consider instrumentation allowed.
+ *
+ * There is a problem with code like:
+ *
+ * noinstr void foo()
+ * {
+ * instrumentation_begin();
+ * ...
+ * if (cond) {
+ * instrumentation_begin();
+ * ...
+ * instrumentation_end();
+ * }
+ * bar();
+ * instrumentation_end();
+ * }
+ *
+ * If instrumentation_end() would be an empty label, like all the other
+ * annotations, the inner _end(), which is at the end of a conditional block,
+ * would land on the instruction after the block.
+ *
+ * If we then consider the sum of the !cond path, we'll see that the call to
+ * bar() is with a 0-value, even though, we meant it to happen with a positive
+ * value.
+ *
+ * To avoid this, have _end() be a NOP instruction, this ensures it will be
+ * part of the condition block and does not escape.
+ */
+#define instrumentation_end() ({ \
+ asm volatile("%c0: nop\n\t" \
+ ".pushsection .discard.instr_end\n\t" \
+ ".long %c0b - .\n\t" \
+ ".popsection\n\t" : : "i" (__COUNTER__)); \
+})
+#endif /* CONFIG_DEBUG_ENTRY */
+
#else
#define annotate_reachable()
#define annotate_unreachable()
#endif
+#ifndef instrumentation_begin
+#define instrumentation_begin() do { } while(0)
+#define instrumentation_end() do { } while(0)
+#endif
+
#ifndef ASM_UNREACHABLE
# define ASM_UNREACHABLE
#endif
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 2b8ed70c4c77..a9b0495051a3 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -234,6 +234,10 @@ struct ftrace_likely_data {
#define notrace __attribute__((no_instrument_function))
#endif
+/* Section for code which can't be instrumented at all */
+#define noinstr \
+ noinline notrace __attribute((__section__(".noinstr.text")))
+
/*
* it doesn't make sense on ARM (currently the only user of __naked)
* to trace naked functions because then mcount is called without
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 91a80036c05d..7c693bd775c1 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -895,7 +895,7 @@ static void check_section(const char *modname, struct elf_info *elf,
#define DATA_SECTIONS ".data", ".data.rel"
#define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \
- ".kprobes.text", ".cpuidle.text"
+ ".kprobes.text", ".cpuidle.text", ".noinstr.text"
#define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \
".fixup", ".entry.text", ".exception.text", ".text.*", \
".coldtext"
--
2.31.0.rc2.261.g7f71774620-goog
^ permalink raw reply related
* [for-stable-4.19 PATCH 0/2] Backport patches to fix KASAN+LKDTM with recent clang on ARM64
From: Nicolas Boichat @ 2021-03-18 23:54 UTC (permalink / raw)
To: stable
Cc: Alexandre Chartre, Peter Zijlstra, Christopher Li,
Masahiro Yamada, Paul Mackerras, Sasha Levin, Nicolas Boichat,
clang-built-linux, linux-sparse, Naveen N. Rao, linux-arch,
Kees Cook, Arnd Bergmann, linux-kbuild, Nicholas Piggin,
Thomas Gleixner, Daniel Axtens, Michal Marek, Greg Kroah-Hartman,
linux-kernel, linuxppc-dev
Backport 2 patches that are required to make KASAN+LKDTM work
with recent clang (patch 2/2 has a complete description).
Tested on our chromeos-4.19 branch.
Patch 1/2 is context conflict only, and 2/2 is a clean backport.
These patches have been merged to 5.4 stable already. We might
need to backport to older stable branches, but this is what I
could test for now.
Mark Rutland (1):
lkdtm: don't move ctors to .rodata
Thomas Gleixner (1):
vmlinux.lds.h: Create section for protection against instrumentation
arch/powerpc/kernel/vmlinux.lds.S | 1 +
drivers/misc/lkdtm/Makefile | 2 +-
drivers/misc/lkdtm/rodata.c | 2 +-
include/asm-generic/sections.h | 3 ++
include/asm-generic/vmlinux.lds.h | 10 ++++++
include/linux/compiler.h | 54 +++++++++++++++++++++++++++++++
include/linux/compiler_types.h | 4 +++
scripts/mod/modpost.c | 2 +-
8 files changed, 75 insertions(+), 3 deletions(-)
--
2.31.0.rc2.261.g7f71774620-goog
^ permalink raw reply
* Re: [PATCH 04/10] MIPS: disable CONFIG_IDE in sb1250_swarm_defconfig
From: Maciej W. Rozycki @ 2021-03-19 0:12 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Thomas Bogendoerfer, linux-doc, Russell King,
linux-kernel, linux-ide, linux-m68k, Ivan Kokshaysky, linux-alpha,
Geert Uytterhoeven, Matt Turner, linux-mips, linuxppc-dev,
David S. Miller, linux-arm-kernel, Richard Henderson
In-Reply-To: <20210318045706.200458-5-hch@lst.de>
On Thu, 18 Mar 2021, Christoph Hellwig wrote:
> sb1250_swarm_defconfig enables CONFIG_IDE but no actual host controller
> driver, so just drop CONFIG_IDE, CONFIG_BLK_DEV_IDECD and
> CONFIG_BLK_DEV_IDETAPE as they are useless.
Actually BLK_DEV_PLATFORM would handle the SWARM's platform driver as an
IDE device, however the driver has supported libata ever since commit
2fef357cf391 ("IDE: Fix platform device registration in Swarm IDE driver
(v2)") back in 2008, so this is good to go. We should probably enable
PATA_PLATFORM in the defconfig instead.
The printed name of the driver could be improved I suppose though:
scsi host0: pata_platform
ata1: PATA max PIO0 mmio cmd 0x100b3e00 ctl 0x100b7ec0 irq 36
(PIO3 is actually hardwired; it's an odd interface and people reported
issues with it, but I have never had any myself be it with IDE or libata).
Acked-by: Maciej W. Rozycki <macro@orcam.me.uk>
Maciej
^ permalink raw reply
* Re: [PATCH 00/36] [Set 4] Rid W=1 warnings in SCSI
From: Martin K. Petersen @ 2021-03-19 3:41 UTC (permalink / raw)
To: Lee Jones
Cc: Uma Krishnan, Brian Macy, Hannes Reinecke, Anil Ravindranath,
Tyrel Datwyler, willy, Le Moal, Dave Boutcher, Marvell,
Jirka Hanika, Linda Xie, C.L. Huang, target-devel, Drew Eckhardt,
Brian King, Christoph Hellwig, Alan Cox, linux-drivers,
Nicholas A. Bellinger, Linux GmbH, linux-scsi, Shaun Tancheff,
Subbu Seetharaman, Sathya Prakash, Doug Ledford,
Leonard N. Zubkoff, Ketan Mukadam, Dave Boutcher, Colin DeVilbiss,
Karan Tilak Kumar, Badari Pulavarty, Bryant G. Ly,
Douglas Gilbert, Jamie Lenehan, MPT-FusionLinux.pdl,
Richard Gooch, MPT-FusionLinux.pdl, Bas Vermeulen,
Artur Paszkiewicz, Michael Cyr, dc395x, Satish Kharat,
Suganath Prabu Subramani, James E.J. Bottomley, Luben Tuikov,
Ali Akcaagac, Kurt Garloff, Jitendra Bhivare, Brian King,
Hannes Reinecke, Erich Chen, David Chaw, Santiago Leon,
Matthew R. Ochs, Manoj N. Kumar, Sreekanth Reddy,
Martin K. Petersen, Eric Youngdale, Oliver Neukum, linux-kernel,
Sesidhar Baddela, Alex Davis, Torben Mathiasen, Paul Mackerras,
FUJITA Tomonori, linuxppc-dev
In-Reply-To: <20210317091230.2912389-1-lee.jones@linaro.org>
Lee,
> 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.
Applied to 5.13/scsi-staging, thanks! I fixed a few little things.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_sai: remove reset code from dai_probe
From: Shengjiu Wang @ 2021-03-19 4:10 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel@alsa-project.org, timur@kernel.org,
Xiubo.Lee@gmail.com, linuxppc-dev@lists.ozlabs.org, S.j. Wang,
tiwai@suse.com, lgirdwood@gmail.com, nicoleotsuka@gmail.com,
Viorel Suman, festevam@gmail.com, linux-kernel@vger.kernel.org
In-Reply-To: <20210316134915.GB4309@sirena.org.uk>
Hi Mark
On Tue, Mar 16, 2021 at 9:51 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Tue, Mar 16, 2021 at 01:42:40PM +0000, Viorel Suman wrote:
>
> > To me it makes sense to manage the clocks and reset from the same place.
> > Currently we have the clocks management moved completely into runtime PM
> > fsl_sai_runtime_resume and fsl_sai_runtime_suspend callbacks.
>
> Usually the pattern is to have probe() leave everything powered up then
> let runtime PM power things down if it's enabled, you can often do the
> power up by having an open coded call to the resume callback in probe().
It seems some drivers very depend on runtime PM, if the CONFIG_PM=n,
the drivers should not work. What's the strategy for this?
Do we need to support both cases, or only one case is also acceptable?
Best regards
Wang Shengjiu
^ permalink raw reply
* Re: remove the legacy ide driver
From: Christoph Hellwig @ 2021-03-19 5:43 UTC (permalink / raw)
To: Finn Thain
Cc: Jens Axboe, Thomas Bogendoerfer, linux-doc, Russell King,
David S. Miller, linux-ide, linux-m68k, Ivan Kokshaysky,
linux-arm-kernel, linux-alpha, Geert Uytterhoeven, Matt Turner,
linux-mips, linuxppc-dev, Christoph Hellwig, linux-kernel,
Richard Henderson
In-Reply-To: <c1fa8e6-a05d-9ea1-f47e-9e85ea6ea65e@telegraphics.com.au>
On Fri, Mar 19, 2021 at 12:43:48PM +1100, Finn Thain wrote:
> A few months ago I wrote another patch to move some more platforms away
> from macide but it has not been tested yet. That is not to say you should
> wait. However, my patch does have some changes that are missing from your
> patch series, relating to ide platform devices in arch/m68k/mac/config.c.
> I hope to be able to test this patch before the 5.13 merge window closes.
Normally we do not remove drivers for hardware that is still used. So
at leat for macide my plan was not to take it away unless the users
are sufficiently happy. Or in other words: I think waiting it the
right choice, but hopefully we can make that wait as short as possible.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox