Merge branch 'linus'
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 23 Aug 2022 22:33:19 +0000 (15:33 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 23 Aug 2022 22:33:19 +0000 (15:33 -0700)
arch/parisc/Kconfig
arch/parisc/include/asm/bitops.h
arch/parisc/kernel/head.S
arch/parisc/kernel/unaligned.c
drivers/mmc/host/Kconfig
drivers/parisc/ccio-dma.c
drivers/parisc/led.c
kernel/module/main.c
tools/testing/selftests/lib.mk
tools/testing/selftests/sgx/sigstruct.c

index 7f059cd..9aede24 100644 (file)
@@ -146,10 +146,10 @@ menu "Processor type and features"
 
 choice
        prompt "Processor type"
-       default PA7000
+       default PA7000 if "$(ARCH)" = "parisc"
 
 config PA7000
-       bool "PA7000/PA7100"
+       bool "PA7000/PA7100" if "$(ARCH)" = "parisc"
        help
          This is the processor type of your CPU.  This information is
          used for optimizing purposes.  In order to compile a kernel
@@ -160,21 +160,21 @@ config PA7000
          which is required on some machines.
 
 config PA7100LC
-       bool "PA7100LC"
+       bool "PA7100LC" if "$(ARCH)" = "parisc"
        help
          Select this option for the PCX-L processor, as used in the
          712, 715/64, 715/80, 715/100, 715/100XC, 725/100, 743, 748,
          D200, D210, D300, D310 and E-class
 
 config PA7200
-       bool "PA7200"
+       bool "PA7200" if "$(ARCH)" = "parisc"
        help
          Select this option for the PCX-T' processor, as used in the
          C100, C110, J100, J110, J210XC, D250, D260, D350, D360,
          K100, K200, K210, K220, K400, K410 and K420
 
 config PA7300LC
-       bool "PA7300LC"
+       bool "PA7300LC" if "$(ARCH)" = "parisc"
        help
          Select this option for the PCX-L2 processor, as used in the
          744, A180, B132L, B160L, B180L, C132L, C160L, C180L,
@@ -224,17 +224,8 @@ config MLONGCALLS
          Enabling this option will probably slow down your kernel.
 
 config 64BIT
-       bool "64-bit kernel"
+       def_bool "$(ARCH)" = "parisc64"
        depends on PA8X00
-       help
-         Enable this if you want to support 64bit kernel on PA-RISC platform.
-
-         At the moment, only people willing to use more than 2GB of RAM,
-         or having a 64bit-only capable PA-RISC machine should say Y here.
-
-         Since there is no 64bit userland on PA-RISC, there is no point to
-         enable this option otherwise. The 64bit kernel is significantly bigger
-         and slower than the 32bit one.
 
 choice
        prompt "Kernel page size"
index 56ffd26..0ec9cfc 100644 (file)
 #include <asm/barrier.h>
 #include <linux/atomic.h>
 
-/* compiler build environment sanity checks: */
-#if !defined(CONFIG_64BIT) && defined(__LP64__)
-#error "Please use 'ARCH=parisc' to build the 32-bit kernel."
-#endif
-#if defined(CONFIG_64BIT) && !defined(__LP64__)
-#error "Please use 'ARCH=parisc64' to build the 64-bit kernel."
-#endif
-
 /* See http://marc.theaimsgroup.com/?t=108826637900003 for discussion
  * on use of volatile and __*_bit() (set/clear/change):
  *     *_bit() want use of volatile.
index e0a9e96..fd15fd4 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/init.h>
 #include <linux/pgtable.h>
 
-       .level  PA_ASM_LEVEL
+       .level  1.1
 
        __INITDATA
 ENTRY(boot_args)
@@ -70,6 +70,47 @@ $bss_loop:
        stw,ma          %arg2,4(%r1)
        stw,ma          %arg3,4(%r1)
 
+#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20)
+       /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU
+        * and halt kernel if we detect a PA1.x CPU. */
+       ldi             32,%r10
+       mtctl           %r10,%cr11
+       .level 2.0
+       mfctl,w         %cr11,%r10
+       .level 1.1
+       comib,<>,n      0,%r10,$cpu_ok
+
+       load32          PA(msg1),%arg0
+       ldi             msg1_end-msg1,%arg1
+$iodc_panic:
+       copy            %arg0, %r10
+       copy            %arg1, %r11
+       load32          PA(init_stack),%sp
+#define MEM_CONS 0x3A0
+       ldw             MEM_CONS+32(%r0),%arg0  // HPA
+       ldi             ENTRY_IO_COUT,%arg1
+       ldw             MEM_CONS+36(%r0),%arg2  // SPA
+       ldw             MEM_CONS+8(%r0),%arg3   // layers
+       load32          PA(__bss_start),%r1
+       stw             %r1,-52(%sp)            // arg4
+       stw             %r0,-56(%sp)            // arg5
+       stw             %r10,-60(%sp)           // arg6 = ptr to text
+       stw             %r11,-64(%sp)           // arg7 = len
+       stw             %r0,-68(%sp)            // arg8
+       load32          PA(.iodc_panic_ret), %rp
+       ldw             MEM_CONS+40(%r0),%r1    // ENTRY_IODC
+       bv,n            (%r1)
+.iodc_panic_ret:
+       b .                             /* wait endless with ... */
+       or              %r10,%r10,%r10  /* qemu idle sleep */
+msg1:  .ascii "Can't boot kernel which was built for PA8x00 CPUs on this machine.\r\n"
+msg1_end:
+
+$cpu_ok:
+#endif
+
+       .level  PA_ASM_LEVEL
+
        /* Initialize startup VM. Just map first 16/32 MB of memory */
        load32          PA(swapper_pg_dir),%r4
        mtctl           %r4,%cr24       /* Initialize kernel root pointer */
index bac581b..e8a4d77 100644 (file)
@@ -93,7 +93,7 @@
 #define R1(i) (((i)>>21)&0x1f)
 #define R2(i) (((i)>>16)&0x1f)
 #define R3(i) ((i)&0x1f)
-#define FR3(i) ((((i)<<1)&0x1f)|(((i)>>6)&1))
+#define FR3(i) ((((i)&0x1f)<<1)|(((i)>>6)&1))
 #define IM(i,n) (((i)>>1&((1<<(n-1))-1))|((i)&1?((0-1L)<<(n-1)):0))
 #define IM5_2(i) IM((i)>>16,5)
 #define IM5_3(i) IM((i),5)
index 10c5639..e636088 100644 (file)
@@ -171,6 +171,7 @@ config MMC_SDHCI_OF_ASPEED
 config MMC_SDHCI_OF_ASPEED_TEST
        bool "Tests for the ASPEED SDHCI driver" if !KUNIT_ALL_TESTS
        depends on MMC_SDHCI_OF_ASPEED && KUNIT
+       depends on (MMC_SDHCI_OF_ASPEED=m || KUNIT=y)
        default KUNIT_ALL_TESTS
        help
          Enable KUnit tests for the ASPEED SDHCI driver. Select this
index 9be007c..f223afe 100644 (file)
@@ -268,7 +268,7 @@ static int ioc_count;
 *   Each bit can represent a number of pages.
 *   LSbs represent lower addresses (IOVA's).
 *
-*   This was was copied from sba_iommu.c. Don't try to unify
+*   This was copied from sba_iommu.c. Don't try to unify
 *   the two resource managers unless a way to have different
 *   allocation policies is also adjusted. We'd like to avoid
 *   I/O TLB thrashing by having resource allocation policy
@@ -1380,15 +1380,17 @@ ccio_init_resource(struct resource *res, char *name, void __iomem *ioaddr)
        }
 }
 
