From 7e07b7475b5274b4739511a0d81e29dd8198743b Mon Sep 17 00:00:00 2001 From: Jinchao Wang Date: Sat, 26 Jun 2021 18:20:52 +0800 Subject: [PATCH 01/13] parisc: Replace symbolic permissions with octal permissions Resolve following checkpatch issue, Replace symbolic permissions with octal permissions Signed-off-by: Jinchao Wang Signed-off-by: Helge Deller --- drivers/parisc/led.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 36c6613f7a36..cf91cb024be3 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -250,14 +250,14 @@ static int __init led_create_procfs(void) if (!lcd_no_led_support) { - ent = proc_create_data("led", S_IRUGO|S_IWUSR, proc_pdc_root, + ent = proc_create_data("led", 0644, proc_pdc_root, &led_proc_ops, (void *)LED_NOLCD); /* LED */ if (!ent) return -1; } if (led_type == LED_HASLCD) { - ent = proc_create_data("lcd", S_IRUGO|S_IWUSR, proc_pdc_root, + ent = proc_create_data("lcd", 0644, proc_pdc_root, &led_proc_ops, (void *)LED_HASLCD); /* LCD */ if (!ent) return -1; } From 55b70eed81cba1331773d4aaf5cba2bb07475cd8 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Wed, 7 Jul 2021 15:38:08 +0200 Subject: [PATCH 02/13] parisc: Increase size of gcc stack frame check parisc uses much bigger frames than other architectures, so increase the stack frame check value to avoid compiler warnings. Cc: Arnd Bergmann Cc: Abd-Alrhman Masalkhi Cc: Christoph Hellwig Signed-off-by: Helge Deller --- lib/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 5ddd575159fb..153c5a86aefa 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -346,7 +346,7 @@ config FRAME_WARN int "Warn for stack frames larger than" range 0 8192 default 2048 if GCC_PLUGIN_LATENT_ENTROPY - default 1280 if (!64BIT && PARISC) + default 1536 if (!64BIT && PARISC) default 1024 if (!64BIT && !PARISC) default 2048 if 64BIT help From 7f2dcc7371c1ab6e5d3678a7eff1cb0eb9725de9 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 17 Aug 2021 20:18:09 -0700 Subject: [PATCH 03/13] parisc: math-emu: Avoid "fmt" macro collision The printk "fmt" macro was colliding. Rename like the others with a "bits" suffix. Fixes a build failure: arch/parisc/math-emu/decode_exc.c: In function 'decode_fpu': arch/parisc/math-emu/decode_exc.c:49:14: error: expected identifier before numeric constant 49 | #define fmt 11 /* bits 19 & 20 */ | ^~ ./include/linux/printk.h:379:6: note: in expansion of macro 'fmt' 379 | .fmt = __builtin_constant_p(_fmt) ? (_fmt) : NULL, \ | ^~~ ./include/linux/printk.h:417:3: note: in expansion of macro '__printk_index_emit' 417 | __printk_index_emit(_fmt, NULL, NULL); \ | ^~~~~~~~~~~~~~~~~~~ ./include/linux/printk.h:446:26: note: in expansion of macro 'printk_index_wrap' 446 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ arch/parisc/math-emu/decode_exc.c:339:3: note: in expansion of macro 'printk' 339 | printk("%s(%d) Unknown FPU exception 0x%x\n", __FILE__, | ^~~~~~ Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Helge Deller --- arch/parisc/math-emu/decode_exc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/parisc/math-emu/decode_exc.c b/arch/parisc/math-emu/decode_exc.c index cd8ffc6ceadf..494ca41df05d 100644 --- a/arch/parisc/math-emu/decode_exc.c +++ b/arch/parisc/math-emu/decode_exc.c @@ -46,7 +46,7 @@ #define SIGNALCODE(signal, code) ((signal) << 24 | (code)) #define copropbit 1<<31-2 /* bit position 2 */ #define opclass 9 /* bits 21 & 22 */ -#define fmt 11 /* bits 19 & 20 */ +#define fmtbits 11 /* bits 19 & 20 */ #define df 13 /* bits 17 & 18 */ #define twobits 3 /* mask low-order 2 bits */ #define fivebits 31 /* mask low-order 5 bits */ @@ -57,7 +57,7 @@ #define Excp_instr(index) Instructionfield(Fpu_register[index]) #define Clear_excp_register(index) Allexception(Fpu_register[index]) = 0 #define Excp_format() \ - (current_ir >> ((current_ir>>opclass & twobits)==1 ? df : fmt) & twobits) + (current_ir >> ((current_ir>>opclass & twobits) == 1 ? df : fmtbits) & twobits) /* Miscellaneous definitions */ #define Fpu_sgl(index) Fpu_register[index*2] From 7bf82eb3873fbbee8273f60ddef584194b99f6c1 Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Thu, 15 Jul 2021 14:46:12 +0100 Subject: [PATCH 04/13] parisc: Rename PMD_ORDER to PMD_TABLE_ORDER This is the order of the page table allocation, not the order of a PMD. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Helge Deller --- arch/parisc/include/asm/pgalloc.h | 6 +++--- arch/parisc/include/asm/pgtable.h | 4 ++-- arch/parisc/mm/init.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h index 6a7e98e71f1d..54b63374579b 100644 --- a/arch/parisc/include/asm/pgalloc.h +++ b/arch/parisc/include/asm/pgalloc.h @@ -48,15 +48,15 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) { pmd_t *pmd; - pmd = (pmd_t *)__get_free_pages(GFP_PGTABLE_KERNEL, PMD_ORDER); + pmd = (pmd_t *)__get_free_pages(GFP_PGTABLE_KERNEL, PMD_TABLE_ORDER); if (likely(pmd)) - memset ((void *)pmd, 0, PAGE_SIZE << PMD_ORDER); + memset ((void *)pmd, 0, PAGE_SIZE << PMD_TABLE_ORDER); return pmd; } static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) { - free_pages((unsigned long)pmd, PMD_ORDER); + free_pages((unsigned long)pmd, PMD_TABLE_ORDER); } #endif diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index 43937af127b1..7badd872f05a 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h @@ -112,7 +112,7 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) #define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) #if CONFIG_PGTABLE_LEVELS == 3 -#define PMD_ORDER 1 +#define PMD_TABLE_ORDER 1 #define PGD_ORDER 0 #else #define PGD_ORDER 1 @@ -131,7 +131,7 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) #define PMD_SHIFT (PLD_SHIFT + BITS_PER_PTE) #define PMD_SIZE (1UL << PMD_SHIFT) #define PMD_MASK (~(PMD_SIZE-1)) -#define BITS_PER_PMD (PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY) +#define BITS_PER_PMD (PAGE_SHIFT + PMD_TABLE_ORDER - BITS_PER_PMD_ENTRY) #define PTRS_PER_PMD (1UL << BITS_PER_PMD) #else #define BITS_PER_PMD 0 diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 591a4e939415..3f7d6d5b56ac 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -378,8 +378,8 @@ static void __init map_pages(unsigned long start_vaddr, #if CONFIG_PGTABLE_LEVELS == 3 if (pud_none(*pud)) { - pmd = memblock_alloc(PAGE_SIZE << PMD_ORDER, - PAGE_SIZE << PMD_ORDER); + pmd = memblock_alloc(PAGE_SIZE << PMD_TABLE_ORDER, + PAGE_SIZE << PMD_TABLE_ORDER); if (!pmd) panic("pmd allocation failed.\n"); pud_populate(NULL, pud, pmd); From d220da0967dbda232350c5dc39317e04e0892743 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 25 Aug 2021 00:48:20 +0900 Subject: [PATCH 05/13] parisc: remove unused arch/parisc/boot/install.sh and its phony target Parisc has two similar installation scripts: arch/parisc/install.sh arch/parisc/boot/install.sh The latter is never used because 'make ARCH=parisc install' always invokes the 'install' target in arch/parisc/Makefile. The target in arch/parisc/boot/Makefile is not used either. Signed-off-by: Masahiro Yamada Signed-off-by: Helge Deller --- arch/parisc/boot/Makefile | 4 --- arch/parisc/boot/install.sh | 65 ------------------------------------- 2 files changed, 69 deletions(-) delete mode 100644 arch/parisc/boot/install.sh diff --git a/arch/parisc/boot/Makefile b/arch/parisc/boot/Makefile index 61f44142cfe1..b873ee4720ca 100644 --- a/arch/parisc/boot/Makefile +++ b/arch/parisc/boot/Makefile @@ -15,7 +15,3 @@ $(obj)/bzImage: $(obj)/compressed/vmlinux FORCE $(obj)/compressed/vmlinux: FORCE $(Q)$(MAKE) $(build)=$(obj)/compressed $@ - -install: $(CONFIGURE) $(obj)/bzImage - sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ - System.map "$(INSTALL_PATH)" diff --git a/arch/parisc/boot/install.sh b/arch/parisc/boot/install.sh deleted file mode 100644 index 8f7c365fad83..000000000000 --- a/arch/parisc/boot/install.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# -# arch/parisc/install.sh, derived from arch/i386/boot/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for i386 architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -verify () { - if [ ! -f "$1" ]; then - echo "" 1>&2 - echo " *** Missing file: $1" 1>&2 - echo ' *** You need to run "make" before "make install".' 1>&2 - echo "" 1>&2 - exit 1 - fi -} - -# Make sure the files actually exist - -verify "$2" -verify "$3" - -# User may have a custom install script - -if [ -n "${INSTALLKERNEL}" ]; then - if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi - if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi -fi - -# Default install - -if [ "$(basename $2)" = "zImage" ]; then -# Compressed install - echo "Installing compressed kernel" - base=vmlinuz -else -# Normal install - echo "Installing normal kernel" - base=vmlinux -fi - -if [ -f $4/$base-$1 ]; then - mv $4/$base-$1 $4/$base-$1.old -fi -cat $2 > $4/$base-$1 - -# Install system map file -if [ -f $4/System.map-$1 ]; then - mv $4/System.map-$1 $4/System.map-$1.old -fi -cp $3 $4/System.map-$1 From 87875c1084a28364dad8cd4f9ecbfdfe0b845ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Sat, 7 Aug 2021 11:19:27 +0200 Subject: [PATCH 06/13] parisc: Make struct parisc_driver::remove() return void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The caller of this function (parisc_driver_remove() in arch/parisc/kernel/drivers.c) ignores the return value, so better don't return any value at all to not wake wrong expectations in driver authors. The only function that could return a non-zero value before was ipmi_parisc_remove() which returns the return value of ipmi_si_remove_by_dev(). Make this function return void, too, as for all other callers the value is ignored, too. Also fold in a small checkpatch fix for: WARNING: Unnecessary space before function pointer arguments + void (*remove) (struct parisc_device *dev); Acked-by: Dmitry Torokhov (for drivers/input) Signed-off-by: Uwe Kleine-König Acked-by: Sudip Mukherjee Acked-by: Jiri Slaby Signed-off-by: Helge Deller --- arch/parisc/include/asm/parisc-device.h | 4 ++-- drivers/char/ipmi/ipmi_si.h | 2 +- drivers/char/ipmi/ipmi_si_intf.c | 6 +----- drivers/char/ipmi/ipmi_si_parisc.c | 4 ++-- drivers/char/ipmi/ipmi_si_platform.c | 4 +++- drivers/input/keyboard/hilkbd.c | 4 +--- drivers/input/serio/gscps2.c | 3 +-- drivers/net/ethernet/i825xx/lasi_82596.c | 3 +-- drivers/parport/parport_gsc.c | 3 +-- drivers/scsi/lasi700.c | 4 +--- drivers/scsi/zalon.c | 4 +--- drivers/tty/serial/mux.c | 3 +-- sound/parisc/harmony.c | 3 +-- 13 files changed, 17 insertions(+), 30 deletions(-) diff --git a/arch/parisc/include/asm/parisc-device.h b/arch/parisc/include/asm/parisc-device.h index d02d144c6012..4de3b391d812 100644 --- a/arch/parisc/include/asm/parisc-device.h +++ b/arch/parisc/include/asm/parisc-device.h @@ -34,8 +34,8 @@ struct parisc_driver { struct parisc_driver *next; char *name; const struct parisc_device_id *id_table; - int (*probe) (struct parisc_device *dev); /* New device discovered */ - int (*remove) (struct parisc_device *dev); + int (*probe)(struct parisc_device *dev); /* New device discovered */ + void (*remove)(struct parisc_device *dev); struct device_driver drv; }; diff --git a/drivers/char/ipmi/ipmi_si.h b/drivers/char/ipmi/ipmi_si.h index 0a4c69539f24..a7ead2a4c753 100644 --- a/drivers/char/ipmi/ipmi_si.h +++ b/drivers/char/ipmi/ipmi_si.h @@ -73,7 +73,7 @@ irqreturn_t ipmi_si_irq_handler(int irq, void *data); void ipmi_irq_start_cleanup(struct si_sm_io *io); int ipmi_std_irq_setup(struct si_sm_io *io); void ipmi_irq_finish_setup(struct si_sm_io *io); -int ipmi_si_remove_by_dev(struct device *dev); +void ipmi_si_remove_by_dev(struct device *dev); struct device *ipmi_si_remove_by_data(int addr_space, enum si_type si_type, unsigned long addr); void ipmi_hardcode_init(void); diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 62929a3e397e..bb466981dc1b 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -2228,22 +2228,18 @@ static void cleanup_one_si(struct smi_info *smi_info) kfree(smi_info); } -int ipmi_si_remove_by_dev(struct device *dev) +void ipmi_si_remove_by_dev(struct device *dev) { struct smi_info *e; - int rv = -ENOENT; mutex_lock(&smi_infos_lock); list_for_each_entry(e, &smi_infos, link) { if (e->io.dev == dev) { cleanup_one_si(e); - rv = 0; break; } } mutex_unlock(&smi_infos_lock); - - return rv; } struct device *ipmi_si_remove_by_data(int addr_space, enum si_type si_type, diff --git a/drivers/char/ipmi/ipmi_si_parisc.c b/drivers/char/ipmi/ipmi_si_parisc.c index 11c9160275df..2be2967f6b5f 100644 --- a/drivers/char/ipmi/ipmi_si_parisc.c +++ b/drivers/char/ipmi/ipmi_si_parisc.c @@ -29,9 +29,9 @@ static int __init ipmi_parisc_probe(struct parisc_device *dev) return ipmi_si_add_smi(&io); } -static int __exit ipmi_parisc_remove(struct parisc_device *dev) +static void __exit ipmi_parisc_remove(struct parisc_device *dev) { - return ipmi_si_remove_by_dev(&dev->dev); + ipmi_si_remove_by_dev(&dev->dev); } static const struct parisc_device_id ipmi_parisc_tbl[] __initconst = { diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c index 380a6a542890..505cc978c97a 100644 --- a/drivers/char/ipmi/ipmi_si_platform.c +++ b/drivers/char/ipmi/ipmi_si_platform.c @@ -411,7 +411,9 @@ static int ipmi_probe(struct platform_device *pdev) static int ipmi_remove(struct platform_device *pdev) { - return ipmi_si_remove_by_dev(&pdev->dev); + ipmi_si_remove_by_dev(&pdev->dev); + + return 0; } static int pdev_match_name(struct device *dev, const void *data) diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index 62ccfebf2f60..c1a4d5055de6 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c @@ -316,11 +316,9 @@ static int __init hil_probe_chip(struct parisc_device *dev) return hil_keyb_init(); } -static int __exit hil_remove_chip(struct parisc_device *dev) +static void __exit hil_remove_chip(struct parisc_device *dev) { hil_keyb_exit(); - - return 0; } static const struct parisc_device_id hil_tbl[] __initconst = { diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 2f9775de3c5b..a9065c6ab550 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -411,7 +411,7 @@ static int __init gscps2_probe(struct parisc_device *dev) * @return: success/error report */ -static int __exit gscps2_remove(struct parisc_device *dev) +static void __exit gscps2_remove(struct parisc_device *dev) { struct gscps2port *ps2port = dev_get_drvdata(&dev->dev); @@ -425,7 +425,6 @@ static int __exit gscps2_remove(struct parisc_device *dev) #endif dev_set_drvdata(&dev->dev, NULL); kfree(ps2port); - return 0; } diff --git a/drivers/net/ethernet/i825xx/lasi_82596.c b/drivers/net/ethernet/i825xx/lasi_82596.c index 96c6f4f36904..48e001881c75 100644 --- a/drivers/net/ethernet/i825xx/lasi_82596.c +++ b/drivers/net/ethernet/i825xx/lasi_82596.c @@ -196,7 +196,7 @@ lan_init_chip(struct parisc_device *dev) return retval; } -static int __exit lan_remove_chip(struct parisc_device *pdev) +static void __exit lan_remove_chip(struct parisc_device *pdev) { struct net_device *dev = parisc_get_drvdata(pdev); struct i596_private *lp = netdev_priv(dev); @@ -205,7 +205,6 @@ static int __exit lan_remove_chip(struct parisc_device *pdev) dma_free_noncoherent(&pdev->dev, sizeof(struct i596_private), lp->dma, lp->dma_addr, DMA_BIDIRECTIONAL); free_netdev (dev); - return 0; } static const struct parisc_device_id lan_tbl[] __initconst = { diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 1e43b3f399a8..4332692ca4b8 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -378,7 +378,7 @@ static int __init parport_init_chip(struct parisc_device *dev) return 0; } -static int __exit parport_remove_chip(struct parisc_device *dev) +static void __exit parport_remove_chip(struct parisc_device *dev) { struct parport *p = dev_get_drvdata(&dev->dev); if (p) { @@ -397,7 +397,6 @@ static int __exit parport_remove_chip(struct parisc_device *dev) parport_put_port(p); kfree (ops); /* hope no-one cached it */ } - return 0; } static const struct parisc_device_id parport_tbl[] __initconst = { diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c index 6d14a7a94d0b..86fe19e0468d 100644 --- a/drivers/scsi/lasi700.c +++ b/drivers/scsi/lasi700.c @@ -134,7 +134,7 @@ lasi700_probe(struct parisc_device *dev) return -ENODEV; } -static int __exit +static void __exit lasi700_driver_remove(struct parisc_device *dev) { struct Scsi_Host *host = dev_get_drvdata(&dev->dev); @@ -146,8 +146,6 @@ lasi700_driver_remove(struct parisc_device *dev) free_irq(host->irq, host); iounmap(hostdata->base); kfree(hostdata); - - return 0; } static struct parisc_driver lasi700_driver __refdata = { diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c index 7eac76cccc4c..f1e5cf8a17d9 100644 --- a/drivers/scsi/zalon.c +++ b/drivers/scsi/zalon.c @@ -168,15 +168,13 @@ static const struct parisc_device_id zalon_tbl[] __initconst = { MODULE_DEVICE_TABLE(parisc, zalon_tbl); -static int __exit zalon_remove(struct parisc_device *dev) +static void __exit zalon_remove(struct parisc_device *dev) { struct Scsi_Host *host = dev_get_drvdata(&dev->dev); scsi_remove_host(host); ncr53c8xx_release(host); free_irq(dev->irq, host); - - return 0; } static struct parisc_driver zalon_driver __refdata = { diff --git a/drivers/tty/serial/mux.c b/drivers/tty/serial/mux.c index be640d9863cd..643dfbcc43f9 100644 --- a/drivers/tty/serial/mux.c +++ b/drivers/tty/serial/mux.c @@ -496,7 +496,7 @@ static int __init mux_probe(struct parisc_device *dev) return 0; } -static int __exit mux_remove(struct parisc_device *dev) +static void __exit mux_remove(struct parisc_device *dev) { int i, j; int port_count = (long)dev_get_drvdata(&dev->dev); @@ -518,7 +518,6 @@ static int __exit mux_remove(struct parisc_device *dev) } release_mem_region(dev->hpa.start + MUX_OFFSET, port_count * MUX_LINE_OFFSET); - return 0; } /* Hack. This idea was taken from the 8250_gsc.c on how to properly order diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c index 1440db8b4177..2e3e5aa47682 100644 --- a/sound/parisc/harmony.c +++ b/sound/parisc/harmony.c @@ -968,11 +968,10 @@ snd_harmony_probe(struct parisc_device *padev) return err; } -static int __exit +static void __exit snd_harmony_remove(struct parisc_device *padev) { snd_card_free(parisc_get_drvdata(padev)); - return 0; } static struct parisc_driver snd_harmony_driver __refdata = { From 0c38502cee6f63a27c7af476948eac18e067d5ff Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sun, 22 Aug 2021 22:29:01 +0200 Subject: [PATCH 07/13] parisc: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller --- drivers/parisc/ccio-dma.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index b5f9ee81a46c..4cd4058218b7 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -518,9 +518,9 @@ typedef unsigned long space_t; ** when it passes in BIDIRECTIONAL flag. */ static u32 hint_lookup[] = { - [PCI_DMA_BIDIRECTIONAL] = HINT_STOP_MOST | HINT_SAFE_DMA | IOPDIR_VALID, - [PCI_DMA_TODEVICE] = HINT_STOP_MOST | HINT_PREFETCH | IOPDIR_VALID, - [PCI_DMA_FROMDEVICE] = HINT_STOP_MOST | IOPDIR_VALID, + [DMA_BIDIRECTIONAL] = HINT_STOP_MOST | HINT_SAFE_DMA | IOPDIR_VALID, + [DMA_TO_DEVICE] = HINT_STOP_MOST | HINT_PREFETCH | IOPDIR_VALID, + [DMA_FROM_DEVICE] = HINT_STOP_MOST | IOPDIR_VALID, }; /** @@ -860,7 +860,7 @@ ccio_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag, if (ret) { memset(ret, 0, size); - *dma_handle = ccio_map_single(dev, ret, size, PCI_DMA_BIDIRECTIONAL); + *dma_handle = ccio_map_single(dev, ret, size, DMA_BIDIRECTIONAL); } return ret; From 6ef4661cad32b5098ffb31be3282c866befde85f Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 12 Aug 2021 01:41:16 +0900 Subject: [PATCH 08/13] parisc: move core-y in arch/parisc/Makefile to arch/parisc/Kbuild Use obj-y to clean up Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Helge Deller --- arch/parisc/Kbuild | 1 + arch/parisc/Makefile | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/parisc/Kbuild b/arch/parisc/Kbuild index a4e40e534e6a..3c068b700a81 100644 --- a/arch/parisc/Kbuild +++ b/arch/parisc/Kbuild @@ -1 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-y += mm/ kernel/ math-emu/ diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index aed8ea29268b..6c27940eff03 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile @@ -111,9 +111,6 @@ KBUILD_CFLAGS += $(cflags-y) LIBGCC := $(shell $(CC) -print-libgcc-file-name) export LIBGCC -kernel-y := mm/ kernel/ math-emu/ - -core-y += $(addprefix arch/parisc/, $(kernel-y)) libs-y += arch/parisc/lib/ $(LIBGCC) boot := arch/parisc/boot From ab9c13a4b539709c7a080089b34de1bf4d1024d0 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Mon, 23 Aug 2021 23:30:39 +0200 Subject: [PATCH 09/13] parisc/parport_gsc: switch from 'pci_' to 'dma_' API The wrappers in include/linux/pci-dma-compat.h should go away. Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller --- drivers/parport/parport_gsc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 4332692ca4b8..0dcc497b0449 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -390,9 +390,8 @@ static void __exit parport_remove_chip(struct parisc_device *dev) if (p->irq != PARPORT_IRQ_NONE) free_irq(p->irq, p); if (priv->dma_buf) - pci_free_consistent(priv->dev, PAGE_SIZE, - priv->dma_buf, - priv->dma_handle); + dma_free_coherent(&priv->dev->dev, PAGE_SIZE, + priv->dma_buf, priv->dma_handle); kfree (p->private_data); parport_put_port(p); kfree (ops); /* hope no-one cached it */ From 8ef5b28d670b76601e14476b00a505854abc838b Mon Sep 17 00:00:00 2001 From: Shubhankar Kuranagatti Date: Wed, 28 Apr 2021 21:09:42 +0530 Subject: [PATCH 10/13] parisc: ccio-dma.c: Added tab instead of spaces Single spaces has been removed and replaced with tabs. This is done to maintain code uniformity. Signed-off-by: Shubhankar Kuranagatti Reported-by: kernel test robot Signed-off-by: Helge Deller --- drivers/parisc/ccio-dma.c | 84 +++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 4cd4058218b7..021b0c69bc9a 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -111,29 +111,29 @@ #define CMD_TLB_PURGE 33 /* IO_COMMAND to Purge I/O TLB entry */ struct ioa_registers { - /* Runway Supervisory Set */ - int32_t unused1[12]; - uint32_t io_command; /* Offset 12 */ - uint32_t io_status; /* Offset 13 */ - uint32_t io_control; /* Offset 14 */ - int32_t unused2[1]; + /* Runway Supervisory Set */ + int32_t unused1[12]; + uint32_t io_command; /* Offset 12 */ + uint32_t io_status; /* Offset 13 */ + uint32_t io_control; /* Offset 14 */ + int32_t unused2[1]; - /* Runway Auxiliary Register Set */ - uint32_t io_err_resp; /* Offset 0 */ - uint32_t io_err_info; /* Offset 1 */ - uint32_t io_err_req; /* Offset 2 */ - uint32_t io_err_resp_hi; /* Offset 3 */ - uint32_t io_tlb_entry_m; /* Offset 4 */ - uint32_t io_tlb_entry_l; /* Offset 5 */ - uint32_t unused3[1]; - uint32_t io_pdir_base; /* Offset 7 */ - uint32_t io_io_low_hv; /* Offset 8 */ - uint32_t io_io_high_hv; /* Offset 9 */ - uint32_t unused4[1]; - uint32_t io_chain_id_mask; /* Offset 11 */ - uint32_t unused5[2]; - uint32_t io_io_low; /* Offset 14 */ - uint32_t io_io_high; /* Offset 15 */ + /* Runway Auxiliary Register Set */ + uint32_t io_err_resp; /* Offset 0 */ + uint32_t io_err_info; /* Offset 1 */ + uint32_t io_err_req; /* Offset 2 */ + uint32_t io_err_resp_hi; /* Offset 3 */ + uint32_t io_tlb_entry_m; /* Offset 4 */ + uint32_t io_tlb_entry_l; /* Offset 5 */ + uint32_t unused3[1]; + uint32_t io_pdir_base; /* Offset 7 */ + uint32_t io_io_low_hv; /* Offset 8 */ + uint32_t io_io_high_hv; /* Offset 9 */ + uint32_t unused4[1]; + uint32_t io_chain_id_mask; /* Offset 11 */ + uint32_t unused5[2]; + uint32_t io_io_low; /* Offset 14 */ + uint32_t io_io_high; /* Offset 15 */ }; /* @@ -198,7 +198,7 @@ struct ioa_registers { ** In order for a Runway address to reside within GSC+ extended address space: ** Runway Address [0:7] must identically compare to 8'b11111111 ** Runway Address [8:11] must be equal to IO_IO_LOW(_HV)[16:19] -** Runway Address [12:23] must be greater than or equal to +** Runway Address [12:23] must be greater than or equal to ** IO_IO_LOW(_HV)[20:31] and less than IO_IO_HIGH(_HV)[20:31]. ** Runway Address [24:39] is not used in the comparison. ** @@ -226,10 +226,10 @@ struct ioc { struct ioa_registers __iomem *ioc_regs; /* I/O MMU base address */ u8 *res_map; /* resource map, bit == pdir entry */ u64 *pdir_base; /* physical base address */ - u32 pdir_size; /* bytes, function of IOV Space size */ - u32 res_hint; /* next available IOVP - + u32 pdir_size; /* bytes, function of IOV Space size */ + u32 res_hint; /* next available IOVP - circular search */ - u32 res_size; /* size of resource map in bytes */ + u32 res_size; /* size of resource map in bytes */ spinlock_t res_lock; #ifdef CCIO_COLLECT_STATS @@ -249,7 +249,7 @@ struct ioc { unsigned short cujo20_bug; /* STUFF We don't need in performance path */ - u32 chainid_shift; /* specify bit location of chain_id */ + u32 chainid_shift; /* specify bit location of chain_id */ struct ioc *next; /* Linked list of discovered iocs */ const char *name; /* device name from firmware */ unsigned int hw_path; /* the hardware path this ioc is associatd with */ @@ -293,7 +293,7 @@ static int ioc_count; ** cause the kernel to panic anyhow. */ #define CCIO_SEARCH_LOOP(ioc, res_idx, mask, size) \ - for(; res_ptr < res_end; ++res_ptr) { \ + for (; res_ptr < res_end; ++res_ptr) { \ int ret;\ unsigned int idx;\ idx = (unsigned int)((unsigned long)res_ptr - (unsigned long)ioc->res_map); \ @@ -309,9 +309,9 @@ static int ioc_count; #define CCIO_FIND_FREE_MAPPING(ioa, res_idx, mask, size) \ u##size *res_ptr = (u##size *)&((ioc)->res_map[ioa->res_hint & ~((size >> 3) - 1)]); \ u##size *res_end = (u##size *)&(ioc)->res_map[ioa->res_size]; \ - CCIO_SEARCH_LOOP(ioc, res_idx, mask, size); \ - res_ptr = (u##size *)&(ioc)->res_map[0]; \ - CCIO_SEARCH_LOOP(ioa, res_idx, mask, size); + CCIO_SEARCH_LOOP(ioc, res_idx, mask, size); \ + res_ptr = (u##size *)&(ioc)->res_map[0]; \ + CCIO_SEARCH_LOOP(ioa, res_idx, mask, size); /* ** Find available bit in this ioa's resource map. @@ -348,9 +348,9 @@ ccio_alloc_range(struct ioc *ioc, struct device *dev, size_t size) BUG_ON(pages_needed == 0); BUG_ON((pages_needed * IOVP_SIZE) > DMA_CHUNK_SIZE); - - DBG_RES("%s() size: %d pages_needed %d\n", - __func__, size, pages_needed); + + DBG_RES("%s() size: %d pages_needed %d\n", + __func__, size, pages_needed); /* ** "seek and ye shall find"...praying never hurts either... @@ -416,7 +416,7 @@ ccio_alloc_range(struct ioc *ioc, struct device *dev, size_t size) #define CCIO_FREE_MAPPINGS(ioc, res_idx, mask, size) \ u##size *res_ptr = (u##size *)&((ioc)->res_map[res_idx]); \ BUG_ON((*res_ptr & mask) != mask); \ - *res_ptr &= ~(mask); + *res_ptr &= ~(mask); /** * ccio_free_range - Free pages from the ioc's resource map. @@ -845,7 +845,7 @@ static void * ccio_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag, unsigned long attrs) { - void *ret; + void *ret; #if 0 /* GRANT Need to establish hierarchy for non-PCI devs as well ** and then provide matching gsc_map_xxx() functions for them as well. @@ -856,7 +856,7 @@ ccio_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag, return 0; } #endif - ret = (void *) __get_free_pages(flag, get_order(size)); + ret = (void *) __get_free_pages(flag, get_order(size)); if (ret) { memset(ret, 0, size); @@ -1022,8 +1022,8 @@ static const struct dma_map_ops ccio_ops = { .free = ccio_free, .map_page = ccio_map_page, .unmap_page = ccio_unmap_page, - .map_sg = ccio_map_sg, - .unmap_sg = ccio_unmap_sg, + .map_sg = ccio_map_sg, + .unmap_sg = ccio_unmap_sg, .get_sgtable = dma_common_get_sgtable, .alloc_pages = dma_common_alloc_pages, .free_pages = dma_common_free_pages, @@ -1080,7 +1080,7 @@ static int ccio_proc_info(struct seq_file *m, void *p) max = ioc->usingle_pages - ioc->usg_pages; seq_printf(m, "pci_unmap_single: %8ld calls %8ld pages (avg %d/1000)\n", min, max, (int)((max * 1000)/min)); - + seq_printf(m, "pci_map_sg() : %8ld calls %8ld pages (avg %d/1000)\n", ioc->msg_calls, ioc->msg_pages, (int)((ioc->msg_pages * 1000)/ioc->msg_calls)); @@ -1169,7 +1169,7 @@ void __init ccio_cujo20_fixup(struct parisc_device *cujo, u32 iovp) idx = PDIR_INDEX(iovp) >> 3; while (idx < ioc->res_size) { - res_ptr[idx] |= 0xff; + res_ptr[idx] |= 0xff; idx += PDIR_INDEX(CUJO_20_STEP) >> 3; } } @@ -1297,7 +1297,7 @@ ccio_ioc_init(struct ioc *ioc) DBG_INIT(" base %p\n", ioc->pdir_base); /* resource map size dictated by pdir_size */ - ioc->res_size = (ioc->pdir_size / sizeof(u64)) >> 3; + ioc->res_size = (ioc->pdir_size / sizeof(u64)) >> 3; DBG_INIT("%s() res_size 0x%x\n", __func__, ioc->res_size); ioc->res_map = (u8 *)__get_free_pages(GFP_KERNEL, From 5f6e0fe01b6b33894cf6f61b359ab5a6d2b7674e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 10 Jun 2021 11:03:31 +0900 Subject: [PATCH 11/13] parisc: Fix compile failure when building 64-bit kernel natively Commit 23243c1ace9f ("arch: use cross_compiling to check whether it is a cross build or not") broke 64-bit parisc builds on 32-bit parisc systems. Helge mentioned: - 64-bit parisc userspace is not supported yet [1] - hppa gcc does not support "-m64" flag [2] That means, parisc developers working on a 32-bit parisc machine need to use hppa64-linux-gnu-gcc (cross compiler) for building the 64-bit parisc kernel. After the offending commit, gcc is used in such a case because both $(SRCARCH) and $(SUBARCH) are 'parisc', hence cross_compiling is unset. A correct way is to introduce ARCH=parisc64 because building the 64-bit parisc kernel on a 32-bit parisc system is not exactly a native build, but rather a semi-cross build. [1]: https://lore.kernel.org/linux-parisc/5dfd81eb-c8ca-b7f5-e80e-8632767c022d@gmx.de/#t [2]: https://lore.kernel.org/linux-parisc/89515325-fc21-31da-d238-6f7a9abbf9a0@gmx.de/ Fixes: 23243c1ace9f ("arch: use cross_compiling to check whether it is a cross build or not") Signed-off-by: Masahiro Yamada Reported-by: Meelis Roos Tested-by: Meelis Roos Cc: # v5.13+ Signed-off-by: Helge Deller --- Makefile | 5 +++++ arch/parisc/Makefile | 6 +++--- scripts/subarch.include | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 61741e9d9c6e..79284e3383c2 100644 --- a/Makefile +++ b/Makefile @@ -404,6 +404,11 @@ ifeq ($(ARCH),sparc64) SRCARCH := sparc endif +# Additional ARCH settings for parisc +ifeq ($(ARCH),parisc64) + SRCARCH := parisc +endif + export cross_compiling := ifneq ($(SRCARCH),$(SUBARCH)) cross_compiling := 1 diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 6c27940eff03..fcde3ffa0221 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile @@ -25,18 +25,18 @@ CHECKFLAGS += -D__hppa__=1 ifdef CONFIG_64BIT UTS_MACHINE := parisc64 CHECKFLAGS += -D__LP64__=1 -CC_ARCHES = hppa64 LD_BFD := elf64-hppa-linux else # 32-bit -CC_ARCHES = hppa hppa2.0 hppa1.1 LD_BFD := elf32-hppa-linux endif # select defconfig based on actual architecture -ifeq ($(shell uname -m),parisc64) +ifeq ($(ARCH),parisc64) KBUILD_DEFCONFIG := generic-64bit_defconfig + CC_ARCHES := hppa64 else KBUILD_DEFCONFIG := generic-32bit_defconfig + CC_ARCHES := hppa hppa2.0 hppa1.1 endif export LD_BFD diff --git a/scripts/subarch.include b/scripts/subarch.include index 650682821126..776849a3c500 100644 --- a/scripts/subarch.include +++ b/scripts/subarch.include @@ -7,7 +7,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ -e s/sun4u/sparc64/ \ -e s/arm.*/arm/ -e s/sa110/arm/ \ - -e s/s390x/s390/ -e s/parisc64/parisc/ \ + -e s/s390x/s390/ \ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \ -e s/riscv.*/riscv/) From 030f653078316a9cc9ca6bd1b0234dcf858be35d Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Mon, 30 Aug 2021 05:42:27 -0400 Subject: [PATCH 12/13] parisc: fix crash with signals and alloca I was debugging some crashes on parisc and I found out that there is a crash possibility if a function using alloca is interrupted by a signal. The reason for the crash is that the gcc alloca implementation leaves garbage in the upper 32 bits of the sp register. This normally doesn't matter (the upper bits are ignored because the PSW W-bit is clear), however the signal delivery routine in the kernel uses full 64 bits of sp and it fails with -EFAULT if the upper 32 bits are not zero. I created this program that demonstrates the problem: #include #include #include #include static __attribute__((noinline,noclone)) void aa(int *size) { void * volatile p = alloca(-*size); while (1) ; } static void handler(int sig) { write(1, "signal delivered\n", 17); _exit(0); } int main(void) { int size = -0x100; signal(SIGALRM, handler); alarm(1); aa(&size); } If you compile it with optimizations, it will crash. The "aa" function has this disassembly: 000106a0 : 106a0: 08 03 02 41 copy r3,r1 106a4: 08 1e 02 43 copy sp,r3 106a8: 6f c1 00 80 stw,ma r1,40(sp) 106ac: 37 dc 3f c1 ldo -20(sp),ret0 106b0: 0c 7c 12 90 stw ret0,8(r3) 106b4: 0f 40 10 9c ldw 0(r26),ret0 ; ret0 = 0x00000000FFFFFF00 106b8: 97 9c 00 7e subi 3f,ret0,ret0 ; ret0 = 0xFFFFFFFF0000013F 106bc: d7 80 1c 1a depwi 0,31,6,ret0 ; ret0 = 0xFFFFFFFF00000100 106c0: 0b 9e 0a 1e add,l sp,ret0,sp ; sp = 0xFFFFFFFFxxxxxxxx 106c4: e8 1f 1f f7 b,l,n 106c4 ,r0 This patch fixes the bug by truncating the "usp" variable to 32 bits. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Helge Deller --- arch/parisc/kernel/signal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index fb1e94a3982b..db1a47cf424d 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c @@ -237,6 +237,12 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs, #endif usp = (regs->gr[30] & ~(0x01UL)); +#ifdef CONFIG_64BIT + if (is_compat_task()) { + /* The gcc alloca implementation leaves garbage in the upper 32 bits of sp */ + usp = (compat_uint_t)usp; + } +#endif /*FIXME: frame_size parameter is unused, remove it. */ frame = get_sigframe(&ksig->ka, usp, sizeof(*frame)); From 6f1fce595b78b775d7fb585c15c2dc3a6994f96e Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Wed, 1 Sep 2021 22:18:18 +0200 Subject: [PATCH 13/13] parisc: math-emu: Fix fall-through warnings Fix lots of fallthrough warnings, e.g.: arch/parisc/math-emu/fpudispatch.c:323:33: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Helge Deller --- arch/parisc/math-emu/fpudispatch.c | 56 ++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/arch/parisc/math-emu/fpudispatch.c b/arch/parisc/math-emu/fpudispatch.c index 7c46969ead9b..01ed133227c2 100644 --- a/arch/parisc/math-emu/fpudispatch.c +++ b/arch/parisc/math-emu/fpudispatch.c @@ -310,12 +310,15 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) r1 &= ~3; fpregs[t+3] = fpregs[r1+3]; fpregs[t+2] = fpregs[r1+2]; + fallthrough; case 1: /* double */ fpregs[t+1] = fpregs[r1+1]; + fallthrough; case 0: /* single */ fpregs[t] = fpregs[r1]; return(NOEXCEPTION); } + BUG(); case 3: /* FABS */ switch (fmt) { case 2: /* illegal */ @@ -325,13 +328,16 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) r1 &= ~3; fpregs[t+3] = fpregs[r1+3]; fpregs[t+2] = fpregs[r1+2]; + fallthrough; case 1: /* double */ fpregs[t+1] = fpregs[r1+1]; + fallthrough; case 0: /* single */ /* copy and clear sign bit */ fpregs[t] = fpregs[r1] & 0x7fffffff; return(NOEXCEPTION); } + BUG(); case 6: /* FNEG */ switch (fmt) { case 2: /* illegal */ @@ -341,13 +347,16 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) r1 &= ~3; fpregs[t+3] = fpregs[r1+3]; fpregs[t+2] = fpregs[r1+2]; + fallthrough; case 1: /* double */ fpregs[t+1] = fpregs[r1+1]; + fallthrough; case 0: /* single */ /* copy and invert sign bit */ fpregs[t] = fpregs[r1] ^ 0x80000000; return(NOEXCEPTION); } + BUG(); case 7: /* FNEGABS */ switch (fmt) { case 2: /* illegal */ @@ -357,13 +366,16 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) r1 &= ~3; fpregs[t+3] = fpregs[r1+3]; fpregs[t+2] = fpregs[r1+2]; + fallthrough; case 1: /* double */ fpregs[t+1] = fpregs[r1+1]; + fallthrough; case 0: /* single */ /* copy and set sign bit */ fpregs[t] = fpregs[r1] | 0x80000000; return(NOEXCEPTION); } + BUG(); case 4: /* FSQRT */ switch (fmt) { case 0: @@ -376,6 +388,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: /* quad not implemented */ return(MAJOR_0C_EXCP); } + BUG(); case 5: /* FRND */ switch (fmt) { case 0: @@ -389,7 +402,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) return(MAJOR_0C_EXCP); } } /* end of switch (subop) */ - + BUG(); case 1: /* class 1 */ df = extru(ir,fpdfpos,2); /* get dest format */ if ((df & 2) || (fmt & 2)) { @@ -419,6 +432,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: /* dbl/dbl */ return(MAJOR_0C_EXCP); } + BUG(); case 1: /* FCNVXF */ switch(fmt) { case 0: /* sgl/sgl */ @@ -434,6 +448,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) return(dbl_to_dbl_fcnvxf(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 2: /* FCNVFX */ switch(fmt) { case 0: /* sgl/sgl */ @@ -449,6 +464,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) return(dbl_to_dbl_fcnvfx(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 3: /* FCNVFXT */ switch(fmt) { case 0: /* sgl/sgl */ @@ -464,6 +480,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) return(dbl_to_dbl_fcnvfxt(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 5: /* FCNVUF (PA2.0 only) */ switch(fmt) { case 0: /* sgl/sgl */ @@ -479,6 +496,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) return(dbl_to_dbl_fcnvuf(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 6: /* FCNVFU (PA2.0 only) */ switch(fmt) { case 0: /* sgl/sgl */ @@ -494,6 +512,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) return(dbl_to_dbl_fcnvfu(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 7: /* FCNVFUT (PA2.0 only) */ switch(fmt) { case 0: /* sgl/sgl */ @@ -509,10 +528,11 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) return(dbl_to_dbl_fcnvfut(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 4: /* undefined */ return(MAJOR_0C_EXCP); } /* end of switch subop */ - + BUG(); case 2: /* class 2 */ fpu_type_flags=fpregs[FPU_TYPE_FLAG_POS]; r2 = extru(ir, fpr2pos, 5) * sizeof(double)/sizeof(u_int); @@ -590,6 +610,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: /* quad not implemented */ return(MAJOR_0C_EXCP); } + BUG(); case 1: /* FTEST */ switch (fmt) { case 0: @@ -609,8 +630,10 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: return(MAJOR_0C_EXCP); } + BUG(); } /* end of switch subop */ } /* end of else for PA1.0 & PA1.1 */ + BUG(); case 3: /* class 3 */ r2 = extru(ir,fpr2pos,5) * sizeof(double)/sizeof(u_int); if (r2 == 0) @@ -633,6 +656,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: /* quad not implemented */ return(MAJOR_0C_EXCP); } + BUG(); case 1: /* FSUB */ switch (fmt) { case 0: @@ -645,6 +669,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: /* quad not implemented */ return(MAJOR_0C_EXCP); } + BUG(); case 2: /* FMPY */ switch (fmt) { case 0: @@ -657,6 +682,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: /* quad not implemented */ return(MAJOR_0C_EXCP); } + BUG(); case 3: /* FDIV */ switch (fmt) { case 0: @@ -669,6 +695,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: /* quad not implemented */ return(MAJOR_0C_EXCP); } + BUG(); case 4: /* FREM */ switch (fmt) { case 0: @@ -681,6 +708,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) case 3: /* quad not implemented */ return(MAJOR_0C_EXCP); } + BUG(); } /* end of class 3 switch */ } /* end of switch(class) */ @@ -736,10 +764,12 @@ u_int fpregs[]; return(MAJOR_0E_EXCP); case 1: /* double */ fpregs[t+1] = fpregs[r1+1]; + fallthrough; case 0: /* single */ fpregs[t] = fpregs[r1]; return(NOEXCEPTION); } + BUG(); case 3: /* FABS */ switch (fmt) { case 2: @@ -747,10 +777,12 @@ u_int fpregs[]; return(MAJOR_0E_EXCP); case 1: /* double */ fpregs[t+1] = fpregs[r1+1]; + fallthrough; case 0: /* single */ fpregs[t] = fpregs[r1] & 0x7fffffff; return(NOEXCEPTION); } + BUG(); case 6: /* FNEG */ switch (fmt) { case 2: @@ -758,10 +790,12 @@ u_int fpregs[]; return(MAJOR_0E_EXCP); case 1: /* double */ fpregs[t+1] = fpregs[r1+1]; + fallthrough; case 0: /* single */ fpregs[t] = fpregs[r1] ^ 0x80000000; return(NOEXCEPTION); } + BUG(); case 7: /* FNEGABS */ switch (fmt) { case 2: @@ -769,10 +803,12 @@ u_int fpregs[]; return(MAJOR_0E_EXCP); case 1: /* double */ fpregs[t+1] = fpregs[r1+1]; + fallthrough; case 0: /* single */ fpregs[t] = fpregs[r1] | 0x80000000; return(NOEXCEPTION); } + BUG(); case 4: /* FSQRT */ switch (fmt) { case 0: @@ -785,6 +821,7 @@ u_int fpregs[]; case 3: return(MAJOR_0E_EXCP); } + BUG(); case 5: /* FRMD */ switch (fmt) { case 0: @@ -798,7 +835,7 @@ u_int fpregs[]; return(MAJOR_0E_EXCP); } } /* end of switch (subop */ - + BUG(); case 1: /* class 1 */ df = extru(ir,fpdfpos,2); /* get dest format */ /* @@ -826,6 +863,7 @@ u_int fpregs[]; case 3: /* dbl/dbl */ return(MAJOR_0E_EXCP); } + BUG(); case 1: /* FCNVXF */ switch(fmt) { case 0: /* sgl/sgl */ @@ -841,6 +879,7 @@ u_int fpregs[]; return(dbl_to_dbl_fcnvxf(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 2: /* FCNVFX */ switch(fmt) { case 0: /* sgl/sgl */ @@ -856,6 +895,7 @@ u_int fpregs[]; return(dbl_to_dbl_fcnvfx(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 3: /* FCNVFXT */ switch(fmt) { case 0: /* sgl/sgl */ @@ -871,6 +911,7 @@ u_int fpregs[]; return(dbl_to_dbl_fcnvfxt(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 5: /* FCNVUF (PA2.0 only) */ switch(fmt) { case 0: /* sgl/sgl */ @@ -886,6 +927,7 @@ u_int fpregs[]; return(dbl_to_dbl_fcnvuf(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 6: /* FCNVFU (PA2.0 only) */ switch(fmt) { case 0: /* sgl/sgl */ @@ -901,6 +943,7 @@ u_int fpregs[]; return(dbl_to_dbl_fcnvfu(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 7: /* FCNVFUT (PA2.0 only) */ switch(fmt) { case 0: /* sgl/sgl */ @@ -916,9 +959,11 @@ u_int fpregs[]; return(dbl_to_dbl_fcnvfut(&fpregs[r1],0, &fpregs[t],status)); } + BUG(); case 4: /* undefined */ return(MAJOR_0C_EXCP); } /* end of switch subop */ + BUG(); case 2: /* class 2 */ /* * Be careful out there. @@ -994,6 +1039,7 @@ u_int fpregs[]; } } /* end of switch subop */ } /* end of else for PA1.0 & PA1.1 */ + BUG(); case 3: /* class 3 */ /* * Be careful out there. @@ -1026,6 +1072,7 @@ u_int fpregs[]; return(dbl_fadd(&fpregs[r1],&fpregs[r2], &fpregs[t],status)); } + BUG(); case 1: /* FSUB */ switch (fmt) { case 0: @@ -1035,6 +1082,7 @@ u_int fpregs[]; return(dbl_fsub(&fpregs[r1],&fpregs[r2], &fpregs[t],status)); } + BUG(); case 2: /* FMPY or XMPYU */ /* * check for integer multiply (x bit set) @@ -1071,6 +1119,7 @@ u_int fpregs[]; &fpregs[r2],&fpregs[t],status)); } } + BUG(); case 3: /* FDIV */ switch (fmt) { case 0: @@ -1080,6 +1129,7 @@ u_int fpregs[]; return(dbl_fdiv(&fpregs[r1],&fpregs[r2], &fpregs[t],status)); } + BUG(); case 4: /* FREM */ switch (fmt) { case 0: