Merge tag 'powerpc-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Jan 2019 19:48:44 +0000 (11:48 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Jan 2019 19:48:44 +0000 (11:48 -0800)
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'

arch/powerpc/configs/ppc40x_defconfig
arch/powerpc/kernel/head_booke.h
arch/powerpc/kvm/book3s_64_mmu_radix.c
arch/powerpc/platforms/4xx/ocm.c

index 10fb1df63b4659b4ce93ca63730f2f68ce0451e1..689d7e276769d00bc3efea7213306ec846449085 100644 (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
index 15ac51072eb3ff80a4f9233717c02b696a3cdb5d..306e26c073a043b91d86f42c25075a2771760bf0 100644 (file)
  */
 #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 */\
index fb88167a402a55beec477c84222c3d734f7a3554..1b821c6efdefba002f3c104208857d7b0694b478 100644 (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 */
index f2610a02844a238e391ce4a71fe27e959d9b66d8..a1aaa1569d7ce63793398610b4abdb8a0f38ebe1 100644 (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);