-static void __init ccio_init_resources(struct ioc *ioc)
+static int __init ccio_init_resources(struct ioc *ioc)
 {
        struct resource *res = ioc->mmio_region;
        char *name = kmalloc(14, GFP_KERNEL);
-
+       if (unlikely(!name))
+               return -ENOMEM;
        snprintf(name, 14, "GSC Bus [%d/]", ioc->hw_path);
 
        ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low);
        ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv);
+       return 0;
 }
 
 static int new_ioc_area(struct resource *res, unsigned long size,
@@ -1543,7 +1545,10 @@ static int __init ccio_probe(struct parisc_device *dev)
                return -ENOMEM;
        }
        ccio_ioc_init(ioc);
-       ccio_init_resources(ioc);
+       if (ccio_init_resources(ioc)) {
+               kfree(ioc);
+               return -ENOMEM;
+       }
        hppa_dma_ops = &ccio_ops;
 
        hba = kzalloc(sizeof(*hba), GFP_KERNEL);
index 1e4a566..d4be9d2 100644 (file)
@@ -646,7 +646,7 @@ int lcd_print( const char *str )
                cancel_delayed_work_sync(&led_task);
 
        /* copy display string to buffer for procfs */
-       strlcpy(lcd_text, str, sizeof(lcd_text));
+       strscpy(lcd_text, str, sizeof(lcd_text));
 
        /* Set LCD Cursor to 1st character */
        gsc_writeb(lcd_info.reset_cmd1, LCD_CMD_REG);
index 6a477c6..a4e4d84 100644 (file)
@@ -2099,7 +2099,7 @@ static int find_module_sections(struct module *mod, struct load_info *info)
                                              sizeof(*mod->static_call_sites),
                                              &mod->num_static_call_sites);
 #endif
-#ifdef CONFIG_KUNIT
+#if IS_ENABLED(CONFIG_KUNIT)
        mod->kunit_suites = section_objs(info, ".kunit_test_suites",
                                              sizeof(*mod->kunit_suites),
                                              &mod->num_kunit_suites);
index 947fc72..d44c72b 100644 (file)
@@ -40,6 +40,7 @@ ifeq (0,$(MAKELEVEL))
     endif
 endif
 selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST))))
+top_srcdir = $(selfdir)/../../..
 
 # The following are built by lib.mk common compile rules.
 # TEST_CUSTOM_PROGS should be used by tests that require
index 50c5ab1..a07896a 100644 (file)
 #include "defines.h"
 #include "main.h"
 
+/*
+ * FIXME: OpenSSL 3.0 has deprecated some functions. For now just ignore
+ * the warnings.
+ */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 struct q1q2_ctx {
        BN_CTX *bn_ctx;
        BIGNUM *m;