From patchwork Mon Nov 22 09:28:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Andrushchenko X-Patchwork-Id: 12631509 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 70CC8C433F5 for ; Mon, 22 Nov 2021 09:28:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.228707.395803 (Exim 4.92) (envelope-from ) id 1mp5cj-0001sY-IJ; Mon, 22 Nov 2021 09:28:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 228707.395803; Mon, 22 Nov 2021 09:28:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mp5cj-0001sR-Ez; Mon, 22 Nov 2021 09:28:29 +0000 Received: by outflank-mailman (input) for mailman id 228707; Mon, 22 Nov 2021 09:28:28 +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 1mp5ci-0001sH-GW for xen-devel@lists.xenproject.org; Mon, 22 Nov 2021 09:28:28 +0000 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [2a00:1450:4864:20::130]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8c5b7ded-4b76-11ec-a9d2-d9f7a1cc8784; Mon, 22 Nov 2021 10:28:27 +0100 (CET) Received: by mail-lf1-x130.google.com with SMTP id k37so77889838lfv.3 for ; Mon, 22 Nov 2021 01:28:27 -0800 (PST) Received: from localhost.localdomain (host-176-36-245-220.b024.la.net.ua. [176.36.245.220]) by smtp.gmail.com with ESMTPSA id f14sm1040024lfv.180.2021.11.22.01.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 01:28:26 -0800 (PST) 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: 8c5b7ded-4b76-11ec-a9d2-d9f7a1cc8784 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zg3iZjdBhPM1qkPiUTQLoFjD2MnrQYA7FWoXHxq7Vsc=; b=gMx/OX1D2vWbGVChKeBF07TAJL/K6t3SsIh9tsJMrL6hQjYuxVLnWm/Y1sojH4A7ae WXJkV8PJ61NYCYYW5q+lPFBQgyog0Bv88EdQRjWeTTnjcqepKKU3Sg417UHL7uOVjVaY KrjnR4e3Bab+1tPFv0YeKDMVWcfS0zXKC+iSzY+bpthJXLS4viBKlpITfMs0HKgiwhT0 CFtPEu9I0AXkEEBTEi4N4NacJi22Xu/ci4U/uJkt64umLuXn5fnEMVRLX5+cL8RGPNvD CeijPkrzpspE7n5/Pp5J6BcfmUNpmr5+GwBRr3z9QeO8OwsZ58rYNB4kp8CdwNCx8MwO xhjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zg3iZjdBhPM1qkPiUTQLoFjD2MnrQYA7FWoXHxq7Vsc=; b=b8MQH3JGxo/lhVpSgDxTDp8by7oNkc7Y6+SE/g5KIwloCCss5/GN/91xnpDt+eMywT oc85yjLCEmP5KpSz1sAXMo+2H67fk0HH46CzFXk0GXY7q4MT6Fd9phbTlnKInEzkN6Ve 6J/8S7+vjYNw6/4moD3JguyaCn9PviXp+1QpvlI3uKxa5lKpPRksGtSWT02Vp4CwiDND b7HgTsZ1D5zG/zBd2JYGiQVWeo53p8hN6X0ecM73BaK+PiEedgl52kfKaMTWRI2/QB2/ zjCRRodWqM/xAKq+/4ew6HPmCnD2io5narCs45Nu5lOiwH/Sj/yFlipQoNzeTV1m91SM 5utQ== X-Gm-Message-State: AOAM530XVt51ggOiDL0lSwQ2dW336hNPIFzYKsk6LVL3kZhyUuA8pxZ6 6xtTQ2e166BMGoJEjzWdmDH/vRCsMLgGCQ== X-Google-Smtp-Source: ABdhPJxkpNrQE0DVLm7TlDxXIxfBbWfPGn47mLNIME9nDHZDqo/bHErYH1ynEHHJ085IbeCwGEL8ag== X-Received: by 2002:a2e:a287:: with SMTP id k7mr49993229lja.295.1637573306891; Mon, 22 Nov 2021 01:28:26 -0800 (PST) From: Oleksandr Andrushchenko To: xen-devel@lists.xenproject.org Cc: roger.pau@citrix.com, jbeulich@suse.com, Oleksandr Andrushchenko Subject: [PATCH 1/2] rangeset: add RANGESETF_no_print flag Date: Mon, 22 Nov 2021 11:28:24 +0200 Message-Id: <20211122092825.2502306-1-andr2000@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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. Suggested-by: Jan Beulich Signed-off-by: Oleksandr Andrushchenko --- xen/common/rangeset.c | 3 +++ xen/include/xen/rangeset.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c index 885b6b15c229..939883a1d145 100644 --- a/xen/common/rangeset.c +++ b/xen/common/rangeset.c @@ -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 135f33f6066f..543540a88b6f 100644 --- a/xen/include/xen/rangeset.h +++ b/xen/include/xen/rangeset.h @@ -51,6 +51,9 @@ void rangeset_limit( /* Pretty-print range limits in hexadecimal. */ #define _RANGESETF_prettyprint_hex 0 #define RANGESETF_prettyprint_hex (1U << _RANGESETF_prettyprint_hex) +/* Do not print entries marked with this flag. */ +#define _RANGESETF_no_print 1 +#define RANGESETF_no_print (1U << _RANGESETF_no_print) bool_t __must_check rangeset_is_empty( const struct rangeset *r); From patchwork Mon Nov 22 09:28:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Andrushchenko X-Patchwork-Id: 12631507 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 2163EC433EF for ; Mon, 22 Nov 2021 09:28:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.228708.395814 (Exim 4.92) (envelope-from ) id 1mp5ck-00028Z-UU; Mon, 22 Nov 2021 09:28:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 228708.395814; Mon, 22 Nov 2021 09:28:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mp5ck-00028O-Qf; Mon, 22 Nov 2021 09:28:30 +0000 Received: by outflank-mailman (input) for mailman id 228708; Mon, 22 Nov 2021 09:28:29 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mp5cj-0001sQ-Li for xen-devel@lists.xenproject.org; Mon, 22 Nov 2021 09:28:29 +0000 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [2a00:1450:4864:20::129]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8d1eba2f-4b76-11ec-9787-a32c541c8605; Mon, 22 Nov 2021 10:28:28 +0100 (CET) Received: by mail-lf1-x129.google.com with SMTP id f18so77828877lfv.6 for ; Mon, 22 Nov 2021 01:28:28 -0800 (PST) Received: from localhost.localdomain (host-176-36-245-220.b024.la.net.ua. [176.36.245.220]) by smtp.gmail.com with ESMTPSA id f14sm1040024lfv.180.2021.11.22.01.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 01:28:27 -0800 (PST) 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: 8d1eba2f-4b76-11ec-9787-a32c541c8605 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PxEeon2P6LCD+Co00Mq24LYfnu7Q7XWANBpcKw0CI/c=; b=XfgtjN+KuNzkPXLaAjPHsZmKN97TNq6Pt6ks3wDi4EokKJBglb2eXyXaX4MdyHgvo9 ZL73iuFh7292TF9rOwxKuWyxYmko8brqSEzgKlrOqPhAD1Nimiz0Qms1QjV0Xg09R/NI ateystA8Dfy6uh+ueEoZKpj4oxg2c/BbjC9bHSOt84YVSQXMZ23FDEN3YMmhU7iHOqGH Yi10jSFpFkzb+PObzcttE4OAZwfznNu/JBivjGwYtlihIHwHovftVht9ua0PYlFvCLOB rT/FREl8pcnm2ajx22YJYMfKVh9hkp7PmVepc4fBJxg8GmtQNdQ8CZXhd2azBDBYYqwS 4HRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PxEeon2P6LCD+Co00Mq24LYfnu7Q7XWANBpcKw0CI/c=; b=Sgatlg2yAbUAufaKFoTCM8mkKSh5eE0VWctYmI4KHFCf7mIaCkD5UIX76FTN+DKd4J LsomHnsO0BipR1a2gJJBQqPK7zo7Z7rUsTrrhLxv7ddpLvuVWbVn0pu6ddniMtDsV7DA c1Buw5X1GivLy2vwbWjsx7htrn/p7HZEQi18eblDsbTGrHGsZb2LmT/C/ylgBcIeu7JZ Rl8Aljne2vGhXvXQYuFr/YM16Duc4PHmr/1VsqXaqTKzyPoyz7gafBppz4875VzVRgLQ 8ic+WTcMaN+ooUCEf3gg8dbiDrC/dzHxZGbS6yMMD0RCbxIZ1NEGdRFJwozMQfSXSigf jOlg== X-Gm-Message-State: AOAM530z/ByI8ZDxKj8o/Bg6fsO8TmTYD67qnrqQGbGo50dqBOI2DeTj QXy96qGbdWFE0Kk5vwVxSqVVUljF/QDqkQ== X-Google-Smtp-Source: ABdhPJz84tBoAiwcAGKoRzgvOF9p8soczNM8fHTTMkXcAjZ/si9Lw1Ayth2JBrt03HMPbUgz9QtDew== X-Received: by 2002:a05:6512:3195:: with SMTP id i21mr55844167lfe.50.1637573307971; Mon, 22 Nov 2021 01:28:27 -0800 (PST) From: Oleksandr Andrushchenko To: xen-devel@lists.xenproject.org Cc: roger.pau@citrix.com, jbeulich@suse.com, Oleksandr Andrushchenko Subject: [PATCH 2/2] vpci: use named rangeset for BARs Date: Mon, 22 Nov 2021 11:28:25 +0200 Message-Id: <20211122092825.2502306-2-andr2000@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122092825.2502306-1-andr2000@gmail.com> References: <20211122092825.2502306-1-andr2000@gmail.com> MIME-Version: 1.0 From: Oleksandr Andrushchenko Use a named range set instead of an anonymous one, but do not print it while dumping range sets for a domain. Suggested-by: Jan Beulich Signed-off-by: Oleksandr Andrushchenko --- xen/drivers/vpci/header.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c index 40ff79c33f8f..82a3e50d6053 100644 --- a/xen/drivers/vpci/header.c +++ b/xen/drivers/vpci/header.c @@ -206,12 +206,16 @@ static void defer_map(struct domain *d, struct pci_dev *pdev, static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only) { struct vpci_header *header = &pdev->vpci->header; - struct rangeset *mem = rangeset_new(NULL, NULL, 0); + struct rangeset *mem; + char str[32]; struct pci_dev *tmp, *dev = NULL; const struct vpci_msix *msix = pdev->vpci->msix; unsigned int i; int rc; + snprintf(str, sizeof(str), "%pp", &pdev->sbdf); + mem = rangeset_new(NULL, str, RANGESETF_no_print); + if ( !mem ) return -ENOMEM;