* Re: [PATCH] i2c: powermac: Simplify reading the "reg" and "i2c-address" property
From: Wolfram Sang @ 2020-04-26 8:32 UTC (permalink / raw)
To: Aishwarya R
Cc: linux-kernel, Richard Fontana, Paul Mackerras, Greg Kroah-Hartman,
Thomas Gleixner, linuxppc-dev, linux-i2c
In-Reply-To: <20200408100354.17782-1-aishwaryarj100@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 294 bytes --]
On Wed, Apr 08, 2020 at 03:33:53PM +0530, Aishwarya R wrote:
> Use of_property_read_u32 to read the "reg" and "i2c-address" property
> instead of using of_get_property to check the return values.
>
> Signed-off-by: Aishwarya R <aishwaryarj100@gmail.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH 2/7] signal: factor copy_siginfo_to_external32 from copy_siginfo_to_user32
From: Christoph Hellwig @ 2020-04-26 7:40 UTC (permalink / raw)
To: Andrew Morton
Cc: Arnd Bergmann, Linus Torvalds, linux-kernel, Alexander Viro,
Jeremy Kerr, linux-fsdevel, linuxppc-dev, Christoph Hellwig,
Eric W . Biederman
In-Reply-To: <20200425214724.a9a00c76edceff7296df7874@linux-foundation.org>
On Sat, Apr 25, 2020 at 09:47:24PM -0700, Andrew Morton wrote:
> I looked at fixing it but surely this sort of thing:
>
>
> int copy_siginfo_to_user32(struct compat_siginfo __user *to,
> const struct kernel_siginfo *from)
> #if defined(CONFIG_X86_X32_ABI) || defined(CONFIG_IA32_EMULATION)
> {
> return __copy_siginfo_to_user32(to, from, in_x32_syscall());
> }
> int __copy_siginfo_to_user32(struct compat_siginfo __user *to,
> const struct kernel_siginfo *from, bool x32_ABI)
> #endif
> {
> ...
>
>
> is too ugly to live?
I fixed it up in my earlier versions, but Eric insisted to keep it,
which is why I switched to his version given that he is the defacto
signal.c maintainer.
Here is what I would have preferred:
https://www.spinics.net/lists/kernel/msg3473847.html
https://www.spinics.net/lists/kernel/msg3473840.html
https://www.spinics.net/lists/kernel/msg3473843.html
^ permalink raw reply
* [PATCH v3] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.
From: Ram Pai @ 2020-04-26 7:27 UTC (permalink / raw)
To: kvm-ppc, linuxppc-dev; +Cc: aik, andmike, groug, clg, sukadev, bauerman, david
In-Reply-To: <20200426020518.GC5853@oc0525413822.ibm.com>
XIVE interrupt controller uses an Event Queue (EQ) to enqueue event
notifications when an exception occurs. The EQ is a single memory page
provided by the O/S defining a circular buffer, one per server and
priority couple.
On baremetal, the EQ page is configured with an OPAL call. On pseries,
an extra hop is necessary and the guest OS uses the hcall
H_INT_SET_QUEUE_CONFIG to configure the XIVE interrupt controller.
The XIVE controller being Hypervisor privileged, it will not be allowed
to enqueue event notifications for a Secure VM unless the EQ pages are
shared by the Secure VM.
Hypervisor/Ultravisor still requires support for the TIMA and ESB page
fault handlers. Until this is complete, QEMU can use the emulated XIVE
device for Secure VMs, option "kernel_irqchip=off" on the QEMU pseries
machine.
Cc: kvm-ppc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Cc: Michael Anderson <andmike@linux.ibm.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cedric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
v3: fix a minor semantics in description.
and added reviewed-by from Cedric and Greg.
v2: better description of the patch from Cedric.
---
arch/powerpc/sysdev/xive/spapr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index 55dc61c..608b52f 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -26,6 +26,8 @@
#include <asm/xive.h>
#include <asm/xive-regs.h>
#include <asm/hvcall.h>
+#include <asm/svm.h>
+#include <asm/ultravisor.h>
#include "xive-internal.h"
@@ -501,6 +503,9 @@ static int xive_spapr_configure_queue(u32 target, struct xive_q *q, u8 prio,
rc = -EIO;
} else {
q->qpage = qpage;
+ if (is_secure_guest())
+ uv_share_page(PHYS_PFN(qpage_phys),
+ 1 << xive_alloc_order(order));
}
fail:
return rc;
@@ -534,6 +539,8 @@ static void xive_spapr_cleanup_queue(unsigned int cpu, struct xive_cpu *xc,
hw_cpu, prio);
alloc_order = xive_alloc_order(xive_queue_shift);
+ if (is_secure_guest())
+ uv_unshare_page(PHYS_PFN(__pa(q->qpage)), 1 << alloc_order);
free_pages((unsigned long)q->qpage, alloc_order);
q->qpage = NULL;
}
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH 4/5] arch/kmap_atomic: Consolidate duplicate code
From: Christoph Hellwig @ 2020-04-26 7:26 UTC (permalink / raw)
To: ira.weiny
Cc: Peter Zijlstra, Dave Hansen, linux-mips, James E.J. Bottomley,
Max Filippov, Paul Mackerras, H. Peter Anvin, sparclinux,
Dan Williams, Helge Deller, x86, linux-csky, Ingo Molnar,
linux-snps-arc, linux-xtensa, Borislav Petkov, Andy Lutomirski,
Thomas Gleixner, linux-arm-kernel, Chris Zankel,
Thomas Bogendoerfer, linux-parisc, linux-kernel, Andrew Morton,
linuxppc-dev, David S. Miller
In-Reply-To: <20200426055406.134198-5-ira.weiny@intel.com>
> diff --git a/arch/arc/mm/highmem.c b/arch/arc/mm/highmem.c
> index 4db13a6b9f3b..1cae4b911a33 100644
> --- a/arch/arc/mm/highmem.c
> +++ b/arch/arc/mm/highmem.c
> @@ -53,11 +53,10 @@ void *kmap_atomic(struct page *page)
> {
> int idx, cpu_idx;
> unsigned long vaddr;
> + void *addr = kmap_atomic_fast(page);
>
> - preempt_disable();
> - pagefault_disable();
> - if (!PageHighMem(page))
> - return page_address(page);
> + if (addr)
> + return addr;
Wouldn't it make sense to just move kmap_atomic itelf to common code,
and call out to a kmap_atomic_high for the highmem case, following the
scheme in kmap? Same for the unmap side. That might require to support
kmap_atomic_prot everywhere first, which sounds like a really good
idea anyway, and would avoid the need for strange workaround in drm.
^ permalink raw reply
* Re: [PATCH 2/5] arch/kmap: Remove redundant arch specific kmaps
From: Christoph Hellwig @ 2020-04-26 7:17 UTC (permalink / raw)
To: ira.weiny
Cc: Peter Zijlstra, Dave Hansen, linux-mips, James E.J. Bottomley,
Max Filippov, Paul Mackerras, H. Peter Anvin, sparclinux,
Dan Williams, Helge Deller, x86, linux-csky, Ingo Molnar,
linux-snps-arc, linux-xtensa, Borislav Petkov, Andy Lutomirski,
Thomas Gleixner, linux-arm-kernel, Chris Zankel,
Thomas Bogendoerfer, linux-parisc, linux-kernel, Andrew Morton,
linuxppc-dev, David S. Miller
In-Reply-To: <20200426055406.134198-3-ira.weiny@intel.com>
On Sat, Apr 25, 2020 at 10:54:03PM -0700, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
>
> The kmap code for all the architectures is almost 100% identical.
>
> Lift the common code to the core. Use ARCH_HAS_KMAP to indicate if an
> arch needs a special kmap.
Can you add a kmap_flush_tlb hook that csky and mips define, and the
just entirely consolidate the code instead?
^ permalink raw reply
* [PATCH 4/5] arch/kmap_atomic: Consolidate duplicate code
From: ira.weiny @ 2020-04-26 5:54 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Peter Zijlstra, Dave Hansen, James E.J. Bottomley, Max Filippov,
Paul Mackerras, H. Peter Anvin, sparclinux, Ira Weiny,
Dan Williams, Helge Deller, x86, linux-csky, Ingo Molnar,
linux-snps-arc, linux-xtensa, Borislav Petkov, Andy Lutomirski,
Thomas Gleixner, linux-arm-kernel, Chris Zankel,
Thomas Bogendoerfer, linux-parisc, linux-mips, linuxppc-dev,
David S. Miller
In-Reply-To: <20200426055406.134198-1-ira.weiny@intel.com>
From: Ira Weiny <ira.weiny@intel.com>
Every arch has the same check for a not HIGHMEM page. Define
kmap_atomic_fast() to quickly return already mapped pages and reduce the
code duplication by lifting this check to the core.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
arch/arc/mm/highmem.c | 7 +++----
arch/arm/mm/highmem.c | 8 +++-----
arch/csky/mm/highmem.c | 7 +++----
arch/microblaze/mm/highmem.c | 8 +++-----
arch/mips/mm/highmem.c | 7 +++----
arch/nds32/mm/highmem.c | 7 +++----
arch/powerpc/mm/highmem.c | 7 +++----
arch/sparc/mm/highmem.c | 7 +++----
arch/x86/mm/highmem_32.c | 8 +++-----
arch/xtensa/mm/highmem.c | 7 +++----
include/linux/highmem.h | 9 +++++++++
11 files changed, 39 insertions(+), 43 deletions(-)
diff --git a/arch/arc/mm/highmem.c b/arch/arc/mm/highmem.c
index 4db13a6b9f3b..1cae4b911a33 100644
--- a/arch/arc/mm/highmem.c
+++ b/arch/arc/mm/highmem.c
@@ -53,11 +53,10 @@ void *kmap_atomic(struct page *page)
{
int idx, cpu_idx;
unsigned long vaddr;
+ void *addr = kmap_atomic_fast(page);
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
+ if (addr)
+ return addr;
cpu_idx = kmap_atomic_idx_push();
idx = cpu_idx + KM_TYPE_NR * smp_processor_id();
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index c700b32350ee..4a629f616a6a 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -35,13 +35,11 @@ void *kmap_atomic(struct page *page)
{
unsigned int idx;
unsigned long vaddr;
- void *kmap;
+ void *kmap = kmap_atomic_fast(page);
int type;
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
+ if (kmap)
+ return kmap;
#ifdef CONFIG_DEBUG_HIGHMEM
/*
diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c
index 69b1931986ae..1191f57f53ae 100644
--- a/arch/csky/mm/highmem.c
+++ b/arch/csky/mm/highmem.c
@@ -25,12 +25,11 @@ EXPORT_SYMBOL(kmap);
void *kmap_atomic(struct page *page)
{
unsigned long vaddr;
+ void *addr = kmap_atomic_fast(page);
int idx, type;
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
+ if (addr)
+ return addr;
type = kmap_atomic_idx_push();
idx = type + KM_TYPE_NR*smp_processor_id();
diff --git a/arch/microblaze/mm/highmem.c b/arch/microblaze/mm/highmem.c
index d7569f77fa15..99fdf826edc2 100644
--- a/arch/microblaze/mm/highmem.c
+++ b/arch/microblaze/mm/highmem.c
@@ -36,13 +36,11 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
{
unsigned long vaddr;
+ void *addr = kmap_atomic_fast(page);
int idx, type;
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
-
+ if (addr)
+ return addr;
type = kmap_atomic_idx_push();
idx = type + KM_TYPE_NR*smp_processor_id();
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index c3c9fe962f0f..ba03ca75d4a1 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -33,12 +33,11 @@ EXPORT_SYMBOL(kmap);
void *kmap_atomic(struct page *page)
{
unsigned long vaddr;
+ void *addr = kmap_atomic_fast(page);
int idx, type;
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
+ if (addr)
+ return addr;
type = kmap_atomic_idx_push();
idx = type + KM_TYPE_NR*smp_processor_id();
diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c
index f9348bec0ecb..4aabde586489 100644
--- a/arch/nds32/mm/highmem.c
+++ b/arch/nds32/mm/highmem.c
@@ -14,13 +14,12 @@ void *kmap_atomic(struct page *page)
{
unsigned int idx;
unsigned long vaddr, pte;
+ void *addr = kmap_atomic_fast(page);
int type;
pte_t *ptep;
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
+ if (addr)
+ return addr;
type = kmap_atomic_idx_push();
diff --git a/arch/powerpc/mm/highmem.c b/arch/powerpc/mm/highmem.c
index 320c1672b2ae..cdf5b716801a 100644
--- a/arch/powerpc/mm/highmem.c
+++ b/arch/powerpc/mm/highmem.c
@@ -33,12 +33,11 @@
void *kmap_atomic_prot(struct page *page, pgprot_t prot)
{
unsigned long vaddr;
+ void *addr = kmap_atomic_fast(page);
int idx, type;
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
+ if (addr)
+ return addr;
type = kmap_atomic_idx_push();
idx = type + KM_TYPE_NR*smp_processor_id();
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c
index d4a80adea7e5..178641805567 100644
--- a/arch/sparc/mm/highmem.c
+++ b/arch/sparc/mm/highmem.c
@@ -56,12 +56,11 @@ void __init kmap_init(void)
void *kmap_atomic(struct page *page)
{
unsigned long vaddr;
+ void *addr = kmap_atomic_fast(page);
long idx, type;
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
+ if (addr)
+ return addr;
type = kmap_atomic_idx_push();
idx = type + KM_TYPE_NR*smp_processor_id();
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index c4ebfd0ae401..34770499b0ff 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -15,13 +15,11 @@
void *kmap_atomic_prot(struct page *page, pgprot_t prot)
{
unsigned long vaddr;
+ void *addr = kmap_atomic_fast(page);
int idx, type;
- preempt_disable();
- pagefault_disable();
-
- if (!PageHighMem(page))
- return page_address(page);
+ if (addr)
+ return addr;
type = kmap_atomic_idx_push();
idx = type + KM_TYPE_NR*smp_processor_id();
diff --git a/arch/xtensa/mm/highmem.c b/arch/xtensa/mm/highmem.c
index 184ceadccc1a..38c14e0b578c 100644
--- a/arch/xtensa/mm/highmem.c
+++ b/arch/xtensa/mm/highmem.c
@@ -41,11 +41,10 @@ void *kmap_atomic(struct page *page)
{
enum fixed_addresses idx;
unsigned long vaddr;
+ void *addr = kmap_atomic_fast(page);
- preempt_disable();
- pagefault_disable();
- if (!PageHighMem(page))
- return page_address(page);
+ if (addr)
+ return addr;
idx = kmap_idx(kmap_atomic_idx_push(),
DCACHE_ALIAS(page_to_phys(page)));
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 1a3b7690c78c..eee53e151900 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -60,6 +60,15 @@ static inline void kunmap(struct page *page)
kunmap_high(page);
}
+static inline void *kmap_atomic_fast(struct page *page)
+{
+ preempt_disable();
+ pagefault_disable();
+ if (!PageHighMem(page))
+ return page_address(page);
+ return NULL;
+}
+
/* declarations for linux/mm/highmem.c */
unsigned int nr_free_highpages(void);
extern atomic_long_t _totalhigh_pages;
--
2.25.1
^ permalink raw reply related
* [PATCH 2/5] arch/kmap: Remove redundant arch specific kmaps
From: ira.weiny @ 2020-04-26 5:54 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Peter Zijlstra, Dave Hansen, James E.J. Bottomley, Max Filippov,
Paul Mackerras, H. Peter Anvin, sparclinux, Ira Weiny,
Dan Williams, Helge Deller, x86, linux-csky, Ingo Molnar,
linux-snps-arc, linux-xtensa, Borislav Petkov, Andy Lutomirski,
Thomas Gleixner, linux-arm-kernel, Chris Zankel,
Thomas Bogendoerfer, linux-parisc, linux-mips, linuxppc-dev,
David S. Miller
In-Reply-To: <20200426055406.134198-1-ira.weiny@intel.com>
From: Ira Weiny <ira.weiny@intel.com>
The kmap code for all the architectures is almost 100% identical.
Lift the common code to the core. Use ARCH_HAS_KMAP to indicate if an
arch needs a special kmap.
This also has the benefit of changing kmap() on a number of
architectures to be an inline call rather than an actual function.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
arch/arc/include/asm/highmem.h | 2 --
arch/arc/mm/highmem.c | 10 ----------
arch/arm/include/asm/highmem.h | 2 --
arch/arm/mm/highmem.c | 9 ---------
arch/csky/include/asm/highmem.h | 2 +-
arch/csky/mm/highmem.c | 7 +------
arch/microblaze/include/asm/highmem.h | 9 ---------
arch/mips/include/asm/highmem.h | 2 +-
arch/mips/mm/highmem.c | 7 +------
arch/nds32/include/asm/highmem.h | 2 --
arch/nds32/mm/highmem.c | 12 ------------
arch/powerpc/include/asm/highmem.h | 9 ---------
arch/sparc/include/asm/highmem.h | 9 ---------
arch/x86/include/asm/highmem.h | 2 --
arch/x86/mm/highmem_32.c | 9 ---------
arch/xtensa/include/asm/highmem.h | 6 +-----
include/linux/highmem.h | 18 ++++++++++++++++++
17 files changed, 23 insertions(+), 94 deletions(-)
diff --git a/arch/arc/include/asm/highmem.h b/arch/arc/include/asm/highmem.h
index 042e92921c4c..96eb67c86961 100644
--- a/arch/arc/include/asm/highmem.h
+++ b/arch/arc/include/asm/highmem.h
@@ -30,8 +30,6 @@
#include <asm/cacheflush.h>
-extern void *kmap(struct page *page);
-extern void *kmap_high(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void kunmap_high(struct page *page);
diff --git a/arch/arc/mm/highmem.c b/arch/arc/mm/highmem.c
index 39ef7b9a3aa9..4db13a6b9f3b 100644
--- a/arch/arc/mm/highmem.c
+++ b/arch/arc/mm/highmem.c
@@ -49,16 +49,6 @@
extern pte_t * pkmap_page_table;
static pte_t * fixmap_page_table;
-void *kmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
-
- return kmap_high(page);
-}
-EXPORT_SYMBOL(kmap);
-
void *kmap_atomic(struct page *page)
{
int idx, cpu_idx;
diff --git a/arch/arm/include/asm/highmem.h b/arch/arm/include/asm/highmem.h
index eb4e4207cd3c..c917522541de 100644
--- a/arch/arm/include/asm/highmem.h
+++ b/arch/arm/include/asm/highmem.h
@@ -20,7 +20,6 @@
extern pte_t *pkmap_page_table;
-extern void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page);
/*
@@ -63,7 +62,6 @@ static inline void *kmap_high_get(struct page *page)
* when CONFIG_HIGHMEM is not set.
*/
#ifdef CONFIG_HIGHMEM
-extern void *kmap(struct page *page);
extern void kunmap(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index cc6eb79ef20c..e8ba37c36590 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -31,15 +31,6 @@ static inline pte_t get_fixmap_pte(unsigned long vaddr)
return *ptep;
}
-void *kmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- return kmap_high(page);
-}
-EXPORT_SYMBOL(kmap);
-
void kunmap(struct page *page)
{
might_sleep();
diff --git a/arch/csky/include/asm/highmem.h b/arch/csky/include/asm/highmem.h
index a345a2f2c22e..4caeff143748 100644
--- a/arch/csky/include/asm/highmem.h
+++ b/arch/csky/include/asm/highmem.h
@@ -30,9 +30,9 @@ extern pte_t *pkmap_page_table;
#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
-extern void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page);
+#define ARCH_HAS_KMAP
extern void *kmap(struct page *page);
extern void kunmap(struct page *page);
extern void *kmap_atomic(struct page *page);
diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c
index 690d678649d1..5fb0bd855444 100644
--- a/arch/csky/mm/highmem.c
+++ b/arch/csky/mm/highmem.c
@@ -15,14 +15,9 @@ unsigned long highstart_pfn, highend_pfn;
void *kmap(struct page *page)
{
- void *addr;
+ void *addr = kmap_generic(page);
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- addr = kmap_high(page);
flush_tlb_one((unsigned long)addr);
-
return addr;
}
EXPORT_SYMBOL(kmap);
diff --git a/arch/microblaze/include/asm/highmem.h b/arch/microblaze/include/asm/highmem.h
index 99ced7278b5c..8c5bfd228bd8 100644
--- a/arch/microblaze/include/asm/highmem.h
+++ b/arch/microblaze/include/asm/highmem.h
@@ -51,19 +51,10 @@ extern pte_t *pkmap_page_table;
#define PKMAP_NR(virt) ((virt - PKMAP_BASE) >> PAGE_SHIFT)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
-extern void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page);
extern void *kmap_atomic_prot(struct page *page, pgprot_t prot);
extern void __kunmap_atomic(void *kvaddr);
-static inline void *kmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- return kmap_high(page);
-}
-
static inline void kunmap(struct page *page)
{
might_sleep();
diff --git a/arch/mips/include/asm/highmem.h b/arch/mips/include/asm/highmem.h
index 9d84aafc33d0..c30bbb88fcfe 100644
--- a/arch/mips/include/asm/highmem.h
+++ b/arch/mips/include/asm/highmem.h
@@ -46,9 +46,9 @@ extern pte_t *pkmap_page_table;
#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
-extern void * kmap_high(struct page *page);
extern void kunmap_high(struct page *page);
+#define ARCH_HAS_KMAP
extern void *kmap(struct page *page);
extern void kunmap(struct page *page);
extern void *kmap_atomic(struct page *page);
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index edd889f6cede..3867dbe9ef32 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -14,14 +14,9 @@ unsigned long highstart_pfn, highend_pfn;
void *kmap(struct page *page)
{
- void *addr;
+ void *addr = kmap_generic(page);
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- addr = kmap_high(page);
flush_tlb_one((unsigned long)addr);
-
return addr;
}
EXPORT_SYMBOL(kmap);
diff --git a/arch/nds32/include/asm/highmem.h b/arch/nds32/include/asm/highmem.h
index b3a82c97ded3..b13654a79069 100644
--- a/arch/nds32/include/asm/highmem.h
+++ b/arch/nds32/include/asm/highmem.h
@@ -44,7 +44,6 @@ extern unsigned long highstart_pfn, highend_pfn;
extern pte_t *pkmap_page_table;
-extern void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page);
extern void kmap_init(void);
@@ -54,7 +53,6 @@ extern void kmap_init(void);
* when CONFIG_HIGHMEM is not set.
*/
#ifdef CONFIG_HIGHMEM
-extern void *kmap(struct page *page);
extern void kunmap(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c
index 4c7c28e994ea..d0cde53b84ae 100644
--- a/arch/nds32/mm/highmem.c
+++ b/arch/nds32/mm/highmem.c
@@ -10,18 +10,6 @@
#include <asm/fixmap.h>
#include <asm/tlbflush.h>
-void *kmap(struct page *page)
-{
- unsigned long vaddr;
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- vaddr = (unsigned long)kmap_high(page);
- return (void *)vaddr;
-}
-
-EXPORT_SYMBOL(kmap);
-
void kunmap(struct page *page)
{
might_sleep();
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index 529512f6d65a..f14e4feef6d5 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -59,19 +59,10 @@ extern pte_t *pkmap_page_table;
#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
-extern void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page);
extern void *kmap_atomic_prot(struct page *page, pgprot_t prot);
extern void __kunmap_atomic(void *kvaddr);
-static inline void *kmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- return kmap_high(page);
-}
-
static inline void kunmap(struct page *page)
{
might_sleep();
diff --git a/arch/sparc/include/asm/highmem.h b/arch/sparc/include/asm/highmem.h
index 7dd2d4b3f980..2ff1192047f7 100644
--- a/arch/sparc/include/asm/highmem.h
+++ b/arch/sparc/include/asm/highmem.h
@@ -50,17 +50,8 @@ void kmap_init(void) __init;
#define PKMAP_END (PKMAP_ADDR(LAST_PKMAP))
-void *kmap_high(struct page *page);
void kunmap_high(struct page *page);
-static inline void *kmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- return kmap_high(page);
-}
-
static inline void kunmap(struct page *page)
{
might_sleep();
diff --git a/arch/x86/include/asm/highmem.h b/arch/x86/include/asm/highmem.h
index a8059930056d..c916a28a9738 100644
--- a/arch/x86/include/asm/highmem.h
+++ b/arch/x86/include/asm/highmem.h
@@ -58,10 +58,8 @@ extern unsigned long highstart_pfn, highend_pfn;
#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
-extern void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page);
-void *kmap(struct page *page);
void kunmap(struct page *page);
void *kmap_atomic_prot(struct page *page, pgprot_t prot);
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 8af66382672b..12591a81b85c 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -4,15 +4,6 @@
#include <linux/swap.h> /* for totalram_pages */
#include <linux/memblock.h>
-void *kmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- return kmap_high(page);
-}
-EXPORT_SYMBOL(kmap);
-
void kunmap(struct page *page)
{
might_sleep();
diff --git a/arch/xtensa/include/asm/highmem.h b/arch/xtensa/include/asm/highmem.h
index 413848cc1e56..fac4f48bde6c 100644
--- a/arch/xtensa/include/asm/highmem.h
+++ b/arch/xtensa/include/asm/highmem.h
@@ -63,7 +63,6 @@ static inline wait_queue_head_t *get_pkmap_wait_queue_head(unsigned int color)
extern pte_t *pkmap_page_table;
-void *kmap_high(struct page *page);
void kunmap_high(struct page *page);
static inline void *kmap(struct page *page)
@@ -73,10 +72,7 @@ static inline void *kmap(struct page *page)
*/
BUILD_BUG_ON(PKMAP_BASE <
TLBTEMP_BASE_1 + TLBTEMP_SIZE);
- might_sleep();
- if (!PageHighMem(page))
- return page_address(page);
- return kmap_high(page);
+ return kmap_generic(page);
}
static inline void kunmap(struct page *page)
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index ea5cdbd8c2c3..2f7f710b7e7d 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -32,8 +32,26 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
#include <asm/kmap_types.h>
#ifdef CONFIG_HIGHMEM
+extern void *kmap_high(struct page *page);
+
+/* kmap_generic: architecture independent portion of kmap calls */
+static inline void *kmap_generic(struct page *page)
+{
+ might_sleep();
+ if (!PageHighMem(page))
+ return page_address(page);
+ return kmap_high(page);
+}
+
#include <asm/highmem.h>
+#ifndef ARCH_HAS_KMAP
+static inline void *kmap(struct page *page)
+{
+ return kmap_generic(page);
+}
+#endif
+
/* declarations for linux/mm/highmem.c */
unsigned int nr_free_highpages(void);
extern atomic_long_t _totalhigh_pages;
--
2.25.1
^ permalink raw reply related
* [PATCH 5/5] arch/kunmap_atomic: Consolidate duplicate code
From: ira.weiny @ 2020-04-26 5:54 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Peter Zijlstra, Dave Hansen, James E.J. Bottomley, Max Filippov,
Paul Mackerras, H. Peter Anvin, sparclinux, Ira Weiny,
Dan Williams, Helge Deller, x86, linux-csky, Ingo Molnar,
linux-snps-arc, linux-xtensa, Borislav Petkov, Andy Lutomirski,
Thomas Gleixner, linux-arm-kernel, Chris Zankel,
Thomas Bogendoerfer, linux-parisc, linux-mips, linuxppc-dev,
David S. Miller
In-Reply-To: <20200426055406.134198-1-ira.weiny@intel.com>
From: Ira Weiny <ira.weiny@intel.com>
Every single architecture (including !CONFIG_HIGHMEM) calls...
pagefault_enable();
preempt_enable();
... before returning from __kunmap_atomic(). Lift this code into the
kunmap_atomic() macro.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
arch/arc/mm/highmem.c | 3 ---
arch/arm/mm/highmem.c | 2 --
arch/csky/mm/highmem.c | 5 +----
arch/microblaze/mm/highmem.c | 2 --
arch/mips/mm/highmem.c | 2 --
arch/nds32/mm/highmem.c | 2 --
arch/parisc/include/asm/cacheflush.h | 2 --
arch/powerpc/mm/highmem.c | 2 --
arch/sparc/mm/highmem.c | 2 --
arch/x86/mm/highmem_32.c | 3 ---
arch/xtensa/mm/highmem.c | 3 ---
include/linux/highmem.h | 6 ++++--
12 files changed, 5 insertions(+), 29 deletions(-)
diff --git a/arch/arc/mm/highmem.c b/arch/arc/mm/highmem.c
index 1cae4b911a33..0725fc56b016 100644
--- a/arch/arc/mm/highmem.c
+++ b/arch/arc/mm/highmem.c
@@ -91,9 +91,6 @@ void __kunmap_atomic(void *kv)
kmap_atomic_idx_pop();
}
-
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index 4a629f616a6a..4983bf18ec32 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -98,8 +98,6 @@ void __kunmap_atomic(void *kvaddr)
/* this address was obtained through kmap_high_get() */
kunmap_high(pte_page(pkmap_page_table[PKMAP_NR(vaddr)]));
}
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c
index 1191f57f53ae..106fa6773084 100644
--- a/arch/csky/mm/highmem.c
+++ b/arch/csky/mm/highmem.c
@@ -50,7 +50,7 @@ void __kunmap_atomic(void *kvaddr)
int idx;
if (vaddr < FIXADDR_START)
- goto out;
+ return;
#ifdef CONFIG_DEBUG_HIGHMEM
idx = KM_TYPE_NR*smp_processor_id() + kmap_atomic_idx();
@@ -63,9 +63,6 @@ void __kunmap_atomic(void *kvaddr)
(void) idx; /* to kill a warning */
#endif
kmap_atomic_idx_pop();
-out:
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/microblaze/mm/highmem.c b/arch/microblaze/mm/highmem.c
index 99fdf826edc2..d382c6821747 100644
--- a/arch/microblaze/mm/highmem.c
+++ b/arch/microblaze/mm/highmem.c
@@ -81,7 +81,5 @@ void __kunmap_atomic(void *kvaddr)
local_flush_tlb_page(NULL, vaddr);
kmap_atomic_idx_pop();
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index ba03ca75d4a1..5a3fc7e84e66 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -79,8 +79,6 @@ void __kunmap_atomic(void *kvaddr)
}
#endif
kmap_atomic_idx_pop();
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c
index 4aabde586489..b8862aafa189 100644
--- a/arch/nds32/mm/highmem.c
+++ b/arch/nds32/mm/highmem.c
@@ -49,8 +49,6 @@ void __kunmap_atomic(void *kvaddr)
ptep = pte_offset_kernel(pmd_off_k(vaddr), vaddr);
set_pte(ptep, 0);
}
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index 0c83644bfa5c..c8458491b9af 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -125,8 +125,6 @@ static inline void *kmap_atomic(struct page *page)
static inline void __kunmap_atomic(void *addr)
{
flush_kernel_dcache_page_addr(addr);
- pagefault_enable();
- preempt_enable();
}
#define kmap_atomic_prot(page, prot) kmap_atomic(page)
diff --git a/arch/powerpc/mm/highmem.c b/arch/powerpc/mm/highmem.c
index cdf5b716801a..7dfccf519621 100644
--- a/arch/powerpc/mm/highmem.c
+++ b/arch/powerpc/mm/highmem.c
@@ -76,7 +76,5 @@ void __kunmap_atomic(void *kvaddr)
}
kmap_atomic_idx_pop();
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c
index 178641805567..7a99a1097f67 100644
--- a/arch/sparc/mm/highmem.c
+++ b/arch/sparc/mm/highmem.c
@@ -130,7 +130,5 @@ void __kunmap_atomic(void *kvaddr)
#endif
kmap_atomic_idx_pop();
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 34770499b0ff..b20e81b2b833 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -78,9 +78,6 @@ void __kunmap_atomic(void *kvaddr)
BUG_ON(vaddr >= (unsigned long)high_memory);
}
#endif
-
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/arch/xtensa/mm/highmem.c b/arch/xtensa/mm/highmem.c
index 38c14e0b578c..9a49263e4cd6 100644
--- a/arch/xtensa/mm/highmem.c
+++ b/arch/xtensa/mm/highmem.c
@@ -77,9 +77,6 @@ void __kunmap_atomic(void *kvaddr)
kmap_atomic_idx_pop();
}
-
- pagefault_enable();
- preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index eee53e151900..94145d4200ab 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -133,8 +133,8 @@ static inline void *kmap_atomic(struct page *page)
static inline void __kunmap_atomic(void *addr)
{
- pagefault_enable();
- preempt_enable();
+ /* Nothing to do in the CONFIG_HIGHMEM=n case as kunmap_atomic()
+ * handles re-enabling faults + preemption */
}
#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn))
@@ -185,6 +185,8 @@ static inline void kmap_atomic_idx_pop(void)
do { \
BUILD_BUG_ON(__same_type((addr), struct page *)); \
__kunmap_atomic(addr); \
+ pagefault_enable(); \
+ preempt_enable(); \
} while (0)
--
2.25.1
^ permalink raw reply related
* [PATCH 1/5] arch/kmap: Remove BUG_ON()
From: ira.weiny @ 2020-04-26 5:54 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Peter Zijlstra, Dave Hansen, James E.J. Bottomley, Max Filippov,
Paul Mackerras, H. Peter Anvin, sparclinux, Ira Weiny,
Dan Williams, Helge Deller, x86, linux-csky, Ingo Molnar,
linux-snps-arc, linux-xtensa, Borislav Petkov, Andy Lutomirski,
Thomas Gleixner, linux-arm-kernel, Chris Zankel,
Thomas Bogendoerfer, linux-parisc, linux-mips, linuxppc-dev,
David S. Miller
In-Reply-To: <20200426055406.134198-1-ira.weiny@intel.com>
From: Ira Weiny <ira.weiny@intel.com>
Replace the use of BUG_ON(in_interrupt()) in the kmap() and kunmap()
in favor of might_sleep().
Besides the benefits of might_sleep(), this normalizes the
implementations such that they can be made generic in subsequent
patches.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
arch/arc/include/asm/highmem.h | 2 +-
arch/arc/mm/highmem.c | 2 +-
arch/arm/mm/highmem.c | 2 +-
arch/csky/mm/highmem.c | 2 +-
arch/microblaze/include/asm/highmem.h | 2 +-
arch/mips/mm/highmem.c | 2 +-
arch/nds32/mm/highmem.c | 2 +-
arch/powerpc/include/asm/highmem.h | 2 +-
arch/sparc/include/asm/highmem.h | 4 ++--
arch/x86/mm/highmem_32.c | 3 +--
arch/xtensa/include/asm/highmem.h | 4 ++--
11 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/arch/arc/include/asm/highmem.h b/arch/arc/include/asm/highmem.h
index 1af00accb37f..042e92921c4c 100644
--- a/arch/arc/include/asm/highmem.h
+++ b/arch/arc/include/asm/highmem.h
@@ -45,7 +45,7 @@ static inline void flush_cache_kmaps(void)
static inline void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/arc/mm/highmem.c b/arch/arc/mm/highmem.c
index fc8849e4f72e..39ef7b9a3aa9 100644
--- a/arch/arc/mm/highmem.c
+++ b/arch/arc/mm/highmem.c
@@ -51,7 +51,7 @@ static pte_t * fixmap_page_table;
void *kmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return page_address(page);
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index a76f8ace9ce6..cc6eb79ef20c 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -42,7 +42,7 @@ EXPORT_SYMBOL(kmap);
void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c
index 813129145f3d..690d678649d1 100644
--- a/arch/csky/mm/highmem.c
+++ b/arch/csky/mm/highmem.c
@@ -29,7 +29,7 @@ EXPORT_SYMBOL(kmap);
void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/microblaze/include/asm/highmem.h b/arch/microblaze/include/asm/highmem.h
index 332c78e15198..99ced7278b5c 100644
--- a/arch/microblaze/include/asm/highmem.h
+++ b/arch/microblaze/include/asm/highmem.h
@@ -66,7 +66,7 @@ static inline void *kmap(struct page *page)
static inline void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index d08e6d7d533b..edd889f6cede 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -28,7 +28,7 @@ EXPORT_SYMBOL(kmap);
void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c
index 022779af6148..4c7c28e994ea 100644
--- a/arch/nds32/mm/highmem.c
+++ b/arch/nds32/mm/highmem.c
@@ -24,7 +24,7 @@ EXPORT_SYMBOL(kmap);
void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index a4b65b186ec6..529512f6d65a 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -74,7 +74,7 @@ static inline void *kmap(struct page *page)
static inline void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/sparc/include/asm/highmem.h b/arch/sparc/include/asm/highmem.h
index 18d776925c45..7dd2d4b3f980 100644
--- a/arch/sparc/include/asm/highmem.h
+++ b/arch/sparc/include/asm/highmem.h
@@ -55,7 +55,7 @@ void kunmap_high(struct page *page);
static inline void *kmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return page_address(page);
return kmap_high(page);
@@ -63,7 +63,7 @@ static inline void *kmap(struct page *page)
static inline void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 0a1898b8552e..8af66382672b 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -15,8 +15,7 @@ EXPORT_SYMBOL(kmap);
void kunmap(struct page *page)
{
- if (in_interrupt())
- BUG();
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
diff --git a/arch/xtensa/include/asm/highmem.h b/arch/xtensa/include/asm/highmem.h
index 04e9340eac4b..413848cc1e56 100644
--- a/arch/xtensa/include/asm/highmem.h
+++ b/arch/xtensa/include/asm/highmem.h
@@ -73,7 +73,7 @@ static inline void *kmap(struct page *page)
*/
BUILD_BUG_ON(PKMAP_BASE <
TLBTEMP_BASE_1 + TLBTEMP_SIZE);
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return page_address(page);
return kmap_high(page);
@@ -81,7 +81,7 @@ static inline void *kmap(struct page *page)
static inline void kunmap(struct page *page)
{
- BUG_ON(in_interrupt());
+ might_sleep();
if (!PageHighMem(page))
return;
kunmap_high(page);
--
2.25.1
^ permalink raw reply related
* [PATCH 3/5] arch/kunmap: Remove duplicate kunmap implementations
From: ira.weiny @ 2020-04-26 5:54 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Peter Zijlstra, Dave Hansen, James E.J. Bottomley, Max Filippov,
Paul Mackerras, H. Peter Anvin, sparclinux, Ira Weiny,
Dan Williams, Helge Deller, x86, linux-csky, Ingo Molnar,
linux-snps-arc, linux-xtensa, Borislav Petkov, Andy Lutomirski,
Thomas Gleixner, linux-arm-kernel, Chris Zankel,
Thomas Bogendoerfer, linux-parisc, linux-mips, linuxppc-dev,
David S. Miller
In-Reply-To: <20200426055406.134198-1-ira.weiny@intel.com>
From: Ira Weiny <ira.weiny@intel.com>
All architectures do exactly the same thing for kunmap(); remove all the
duplicate definitions and lift the call to the core.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
arch/arc/include/asm/highmem.h | 9 ---------
arch/arm/include/asm/highmem.h | 1 -
arch/arm/mm/highmem.c | 9 ---------
arch/csky/include/asm/highmem.h | 1 -
arch/csky/mm/highmem.c | 9 ---------
arch/microblaze/include/asm/highmem.h | 8 --------
arch/mips/include/asm/highmem.h | 1 -
arch/mips/mm/highmem.c | 9 ---------
arch/nds32/include/asm/highmem.h | 1 -
arch/nds32/mm/highmem.c | 10 ----------
arch/powerpc/include/asm/highmem.h | 8 --------
arch/sparc/include/asm/highmem.h | 8 --------
arch/x86/include/asm/highmem.h | 2 --
arch/x86/mm/highmem_32.c | 9 ---------
arch/xtensa/include/asm/highmem.h | 8 --------
include/linux/highmem.h | 8 ++++++++
16 files changed, 8 insertions(+), 93 deletions(-)
diff --git a/arch/arc/include/asm/highmem.h b/arch/arc/include/asm/highmem.h
index 96eb67c86961..c03a911c9f21 100644
--- a/arch/arc/include/asm/highmem.h
+++ b/arch/arc/include/asm/highmem.h
@@ -41,15 +41,6 @@ static inline void flush_cache_kmaps(void)
flush_cache_all();
}
-static inline void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-
-
#endif
#endif
diff --git a/arch/arm/include/asm/highmem.h b/arch/arm/include/asm/highmem.h
index c917522541de..829e3b969819 100644
--- a/arch/arm/include/asm/highmem.h
+++ b/arch/arm/include/asm/highmem.h
@@ -62,7 +62,6 @@ static inline void *kmap_high_get(struct page *page)
* when CONFIG_HIGHMEM is not set.
*/
#ifdef CONFIG_HIGHMEM
-extern void kunmap(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void *kmap_atomic_pfn(unsigned long pfn);
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index e8ba37c36590..c700b32350ee 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -31,15 +31,6 @@ static inline pte_t get_fixmap_pte(unsigned long vaddr)
return *ptep;
}
-void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-EXPORT_SYMBOL(kunmap);
-
void *kmap_atomic(struct page *page)
{
unsigned int idx;
diff --git a/arch/csky/include/asm/highmem.h b/arch/csky/include/asm/highmem.h
index 4caeff143748..a0e7c43731a0 100644
--- a/arch/csky/include/asm/highmem.h
+++ b/arch/csky/include/asm/highmem.h
@@ -34,7 +34,6 @@ extern void kunmap_high(struct page *page);
#define ARCH_HAS_KMAP
extern void *kmap(struct page *page);
-extern void kunmap(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void *kmap_atomic_pfn(unsigned long pfn);
diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c
index 5fb0bd855444..69b1931986ae 100644
--- a/arch/csky/mm/highmem.c
+++ b/arch/csky/mm/highmem.c
@@ -22,15 +22,6 @@ void *kmap(struct page *page)
}
EXPORT_SYMBOL(kmap);
-void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-EXPORT_SYMBOL(kunmap);
-
void *kmap_atomic(struct page *page)
{
unsigned long vaddr;
diff --git a/arch/microblaze/include/asm/highmem.h b/arch/microblaze/include/asm/highmem.h
index 8c5bfd228bd8..1cbd52a0e39b 100644
--- a/arch/microblaze/include/asm/highmem.h
+++ b/arch/microblaze/include/asm/highmem.h
@@ -55,14 +55,6 @@ extern void kunmap_high(struct page *page);
extern void *kmap_atomic_prot(struct page *page, pgprot_t prot);
extern void __kunmap_atomic(void *kvaddr);
-static inline void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-
static inline void *kmap_atomic(struct page *page)
{
return kmap_atomic_prot(page, kmap_prot);
diff --git a/arch/mips/include/asm/highmem.h b/arch/mips/include/asm/highmem.h
index c30bbb88fcfe..af9a66300628 100644
--- a/arch/mips/include/asm/highmem.h
+++ b/arch/mips/include/asm/highmem.h
@@ -50,7 +50,6 @@ extern void kunmap_high(struct page *page);
#define ARCH_HAS_KMAP
extern void *kmap(struct page *page);
-extern void kunmap(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void *kmap_atomic_pfn(unsigned long pfn);
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index 3867dbe9ef32..c3c9fe962f0f 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -21,15 +21,6 @@ void *kmap(struct page *page)
}
EXPORT_SYMBOL(kmap);
-void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-EXPORT_SYMBOL(kunmap);
-
/*
* kmap_atomic/kunmap_atomic is significantly faster than kmap/kunmap because
* no global lock is needed and because the kmap code must perform a global TLB
diff --git a/arch/nds32/include/asm/highmem.h b/arch/nds32/include/asm/highmem.h
index b13654a79069..e455e2624247 100644
--- a/arch/nds32/include/asm/highmem.h
+++ b/arch/nds32/include/asm/highmem.h
@@ -53,7 +53,6 @@ extern void kmap_init(void);
* when CONFIG_HIGHMEM is not set.
*/
#ifdef CONFIG_HIGHMEM
-extern void kunmap(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void *kmap_atomic_pfn(unsigned long pfn);
diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c
index d0cde53b84ae..f9348bec0ecb 100644
--- a/arch/nds32/mm/highmem.c
+++ b/arch/nds32/mm/highmem.c
@@ -10,16 +10,6 @@
#include <asm/fixmap.h>
#include <asm/tlbflush.h>
-void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-
-EXPORT_SYMBOL(kunmap);
-
void *kmap_atomic(struct page *page)
{
unsigned int idx;
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index f14e4feef6d5..08e02a4f3a8f 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -63,14 +63,6 @@ extern void kunmap_high(struct page *page);
extern void *kmap_atomic_prot(struct page *page, pgprot_t prot);
extern void __kunmap_atomic(void *kvaddr);
-static inline void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-
static inline void *kmap_atomic(struct page *page)
{
return kmap_atomic_prot(page, kmap_prot);
diff --git a/arch/sparc/include/asm/highmem.h b/arch/sparc/include/asm/highmem.h
index 2ff1192047f7..b3ee234b2a8f 100644
--- a/arch/sparc/include/asm/highmem.h
+++ b/arch/sparc/include/asm/highmem.h
@@ -52,14 +52,6 @@ void kmap_init(void) __init;
void kunmap_high(struct page *page);
-static inline void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-
void *kmap_atomic(struct page *page);
void __kunmap_atomic(void *kvaddr);
diff --git a/arch/x86/include/asm/highmem.h b/arch/x86/include/asm/highmem.h
index c916a28a9738..102cdcde74cb 100644
--- a/arch/x86/include/asm/highmem.h
+++ b/arch/x86/include/asm/highmem.h
@@ -60,8 +60,6 @@ extern unsigned long highstart_pfn, highend_pfn;
extern void kunmap_high(struct page *page);
-void kunmap(struct page *page);
-
void *kmap_atomic_prot(struct page *page, pgprot_t prot);
void *kmap_atomic(struct page *page);
void __kunmap_atomic(void *kvaddr);
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 12591a81b85c..c4ebfd0ae401 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -4,15 +4,6 @@
#include <linux/swap.h> /* for totalram_pages */
#include <linux/memblock.h>
-void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-EXPORT_SYMBOL(kunmap);
-
/*
* kmap_atomic/kunmap_atomic is significantly faster than kmap/kunmap because
* no global lock is needed and because the kmap code must perform a global TLB
diff --git a/arch/xtensa/include/asm/highmem.h b/arch/xtensa/include/asm/highmem.h
index fac4f48bde6c..ae9e0ffbdb80 100644
--- a/arch/xtensa/include/asm/highmem.h
+++ b/arch/xtensa/include/asm/highmem.h
@@ -75,14 +75,6 @@ static inline void *kmap(struct page *page)
return kmap_generic(page);
}
-static inline void kunmap(struct page *page)
-{
- might_sleep();
- if (!PageHighMem(page))
- return;
- kunmap_high(page);
-}
-
static inline void flush_cache_kmaps(void)
{
flush_cache_all();
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 2f7f710b7e7d..1a3b7690c78c 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -52,6 +52,14 @@ static inline void *kmap(struct page *page)
}
#endif
+static inline void kunmap(struct page *page)
+{
+ might_sleep();
+ if (!PageHighMem(page))
+ return;
+ kunmap_high(page);
+}
+
/* declarations for linux/mm/highmem.c */
unsigned int nr_free_highpages(void);
extern atomic_long_t _totalhigh_pages;
--
2.25.1
^ permalink raw reply related
* [PATCH 0/5] Remove duplicated kmap code
From: ira.weiny @ 2020-04-26 5:54 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Peter Zijlstra, Dave Hansen, James E.J. Bottomley, Max Filippov,
Paul Mackerras, H. Peter Anvin, sparclinux, Ira Weiny,
Thomas Gleixner, Helge Deller, x86, linux-csky, Ingo Molnar,
linux-snps-arc, linux-xtensa, Borislav Petkov, Andy Lutomirski,
Dan Williams, linux-arm-kernel, Chris Zankel, Thomas Bogendoerfer,
linux-parisc, linux-mips, linuxppc-dev, David S. Miller
From: Ira Weiny <ira.weiny@intel.com>
The kmap infrastructure has been copied almost verbatim to every architecture.
This series consolidates obvious duplicated code. (k[un]map_atmoic has some
additional duplication between some of the architectures but the differences
were such to not warrant further changes.)
0day built successfully to cover all the architectures I can't readily build.
Ira Weiny (5):
arch/kmap: Remove BUG_ON()
arch/kmap: Remove redundant arch specific kmaps
arch/kunmap: Remove duplicate kunmap implementations
arch/kmap_atomic: Consolidate duplicate code
arch/kunmap_atomic: Consolidate duplicate code
arch/arc/include/asm/highmem.h | 11 -------
arch/arc/mm/highmem.c | 20 ++-----------
arch/arm/include/asm/highmem.h | 3 --
arch/arm/mm/highmem.c | 28 ++----------------
arch/csky/include/asm/highmem.h | 3 +-
arch/csky/mm/highmem.c | 28 ++++--------------
arch/microblaze/include/asm/highmem.h | 17 -----------
arch/microblaze/mm/highmem.c | 10 ++-----
arch/mips/include/asm/highmem.h | 3 +-
arch/mips/mm/highmem.c | 25 +++-------------
arch/nds32/include/asm/highmem.h | 3 --
arch/nds32/mm/highmem.c | 31 ++------------------
arch/parisc/include/asm/cacheflush.h | 2 --
arch/powerpc/include/asm/highmem.h | 17 -----------
arch/powerpc/mm/highmem.c | 9 ++----
arch/sparc/include/asm/highmem.h | 17 -----------
arch/sparc/mm/highmem.c | 9 ++----
arch/x86/include/asm/highmem.h | 4 ---
arch/x86/mm/highmem_32.c | 30 ++------------------
arch/xtensa/include/asm/highmem.h | 14 +--------
arch/xtensa/mm/highmem.c | 10 ++-----
include/linux/highmem.h | 41 +++++++++++++++++++++++++--
22 files changed, 75 insertions(+), 260 deletions(-)
--
2.25.1
^ permalink raw reply
* Re: [PATCH 2/7] signal: factor copy_siginfo_to_external32 from copy_siginfo_to_user32
From: Andrew Morton @ 2020-04-26 4:47 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Arnd Bergmann, Jeremy Kerr, linux-kernel, Eric W . Biederman,
linux-fsdevel, linuxppc-dev, Alexander Viro
In-Reply-To: <20200421154204.252921-3-hch@lst.de>
On Tue, 21 Apr 2020 17:41:59 +0200 Christoph Hellwig <hch@lst.de> wrote:
> To remove the use of set_fs in the coredump code there needs to be a
> way to convert a kernel siginfo to a userspace compat siginfo.
>
> Call that function copy_siginfo_to_compat and factor it out of
> copy_siginfo_to_user32.
>
> The existence of x32 complicates this code. On x32 SIGCHLD uses 64bit
> times for utime and stime. As only SIGCHLD is affected and SIGCHLD
> never causes a coredump I have avoided handling that case.
x86_64 allmodconfig:
kernel/signal.c: In function 'copy_siginfo_to_external32':
kernel/signal.c:3299:7: error: 'x32_ABI' undeclared (first use in this function); did you mean 'CTL_ABI'?
if (x32_ABI) {
^~~~~~~
I looked at fixing it but surely this sort of thing:
int copy_siginfo_to_user32(struct compat_siginfo __user *to,
const struct kernel_siginfo *from)
#if defined(CONFIG_X86_X32_ABI) || defined(CONFIG_IA32_EMULATION)
{
return __copy_siginfo_to_user32(to, from, in_x32_syscall());
}
int __copy_siginfo_to_user32(struct compat_siginfo __user *to,
const struct kernel_siginfo *from, bool x32_ABI)
#endif
{
...
is too ugly to live?
^ permalink raw reply
* Re: [PATCH v5 0/6] implement KASLR for powerpc/fsl_booke/64
From: Jason Yan @ 2020-04-26 3:56 UTC (permalink / raw)
To: Daniel Axtens, mpe, linuxppc-dev, diana.craciun, christophe.leroy,
benh, paulus, npiggin, keescook, kernel-hardening, oss
Cc: linux-kernel, zhaohongjiang
In-Reply-To: <87368su7lb.fsf@dja-thinkpad.axtens.net>
Hi Daniel,
Thanks for the test. Can you send me the full log which may contain the
system info such as the following:
-----------------------------------------------------
phys_mem_size = 0x200000000
dcache_bsize = 0x20
icache_bsize = 0x20
cpu_features = 0x00000003008003b6
possible = 0x00000003009003b6
always = 0x00000003008003b4
cpu_user_features = 0xdc008000 0x08000000
mmu_features = 0x000a0010
firmware_features = 0x0000000000000000
physical_start = 0x20000000
-----------------------------------------------------
barrier-nospec: using isync; sync as speculation barrier
Zone ranges:
DMA [mem 0x0000000000000000-0x000000007fffffff]
Normal [mem 0x0000000080000000-0x00000001ffffffff]
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x0000000000000000-0x00000001ffffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
MMU: Allocated 2112 bytes of context maps for 255 contexts
percpu: Embedded 32 pages/cpu s91736 r0 d39336 u131072
Built 1 zonelists, mobility grouping on. Total pages: 2064384
Kernel command line: console=ttyS0 root=/dev/ram0
printk: log_buf_len individual max cpu contribution: 16384 bytes
printk: log_buf_len total cpu_extra contributions: 376832 bytes
printk: log_buf_len min size: 131072 bytes
printk: log_buf_len: 524288 bytes
printk: early log buf free: 127460(97%)
Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 8135632K/8388608K available (10572K kernel code, 2000K rwdata,
3396K rodata, 4124K init, 358K bss, 252976K reserved, 0K cma-reserved)
rcu: Hierarchical RCU implementation.
rcu: RCU event tracing is enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
mpic: Setting up MPIC " OpenPIC " version 1.2 at fe0040000, max 24 CPUs
mpic: ISU size: 256, shift: 8, mask: ff
mpic: Initializing for 256 sources
random: get_random_u64 called from .start_kernel+0x724/0x954 with
crng_init=0
clocksource: timebase: mask: 0xffffffffffffffff max_cycles:
0x5c4093a7d1, max_idle_ns: 440795210635 ns
clocksource: timebase mult[2800000] shift[24] registered
Console: colour dummy device 80x25
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
e6500 family performance monitor hardware support registered
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
smp: Brought up 1 node, 24 CPUs
在 2020/4/25 1:17, Daniel Axtens 写道:
> Hi Jason,
>
> Apologies for the delay in testing.
>
> I'm seeing this problem when I try to boot on a t4240rdb:
>
> random: get_random_u64 called from .start_kernel+0x734/0x964 with crng_init=0 [8/973]
> clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0xa9210e89c, max_idle_ns: 440795203878 ns
> clocksource: timebase mult[15d17460] shift[24] registered
> Console: colour dummy device 80x25
> pid_max: default: 32768 minimum: 301
> Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
> Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
> e6500 family performance monitor hardware support registered
> rcu: Hierarchical SRCU implementation.
> smp: Bringing up secondary CPUs ...
> Processor 2 is stuck.
> Processor 3 is stuck.
> Processor 4 is stuck.
> Processor 5 is stuck.
> Processor 6 is stuck.
> Processor 7 is stuck.
> Processor 8 is stuck.
> Processor 9 is stuck.
> Processor 10 is stuck.
> Processor 11 is stuck.
> Processor 12 is stuck.
> Processor 13 is stuck.
> Processor 14 is stuck.
> ...
> Processor 22 is stuck.
> Processor 23 is stuck.
> smp: Brought up 1 node, 2 CPUs
> Using standard scheduler topology
> devtmpfs: initialized
> clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
> futex hash table entries: 8192 (order: 7, 524288 bytes, linear)
> NET: Registered protocol family 16
> audit: initializing netlink subsys (disabled)
> audit: type=2000 audit(108.032:1): state=initialized audit_enabled=0 res=1
> Machine: fsl,T4240RDB
> SoC family: QorIQ T4240
> SoC ID: svr:0x82480020, Revision: 2.0
> ... boot continues ...
>
>
> If I boot with nokaslr, all the CPUs come up with no issue.
>
> This is on top of powerpc/merge at
> 8299da600ad05b8aa0f15ec0f5f03bd40e37d6f0. If you'd like me to test any
> debug patches I can do that.
>
> I've attached my .config.
>
> Regards,
> Daniel
>
>
>
>> This is a try to implement KASLR for Freescale BookE64 which is based on
>> my earlier implementation for Freescale BookE32:
>> https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=131718&state=*
>>
>> The implementation for Freescale BookE64 is similar as BookE32. One
>> difference is that Freescale BookE64 set up a TLB mapping of 1G during
>> booting. Another difference is that ppc64 needs the kernel to be
>> 64K-aligned. So we can randomize the kernel in this 1G mapping and make
>> it 64K-aligned. This can save some code to creat another TLB map at
>> early boot. The disadvantage is that we only have about 1G/64K = 16384
>> slots to put the kernel in.
>>
>> KERNELBASE
>>
>> 64K |--> kernel <--|
>> | | |
>> +--+--+--+ +--+--+--+--+--+--+--+--+--+ +--+--+
>> | | | |....| | | | | | | | | |....| | |
>> +--+--+--+ +--+--+--+--+--+--+--+--+--+ +--+--+
>> | | 1G
>> |-----> offset <-----|
>>
>> kernstart_virt_addr
>>
>> I'm not sure if the slot numbers is enough or the design has any
>> defects. If you have some better ideas, I would be happy to hear that.
>>
>> Thank you all.
>>
>> v4->v5:
>> Fix "-Werror=maybe-uninitialized" compile error.
>> Fix typo "similar as" -> "similar to".
>> v3->v4:
>> Do not define __kaslr_offset as a fixed symbol. Reference __run_at_load and
>> __kaslr_offset by symbol instead of magic offsets.
>> Use IS_ENABLED(CONFIG_PPC32) instead of #ifdef CONFIG_PPC32.
>> Change kaslr-booke32 to kaslr-booke in index.rst
>> Switch some instructions to 64-bit.
>> v2->v3:
>> Fix build error when KASLR is disabled.
>> v1->v2:
>> Add __kaslr_offset for the secondary cpu boot up.
>>
>> Jason Yan (6):
>> powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and
>> kaslr_early_init()
>> powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper
>> powerpc/fsl_booke/64: implement KASLR for fsl_booke64
>> powerpc/fsl_booke/64: do not clear the BSS for the second pass
>> powerpc/fsl_booke/64: clear the original kernel if randomized
>> powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst
>> and add 64bit part
>>
>> Documentation/powerpc/index.rst | 2 +-
>> .../{kaslr-booke32.rst => kaslr-booke.rst} | 35 ++++++-
>> arch/powerpc/Kconfig | 2 +-
>> arch/powerpc/kernel/exceptions-64e.S | 23 +++++
>> arch/powerpc/kernel/head_64.S | 13 +++
>> arch/powerpc/kernel/setup_64.c | 3 +
>> arch/powerpc/mm/mmu_decl.h | 23 +++--
>> arch/powerpc/mm/nohash/kaslr_booke.c | 91 +++++++++++++------
>> 8 files changed, 147 insertions(+), 45 deletions(-)
>> rename Documentation/powerpc/{kaslr-booke32.rst => kaslr-booke.rst} (59%)
>>
>> --
>> 2.17.2
^ permalink raw reply
* Re: New powerpc vdso calling convention
From: Nicholas Piggin @ 2020-04-26 3:41 UTC (permalink / raw)
To: Rich Felker
Cc: libc-alpha, Andy Lutomirski, musl, binutils, Adhemerval Zanella,
libc-dev, Thomas Gleixner, Vincenzo Frascino, linuxppc-dev
In-Reply-To: <20200425231119.GM11469@brightrain.aerifal.cx>
Excerpts from Rich Felker's message of April 26, 2020 9:11 am:
> On Sun, Apr 26, 2020 at 08:58:19AM +1000, Nicholas Piggin wrote:
>> Excerpts from Christophe Leroy's message of April 25, 2020 10:20 pm:
>> >
>> >
>> > Le 25/04/2020 à 12:56, Nicholas Piggin a écrit :
>> >> Excerpts from Christophe Leroy's message of April 25, 2020 5:47 pm:
>> >>>
>> >>>
>> >>> Le 25/04/2020 à 07:22, Nicholas Piggin a écrit :
>> >>>> As noted in the 'scv' thread, powerpc's vdso calling convention does not
>> >>>> match the C ELF ABI calling convention (or the proposed scv convention).
>> >>>> I think we could implement a new ABI by basically duplicating function
>> >>>> entry points with different names.
>> >>>
>> >>> I think doing this is a real good idea.
>> >>>
>> >>> I've been working at porting powerpc VDSO to the GENERIC C VDSO, and the
>> >>> main pitfall has been that our vdso calling convention is not compatible
>> >>> with C calling convention, so we have go through an ASM entry/exit.
>> >>>
>> >>> See https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=171469
>> >>>
>> >>> We should kill this error flag return through CR[SO] and get it the
>> >>> "modern" way like other architectectures implementing the C VDSO: return
>> >>> 0 when successfull, return -err when failed.
>> >>
>> >> Agreed.
>> >>
>> >>>> The ELF v2 ABI convention would suit it well, because the caller already
>> >>>> requires the function address for ctr, so having it in r12 will
>> >>>> eliminate the need for address calculation, which suits the vdso data
>> >>>> page access.
>> >>>>
>> >>>> Is there a need for ELF v1 specific calls as well, or could those just be
>> >>>> deprecated and remain on existing functions or required to use the ELF
>> >>>> v2 calls using asm wrappers?
>> >>>
>> >>> What's ELF v1 and ELF v2 ? Is ELF v1 what PPC32 uses ? If so, I'd say
>> >>> yes, it would be good to have it to avoid going through ASM in the middle.
>> >>
>> >> I'm not sure about PPC32. On PPC64, ELFv2 functions must be called with
>> >> their address in r12 if called at their global entry point. ELFv1 have a
>> >> function descriptor with call address and TOC in it, caller has to load
>> >> the TOC if it's global.
>> >>
>> >> The vdso doesn't have TOC, it has one global address (the vdso data
>> >> page) which it loads by calculating its own address.
>> >>
>> >> The kernel doesn't change the vdso based on whether it's called by a v1
>> >> or v2 userspace (it doesn't really know itself and would have to export
>> >> different functions). glibc has a hack to create something:
>> >>
>> >> # define VDSO_IFUNC_RET(value) \
>> >> ({ \
>> >> static Elf64_FuncDesc vdso_opd = { .fd_toc = ~0x0 }; \
>> >> vdso_opd.fd_func = (Elf64_Addr)value; \
>> >> &vdso_opd; \
>> >> })
>> >>
>> >> If we could make something which links more like any other dso with
>> >> ELFv1, that would be good. Otherwise I think v2 is preferable so it
>> >> doesn't have to calculate its own address.
>> >
>> > I see the following in glibc. So looks like PPC32 is like PPC64 elfv1.
>> > By the way, they are talking about something not completely finished in
>> > the kernel. Can we finish it ?
>>
>> Possibly can. It seems like a good idea to fix all loose ends if we are
>> going to add new versions. Will have to check with the toolchain people
>> to make sure we're doing the right thing.
>
> "ELFv1" and "ELFv2" are PPC64-specific names for the old and new
> version of the ELF psABI for PPC64. They have nothing at all to do
> with PPC32 which is a completely different ABI from either.
Right, I'm just talking about those comments -- it seems like the kernel
vdso should contain an .opd section with function descriptors in it for
elfv1 calls, rather than the hack it has now of creating one in the
caller's .data section.
But all that function descriptor code is gated by
#if (defined(__PPC64__) || defined(__powerpc64__)) && _CALL_ELF != 2
So it seems PPC32 does not use function descriptors but a direct pointer
to the entry point like PPC64 with ELFv2.
Thanks,
Nick
^ permalink raw reply
* Re: [PATCH 3/3] mm/hugetlb: Introduce HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS
From: Andrew Morton @ 2020-04-26 3:01 UTC (permalink / raw)
To: Anshuman Khandual
Cc: Rich Felker, linux-ia64, linux-sh, Catalin Marinas,
Heiko Carstens, linux-kernel, James E.J. Bottomley, linux-mm,
Paul Mackerras, H. Peter Anvin, sparclinux, linux-riscv,
Will Deacon, linux-arch, linux-s390, Yoshinori Sato, Helge Deller,
x86, Russell King, Christian Borntraeger, Ingo Molnar, Fenghua Yu,
Vasily Gorbik, Thomas Bogendoerfer, Borislav Petkov,
Paul Walmsley, Thomas Gleixner, linux-arm-kernel, Tony Luck,
linux-parisc, linux-mips, Palmer Dabbelt, linuxppc-dev,
David S. Miller, Mike Kravetz
In-Reply-To: <87d37591-caa2-b82b-392a-3a29b2c7e9a6@arm.com>
On Sun, 26 Apr 2020 08:13:17 +0530 Anshuman Khandual <anshuman.khandual@arm.com> wrote:
>
>
> On 04/26/2020 06:25 AM, Andrew Morton wrote:
> > On Tue, 14 Apr 2020 17:14:30 +0530 Anshuman Khandual <anshuman.khandual@arm.com> wrote:
> >
> >> There are multiple similar definitions for arch_clear_hugepage_flags() on
> >> various platforms. This introduces HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS for those
> >> platforms that need to define their own arch_clear_hugepage_flags() while
> >> also providing a generic fallback definition for others to use. This help
> >> reduce code duplication.
> >>
> >> ...
> >>
> >> --- a/include/linux/hugetlb.h
> >> +++ b/include/linux/hugetlb.h
> >> @@ -544,6 +544,10 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
> >> }
> >> #endif
> >>
> >> +#ifndef HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS
> >> +static inline void arch_clear_hugepage_flags(struct page *page) { }
> >> +#endif
> >> +
> >> #ifndef arch_make_huge_pte
> >> static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
> >> struct page *page, int writable)
> >
> > This is the rather old-school way of doing it. The Linus-suggested way is
> >
> > #ifndef arch_clear_hugepage_flags
> > static inline void arch_clear_hugepage_flags(struct page *page)
> > {
> > }
> > #define arch_clear_hugepage_flags arch_clear_hugepage_flags
>
> Do we need that above line here ? Is not that implicit.
It depends if other header files want to test whether
arch_clear_hugepage_flags is already defined. If the header heorarchy
is well-defined and working properly, they shouldn't need to, because
we're reliably indluding the relevant arch header before (or early
within) include/linux/hugetlb.h.
It would be nice if
#define arch_clear_hugepage_flags arch_clear_hugepage_flags
#define arch_clear_hugepage_flags arch_clear_hugepage_flags
were to generate an compiler error but it doesn't. If it did we could
detect these incorrect inclusion orders.
> > #endif
> >
> > And the various arch headers do
> >
> > static inline void arch_clear_hugepage_flags(struct page *page)
> > {
> > <some implementation>
> > }
> > #define arch_clear_hugepage_flags arch_clear_hugepage_flags
> >
> > It's a small difference - mainly to avoid adding two variables to the
> > overall namespace where one would do.
>
> Understood, will change and resend.
That's OK - I've queued up that fix.
^ permalink raw reply
* Re: [PATCH 3/3] mm/hugetlb: Introduce HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS
From: Anshuman Khandual @ 2020-04-26 2:43 UTC (permalink / raw)
To: Andrew Morton
Cc: Rich Felker, linux-ia64, linux-sh, Catalin Marinas,
Heiko Carstens, linux-kernel, James E.J. Bottomley, linux-mm,
Paul Mackerras, H. Peter Anvin, sparclinux, linux-riscv,
Will Deacon, linux-arch, linux-s390, Yoshinori Sato, Helge Deller,
x86, Russell King, Christian Borntraeger, Ingo Molnar, Fenghua Yu,
Vasily Gorbik, Thomas Bogendoerfer, Borislav Petkov,
Paul Walmsley, Thomas Gleixner, linux-arm-kernel, Tony Luck,
linux-parisc, linux-mips, Palmer Dabbelt, linuxppc-dev,
David S. Miller, Mike Kravetz
In-Reply-To: <20200425175511.7a68efb5e2f4436fe0328c1d@linux-foundation.org>
On 04/26/2020 06:25 AM, Andrew Morton wrote:
> On Tue, 14 Apr 2020 17:14:30 +0530 Anshuman Khandual <anshuman.khandual@arm.com> wrote:
>
>> There are multiple similar definitions for arch_clear_hugepage_flags() on
>> various platforms. This introduces HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS for those
>> platforms that need to define their own arch_clear_hugepage_flags() while
>> also providing a generic fallback definition for others to use. This help
>> reduce code duplication.
>>
>> ...
>>
>> --- a/include/linux/hugetlb.h
>> +++ b/include/linux/hugetlb.h
>> @@ -544,6 +544,10 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>> }
>> #endif
>>
>> +#ifndef HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS
>> +static inline void arch_clear_hugepage_flags(struct page *page) { }
>> +#endif
>> +
>> #ifndef arch_make_huge_pte
>> static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
>> struct page *page, int writable)
>
> This is the rather old-school way of doing it. The Linus-suggested way is
>
> #ifndef arch_clear_hugepage_flags
> static inline void arch_clear_hugepage_flags(struct page *page)
> {
> }
> #define arch_clear_hugepage_flags arch_clear_hugepage_flags
Do we need that above line here ? Is not that implicit.
> #endif
>
> And the various arch headers do
>
> static inline void arch_clear_hugepage_flags(struct page *page)
> {
> <some implementation>
> }
> #define arch_clear_hugepage_flags arch_clear_hugepage_flags
>
> It's a small difference - mainly to avoid adding two variables to the
> overall namespace where one would do.
Understood, will change and resend.
>
>
^ permalink raw reply
* [PATCH v3] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.
From: Ram Pai @ 2020-04-26 2:05 UTC (permalink / raw)
To: kvm-ppc, linuxppc-dev; +Cc: aik, andmike, groug, clg, sukadev, bauerman, david
In-Reply-To: <1585211927-784-1-git-send-email-linuxram@us.ibm.com>
From 10ea2eaf492ca3f22f67a5a63a2b7865e45299ad Mon Sep 17 00:00:00 2001
From: Ram Pai <linuxram@us.ibm.com>
Date: Mon, 24 Feb 2020 01:09:48 -0500
Subject: [PATCH v3] powerpc/XIVE: SVM: share the event-queue page with the
Hypervisor.
XIVE interrupt controller uses an Event Queue (EQ) to enqueue event
notifications when an exception occurs. The EQ is a single memory page
provided by the O/S defining a circular buffer, one per server and
priority couple.
On baremetal, the EQ page is configured with an OPAL call. On pseries,
an extra hop is necessary and the guest OS uses the hcall
H_INT_SET_QUEUE_CONFIG to configure the XIVE interrupt controller.
The XIVE controller being Hypervisor privileged, it will not be allowed
to enqueue event notifications for a Secure VM unless the EQ pages are
shared by the Secure VM.
Hypervisor/Ultravisor still requires support for the TIMA and ESB page
fault handlers. Until this is complete, QEMU can use the emulated XIVE
device for Secure VMs, option "kernel_irqchip=off" on the QEMU pseries
machine.
Cc: kvm-ppc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Cc: Michael Anderson <andmike@linux.ibm.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cedric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
v3: fix a minor semantics in description.
and added reviewed-by from Cedric and Greg.
v2: better description of the patch from Cedric.
---
arch/powerpc/sysdev/xive/spapr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index 55dc61c..608b52f 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -26,6 +26,8 @@
#include <asm/xive.h>
#include <asm/xive-regs.h>
#include <asm/hvcall.h>
+#include <asm/svm.h>
+#include <asm/ultravisor.h>
#include "xive-internal.h"
@@ -501,6 +503,9 @@ static int xive_spapr_configure_queue(u32 target, struct xive_q *q, u8 prio,
rc = -EIO;
} else {
q->qpage = qpage;
+ if (is_secure_guest())
+ uv_share_page(PHYS_PFN(qpage_phys),
+ 1 << xive_alloc_order(order));
}
fail:
return rc;
@@ -534,6 +539,8 @@ static void xive_spapr_cleanup_queue(unsigned int cpu, struct xive_cpu *xc,
hw_cpu, prio);
alloc_order = xive_alloc_order(xive_queue_shift);
+ if (is_secure_guest())
+ uv_unshare_page(PHYS_PFN(__pa(q->qpage)), 1 << alloc_order);
free_pages((unsigned long)q->qpage, alloc_order);
q->qpage = NULL;
}
--
1.8.3.1
^ permalink raw reply related
* [powerpc:merge] BUILD SUCCESS 5d23fec1ac1d385a5c4f29252fd91c84c6ea4ccc
From: kbuild test robot @ 2020-04-26 1:24 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge
branch HEAD: 5d23fec1ac1d385a5c4f29252fd91c84c6ea4ccc Automatic merge of branches 'master', 'next' and 'fixes' into merge
elapsed time: 2109m
configs tested: 188
configs skipped: 0
The following configs have been built successfully.
More configs may be tested in the coming days.
arm64 allyesconfig
arm allyesconfig
arm64 allmodconfig
arm allmodconfig
arm64 allnoconfig
arm allnoconfig
arm efm32_defconfig
arm at91_dt_defconfig
arm shmobile_defconfig
arm64 defconfig
arm exynos_defconfig
arm multi_v5_defconfig
arm sunxi_defconfig
arm multi_v7_defconfig
sparc allyesconfig
arc allyesconfig
powerpc ppc64_defconfig
sh allnoconfig
mips tb0287_defconfig
c6x evmc6678_defconfig
nds32 allnoconfig
ia64 tiger_defconfig
i386 allnoconfig
i386 allyesconfig
i386 alldefconfig
i386 defconfig
i386 debian-10.3
ia64 allmodconfig
ia64 defconfig
ia64 allnoconfig
ia64 generic_defconfig
ia64 bigsur_defconfig
ia64 allyesconfig
ia64 alldefconfig
nios2 3c120_defconfig
nios2 10m50_defconfig
xtensa iss_defconfig
c6x allyesconfig
xtensa common_defconfig
openrisc simple_smp_defconfig
openrisc or1ksim_defconfig
nds32 defconfig
csky defconfig
alpha defconfig
h8300 h8s-sim_defconfig
h8300 edosk2674_defconfig
m68k m5475evb_defconfig
m68k allmodconfig
h8300 h8300h-sim_defconfig
m68k sun3_defconfig
m68k multi_defconfig
arc defconfig
powerpc defconfig
powerpc rhel-kconfig
microblaze mmu_defconfig
microblaze nommu_defconfig
powerpc allnoconfig
mips fuloong2e_defconfig
mips malta_kvm_defconfig
mips ar7_defconfig
mips allyesconfig
mips 64r6el_defconfig
mips allnoconfig
mips 32r2_defconfig
mips allmodconfig
mips malta_kvm_guest_defconfig
mips capcella_defconfig
mips ip32_defconfig
mips decstation_64_defconfig
mips loongson3_defconfig
mips ath79_defconfig
mips bcm63xx_defconfig
parisc allnoconfig
parisc generic-64bit_defconfig
parisc generic-32bit_defconfig
parisc allyesconfig
parisc allmodconfig
parisc randconfig-a001-20200424
alpha randconfig-a001-20200424
m68k randconfig-a001-20200424
riscv randconfig-a001-20200424
nds32 randconfig-a001-20200424
nios2 randconfig-a001-20200424
c6x randconfig-a001-20200424
h8300 randconfig-a001-20200424
sparc64 randconfig-a001-20200424
microblaze randconfig-a001-20200424
nios2 randconfig-a001-20200426
c6x randconfig-a001-20200426
h8300 randconfig-a001-20200426
sparc64 randconfig-a001-20200426
microblaze randconfig-a001-20200426
sh randconfig-a001-20200424
csky randconfig-a001-20200424
s390 randconfig-a001-20200424
xtensa randconfig-a001-20200424
openrisc randconfig-a001-20200424
i386 randconfig-c002-20200424
i386 randconfig-c001-20200424
x86_64 randconfig-c001-20200424
i386 randconfig-c003-20200424
x86_64 randconfig-c003-20200424
x86_64 randconfig-d001-20200424
i386 randconfig-d002-20200424
i386 randconfig-d001-20200424
x86_64 randconfig-d003-20200424
i386 randconfig-d003-20200424
i386 randconfig-e003-20200426
x86_64 randconfig-e003-20200426
i386 randconfig-e002-20200426
i386 randconfig-e001-20200426
x86_64 randconfig-e001-20200426
x86_64 randconfig-a001-20200426
i386 randconfig-a003-20200426
x86_64 randconfig-a003-20200426
i386 randconfig-a002-20200426
i386 randconfig-a001-20200426
x86_64 randconfig-a002-20200426
i386 randconfig-f002-20200425
i386 randconfig-f003-20200425
x86_64 randconfig-f003-20200425
i386 randconfig-f001-20200425
x86_64 randconfig-f001-20200425
i386 randconfig-g003-20200425
i386 randconfig-g001-20200425
x86_64 randconfig-g002-20200425
i386 randconfig-g002-20200425
i386 randconfig-g003-20200424
i386 randconfig-g001-20200424
x86_64 randconfig-g001-20200424
x86_64 randconfig-g002-20200424
i386 randconfig-g002-20200424
x86_64 randconfig-g003-20200424
x86_64 randconfig-a001-20200424
i386 randconfig-a003-20200424
x86_64 randconfig-a003-20200424
i386 randconfig-a002-20200424
i386 randconfig-a001-20200424
x86_64 randconfig-a002-20200424
i386 randconfig-h003-20200424
x86_64 randconfig-h001-20200424
x86_64 randconfig-h003-20200424
x86_64 randconfig-h002-20200424
i386 randconfig-h001-20200424
i386 randconfig-h002-20200424
sparc randconfig-a001-20200426
ia64 randconfig-a001-20200426
powerpc randconfig-a001-20200426
arm randconfig-a001-20200426
arm64 randconfig-a001-20200426
arc randconfig-a001-20200426
sparc randconfig-a001-20200425
ia64 randconfig-a001-20200425
powerpc randconfig-a001-20200425
arm randconfig-a001-20200425
arc randconfig-a001-20200425
riscv allyesconfig
riscv nommu_virt_defconfig
riscv allnoconfig
riscv defconfig
riscv rv32_defconfig
riscv allmodconfig
s390 zfcpdump_defconfig
s390 debug_defconfig
s390 allyesconfig
s390 allnoconfig
s390 allmodconfig
s390 alldefconfig
s390 defconfig
sh rsk7269_defconfig
sh allmodconfig
sh titan_defconfig
sh sh7785lcr_32bit_defconfig
sparc defconfig
sparc64 defconfig
sparc64 allnoconfig
sparc64 allyesconfig
sparc64 allmodconfig
um x86_64_defconfig
um i386_defconfig
um defconfig
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
x86_64 kexec
x86_64 rhel-7.2-clear
x86_64 rhel-7.6-kselftests
x86_64 rhel-7.6
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [powerpc:next] BUILD SUCCESS 45591da765885f7320a111d290b3a28a23eed359
From: kbuild test robot @ 2020-04-26 0:57 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
branch HEAD: 45591da765885f7320a111d290b3a28a23eed359 powerpc/vas: Include linux/types.h in uapi/asm/vas-api.h
elapsed time: 4294m
configs tested: 349
configs skipped: 0
The following configs have been built successfully.
More configs may be tested in the coming days.
arm64 allyesconfig
arm allyesconfig
arm64 allmodconfig
arm allmodconfig
arm64 allnoconfig
arm allnoconfig
arm efm32_defconfig
arm at91_dt_defconfig
arm shmobile_defconfig
arm64 defconfig
arm exynos_defconfig
arm multi_v5_defconfig
arm sunxi_defconfig
arm multi_v7_defconfig
sparc allyesconfig
ia64 defconfig
parisc allnoconfig
riscv allmodconfig
parisc allmodconfig
alpha defconfig
powerpc defconfig
sparc64 defconfig
sh sh7785lcr_32bit_defconfig
s390 alldefconfig
mips decstation_64_defconfig
parisc generic-64bit_defconfig
riscv allyesconfig
xtensa common_defconfig
sparc64 allnoconfig
mips ath79_defconfig
openrisc or1ksim_defconfig
i386 allnoconfig
i386 allyesconfig
i386 alldefconfig
i386 defconfig
i386 debian-10.3
ia64 allmodconfig
ia64 allnoconfig
ia64 generic_defconfig
ia64 tiger_defconfig
ia64 bigsur_defconfig
ia64 allyesconfig
ia64 alldefconfig
nios2 3c120_defconfig
nios2 10m50_defconfig
c6x evmc6678_defconfig
xtensa iss_defconfig
c6x allyesconfig
openrisc simple_smp_defconfig
nds32 defconfig
nds32 allnoconfig
csky defconfig
h8300 h8s-sim_defconfig
h8300 edosk2674_defconfig
m68k m5475evb_defconfig
m68k allmodconfig
h8300 h8300h-sim_defconfig
m68k sun3_defconfig
m68k multi_defconfig
arc defconfig
arc allyesconfig
powerpc ppc64_defconfig
powerpc rhel-kconfig
microblaze mmu_defconfig
microblaze nommu_defconfig
powerpc allnoconfig
mips fuloong2e_defconfig
mips malta_kvm_defconfig
mips ar7_defconfig
mips allyesconfig
mips 64r6el_defconfig
mips allnoconfig
mips 32r2_defconfig
mips allmodconfig
mips malta_kvm_guest_defconfig
mips tb0287_defconfig
mips capcella_defconfig
mips ip32_defconfig
mips loongson3_defconfig
mips bcm63xx_defconfig
parisc generic-32bit_defconfig
parisc allyesconfig
parisc randconfig-a001-20200422
mips randconfig-a001-20200422
alpha randconfig-a001-20200422
m68k randconfig-a001-20200422
riscv randconfig-a001-20200422
nds32 randconfig-a001-20200422
parisc randconfig-a001-20200424
alpha randconfig-a001-20200424
m68k randconfig-a001-20200424
riscv randconfig-a001-20200424
nds32 randconfig-a001-20200424
parisc randconfig-a001-20200423
alpha randconfig-a001-20200423
mips randconfig-a001-20200423
m68k randconfig-a001-20200423
riscv randconfig-a001-20200423
nds32 randconfig-a001-20200423
parisc randconfig-a001-20200426
mips randconfig-a001-20200426
alpha randconfig-a001-20200426
m68k randconfig-a001-20200426
nds32 randconfig-a001-20200426
nios2 randconfig-a001-20200423
h8300 randconfig-a001-20200423
c6x randconfig-a001-20200423
sparc64 randconfig-a001-20200423
microblaze randconfig-a001-20200423
nios2 randconfig-a001-20200424
c6x randconfig-a001-20200424
h8300 randconfig-a001-20200424
sparc64 randconfig-a001-20200424
microblaze randconfig-a001-20200424
nios2 randconfig-a001-20200422
h8300 randconfig-a001-20200422
c6x randconfig-a001-20200422
sparc64 randconfig-a001-20200422
microblaze randconfig-a001-20200422
nios2 randconfig-a001-20200425
c6x randconfig-a001-20200425
h8300 randconfig-a001-20200425
sparc64 randconfig-a001-20200425
microblaze randconfig-a001-20200425
sh randconfig-a001-20200423
csky randconfig-a001-20200423
xtensa randconfig-a001-20200423
openrisc randconfig-a001-20200423
sh randconfig-a001-20200422
csky randconfig-a001-20200422
s390 randconfig-a001-20200422
xtensa randconfig-a001-20200422
openrisc randconfig-a001-20200422
sh randconfig-a001-20200424
csky randconfig-a001-20200424
s390 randconfig-a001-20200424
xtensa randconfig-a001-20200424
openrisc randconfig-a001-20200424
sh randconfig-a001-20200425
csky randconfig-a001-20200425
s390 randconfig-a001-20200425
xtensa randconfig-a001-20200425
openrisc randconfig-a001-20200425
x86_64 randconfig-a001-20200422
i386 randconfig-a003-20200422
x86_64 randconfig-a003-20200422
i386 randconfig-a002-20200422
i386 randconfig-a001-20200422
x86_64 randconfig-a002-20200422
i386 randconfig-b002-20200422
i386 randconfig-b001-20200422
x86_64 randconfig-b001-20200422
i386 randconfig-b003-20200422
x86_64 randconfig-b003-20200422
i386 randconfig-b002-20200426
x86_64 randconfig-b001-20200426
i386 randconfig-b001-20200426
i386 randconfig-b003-20200426
x86_64 randconfig-b003-20200426
i386 randconfig-b002-20200425
x86_64 randconfig-b001-20200425
i386 randconfig-b001-20200425
i386 randconfig-b003-20200425
x86_64 randconfig-b002-20200425
x86_64 randconfig-b003-20200425
x86_64 randconfig-a001-20200424
i386 randconfig-a003-20200424
x86_64 randconfig-a003-20200424
i386 randconfig-a002-20200424
i386 randconfig-a001-20200424
x86_64 randconfig-a002-20200424
i386 randconfig-c002-20200424
i386 randconfig-c001-20200424
x86_64 randconfig-c001-20200424
i386 randconfig-c003-20200424
x86_64 randconfig-c003-20200424
i386 randconfig-c002-20200423
i386 randconfig-c001-20200423
x86_64 randconfig-c002-20200423
x86_64 randconfig-c001-20200423
i386 randconfig-c003-20200423
x86_64 randconfig-c003-20200423
x86_64 randconfig-d001-20200423
x86_64 randconfig-d002-20200423
i386 randconfig-d002-20200423
i386 randconfig-d001-20200423
x86_64 randconfig-d003-20200423
i386 randconfig-d003-20200423
x86_64 randconfig-d001-20200424
i386 randconfig-d002-20200424
i386 randconfig-d001-20200424
x86_64 randconfig-d003-20200424
i386 randconfig-d003-20200424
x86_64 randconfig-d002-20200426
i386 randconfig-d002-20200426
i386 randconfig-d001-20200426
i386 randconfig-d003-20200426
x86_64 randconfig-d002-20200422
i386 randconfig-d002-20200422
i386 randconfig-d001-20200422
i386 randconfig-d003-20200422
x86_64 randconfig-a001-20200426
i386 randconfig-a003-20200426
x86_64 randconfig-a003-20200426
i386 randconfig-a002-20200426
i386 randconfig-a001-20200426
x86_64 randconfig-a002-20200426
i386 randconfig-e003-20200422
x86_64 randconfig-e003-20200422
i386 randconfig-e002-20200422
i386 randconfig-e001-20200422
x86_64 randconfig-e001-20200422
x86_64 randconfig-e002-20200423
i386 randconfig-e003-20200423
x86_64 randconfig-e003-20200423
i386 randconfig-e002-20200423
i386 randconfig-e001-20200423
x86_64 randconfig-e001-20200423
i386 randconfig-e003-20200426
x86_64 randconfig-e003-20200426
i386 randconfig-e002-20200426
i386 randconfig-e001-20200426
x86_64 randconfig-e001-20200426
i386 randconfig-e003-20200425
x86_64 randconfig-e002-20200425
x86_64 randconfig-e003-20200425
i386 randconfig-e002-20200425
i386 randconfig-e001-20200425
x86_64 randconfig-e001-20200425
i386 randconfig-a003-20200423
i386 randconfig-a001-20200423
i386 randconfig-a002-20200423
x86_64 randconfig-a002-20200423
x86_64 randconfig-f002-20200424
i386 randconfig-f002-20200424
i386 randconfig-f003-20200424
x86_64 randconfig-f003-20200424
i386 randconfig-f001-20200424
x86_64 randconfig-f001-20200424
i386 randconfig-f002-20200425
i386 randconfig-f003-20200425
x86_64 randconfig-f003-20200425
i386 randconfig-f001-20200425
x86_64 randconfig-f001-20200425
x86_64 randconfig-f002-20200426
i386 randconfig-f002-20200426
x86_64 randconfig-f003-20200426
i386 randconfig-f003-20200426
i386 randconfig-f001-20200426
x86_64 randconfig-f001-20200426
i386 randconfig-f002-20200421
i386 randconfig-f003-20200421
x86_64 randconfig-f003-20200421
i386 randconfig-f001-20200421
x86_64 randconfig-f001-20200421
x86_64 randconfig-f002-20200422
i386 randconfig-f002-20200422
x86_64 randconfig-f003-20200422
i386 randconfig-f003-20200422
i386 randconfig-f001-20200422
x86_64 randconfig-f001-20200422
i386 randconfig-g003-20200422
x86_64 randconfig-g001-20200422
i386 randconfig-g001-20200422
x86_64 randconfig-g002-20200422
i386 randconfig-g002-20200422
x86_64 randconfig-g003-20200422
i386 randconfig-g003-20200424
i386 randconfig-g001-20200424
x86_64 randconfig-g001-20200424
x86_64 randconfig-g002-20200424
i386 randconfig-g002-20200424
x86_64 randconfig-g003-20200424
i386 randconfig-g003-20200426
i386 randconfig-g001-20200426
x86_64 randconfig-g001-20200426
x86_64 randconfig-g002-20200426
i386 randconfig-g002-20200426
x86_64 randconfig-g003-20200426
i386 randconfig-g003-20200423
x86_64 randconfig-g001-20200423
i386 randconfig-g001-20200423
i386 randconfig-g002-20200423
x86_64 randconfig-g003-20200423
i386 randconfig-h003-20200424
x86_64 randconfig-h001-20200424
x86_64 randconfig-h003-20200424
x86_64 randconfig-h002-20200424
i386 randconfig-h001-20200424
i386 randconfig-h002-20200424
i386 randconfig-h003-20200426
x86_64 randconfig-h001-20200426
x86_64 randconfig-h003-20200426
x86_64 randconfig-h002-20200426
i386 randconfig-h001-20200426
i386 randconfig-h002-20200426
i386 randconfig-h003-20200422
x86_64 randconfig-h001-20200422
x86_64 randconfig-h003-20200422
x86_64 randconfig-h002-20200422
i386 randconfig-h001-20200422
i386 randconfig-h002-20200422
i386 randconfig-h003-20200423
x86_64 randconfig-h002-20200423
i386 randconfig-h002-20200423
i386 randconfig-h001-20200423
sparc randconfig-a001-20200423
ia64 randconfig-a001-20200423
arm randconfig-a001-20200423
arm64 randconfig-a001-20200423
arc randconfig-a001-20200423
sparc randconfig-a001-20200424
ia64 randconfig-a001-20200424
powerpc randconfig-a001-20200424
arm64 randconfig-a001-20200424
arc randconfig-a001-20200424
sparc randconfig-a001-20200422
ia64 randconfig-a001-20200422
powerpc randconfig-a001-20200422
arm randconfig-a001-20200422
arm64 randconfig-a001-20200422
arc randconfig-a001-20200422
riscv nommu_virt_defconfig
riscv allnoconfig
riscv defconfig
riscv rv32_defconfig
s390 zfcpdump_defconfig
s390 debug_defconfig
s390 allyesconfig
s390 allnoconfig
s390 allmodconfig
s390 defconfig
sh rsk7269_defconfig
sh allmodconfig
sh titan_defconfig
sh allnoconfig
sparc defconfig
sparc64 allyesconfig
sparc64 allmodconfig
um x86_64_defconfig
um i386_defconfig
um defconfig
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
x86_64 kexec
x86_64 rhel-7.2-clear
x86_64 rhel-7.6-kselftests
x86_64 rhel-7.6
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* Re: [PATCH 3/3] mm/hugetlb: Introduce HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS
From: Andrew Morton @ 2020-04-26 0:55 UTC (permalink / raw)
To: Anshuman Khandual
Cc: Rich Felker, linux-ia64, linux-sh, Catalin Marinas,
Heiko Carstens, linux-kernel, James E.J. Bottomley, linux-mm,
Paul Mackerras, H. Peter Anvin, sparclinux, linux-riscv,
Will Deacon, linux-arch, linux-s390, Yoshinori Sato, Helge Deller,
x86, Russell King, Christian Borntraeger, Ingo Molnar, Fenghua Yu,
Vasily Gorbik, Thomas Bogendoerfer, Borislav Petkov,
Paul Walmsley, Thomas Gleixner, linux-arm-kernel, Tony Luck,
linux-parisc, linux-mips, Palmer Dabbelt, linuxppc-dev,
David S. Miller, Mike Kravetz
In-Reply-To: <1586864670-21799-4-git-send-email-anshuman.khandual@arm.com>
On Tue, 14 Apr 2020 17:14:30 +0530 Anshuman Khandual <anshuman.khandual@arm.com> wrote:
> There are multiple similar definitions for arch_clear_hugepage_flags() on
> various platforms. This introduces HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS for those
> platforms that need to define their own arch_clear_hugepage_flags() while
> also providing a generic fallback definition for others to use. This help
> reduce code duplication.
>
> ...
>
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -544,6 +544,10 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
> }
> #endif
>
> +#ifndef HAVE_ARCH_CLEAR_HUGEPAGE_FLAGS
> +static inline void arch_clear_hugepage_flags(struct page *page) { }
> +#endif
> +
> #ifndef arch_make_huge_pte
> static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
> struct page *page, int writable)
This is the rather old-school way of doing it. The Linus-suggested way is
#ifndef arch_clear_hugepage_flags
static inline void arch_clear_hugepage_flags(struct page *page)
{
}
#define arch_clear_hugepage_flags arch_clear_hugepage_flags
#endif
And the various arch headers do
static inline void arch_clear_hugepage_flags(struct page *page)
{
<some implementation>
}
#define arch_clear_hugepage_flags arch_clear_hugepage_flags
It's a small difference - mainly to avoid adding two variables to the
overall namespace where one would do.
^ permalink raw reply
* [powerpc:fixes-test] BUILD SUCCESS 5990cdee689c6885b27c6d969a3d58b09002b0bc
From: kbuild test robot @ 2020-04-26 0:53 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git fixes-test
branch HEAD: 5990cdee689c6885b27c6d969a3d58b09002b0bc lib/mpi: Fix building for powerpc with clang
elapsed time: 2079m
configs tested: 249
configs skipped: 0
The following configs have been built successfully.
More configs may be tested in the coming days.
arm64 allyesconfig
arm allyesconfig
arm64 allmodconfig
arm64 allnoconfig
arm allnoconfig
arm allmodconfig
arm efm32_defconfig
arm at91_dt_defconfig
arm shmobile_defconfig
arm64 defconfig
arm exynos_defconfig
arm multi_v5_defconfig
arm sunxi_defconfig
arm multi_v7_defconfig
sparc allyesconfig
mips allnoconfig
ia64 tiger_defconfig
mips capcella_defconfig
s390 alldefconfig
mips tb0287_defconfig
s390 allnoconfig
powerpc defconfig
riscv allyesconfig
xtensa common_defconfig
sparc64 allnoconfig
mips ath79_defconfig
openrisc or1ksim_defconfig
i386 allnoconfig
i386 alldefconfig
i386 defconfig
i386 debian-10.3
i386 allyesconfig
ia64 allmodconfig
ia64 defconfig
ia64 allnoconfig
ia64 generic_defconfig
ia64 bigsur_defconfig
ia64 allyesconfig
ia64 alldefconfig
nios2 3c120_defconfig
nios2 10m50_defconfig
c6x evmc6678_defconfig
xtensa iss_defconfig
c6x allyesconfig
openrisc simple_smp_defconfig
nds32 defconfig
nds32 allnoconfig
csky defconfig
alpha defconfig
h8300 h8s-sim_defconfig
h8300 edosk2674_defconfig
m68k m5475evb_defconfig
m68k allmodconfig
h8300 h8300h-sim_defconfig
m68k sun3_defconfig
m68k multi_defconfig
arc defconfig
arc allyesconfig
powerpc ppc64_defconfig
powerpc rhel-kconfig
microblaze mmu_defconfig
microblaze nommu_defconfig
powerpc allnoconfig
mips fuloong2e_defconfig
mips malta_kvm_defconfig
mips ar7_defconfig
mips allyesconfig
mips 64r6el_defconfig
mips 32r2_defconfig
mips allmodconfig
mips malta_kvm_guest_defconfig
mips ip32_defconfig
mips decstation_64_defconfig
mips loongson3_defconfig
mips bcm63xx_defconfig
parisc allnoconfig
parisc generic-64bit_defconfig
parisc generic-32bit_defconfig
parisc allyesconfig
parisc allmodconfig
parisc randconfig-a001-20200424
alpha randconfig-a001-20200424
m68k randconfig-a001-20200424
riscv randconfig-a001-20200424
nds32 randconfig-a001-20200424
parisc randconfig-a001-20200426
mips randconfig-a001-20200426
alpha randconfig-a001-20200426
m68k randconfig-a001-20200426
nds32 randconfig-a001-20200426
nios2 randconfig-a001-20200424
c6x randconfig-a001-20200424
h8300 randconfig-a001-20200424
sparc64 randconfig-a001-20200424
microblaze randconfig-a001-20200424
nios2 randconfig-a001-20200425
c6x randconfig-a001-20200425
h8300 randconfig-a001-20200425
sparc64 randconfig-a001-20200425
microblaze randconfig-a001-20200425
sh randconfig-a001-20200424
csky randconfig-a001-20200424
s390 randconfig-a001-20200424
xtensa randconfig-a001-20200424
openrisc randconfig-a001-20200424
sh randconfig-a001-20200425
csky randconfig-a001-20200425
s390 randconfig-a001-20200425
xtensa randconfig-a001-20200425
openrisc randconfig-a001-20200425
i386 randconfig-b002-20200426
x86_64 randconfig-b001-20200426
i386 randconfig-b001-20200426
i386 randconfig-b003-20200426
x86_64 randconfig-b003-20200426
i386 randconfig-b002-20200425
x86_64 randconfig-b001-20200425
i386 randconfig-b001-20200425
i386 randconfig-b003-20200425
x86_64 randconfig-b002-20200425
x86_64 randconfig-b003-20200425
i386 randconfig-c002-20200425
i386 randconfig-c001-20200425
x86_64 randconfig-c002-20200425
x86_64 randconfig-c001-20200425
i386 randconfig-c003-20200425
x86_64 randconfig-c003-20200425
i386 randconfig-c002-20200424
i386 randconfig-c001-20200424
x86_64 randconfig-c001-20200424
i386 randconfig-c003-20200424
x86_64 randconfig-c003-20200424
x86_64 randconfig-d001-20200424
i386 randconfig-d002-20200424
i386 randconfig-d001-20200424
x86_64 randconfig-d003-20200424
i386 randconfig-d003-20200424
x86_64 randconfig-d002-20200426
i386 randconfig-d002-20200426
i386 randconfig-d001-20200426
i386 randconfig-d003-20200426
x86_64 randconfig-a001-20200426
i386 randconfig-a003-20200426
x86_64 randconfig-a003-20200426
i386 randconfig-a002-20200426
i386 randconfig-a001-20200426
x86_64 randconfig-a002-20200426
i386 randconfig-e003-20200425
x86_64 randconfig-e002-20200425
x86_64 randconfig-e003-20200425
i386 randconfig-e002-20200425
i386 randconfig-e001-20200425
x86_64 randconfig-e001-20200425
i386 randconfig-e003-20200426
x86_64 randconfig-e003-20200426
i386 randconfig-e002-20200426
i386 randconfig-e001-20200426
x86_64 randconfig-e001-20200426
x86_64 randconfig-a001-20200424
i386 randconfig-a003-20200424
x86_64 randconfig-a003-20200424
i386 randconfig-a002-20200424
i386 randconfig-a001-20200424
x86_64 randconfig-a002-20200424
i386 randconfig-f002-20200425
i386 randconfig-f003-20200425
x86_64 randconfig-f003-20200425
i386 randconfig-f001-20200425
x86_64 randconfig-f001-20200425
x86_64 randconfig-f002-20200424
i386 randconfig-f002-20200424
i386 randconfig-f003-20200424
x86_64 randconfig-f003-20200424
i386 randconfig-f001-20200424
x86_64 randconfig-f001-20200424
x86_64 randconfig-f002-20200426
i386 randconfig-f002-20200426
x86_64 randconfig-f003-20200426
i386 randconfig-f003-20200426
i386 randconfig-f001-20200426
x86_64 randconfig-f001-20200426
i386 randconfig-g003-20200424
i386 randconfig-g001-20200424
x86_64 randconfig-g001-20200424
x86_64 randconfig-g002-20200424
i386 randconfig-g002-20200424
x86_64 randconfig-g003-20200424
i386 randconfig-g003-20200426
i386 randconfig-g001-20200426
x86_64 randconfig-g001-20200426
x86_64 randconfig-g002-20200426
i386 randconfig-g002-20200426
x86_64 randconfig-g003-20200426
i386 randconfig-h003-20200424
x86_64 randconfig-h001-20200424
x86_64 randconfig-h003-20200424
x86_64 randconfig-h002-20200424
i386 randconfig-h001-20200424
i386 randconfig-h002-20200424
i386 randconfig-h003-20200426
x86_64 randconfig-h001-20200426
x86_64 randconfig-h003-20200426
x86_64 randconfig-h002-20200426
i386 randconfig-h001-20200426
i386 randconfig-h002-20200426
i386 randconfig-h003-20200425
x86_64 randconfig-h001-20200425
x86_64 randconfig-h003-20200425
i386 randconfig-h002-20200425
i386 randconfig-h001-20200425
sparc randconfig-a001-20200425
ia64 randconfig-a001-20200425
powerpc randconfig-a001-20200425
arm randconfig-a001-20200425
arc randconfig-a001-20200425
sparc randconfig-a001-20200424
ia64 randconfig-a001-20200424
powerpc randconfig-a001-20200424
arm64 randconfig-a001-20200424
arc randconfig-a001-20200424
riscv nommu_virt_defconfig
riscv allnoconfig
riscv defconfig
riscv rv32_defconfig
riscv allmodconfig
s390 zfcpdump_defconfig
s390 debug_defconfig
s390 allyesconfig
s390 allmodconfig
s390 defconfig
sh rsk7269_defconfig
sh allmodconfig
sh titan_defconfig
sh sh7785lcr_32bit_defconfig
sh allnoconfig
sparc defconfig
sparc64 defconfig
sparc64 allyesconfig
sparc64 allmodconfig
um x86_64_defconfig
um i386_defconfig
um defconfig
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
x86_64 kexec
x86_64 rhel-7.2-clear
x86_64 rhel-7.6-kselftests
x86_64 rhel-7.6
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [GIT PULL] Please pull powerpc/linux.git powerpc-5.7-3 tag
From: Michael Ellerman @ 2020-04-25 23:52 UTC (permalink / raw)
To: Linus Torvalds
Cc: herbert, linux-kernel, chris.packham, natechancellor,
linuxppc-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi Linus,
Please pull some more powerpc fixes for 5.7.
The lib/mpi one is all contained within #ifdef _ARCH_PPC.
cheers
The following changes since commit ae83d0b416db002fe95601e7f97f64b59514d936:
Linux 5.7-rc2 (2020-04-19 14:35:30 -0700)
are available in the git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.7-3
for you to fetch changes up to 5990cdee689c6885b27c6d969a3d58b09002b0bc:
lib/mpi: Fix building for powerpc with clang (2020-04-24 13:14:59 +1000)
Out of area changes:
lib/mpi/longlong.h # 5990cdee689c lib/mpi: Fix building for powerpc with clang
- ------------------------------------------------------------------
powerpc fixes for 5.7 #3
- One important fix for a bug in the way we find the cache-line size from the
device tree, which was leading to the wrong size being reported to userspace
on some platforms.
- A fix for 8xx STRICT_KERNEL_RWX which was leaving TLB entries around leading
to a window at boot when the strict mapping wasn't enforced.
- A fix to enable our KUAP (kernel user access prevention) debugging on PPC32.
- A build fix for clang in lib/mpi.
Thanks to:
Chris Packham, Christophe Leroy, Nathan Chancellor, Qian Cai.
- ------------------------------------------------------------------
Chris Packham (1):
powerpc/setup_64: Set cache-line-size based on cache-block-size
Christophe Leroy (2):
powerpc/8xx: Fix STRICT_KERNEL_RWX startup test failure
powerpc/mm: Fix CONFIG_PPC_KUAP_DEBUG on PPC32
Nathan Chancellor (1):
lib/mpi: Fix building for powerpc with clang
arch/powerpc/kernel/entry_32.S | 2 +-
arch/powerpc/kernel/setup_64.c | 2 ++
arch/powerpc/mm/nohash/8xx.c | 3 ++
arch/powerpc/platforms/Kconfig.cputype | 2 +-
lib/mpi/longlong.h | 34 ++++++++++----------
5 files changed, 24 insertions(+), 19 deletions(-)
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAl6kzJMACgkQUevqPMjh
pYDp0g/+Ndo+utPPnfPQmcc8fX9poJYqxW27p99rK4lj3t2Gk1tuIwHK6UmZYjTP
admPhfRPU16M+bqcIEhqab8YA0JeTYxgggGZER0hxHBCeZXqp6nxcr6J7N4rlR+I
HqwE8Pt4+8GOvIK992F5O2YL0upAkgjdfNGwIDdYEcui1312P0y2OWxb/CMJ6wn/
nvzmljbog/U/OR6oCppe2DkEJwxM4Q+XOP7nMsDSsQCYmFakjlbpvMVOv0SuQ2nJ
A9zOihWDonYYD17kKRUON6Z0QStGCWM53koHZXzSvC3CZxv749/FD1iIfs1wGUzc
/xGMuqjCWbzOBlDF7Nc8OsO9sdB7MkymZu5yINLgrL0kaHftiUVDrooPdTgK0pZO
tFW41pgbMUHJaLqvH51oNxbrTpsu3uUaR8fv+aPeQW6sGxehQ3qANQUHiTQ+U+Jq
qwyxqBlGHVRe2DmjAaOSP2fYRwlFVQbH1/C7kCMByNNbWiJ6lQYi7Prxq8/3HQ2q
nrmLhYTna52YPPH0i745KxXvi0z0B46nMjpKq5r1a7R2MwWZ0+cBoTvZEECH9ar/
Pzu7qR4SrEJLBXfQ9T5wEPbqe1/yL9Azt836juRyEc7kF94htOswW5MiAtyxZ6v1
6BWX58XYw+QUhtH6QmB8xtm6zLTRiT0mChwU7VxwuEUBa3T6SSA=
=fSRV
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: linux-next: build failure after merge of the powerpc tree
From: Michael Ellerman @ 2020-04-25 23:52 UTC (permalink / raw)
To: Stephen Rothwell, PowerPC
Cc: Linux Next Mailing List, Haren Myneni, Linux Kernel Mailing List
In-Reply-To: <20200422154129.11f988fd@canb.auug.org.au>
On Wed, 2020-04-22 at 05:41:29 UTC, Stephen Rothwell wrote:
> Hi all,
>
> After merging the powerpc tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
>
> In file included from <command-line>:32:
> ./usr/include/asm/vas-api.h:15:2: error: unknown type name '__u32'
> 15 | __u32 version;
> | ^~~~~
> ./usr/include/asm/vas-api.h:16:2: error: unknown type name '__s16'
> 16 | __s16 vas_id; /* specific instance of vas or -1 for default */
> | ^~~~~
> ./usr/include/asm/vas-api.h:17:2: error: unknown type name '__u16'
> 17 | __u16 reserved1;
> | ^~~~~
> ./usr/include/asm/vas-api.h:18:2: error: unknown type name '__u64'
> 18 | __u64 flags; /* Future use */
> | ^~~~~
> ./usr/include/asm/vas-api.h:19:2: error: unknown type name '__u64'
> 19 | __u64 reserved2[6];
> | ^~~~~
>
> Caused by commit
>
> 45f25a79fe50 ("powerpc/vas: Define VAS_TX_WIN_OPEN ioctl API")
>
> uapi headers should be self contained. I have added the following patch
> for today:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 22 Apr 2020 15:28:26 +1000
> Subject: [PATCH] powerpc/vas: uapi headers should be self contained
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/45591da765885f7320a111d290b3a28a23eed359
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc/8xx: Fix STRICT_KERNEL_RWX startup test failure
From: Michael Ellerman @ 2020-04-25 23:51 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <485caac75f195f18c11eb077b0031fdd2bb7fb9e.1587361039.git.christophe.leroy@c-s.fr>
On Mon, 2020-04-20 at 05:37:42 UTC, Christophe Leroy wrote:
> WRITE_RO lkdtm test works.
>
> But when selecting CONFIG_DEBUG_RODATA_TEST, the kernel reports
> rodata_test: test data was not read only
>
> This is because when rodata test runs, there are still old entries
> in TLB.
>
> Flush TLB after setting kernel pages RO or NX.
>
> Fixes: d5f17ee96447 ("powerpc/8xx: don't disable large TLBs with CONFIG_STRICT_KERNEL_RWX")
> Cc: stable@vger.kernel.org
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/b61c38baa98056d4802ff5be5cfb979efc2d0f7a
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/mm: Fix CONFIG_PPC_KUAP_DEBUG on PPC32
From: Michael Ellerman @ 2020-04-25 23:51 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <540242f7d4573f7cdf1b3bf46bb35f743b2cd68f.1587124651.git.christophe.leroy@c-s.fr>
On Fri, 2020-04-17 at 11:58:36 UTC, Christophe Leroy wrote:
> CONFIG_PPC_KUAP_DEBUG is not selectable because it depends on PPC_32
> which doesn't exists.
>
> Fixing it leads to a deadlock due to a vital register getting
> clobbered in _switch().
>
> Change dependency to PPC32 and use r0 instead of r4 in _switch()
>
> Fixes: e2fb9f544431 ("powerpc/32: Prepare for Kernel Userspace Access Protection")
> Cc: stable@vger.kernel.org
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/feb8e960d780e170e992a70491eec9dd68f4dbf2
cheers
^ 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