powerpc fixes for 4.21 #2

A fix for the recent access_ok() change, which broke the build. We recently
 added a use of type in order to squash a warning elsewhere about type being
 unused.
 
 A handful of other minor build fixes, and one defconfig update.
 
 Thanks to:
   Christian Lamparter, Christophe Leroy, Diana Craciun, Mathieu Malaterre.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJcL05pAAoJEFHr6jzI4aWAaQIP/iKoKuPvS94Y6DDny4JQTgB5
 5NxOm40Wmylx7DyJQYY55Hdvs6EbitO+5YajW08Buc0EU6yCaSdDlH27ExTFI1c/
 14y59dWXI85NZBo3wTPa0229TDfA8ghw5jwwT8BGEvZe3xSzrKGlGcCuSJGnmEBH
 YOUpTdY34IHR4o8yiIqxEkg0QyPDimqx3fnK/PYRcbwnynxE/QQ7sRDDVtHXvseC
 MuOE5kooac78dDEXsOWrLqGoXpvMqRWdn8YZe17x+fO2dxMrWQbYYZT8IZC2DS1u
 yFxYYU8r4xfQS/EnGrzpn6P/+hNQ1Cj5zhR0mr8m45cDu9hk5py3h5LSp9uhJeqw
 PaYGGNp+v1jEWE8w2XOW3+bSszjUalTMRLV6xfLLGZm+pJrn+cWycN3e05OJuHcK
 Pzjqez+h/cJoahNL1Iw79iGxkS8bHitwdEvAGTv88Y4MzMGBlr1rOU9073yoiJZ2
 iVNLoacdHicAicUZ5g4+H3TQBZ3OU4mQb3XaOwJFspPmsbN5jLZw/YqegqYX1zgT
 l1qpxqhnqPJDjl5bjcBxS5jfGv7mLS2Qyk/r3h9+BSqAMK50eGOBpNaqQs5Zcc2e
 mGEWA+Fd+xIHdGCLlgs3HyhhgoQC/o1VR1usAbncRgaFR4UbiKg+8nMAIpIiyZhK
 zrJIYMekNcuO+k+d/Gtr
 =0vml
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 "A fix for the recent access_ok() change, which broke the build. We
  recently added a use of type in order to squash a warning elsewhere
  about type being unused.

  A handful of other minor build fixes, and one defconfig update.

  Thanks to: Christian Lamparter, Christophe Leroy, Diana Craciun,
  Mathieu Malaterre"

* tag 'powerpc-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc: Drop use of 'type' from access_ok()
  KVM: PPC: Book3S HV: radix: Fix uninitialized var build error
  powerpc/configs: Add PPC4xx_OCM to ppc40x_defconfig
  powerpc/4xx/ocm: Fix phys_addr_t printf warnings
  powerpc/4xx/ocm: Fix compilation error due to PAGE_KERNEL usage
  powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup'
This commit is contained in:
Linus Torvalds 2019-01-05 11:48:44 -08:00
commit f1c2f8857c
4 changed files with 19 additions and 12 deletions

View File

@ -85,3 +85,4 @@ CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_PCBC=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_DES=y
CONFIG_PPC4xx_OCM=y

View File

