From nobody Tue Nov 26 09:00:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0B6A205AA3; Fri, 18 Oct 2024 19:46:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729280792; cv=none; b=bnav2LSWdCdnPH/1kghmXZAMVps+C5//RPymwjfZp4INA8EN2KKZGS4i+6GvT35h46jrIgkvlJn04T8QGtpGu6QiAuH+MyPLJd7bhoob7QAYPAUiq8MnPLwqH2aKKf/JkC+bJIxBSkSDz5uAxfkz2cL7tGBUlB7Mh9uMtaZqjxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729280792; c=relaxed/simple; bh=Orx9NU1JXDRhmnV4iiGDSo5qc8ZgJogIS81BGkbWzEU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=W5aBPpfVR4XpFE8TwM9T4bGZK+WFVo6FINjcJR9WPqv4dIJG+8hEEdL+XtcMZxrmlrIDJERek10JTktKKXXwb4CQpFeMYK/SLd2QSPNiLfLk9Atctqh4GpaxZ20mzA/mYGlAuAtkZRWPpUvQ1I7vS8iho2WiLaxdut43DniKk28= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZX1+bObo; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZX1+bObo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729280791; x=1760816791; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=Orx9NU1JXDRhmnV4iiGDSo5qc8ZgJogIS81BGkbWzEU=; b=ZX1+bOboNO0LWKtllgI5lAKuKl37VnNU94ToaIjwi/9QjUHzcLfvA8aM fp7R3T65XDjQbFCfRoIup4R4VR8pgJNZKfpo/IrBkZ5pEaZ/2Ar8uzRxs jQ3kH+6QlhlCJO5jV9Vbh13uPMbZQhbN9qq/wmJ8RgTSYcxWK3W/Q1WJx aSgZE6XfdFqxjYOQxoIYndDQXIgl0ZC/Xl3MRppZmk5tAAYwP894P10+m JpBopnXnWmEtNKIXU8R0C6CV3N4G+Kclk941z5kzZqDZ4kE/qC4HDjCuU PFeiMrDxDMTDX5DxP+y451VUkeKcOPnDg7TLgr+ZVZQcCLY4diQoCXrEJ Q==; X-CSE-ConnectionGUID: bqSh6sukTjKpJ/w9HN0zYQ== X-CSE-MsgGUID: ZqtAFxi/Sf+9OALj/VrWDA== X-IronPort-AV: E=McAfee;i="6700,10204,11229"; a="28704446" X-IronPort-AV: E=Sophos;i="6.11,214,1725346800"; d="scan'208";a="28704446" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2024 12:46:30 -0700 X-CSE-ConnectionGUID: E6pFp742Rv6/XqkWE2p6TA== X-CSE-MsgGUID: kyeRiIOvTNaK5NH2GmRNmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,214,1725346800"; d="scan'208";a="79017568" Received: from ldmartin-desk2.corp.intel.com (HELO localhost) ([10.125.109.148]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2024 12:46:29 -0700 From: Ira Weiny Date: Fri, 18 Oct 2024 14:46:24 -0500 Subject: [PATCH 1/3] test printf: Add very basic struct resource tests Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241018-cxl-pra-v1-1-7f49ba58208b@intel.com> References: <20241018-cxl-pra-v1-0-7f49ba58208b@intel.com> In-Reply-To: <20241018-cxl-pra-v1-0-7f49ba58208b@intel.com> To: Andrew Morton , Petr Mladek , Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Jonathan Corbet , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Dan Williams Cc: Fan Ni , Bagas Sanjaya , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-cxl@vger.kernel.org, Ira Weiny , Jonathan Cameron X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=ed25519-sha256; t=1729280784; l=2039; i=ira.weiny@intel.com; s=20221211; h=from:subject:message-id; bh=Orx9NU1JXDRhmnV4iiGDSo5qc8ZgJogIS81BGkbWzEU=; b=7Dm1Njh7l5EKclKzUrGE+hSvD3mG3IDjwOXxfU80SpRaZPPKIfTKWxpelqTQ4h5bxRgFAtklV PaMyHYBl7aoBcj/wwtK00011fatWXNgwMRVDYidGJOz/1Nyt0Ry8Eqk X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=noldbkG+Wp1qXRrrkfY1QJpDf7QsOEthbOT7vm0PqsE= The printf tests for struct resource were stubbed out. struct range printing will leverage the struct resource implementation. To prevent regression add some basic sanity tests for struct resource. Reviewed-by: Andy Shevchenko Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni Tested-by: Fan Ni Acked-by: Petr Mladek Link: https://patch.msgid.link/20241007-dcd-type2-upstream-v4-1-c261ee6eede= d@intel.com Signed-off-by: Ira Weiny Tested-by: Petr Mladek --- lib/test_printf.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/lib/test_printf.c b/lib/test_printf.c index 8448b6d02bd9..5afdf5efc627 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -386,6 +386,50 @@ kernel_ptr(void) static void __init struct_resource(void) { + struct resource test_resource =3D { + .start =3D 0xc0ffee00, + .end =3D 0xc0ffee00, + .flags =3D IORESOURCE_MEM, + }; + + test("[mem 0xc0ffee00 flags 0x200]", + "%pr", &test_resource); + + test_resource =3D (struct resource) { + .start =3D 0xc0ffee, + .end =3D 0xba5eba11, + .flags =3D IORESOURCE_MEM, + }; + test("[mem 0x00c0ffee-0xba5eba11 flags 0x200]", + "%pr", &test_resource); + + test_resource =3D (struct resource) { + .start =3D 0xba5eba11, + .end =3D 0xc0ffee, + .flags =3D IORESOURCE_MEM, + }; + test("[mem 0xba5eba11-0x00c0ffee flags 0x200]", + "%pr", &test_resource); + + test_resource =3D (struct resource) { + .start =3D 0xba5eba11, + .end =3D 0xba5eca11, + .flags =3D IORESOURCE_MEM, + }; + + test("[mem 0xba5eba11-0xba5eca11 flags 0x200]", + "%pr", &test_resource); + + test_resource =3D (struct resource) { + .start =3D 0xba11, + .end =3D 0xca10, + .flags =3D IORESOURCE_IO | + IORESOURCE_DISABLED | + IORESOURCE_UNSET, + }; + + test("[io size 0x1000 disabled]", + "%pR", &test_resource); } =20 static void __init --=20 2.47.0 From nobody Tue Nov 26 09:00:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0D8B206E79; Fri, 18 Oct 2024 19:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729280796; cv=none; b=tDQlZgx4ac4jBl0RWyCBgzITC4ee5ITFjeHdB8HOiTsjoYUrR9nrIVlL39ogKCpt1NnYwEHVZW7zIM8bUkOfgEnymq8eU11ltjW6wdmUJmzeOKns5o9ceF5TWvClG7hVkyUO6XqijNyLNGkKh+TXeGkNe5L/8Lx4dOw1yoPFoPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729280796; c=relaxed/simple; bh=3JfD/IY0gogMnjuoL9D2GLfZIVy1JrKKP7OgwHv7vxc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rDaErFJL4blm56hSxVSZMo1tJfDdVwe+XVc9BekFyp4iLFJiZ0eA4++9NVi1gjPG+UbiDwhAaIlkiRTCQf+jAgwBFK2OxogAfw3AZHmSYtgT/IyvEf380j89NwwKX13Qn1TSF5dkFTfMVOp6K5YZRCihsbirxq0yJpivuNbG1JM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kdH9rCRT; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kdH9rCRT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729280794; x=1760816794; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=3JfD/IY0gogMnjuoL9D2GLfZIVy1JrKKP7OgwHv7vxc=; b=kdH9rCRTO/XqyBjoClDXNZysO+Qzybzg+2qIwEf8OjqyDoT2dKlOHvbE LgfsS24n9UfzlaTLQzM7V9tTfb+Yfew+w+rIabIag+7PyX2oktUFs2LDb 8cRi/inSy1/gYxBE/0mE2Y7T3Q9+yx/sbSVwzcRavZC8K5JCXstUacEmL YftVeMlze9edBh2nGk9uvcl2gKzr6FYK6a6mM0FgzTDMS7z7nJSceEWU2 kLKf1Q/6OQ2FhMLVHYxnxREPoEiYdRYcGp0Nilkwc1JUlp0M4QT5EZJu/ O+y+zQK/H0GDJOft1IMHkqy17TNJdVT1UXP2pCeavstztyawND3C7t78F g==; X-CSE-ConnectionGUID: qP1eZmGETqyj8ztITtzC1Q== X-CSE-MsgGUID: FK/7LuH4Tyya3ob1UWegkA== X-IronPort-AV: E=McAfee;i="6700,10204,11229"; a="28704458" X-IronPort-AV: E=Sophos;i="6.11,214,1725346800"; d="scan'208";a="28704458" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2024 12:46:33 -0700 X-CSE-ConnectionGUID: vIC43TlMTTy+WN58dTjGmg== X-CSE-MsgGUID: i6ikMtlSRtWVSGV1UgTgDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,214,1725346800"; d="scan'208";a="79017578" Received: from ldmartin-desk2.corp.intel.com (HELO localhost) ([10.125.109.148]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2024 12:46:32 -0700 From: Ira Weiny Date: Fri, 18 Oct 2024 14:46:25 -0500 Subject: [PATCH 2/3] printf: Add print format (%pra) for struct range Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241018-cxl-pra-v1-2-7f49ba58208b@intel.com> References: <20241018-cxl-pra-v1-0-7f49ba58208b@intel.com> In-Reply-To: <20241018-cxl-pra-v1-0-7f49ba58208b@intel.com> To: Andrew Morton , Petr Mladek , Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Jonathan Corbet , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Dan Williams Cc: Fan Ni , Bagas Sanjaya , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-cxl@vger.kernel.org, Ira Weiny X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=ed25519-sha256; t=1729280784; l=7710; i=ira.weiny@intel.com; s=20221211; h=from:subject:message-id; bh=3JfD/IY0gogMnjuoL9D2GLfZIVy1JrKKP7OgwHv7vxc=; b=C7e4ofwLZmWqXfjvO1KoJnpVlBhnDe2j5+Ru7sVlECe5yt+qRTunxNvxUgHvuGG7Fsn/8AV6U Wl8nn34ZSxaA2tFUDAupRUR9QS/ZHdDDzDUea2nx0wSxz8iOSFoGgso X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=noldbkG+Wp1qXRrrkfY1QJpDf7QsOEthbOT7vm0PqsE= The use of struct range in the CXL subsystem is growing. In particular, the addition of Dynamic Capacity devices uses struct range in a number of places which are reported in debug and error messages. To wit requiring the printing of the start/end fields in each print became cumbersome. Dan Williams mentions in [1] that it might be time to have a print specifier for struct range similar to struct resource A few alternatives were considered including '%par', '%r', and '%pn'. %pra follows that struct range is similar to struct resource (%p[rR]) but needs to be different. Based on discussions with Petr and Andy '%pra' was chosen.[2] Andy also suggested to keep the range prints similar to struct resource though combined code. Add hex_range() to handle printing for both pointer types. Finally introduce DEFINE_RANGE() as a parallel to DEFINE_RES_*() and use it in the tests. Cc: Jonathan Corbet (maintainer:DOCUMENTATION) Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list) Link: https://lore.kernel.org/all/663922b475e50_d54d72945b@dwillia2-xfh.jf.= intel.com.notmuch/ [1] Link: https://lore.kernel.org/all/66cea3bf3332f_f937b29424@iweiny-mobl.notm= uch/ [2] Suggested-by: "Dan Williams" Signed-off-by: Ira Weiny --- Changes: [iweiny: split from CXL patch set] [Andy: Define DEFINE_RANGE()] [Andy: rework hex_range() logic] [Andy: Don't use fallthrough] [Andy: clean up help comment] [Fan: clean up printk comment] [Rasmus: fix buf processing in hex_range()] [Rasmus: simplify buffer sizing] [Rasmus: add '[' to string] [Bagas: Clarify the start =3D=3D end print behavior] --- Documentation/core-api/printk-formats.rst | 13 +++++++ include/linux/range.h | 6 ++++ lib/test_printf.c | 17 +++++++++ lib/vsprintf.c | 57 +++++++++++++++++++++++++++= ---- 4 files changed, 87 insertions(+), 6 deletions(-) diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core= -api/printk-formats.rst index 14e093da3ccd..e1ebf0376154 100644 --- a/Documentation/core-api/printk-formats.rst +++ b/Documentation/core-api/printk-formats.rst @@ -231,6 +231,19 @@ width of the CPU data path. =20 Passed by reference. =20 +Struct Range +------------ + +:: + + %pra [range 0x0000000060000000-0x000000006fffffff] + %pra [range 0x0000000060000000] + +For printing struct range. struct range holds an arbitrary range of u64 +values. If start is equal to end only print the start value. + +Passed by reference. + DMA address types dma_addr_t ---------------------------- =20 diff --git a/include/linux/range.h b/include/linux/range.h index 6ad0b73cb7ad..1358d4b1807a 100644 --- a/include/linux/range.h +++ b/include/linux/range.h @@ -31,4 +31,10 @@ int clean_sort_range(struct range *range, int az); =20 void sort_range(struct range *range, int nr_range); =20 +#define DEFINE_RANGE(_start, _end) \ +(struct range) { \ + .start =3D (_start), \ + .end =3D (_end), \ + } + #endif diff --git a/lib/test_printf.c b/lib/test_printf.c index 5afdf5efc627..59dbe4f9a4cb 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -432,6 +432,22 @@ struct_resource(void) "%pR", &test_resource); } =20 +static void __init +struct_range(void) +{ + struct range test_range =3D DEFINE_RANGE(0xc0ffee00ba5eba11, + 0xc0ffee00ba5eba11); + test("[range 0xc0ffee00ba5eba11]", "%pra", &test_range); + + test_range =3D DEFINE_RANGE(0xc0ffee, 0xba5eba11); + test("[range 0x0000000000c0ffee-0x00000000ba5eba11]", + "%pra", &test_range); + + test_range =3D DEFINE_RANGE(0xba5eba11, 0xc0ffee); + test("[range 0x00000000ba5eba11-0x0000000000c0ffee]", + "%pra", &test_range); +} + static void __init addr(void) { @@ -807,6 +823,7 @@ test_pointer(void) symbol_ptr(); kernel_ptr(); struct_resource(); + struct_range(); addr(); escaped_str(); hex_string(); diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 09f022ba1c05..f6a62f273fad 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1039,6 +1039,20 @@ static const struct printf_spec default_dec04_spec = =3D { .flags =3D ZEROPAD, }; =20 +static noinline_for_stack +char *hex_range(char *buf, char *end, u64 start_val, u64 end_val, + struct printf_spec spec) +{ + buf =3D number(buf, end, start_val, spec); + if (start_val =3D=3D end_val) + return buf; + + if (buf < end) + *buf =3D '-'; + ++buf; + return number(buf, end, end_val, spec); +} + static noinline_for_stack char *resource_string(char *buf, char *end, struct resource *res, struct printf_spec spec, const char *fmt) @@ -1115,11 +1129,7 @@ char *resource_string(char *buf, char *end, struct r= esource *res, p =3D string_nocheck(p, pend, "size ", str_spec); p =3D number(p, pend, resource_size(res), *specp); } else { - p =3D number(p, pend, res->start, *specp); - if (res->start !=3D res->end) { - *p++ =3D '-'; - p =3D number(p, pend, res->end, *specp); - } + p =3D hex_range(p, pend, res->start, res->end, *specp); } if (decode) { if (res->flags & IORESOURCE_MEM_64) @@ -1140,6 +1150,31 @@ char *resource_string(char *buf, char *end, struct r= esource *res, return string_nocheck(buf, end, sym, spec); } =20 +static noinline_for_stack +char *range_string(char *buf, char *end, const struct range *range, + struct printf_spec spec, const char *fmt) +{ + char sym[sizeof("[range 0x0123456789abcdef-0x0123456789abcdef]")]; + char *p =3D sym, *pend =3D sym + sizeof(sym); + + struct printf_spec range_spec =3D { + .field_width =3D 2 + 2 * sizeof(range->start), /* 0x + 2 * 8 */ + .flags =3D SPECIAL | SMALL | ZEROPAD, + .base =3D 16, + .precision =3D -1, + }; + + if (check_pointer(&buf, end, range, spec)) + return buf; + + p =3D string_nocheck(p, pend, "[range ", default_str_spec); + p =3D hex_range(p, pend, range->start, range->end, range_spec); + *p++ =3D ']'; + *p =3D '\0'; + + return string_nocheck(buf, end, sym, spec); +} + static noinline_for_stack char *hex_string(char *buf, char *end, u8 *addr, struct printf_spec spec, const char *fmt) @@ -2229,6 +2264,15 @@ char *fwnode_string(char *buf, char *end, struct fwn= ode_handle *fwnode, return widen_string(buf, buf - buf_start, end, spec); } =20 +static noinline_for_stack +char *resource_and_range(const char *fmt, char *buf, char *end, void *ptr, + struct printf_spec spec) +{ + if (*fmt =3D=3D 'r' && fmt[1] =3D=3D 'a') + return range_string(buf, end, ptr, spec, fmt); + return resource_string(buf, end, ptr, spec, fmt); +} + int __init no_hash_pointers_enable(char *str) { if (no_hash_pointers) @@ -2277,6 +2321,7 @@ char *rust_fmt_argument(char *buf, char *end, void *p= tr); * - 'Bb' as above with module build ID (for use in backtraces) * - 'R' For decoded struct resource, e.g., [mem 0x0-0x1f 64bit pref] * - 'r' For raw struct resource, e.g., [mem 0x0-0x1f flags 0x201] + * - 'ra' For struct ranges, e.g., [range 0x0000000000000000 - 0x000000000= 00000ff] * - 'b[l]' For a bitmap, the number of bits is determined by the field * width which must be explicitly specified either as part of the * format string '%32b[l]' or through '%*b[l]', [l] selects @@ -2401,7 +2446,7 @@ char *pointer(const char *fmt, char *buf, char *end, = void *ptr, return symbol_string(buf, end, ptr, spec, fmt); case 'R': case 'r': - return resource_string(buf, end, ptr, spec, fmt); + return resource_and_range(fmt, buf, end, ptr, spec); case 'h': return hex_string(buf, end, ptr, spec, fmt); case 'b': --=20 2.47.0 From nobody Tue Nov 26 09:00:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB34C2071E9; Fri, 18 Oct 2024 19:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729280798; cv=none; b=QgE8o8gnSmBkoOMLcTBXc1eAEtT6o5UQk0ZzDHDdAAXjmeMQH3JbANGVODqB8iEwZPNDUXVAqhDQfT2aXsLjqWt3UReI/zrm/nkZS94yyuZaW+z27pGNWiOVlQfXQmjFTLJZF9+SgXd0fWUFXjE7W0cNTnf9axnUFYtpglekq3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729280798; c=relaxed/simple; bh=/JeMO2fu7enk080lSjfE13zH8ww++AGV97ihDY9Z1G4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FRp6K1QyMClaC6tHWqSBfcsFBo92GpOVCqvGieE7m4NS3/3c6Kr7DftnUYjbiWrbWuJ+I6vKdY7I+uKNdmzGaLk0f4DxiSFOeDuyxmbv6r74t0SttasB5mjMq7gtOMMexvFhw+CIfYmvhpYerVeayPynrVHQXK7nQoV8brCcom0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=W/anIrzH; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="W/anIrzH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729280797; x=1760816797; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=/JeMO2fu7enk080lSjfE13zH8ww++AGV97ihDY9Z1G4=; b=W/anIrzHPInrWlpw09VZuUPT2tKuQXxA0dmGVyJ1Uxifu047rzEi9Zt7 9E0bPhwbibbUucThY4M1dkOANzIs+YvVrgvPhcEfCRwG6u4oyDp0AmK2Q 4m5KxM2hh05KrcI9Jd62AfMAQohRBPbzXJRrWdr+9bUTW178eoNfxdfMv Zw5/Rv58R5S8+pI/bYsOazKyqWFq72ezESGWKjyA4Udau2imnwVsdDOsH 4rH2xVyb93V8Or1Twj3NENUABZxPG4FSsT1WmTTPtwSzLuQNS+pScpfFk cCSVGjNBebEtjmXLMiiBRj6TUYt/UDfdExYWPaFXKDFKavDVV0uq7sVc0 Q==; X-CSE-ConnectionGUID: Le4112cyQd2/m7q7ZyBqPA== X-CSE-MsgGUID: uP5zL71lStiakzLMApF0Mg== X-IronPort-AV: E=McAfee;i="6700,10204,11229"; a="28704469" X-IronPort-AV: E=Sophos;i="6.11,214,1725346800"; d="scan'208";a="28704469" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2024 12:46:36 -0700 X-CSE-ConnectionGUID: LB7sNHGETXGuCIc+Tuqhvw== X-CSE-MsgGUID: 5zmL7R7LSMOxg5ipA4decg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,214,1725346800"; d="scan'208";a="79017591" Received: from ldmartin-desk2.corp.intel.com (HELO localhost) ([10.125.109.148]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2024 12:46:35 -0700 From: Ira Weiny Date: Fri, 18 Oct 2024 14:46:26 -0500 Subject: [PATCH 3/3] cxl/cdat: Use %pra for dpa range outputs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241018-cxl-pra-v1-3-7f49ba58208b@intel.com> References: <20241018-cxl-pra-v1-0-7f49ba58208b@intel.com> In-Reply-To: <20241018-cxl-pra-v1-0-7f49ba58208b@intel.com> To: Andrew Morton , Petr Mladek , Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Jonathan Corbet , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Dan Williams Cc: Fan Ni , Bagas Sanjaya , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-cxl@vger.kernel.org, Ira Weiny X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=ed25519-sha256; t=1729280784; l=1437; i=ira.weiny@intel.com; s=20221211; h=from:subject:message-id; bh=/JeMO2fu7enk080lSjfE13zH8ww++AGV97ihDY9Z1G4=; b=zLjjim30L5onOW4NpnzoIUsh/fvGuaNQH83i+1j4TebZKv0bkUxZzY1GMt8Ak4d7IOTebFMyp 7DEuGgzmN++DzlOCC9VQHn6hsIgaAMoiBt2MYVvVhlbeo+7LGSNsqSp X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=noldbkG+Wp1qXRrrkfY1QJpDf7QsOEthbOT7vm0PqsE= Now that there is a printf specifier for struct range use it to enhance the debug output of CDAT data. Signed-off-by: Ira Weiny Reviewed-by: Alison Schofield --- drivers/cxl/core/cdat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c index ef1621d40f05..438869df241a 100644 --- a/drivers/cxl/core/cdat.c +++ b/drivers/cxl/core/cdat.c @@ -247,8 +247,8 @@ static void update_perf_entry(struct device *dev, struc= t dsmas_entry *dent, dpa_perf->dpa_range =3D dent->dpa_range; dpa_perf->qos_class =3D dent->qos_class; dev_dbg(dev, - "DSMAS: dpa: %#llx qos: %d read_bw: %d write_bw %d read_lat: %d write_la= t: %d\n", - dent->dpa_range.start, dpa_perf->qos_class, + "DSMAS: dpa: %pra qos: %d read_bw: %d write_bw %d read_lat: %d write_lat= : %d\n", + &dent->dpa_range, dpa_perf->qos_class, dent->coord[ACCESS_COORDINATE_CPU].read_bandwidth, dent->coord[ACCESS_COORDINATE_CPU].write_bandwidth, dent->coord[ACCESS_COORDINATE_CPU].read_latency, @@ -279,8 +279,8 @@ static void cxl_memdev_set_qos_class(struct cxl_dev_sta= te *cxlds, range_contains(&pmem_range, &dent->dpa_range)) update_perf_entry(dev, dent, &mds->pmem_perf); else - dev_dbg(dev, "no partition for dsmas dpa: %#llx\n", - dent->dpa_range.start); + dev_dbg(dev, "no partition for dsmas dpa: %pra\n", + &dent->dpa_range); } } =20 --=20 2.47.0