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;