@ -32,6 +32,16 @@
*/
#define THREAD_NORMSAVE(offset) (THREAD_NORMSAVES + (offset * 4))
#ifdef CONFIG_PPC_FSL_BOOK3E
#define BOOKE_CLEAR_BTB(reg) \
START_BTB_FLUSH_SECTION \
BTB_FLUSH(reg) \
END_BTB_FLUSH_SECTION
#else
#define BOOKE_CLEAR_BTB(reg)
#endif
#define NORMAL_EXCEPTION_PROLOG(intno) \
mtspr SPRN_SPRG_WSCRATCH0, r10; /* save one register */ \
mfspr r10, SPRN_SPRG_THREAD; \
@ -43,9 +53,7 @@
andi. r11, r11, MSR_PR; /* check whether user or kernel */\
mr r11, r1; \
beq 1f; \
START_BTB_FLUSH_SECTION \
BTB_FLUSH(r11) \
END_BTB_FLUSH_SECTION \
BOOKE_CLEAR_BTB(r11) \
/* if from user, start at top of this thread's kernel stack */ \
lwz r11, THREAD_INFO-THREAD(r10); \
ALLOC_STACK_FRAME(r11, THREAD_SIZE); \
@ -131,9 +139,7 @@ END_BTB_FLUSH_SECTION \
stw r9,_CCR(r8); /* save CR on stack */\
mfspr r11,exc_level_srr1; /* check whether user or kernel */\
DO_KVM BOOKE_INTERRUPT_##intno exc_level_srr1; \
START_BTB_FLUSH_SECTION \
BTB_FLUSH(r10) \
END_BTB_FLUSH_SECTION \
BOOKE_CLEAR_BTB(r10) \
andi. r11,r11,MSR_PR; \
mfspr r11,SPRN_SPRG_THREAD; /* if from user, start at top of */\
lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\

View File

@ -33,8 +33,8 @@ unsigned long __kvmhv_copy_tofrom_guest_radix(int lpid, int pid,
gva_t eaddr, void *to, void *from,
unsigned long n)
{
int uninitialized_var(old_pid), old_lpid;
unsigned long quadrant, ret = n;
int old_pid, old_lpid;
bool is_load = !!to;
/* Can't access quadrants 1 or 2 in non-HV mode, call the HV to do it */

View File

@ -179,7 +179,7 @@ static void __init ocm_init_node(int count, struct device_node *node)
/* ioremap the non-cached region */
if (ocm->nc.memtotal) {
ocm->nc.virt = __ioremap(ocm->nc.phys, ocm->nc.memtotal,
_PAGE_EXEC | PAGE_KERNEL_NCG);
_PAGE_EXEC | pgprot_val(PAGE_KERNEL_NCG));
if (!ocm->nc.virt) {
printk(KERN_ERR
@ -194,7 +194,7 @@ static void __init ocm_init_node(int count, struct device_node *node)
if (ocm->c.memtotal) {
ocm->c.virt = __ioremap(ocm->c.phys, ocm->c.memtotal,
_PAGE_EXEC | PAGE_KERNEL);
_PAGE_EXEC | pgprot_val(PAGE_KERNEL));
if (!ocm->c.virt) {
printk(KERN_ERR
@ -237,12 +237,12 @@ static int ocm_debugfs_show(struct seq_file *m, void *v)
continue;
seq_printf(m, "PPC4XX OCM : %d\n", ocm->index);
seq_printf(m, "PhysAddr : 0x%llx\n", ocm->phys);
seq_printf(m, "PhysAddr : %pa[p]\n", &(ocm->phys));
seq_printf(m, "MemTotal : %d Bytes\n", ocm->memtotal);
seq_printf(m, "MemTotal(NC) : %d Bytes\n", ocm->nc.memtotal);
seq_printf(m, "MemTotal(C) : %d Bytes\n\n", ocm->c.memtotal);
seq_printf(m, "NC.PhysAddr : 0x%llx\n", ocm->nc.phys);
seq_printf(m, "NC.PhysAddr : %pa[p]\n", &(ocm->nc.phys));
seq_printf(m, "NC.VirtAddr : 0x%p\n", ocm->nc.virt);
seq_printf(m, "NC.MemTotal : %d Bytes\n", ocm->nc.memtotal);
seq_printf(m, "NC.MemFree : %d Bytes\n", ocm->nc.memfree);
@ -252,7 +252,7 @@ static int ocm_debugfs_show(struct seq_file *m, void *v)
blk->size, blk->owner);
}
seq_printf(m, "\nC.PhysAddr : 0x%llx\n", ocm->c.phys);
seq_printf(m, "\nC.PhysAddr : %pa[p]\n", &(ocm->c.phys));
seq_printf(m, "C.VirtAddr : 0x%p\n", ocm->c.virt);
seq_printf(m, "C.MemTotal : %d Bytes\n", ocm->c.memtotal);
seq_printf(m, "C.MemFree : %d Bytes\n", ocm->c.memfree);