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: <95a899051e5c46aca70aa0b0016c0f90@huawei.com>
Date: Thu, 3 Jul 2025 09:52:47 +0000
From: Shiju Jose <shiju.jose@...wei.com>
To: Li Ming <ming.li@...omail.com>, "akpm@...ux-foundation.org"
	<akpm@...ux-foundation.org>, "andriy.shevchenko@...ux.intel.com"
	<andriy.shevchenko@...ux.intel.com>, "bhelgaas@...gle.com"
	<bhelgaas@...gle.com>, "ilpo.jarvinen@...ux.intel.com"
	<ilpo.jarvinen@...ux.intel.com>, "dave@...olabs.net" <dave@...olabs.net>,
	Jonathan Cameron <jonathan.cameron@...wei.com>, "dave.jiang@...el.com"
	<dave.jiang@...el.com>, "alison.schofield@...el.com"
	<alison.schofield@...el.com>, "vishal.l.verma@...el.com"
	<vishal.l.verma@...el.com>, "ira.weiny@...el.com" <ira.weiny@...el.com>,
	"dan.j.williams@...el.com" <dan.j.williams@...el.com>
CC: "linux-cxl@...r.kernel.org" <linux-cxl@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2 1/3] resource: Introduce a new helper
 resource_contains_addr()

>-----Original Message-----
>From: Li Ming <ming.li@...omail.com>
>Sent: 02 July 2025 08:20
>To: akpm@...ux-foundation.org; andriy.shevchenko@...ux.intel.com;
>bhelgaas@...gle.com; ilpo.jarvinen@...ux.intel.com; dave@...olabs.net;
>Jonathan Cameron <jonathan.cameron@...wei.com>; dave.jiang@...el.com;
>alison.schofield@...el.com; vishal.l.verma@...el.com; ira.weiny@...el.com;
>dan.j.williams@...el.com; Shiju Jose <shiju.jose@...wei.com>
>Cc: linux-cxl@...r.kernel.org; linux-kernel@...r.kernel.org; Li Ming
><ming.li@...omail.com>
>Subject: [PATCH v2 1/3] resource: Introduce a new helper
>resource_contains_addr()
>
>In CXL subsystem, many functions need to check an address availability by
>checking if the resource range contains the address. Providing a new helper
>function resource_contains_addr() to check if the resource range contains the
>input address.
>
>Suggested-by: Alison Schofield <alison.schofield@...el.com>
>Signed-off-by: Li Ming <ming.li@...omail.com>
Tested-by: Shiju Jose <shiju.jose@...wei.com>
>---
>v2:
>* Implement a general helper resource_contains_addr(). (Alison)
>
>base-commit: 0a46f60a9fe16f5596b6b4b3ee1a483ea7854136 cxl/fixes
>---
> include/linux/ioport.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
>diff --git a/include/linux/ioport.h b/include/linux/ioport.h index
>e8b2d6aa4013..75f5e9ccd549 100644
>--- a/include/linux/ioport.h
>+++ b/include/linux/ioport.h
>@@ -308,6 +308,14 @@ static inline bool resource_contains(const struct
>resource *r1, const struct res
> 	return r1->start <= r2->start && r1->end >= r2->end;  }
>
>+/* True if res contains addr */
>+static inline bool resource_contains_addr(const struct resource *res,
>+const resource_size_t addr) {
>+	if (res->flags & IORESOURCE_UNSET)
>+		return false;
>+	return res->start <= addr && addr <= res->end; }
>+
> /* True if any part of r1 overlaps r2 */  static inline bool
>resource_overlaps(const struct resource *r1, const struct resource *r2)  {
>--
>2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