From 77bfc8bdb5a1cdbcea21daccdf1686e1bfea3db6 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Sun, 4 Sep 2022 00:45:25 +0200 Subject: parisc: Remove 64bit access on 32bit machines The parisc was using some readq/writeq accessors without special considerations as to what will happen on 32bit CPUs if you do this. Maybe we have been lucky that it "just worked" on 32bit due to the compiler behaviour, or the code paths were never executed. Fix the two offending code sites like this: arch/parisc/lib/iomap.c: - Put ifdefs around the 64bit accessors and make sure that ioread64, ioread64be, iowrite64 and iowrite64be are not available on 32bit builds. - Also fold in a bug fix where 64bit access was by mistake using 32bit writel() accessors rather than 64bit writeq(). drivers/parisc/sba_iommu.c: - Access any 64bit registers using _lo_hi-semantics by way of the readq and writeq operations provided by Signed-off-by: Linus Walleij Reviewed-by: Arnd Bergmann Cc: James E.J. Bottomley Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: Arnd Bergmann Cc: John David Anglin Signed-off-by: Arnd Bergmann --- drivers/parisc/sba_iommu.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/parisc') diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 374b9199878d..ecd870087a3d 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -28,6 +28,12 @@ #include #include #include +/* + * The semantics of 64 register access on 32bit systems can't be guaranteed + * by the C standard, we hope the _lo_hi() macros defining readq and writeq + * here will behave as expected. + */ +#include #include #include -- cgit v1.2.3