lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210226140305.26356-7-nsaenzjulienne@suse.de>
Date:   Fri, 26 Feb 2021 15:02:58 +0100
From:   Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To:     linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     f.fainelli@...il.com, robh+dt@...nel.org, robin.murphy@....com,
        ardb@...nel.org, hch@...radead.org, narmstrong@...libre.com,
        dwmw2@...radead.org, linux@...linux.org.uk,
        catalin.marinas@....com, arnd@...db.de, will@...nel.org,
        Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Subject: [RFC 06/13] device core: Introduce dev_64bit_mmio_supported()

This helper function will be help drivers ascertain whether they can use
64-bit memory accesses.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
---
 include/linux/device.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index bd94aa0cbd72..e9b4b2f99a44 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -826,6 +826,23 @@ static inline int dev_num_vf(struct device *dev)
 	return 0;
 }
 
+#if defined(CONFIG_ARCH_HAS_64BIT_MMIO_BROKEN)
+static inline bool dev_64bit_mmio_supported(struct device *dev)
+{
+	return !dev->mmio_64bit_broken;
+}
+#elif defined(CONFIG_64BIT)
+static inline bool dev_64bit_mmio_supported(struct device *dev)
+{
+	return true;
+}
+#else
+static inline bool dev_64bit_mmio_supported(struct device *dev)
+{
+	return false;
+}
+#endif
+
 /*
  * Root device objects for grouping under /sys/devices
  */
-- 
2.30.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