Commit b952e974 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus' of git://github.com/openrisc/linux

Pull OpenRISC fixes from Stafford Horne:
 "Fixes for compile issues pointed out by kbuild and one bug I found in
  initrd with the 5.9 patches"

* tag 'for-linus' of git://github.com/openrisc/linux:
  openrisc: Fix issue with get_user for 64-bit values
  openrisc: Fix cache API compile issue when not inlining
  openrisc: Reserve memblock for initrd
parents ef2e9a56 d877322b
...@@ -165,19 +165,19 @@ struct __large_struct { ...@@ -165,19 +165,19 @@ struct __large_struct {
#define __get_user_nocheck(x, ptr, size) \ #define __get_user_nocheck(x, ptr, size) \
({ \ ({ \
long __gu_err, __gu_val; \ long __gu_err; \
__get_user_size(__gu_val, (ptr), (size), __gu_err); \ __get_user_size((x), (ptr), (size), __gu_err); \
(x) = (__force __typeof__(*(ptr)))__gu_val; \
__gu_err; \ __gu_err; \
}) })
#define __get_user_check(x, ptr, size) \ #define __get_user_check(x, ptr, size) \
({ \ ({ \
long __gu_err = -EFAULT, __gu_val = 0; \ long __gu_err = -EFAULT; \
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
if (access_ok(__gu_addr, size)) \ if (access_ok(__gu_addr, size)) \
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ __get_user_size((x), __gu_addr, (size), __gu_err); \
(x) = (__force __typeof__(*(ptr)))__gu_val; \ else \
(x) = (__typeof__(*(ptr))) 0; \
__gu_err; \ __gu_err; \
}) })
...@@ -191,11 +191,13 @@ do { \ ...@@ -191,11 +191,13 @@ do { \
case 2: __get_user_asm(x, ptr, retval, "l.lhz"); break; \ case 2: __get_user_asm(x, ptr, retval, "l.lhz"); break; \
case 4: __get_user_asm(x, ptr, retval, "l.lwz"); break; \ case 4: __get_user_asm(x, ptr, retval, "l.lwz"); break; \
case 8: __get_user_asm2(x, ptr, retval); break; \ case 8: __get_user_asm2(x, ptr, retval); break; \
default: (x) = __get_user_bad(); \ default: (x) = (__typeof__(*(ptr)))__get_user_bad(); \
} \ } \
} while (0) } while (0)
#define __get_user_asm(x, addr, err, op) \ #define __get_user_asm(x, addr, err, op) \
{ \
unsigned long __gu_tmp; \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: "op" %1,0(%2)\n" \ "1: "op" %1,0(%2)\n" \
"2:\n" \ "2:\n" \
...@@ -209,10 +211,14 @@ do { \ ...@@ -209,10 +211,14 @@ do { \
" .align 2\n" \ " .align 2\n" \
" .long 1b,3b\n" \ " .long 1b,3b\n" \
".previous" \ ".previous" \
: "=r"(err), "=r"(x) \ : "=r"(err), "=r"(__gu_tmp) \
: "r"(addr), "i"(-EFAULT), "0"(err)) : "r"(addr), "i"(-EFAULT), "0"(err)); \
(x) = (__typeof__(*(addr)))__gu_tmp; \
}
#define __get_user_asm2(x, addr, err) \ #define __get_user_asm2(x, addr, err) \
{ \
unsigned long long __gu_tmp; \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: l.lwz %1,0(%2)\n" \ "1: l.lwz %1,0(%2)\n" \
"2: l.lwz %H1,4(%2)\n" \ "2: l.lwz %H1,4(%2)\n" \
...@@ -229,8 +235,11 @@ do { \ ...@@ -229,8 +235,11 @@ do { \
" .long 1b,4b\n" \ " .long 1b,4b\n" \
" .long 2b,4b\n" \ " .long 2b,4b\n" \
".previous" \ ".previous" \
: "=r"(err), "=&r"(x) \ : "=r"(err), "=&r"(__gu_tmp) \
: "r"(addr), "i"(-EFAULT), "0"(err)) : "r"(addr), "i"(-EFAULT), "0"(err)); \
(x) = (__typeof__(*(addr)))( \
(__typeof__((x)-(x)))__gu_tmp); \
}
/* more complex routines */ /* more complex routines */
......
...@@ -80,6 +80,16 @@ static void __init setup_memory(void) ...@@ -80,6 +80,16 @@ static void __init setup_memory(void)
*/ */
memblock_reserve(__pa(_stext), _end - _stext); memblock_reserve(__pa(_stext), _end - _stext);
#ifdef CONFIG_BLK_DEV_INITRD
/* Then reserve the initrd, if any */
if (initrd_start && (initrd_end > initrd_start)) {
unsigned long aligned_start = ALIGN_DOWN(initrd_start, PAGE_SIZE);
unsigned long aligned_end = ALIGN(initrd_end, PAGE_SIZE);
memblock_reserve(__pa(aligned_start), aligned_end - aligned_start);
}
#endif /* CONFIG_BLK_DEV_INITRD */
early_init_fdt_reserve_self(); early_init_fdt_reserve_self();
early_init_fdt_scan_reserved_mem(); early_init_fdt_scan_reserved_mem();
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
static void cache_loop(struct page *page, const unsigned int reg) static __always_inline void cache_loop(struct page *page, const unsigned int reg)
{ {
unsigned long paddr = page_to_pfn(page) << PAGE_SHIFT; unsigned long paddr = page_to_pfn(page) << PAGE_SHIFT;
unsigned long line = paddr & ~(L1_CACHE_BYTES - 1); unsigned long line = paddr & ~(L1_CACHE_BYTES - 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment