From patchwork Wed Dec 15 14:16:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 12678403 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FAAAC433FE for ; Wed, 15 Dec 2021 14:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243248AbhLOOQx (ORCPT ); Wed, 15 Dec 2021 09:16:53 -0500 Received: from mga17.intel.com ([192.55.52.151]:25794 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243257AbhLOOQw (ORCPT ); Wed, 15 Dec 2021 09:16:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639577812; x=1671113812; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=7P08SDgAUC8vnr+ywcoDxL9jz8+qYJarvsS+T8NGUCE=; b=k2TVoSmVSO5hZ/Dp1ugrAz/uggnT0UiaOZz1wa4og2l8rITuNjJASRjN UqVIHgICAgx4h8Wnq00xogYjYX5K90B3ILwFaQFmiDof3RIlBaGprUJlg BrkpkYu/DGP1Dutzzw5LZV/VheD/snYV0II4Bz0jgXmx/JTOxDgNU40dg h+JqWRVGwcUk1tBwCCh8HnW3rdTQgbDpBPkorclq5sNZ+US7VvFBjmYgJ eYwBsx+La9XecrAT5Wx2b4UctrSpAN9cEcx8FUvPQYzXC6jUaQorgTD/5 Rdo45hRbm8sw+b2UtWhLRZULNH7xxaRQXz1jj9KskO8ACJiMaqqOECzKn g==; X-IronPort-AV: E=McAfee;i="6200,9189,10198"; a="219918510" X-IronPort-AV: E=Sophos;i="5.88,207,1635231600"; d="scan'208";a="219918510" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2021 06:16:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,207,1635231600"; d="scan'208";a="584215572" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 15 Dec 2021 06:16:52 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 15 Dec 2021 06:16:52 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 15 Dec 2021 06:16:51 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 15 Dec 2021 06:16:51 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.43) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 15 Dec 2021 06:16:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hGo12S5YGismt/BYi16WFCHdeL7sOweJ4U5CNcZq2ShOmqQN20a0ktg+BixTtqiGmszppYf2NvuhZ+j00JyDs+h5WeJBb3duaD/zFpcFkVwAWqZ5+qkN8mavQH2ACX76wehtcTFfjHxPDDofV++simykkqcwqLXb7BxHJK0d/jfzRyoDihPpq0zYHQGnzUX8a9c7oKcz9HPA4XR47531N4B+F6mqjYkbLm0XTihsFtqbCXtt3rT9eCPFlyhhanAf3n+8RUlsCFECoN1xwreRSdARCmKP0p5F5BtKDulE/X7fYwHoCdXuvX+FT4rG5IYudBY5ggAXydAcb0PqHB/rEQ== 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=yxRF5GkEOw5eqN5jLZy2Lp3RlE7R9GLAzzey6XLB2qs=; b=jV0YZMgpWgqjhu+BTE1uI9wkBJRHn4di94fCToSAsVcTrpo+fpr/Fkp8EDyzebvDp/ydxpXQg9K2W6WHGq9uyuxsuD5YaW6BdCshGuaXuAU6q8aWn5BCNvwwWqlFQmgs1emun1U402vCX01wdq/IblqzkU6Ap7rQ5TSsD/LT4eyakbJ1YZcZ8lE2V/y9ipfdbs5SYB0AEn9e/b0nxqluuJMlu/L26gKB1cMLW8e8BLSchNSYXqMMZjAgAz/ApaLXe4ZI5jdrLwwWK1PRTYTVb/wZOw7x9FZyEz8KX8Ek0VVevD5z7mzKNPPsvH9ipdznEPgCiLzvVXw7hdqNStohqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by DM5PR11MB2011.namprd11.prod.outlook.com (2603:10b6:3:f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Wed, 15 Dec 2021 14:16:50 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::54fb:8c9f:670:3658]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::54fb:8c9f:670:3658%4]) with mapi id 15.20.4801.014; Wed, 15 Dec 2021 14:16:49 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Bjorn Helgaas CC: =?utf-8?q?Christian_K=C3=B6nig?= , "Ard Biesheuvel" , "Michael J . Ruhl" , Rodrigo Vivi , =?utf-8?q?Micha=C5=82_Winiarski?= Subject: [PATCH 0/2] PCI: VF resizable BAR Date: Wed, 15 Dec 2021 15:16:24 +0100 Message-ID: <20211215141626.3090807-1-michal.winiarski@intel.com> X-Mailer: git-send-email 2.34.0 X-ClientProxiedBy: FR3P281CA0076.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::14) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f086514-478c-4317-d2bc-08d9bfd58904 X-MS-TrafficTypeDiagnostic: DM5PR11MB2011:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: km9nXyk2XKMAFtzO4fG4g+BP/ophs4ewdQsXbrQFxm6W4IJ8It32rXYFw+jkCdAa0X/+8TMoL0XdlV9jnpe016rYOOVno5SCUu/y4YmsYcio9xJuo+eMVpIUpeLB58L3xUae9bmz7GfQN0fCz06a4sD0TLU2BN7Ibe0pnxtlYxTu6rZZGG9jWpu6gGACFid9jkmPa4v7AKGCbYmLs+eM115b2y97zNFNinrahvDlEnrs2/D2KW2o2J33QVOy9Tk7z7nC41OFaqtwwcjvL8XEUiOiRkwwqDt4bzPFtsz2M89ApPOXEVDiu0Dqed7F9tyz4RzBgszV+5JHbK23nOhdHJ5RpWIFLwJMv48uKfZoyCL2WlfJXd14IIb+kkAmsSrzCo5gknasZWn2lov8UkZIkiwpych3IZMMarFU5DQsG5CWXtCwoKonZi+fiNtsVRqT5VzCy282iEfXkTYcj0n6TSf/nsDca2PmuEpdLHRzfPtor5OQEnA9ljX9Hky7axnVwgXe21Gp3NCBTbz8Degs6zMzjXDFP7dAS6Gr2rB4Ogb9qHjlRiam/v9ykm2shnPHUM5xKKNQ1GrRVf/u6WBU0O5gBL3zBdoSi3Cty7TXaIHmnagt7mUl8XlZKUnc0KjTAdqH9uINK+EnLKjff+bFtw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5373.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(2616005)(4326008)(1076003)(107886003)(6666004)(86362001)(83380400001)(66476007)(4744005)(66946007)(66556008)(508600001)(8676002)(6486002)(5660300002)(26005)(186003)(6512007)(36756003)(8936002)(82960400001)(38100700002)(316002)(54906003)(6506007)(2906002)(6916009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?4ZjBzGe2ZYOU+vogqPKhK7Dy16Ab?= =?utf-8?q?ZTpWoGlcfVIzQlAQ0w933HJdfd5tMS6twDu3JPheufytRLfjGfnSXsz2YSYx2F1VX?= =?utf-8?q?NgyQDE+7F0IrAHgB+8o8R1lPPrCd4jH4iow2iZfAZMrJy7A9G1ZjcbQD98pec5+C8?= =?utf-8?q?RLthdJu7+Lh3qJJrmxajDidyPgGxM3JLNI4JCSckkeoewUMxJ/GDJbEDACT3N4tIL?= =?utf-8?q?tq2jQGwjUUtvCP08RDcKw0m4QPopSNT42n39ejBKsRcUm5kcq6iin/rzg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=?utf-8?q?7Sym9ZPddcsGxjr0PwUMEMf6q0r146dfvyrUnFauekyR56RHjsZ7svA26ULbA5H2W?= =?utf-8?q?WdeTJWxq0PIcqGHKWlHOWnzL9hUB7qaN1UCKWIsdPxa72KYpYGJyUZCcjXmebCMmu?= =?utf-8?q?eACFkw/+yBQzeLxb0xy2/3wmaUUFuJrLbkD9qIjhHuyt2KMspVGswkQAOyALUioFf?= =?utf-8?q?UJq463xksthZYyuyzawT/wobFUKVAbWoOMUWCCNUz7U/kvmC1OdY9pBBHNKoqZ0Pz?= =?utf-8?q?6RrEUPc0b7C87Shv4lVoW/hAW2MivBq06YNj87a9kCdX+tfyP2uWAEOaKdLb/Aa/x?= =?utf-8?q?Tvh3zaG5XepW8T5zspNd7V7FnROuIkkOkmeXcTcs7C9GHF2Cre/0n9K3IjYNvn9DD?= =?utf-8?q?9/YFdXIApc1SNqrQd56PWq44KHMKB46XJbCPIUl4TahQSPYJnH771ttKAImY1w0Kj?= =?utf-8?q?Wr9/tfLsFsa6pV+9f9VLVsZ0fcu6Atp/g=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 3f086514-478c-4317-d2bc-08d9bfd58904 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 14:16:49.8775 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wPxShPIuTQrSztBbFlTxLKZEalpvHhE+kpxg01e1A+jQ4fGhqhwDO8W4a1HeYBBm1wwKOq4xtz1AjDa5EgTRUCNqFkTnhWuCBmW7GocCO+M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB2011 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org For regular BAR, drivers can use pci_resize_resource to resize it to the desired size provided that it is supported by the hardware, which the driver can query using pci_rebar_get_possible_sizes. This series expands the API to work with IOV BAR as well. Thanks! -Michał Michał Winiarski (2): PCI: Add support for VF Resizable Bar extended cap PCI: Don't fail BAR resize if nothing is reassigned drivers/pci/pci.c | 25 ++++++++++++++-- drivers/pci/setup-res.c | 55 +++++++++++++++++++++++++++++++---- include/uapi/linux/pci_regs.h | 1 + 3 files changed, 73 insertions(+), 8 deletions(-)