From patchwork Thu Oct 12 22:09:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 13419851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30CBECDB488 for ; Thu, 12 Oct 2023 22:09:52 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.616070.957832 (Exim 4.92) (envelope-from ) id 1qr3s5-0002WM-MB; Thu, 12 Oct 2023 22:09:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 616070.957832; Thu, 12 Oct 2023 22:09:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qr3s5-0002WE-ID; Thu, 12 Oct 2023 22:09:33 +0000 Received: by outflank-mailman (input) for mailman id 616070; Thu, 12 Oct 2023 22:09:31 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qr3s3-00016s-Lq for xen-devel@lists.xenproject.org; Thu, 12 Oct 2023 22:09:31 +0000 Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 036dea3c-694c-11ee-9b0e-b553b5be7939; Fri, 13 Oct 2023 00:09:29 +0200 (CEST) Received: from pps.filterd (m0174682.ppops.net [127.0.0.1]) by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39CKqmlC008371; Thu, 12 Oct 2023 22:09:25 GMT Received: from eur01-db5-obe.outbound.protection.outlook.com (mail-db5eur01lp2050.outbound.protection.outlook.com [104.47.2.50]) by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3tpr7cr8dp-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 22:09:25 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18) by DBAPR03MB6376.eurprd03.prod.outlook.com (2603:10a6:10:193::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 22:09:18 +0000 Received: from VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::f606:63f7:5875:6076]) by VI1PR03MB3710.eurprd03.prod.outlook.com ([fe80::f606:63f7:5875:6076%4]) with mapi id 15.20.6863.043; Thu, 12 Oct 2023 22:09:18 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 036dea3c-694c-11ee-9b0e-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K01p0D6CTf1gJqbojqphmWFrqYpv3U2b5T130F9+y8xPt8mmHhLcS/g38NSfVCgVjJau+wJwcQScJiBUmgnbaseBHByBel2MgcMABUzoZ0BTjXmClUETTHRwXEpmGzcf0jA87HU3hFlm3jl8p2yniFkHIFiMebWBxpDX8YTrhFK6G2Bv186fuIO0m72nAxLYjPH7GH9tI1mtc8QS+f5vCxwEyZ2HJLZKlD6nePDuKtT2dqdiGW7FqC43ZkbDjoiBMBZNVhUN3mowySjGjkY+/0nNl0FvUydcfG42DJXPuVNVZnXiEXyUaBgURYDhns8vvLoAdEAKZFyVAgvKI0DVXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3CXc+8tX6pBxxfJFpCA5LYlgxAC78/KBYrjedW2YSTs=; b=aAR2gCzjmxBMHzjEyAMQnk6E5fnrRTbS4q0ULpDxzKFjsHj7s1RdJjqEliG1Byl+EyQ3cnbSVHLh8ohTMJOg9utnl7rUe3VLr7pbf0jtKKOU73LaFkFF/XY/2CL4Da8DmdxKalx1f/9bm4oSPzNN1uEiB61mOY3BMw00rPcNo+OAowjbR6JvRaceENDE1TibDZEnvzUiUe7RNPKD7Ss1245uIhuIq5oLyQ2gTeqOCeLX68jcmXYiAE/x3denuWc2ueObD0+irbwN7eT39C0G2KakW709Y37wWutDb4GY1nd4VWpBxR+nuLfkFAlpEQ3WdJx6T0SVMK+gEKEj7Ec6Mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3CXc+8tX6pBxxfJFpCA5LYlgxAC78/KBYrjedW2YSTs=; b=mFsLeuqU5CVV0qamOsO0ew1vbsWymMJ96rbk3rEiwtJUm+wqe9MSqZQEmoxytRFDp/iORH8DDEEEKRlAVQlh3wzOuYo+pOdjBDdVMlkx8km67C5JvOEB5tO5pHp4LYBD2YcN/BbB+b/gJXhnoytcH5R1xZaSWXdsZpyfdhq+GCmuAilWbmWkIEH/GQcpiF150YyGp422ZF61Ht/O/X41tEuEF89hP9LgKds9iwYpzL3une9AgCngmEhOYJ2vaUqe2PIpvwHrJief2PNqAJK4LcPUIYB8BgPlbD23iNERnE6t9KQDL7pkNOs/5VAQf0Dtl3inaU6nKDWdXArE4j5w7A== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Stewart Hildebrand , Oleksandr Andrushchenko , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v10 08/17] rangeset: add RANGESETF_no_print flag Thread-Topic: [PATCH v10 08/17] rangeset: add RANGESETF_no_print flag Thread-Index: AQHZ/Vi9FGz7fvuB1UuuzM8p/4QjlA== Date: Thu, 12 Oct 2023 22:09:16 +0000 Message-ID: <20231012220854.2736994-9-volodymyr_babchuk@epam.com> References: <20231012220854.2736994-1-volodymyr_babchuk@epam.com> In-Reply-To: <20231012220854.2736994-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.42.0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DBAPR03MB6376:EE_ x-ms-office365-filtering-correlation-id: 50804346-9409-4745-3ece-08dbcb6fe110 x-ld-processed: b41b72d0-4e9f-4c26-8a69-f949f367c91d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WbdXn/iWcHUfvCky1h5v0IRMQybWxeH5I6vc7/G6AieH4buFhCm6x4z5Vrxyq6JI9StcvHXd+pCSK+B0X9eoo8SoJtubeyZ+ftwm+qQcbMvxeXoRWMisZrzhbO8IjrW9MMafR/Y941WGgiuVYV1jOL7yJTm3Us/i8vAgaVVVj4mn2DWjLR3Z4y/dWHjfuWoMhhbIlbdyYuYuZDW6Kz3VolWSpKffCjhgZaEPTnP6uLbvmCehAdVNy3s4tHX1BWq3lye4tvihu3+9nSKmW506rUjux1eh2mACvK/tiMnXjnDFuolSiBKftUmMNlCVD24LwWxSN5i2FB0R4X3u4yhuVDBGLOeA/U+sfekPBah+wbW0W2cPkE756dmMJG41VdL2b32d030hBmfTw8w9XbaqktRadfwnzTuBiMy24laOQRBV6ukyGZdNmnLbdSn9EgqJR/+jYuPg9Ro+W1UWrjBCtLYmCm8x+XF5FlcerUnFy9sv6LbJaFrals03EjloOFAUlEpx+HRARldTsD8NF4VQVriHbDlgd+BprElAb4mbd36+H245He+nUxDsQpBUvxFerhj5p/Qn1WVIRV4vn+O6uGugCymwViCfqub4VYQIrTJfuUwwMHDqwoH4MNS6weid x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39860400002)(396003)(346002)(366004)(136003)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(2616005)(71200400001)(26005)(6512007)(6506007)(55236004)(36756003)(86362001)(38100700002)(38070700005)(122000001)(1076003)(83380400001)(91956017)(41300700001)(64756008)(316002)(76116006)(54906003)(66946007)(66446008)(6916009)(66556008)(66476007)(2906002)(8936002)(5660300002)(8676002)(4326008)(6486002)(478600001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?xyc9xJ94f5mYD7PnywC1qW9?= =?iso-8859-1?q?i3uRG+HqKKAW8XWZ5aGSXlOYEOP1WiNaAMGytDC6rF1hFlUT81J0D/9VHsgh?= =?iso-8859-1?q?/ygyQRN3sOg3fvWeu3qFKLYlHMxOS+1U4GDIHiuyoaGKUtnXoGJjg5dlwfSN?= =?iso-8859-1?q?f23edL5CjuTwP+smvph7DUYMQ4uliJrM1Q0sW5NAsZmBbYEnRx2yB1seLmH4?= =?iso-8859-1?q?YXOOcrxYo8/6+Pwg8HhKukR308wJiQ8Tc7EikwPv7eCtUdTZz5jWm1LeZb57?= =?iso-8859-1?q?5vF3swYYGIg6IipsG3S7ecrT5Bh+FrIattLK1X3UipRl+y49HwPce2bXQhgg?= =?iso-8859-1?q?Rl4VKknnYs2KScRh4oVyk8Umr5UMBvQ0KAzGW62fWBw1mCxl86p9lxDCZWv0?= =?iso-8859-1?q?dpyckbod/GlutiPA00Vtk4c161/lFCebIyMJrTa9udwV2QlTK7qYiYcPeIdH?= =?iso-8859-1?q?G/pX/bWo83FtKR/rAFLjTREPDqr7YhmvVOlupWcgp4K4AUBRBzc2O18pKsYZ?= =?iso-8859-1?q?712PXAbkzeMcseUs/SMkEReWbLb8cWAMH2A4n8MZzo2tdeOzuaE5BCjs12VG?= =?iso-8859-1?q?g4LUyPepVXvYexe/8No/ttF1+wwTv5He4GDmCiUVxBHLHdrKz/GT0/wOIVIS?= =?iso-8859-1?q?7s3s5AQ1FT/r7zyJsOSFS3KwOy/VtDcCzbGTswsfUInQsbxsvUc7LUnUlJXZ?= =?iso-8859-1?q?owwagfTSdHCIOZ7o46s6beniJoNLI4bPEJCVd6xaNQbgNTarSNrZUycsMFOY?= =?iso-8859-1?q?bYerEXcVh85gBLJa+FQPM5vbZbI7J4Fg14Q4qpen7eP8wE9Jx8D70CnkHgtM?= =?iso-8859-1?q?H5jah7FR8Jy3jfcdheHte74sPwUtTfERODgyVFZMi8dUOUOrxwMx1ASwjRvI?= =?iso-8859-1?q?ZdsA5nnUYCxMvc5BSRwtmfGwyDcmf3sBF3BeXyNlIMn/mGfP7TbbDJjnYEoj?= =?iso-8859-1?q?8xGXGzaOZKTWUUsJyYBiaJcTg+TxKi3vLIer6XqltilWY+4NP0s2BfA07Q58?= =?iso-8859-1?q?ONxBfkYI6NW5hwWmTgeLgpkRztz7WpkYZP1eusnpGr/5S5XY4eq8XiHk8+4i?= =?iso-8859-1?q?tDNYzbTHZs8/hqkndQXQOTy7MJuPR3FgURWnceA/fZ+NX8rrv6mg5GmhF1sp?= =?iso-8859-1?q?SivPI3R4dXD3+imyiwxqnitB1GW2F2mjOKiEdm9eTi/z5vraxAR0lYQU8MVp?= =?iso-8859-1?q?n9qc7PYNQXySp1tOXT6429trdQBCzJNmOxkn4q0WaAtrUXxluQDI9ZJW6MA4?= =?iso-8859-1?q?aNcmNGmpBFsmS7ZIw/5D9u1REC14MlKCOW4/S/BjJ4AuouxD2cE7yk0R52Tw?= =?iso-8859-1?q?3smOAbh+iDNGMIwXZ70mzCA+aPmhldShl3NZpsYMVHq8ur6dqxOoKMYlFf9w?= =?iso-8859-1?q?27A2T47EOnI+yk6oLoe3i51vu4B/z34RAHxVqIoN5KiVctku1jLwWTJjz90i?= =?iso-8859-1?q?1SVAJ1lEQdmXJx2p3lg0w/4HdJcqTk26cBaBxC7tMtxnP5ldPW0N8/pUZsOD?= =?iso-8859-1?q?97GSiHc2h44Buh7yjYEVSVFCAWarqeTy9nqHhFwse7IwdgCEVIUt2qNLpa/T?= =?iso-8859-1?q?QynmPG3D0o8AD/ZptRrBP8pSPXQwSUXfQlWMA35PVS15kgPRiWhUCaNdmLnC?= =?iso-8859-1?q?qOa+ximZaJBvK2igIOTQ9qmPRF/blMFDl+asaXA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50804346-9409-4745-3ece-08dbcb6fe110 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2023 22:09:16.9516 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: athmZe0YnSiUKlKOx/JaNiwB/22yXYb5ojlolh2IbIqs/Z0xfyUd9g4BfdIcz/6BwtBoskeCJ1WH8vLP5ODlrgjSW/CLXM1R19E38cX8Li0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR03MB6376 X-Proofpoint-GUID: 3FMKdQ3tyOgELXzpi1gM4MVpENRkgynf X-Proofpoint-ORIG-GUID: 3FMKdQ3tyOgELXzpi1gM4MVpENRkgynf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-12_14,2023-10-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 malwarescore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310120186 From: Oleksandr Andrushchenko There are range sets which should not be printed, so introduce a flag which allows marking those as such. Implement relevant logic to skip such entries while printing. While at it also simplify the definition of the flags by directly defining those without helpers. Suggested-by: Jan Beulich Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Jan Beulich --- Since v5: - comment indentation (Jan) Since v1: - update BUG_ON with new flag - simplify the definition of the flags --- xen/common/rangeset.c | 5 ++++- xen/include/xen/rangeset.h | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c index f3baf52ab6..35c3420885 100644 --- a/xen/common/rangeset.c +++ b/xen/common/rangeset.c @@ -433,7 +433,7 @@ struct rangeset *rangeset_new( INIT_LIST_HEAD(&r->range_list); r->nr_ranges = -1; - BUG_ON(flags & ~RANGESETF_prettyprint_hex); + BUG_ON(flags & ~(RANGESETF_prettyprint_hex | RANGESETF_no_print)); r->flags = flags; safe_strcpy(r->name, name ?: "(no name)"); @@ -575,6 +575,9 @@ void rangeset_domain_printk( list_for_each_entry ( r, &d->rangesets, rangeset_list ) { + if ( r->flags & RANGESETF_no_print ) + continue; + printk(" "); rangeset_printk(r); printk("\n"); diff --git a/xen/include/xen/rangeset.h b/xen/include/xen/rangeset.h index 135f33f606..f7c69394d6 100644 --- a/xen/include/xen/rangeset.h +++ b/xen/include/xen/rangeset.h @@ -49,8 +49,9 @@ void rangeset_limit( /* Flags for passing to rangeset_new(). */ /* Pretty-print range limits in hexadecimal. */ -#define _RANGESETF_prettyprint_hex 0 -#define RANGESETF_prettyprint_hex (1U << _RANGESETF_prettyprint_hex) +#define RANGESETF_prettyprint_hex (1U << 0) + /* Do not print entries marked with this flag. */ +#define RANGESETF_no_print (1U << 1) bool_t __must_check rangeset_is_empty( const struct rangeset *r);