From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE30E42BCC; Mon, 29 May 2023 08:32:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCBDF4111C; Mon, 29 May 2023 08:32:59 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id D0FC440A4B for ; Mon, 29 May 2023 08:32:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685341978; x=1716877978; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=NTn9LGBdQ8AJ0OHL8PYHeLmWXcjmL+r1IhR9x91QHOs=; b=BwE+73JZvAWsfyVnxWrXhi+wGeLcmCaTGjtvKSYt9ES6eL+vPisL5GyM epZd/gWgQWxsyCaciT4KOkrYafp7004Gq9vy2zsg78mQKYn1Et6HvJIpD Om64/LxjUS4z9p021yT34YBDu/44quLaSThUYTkQfXNmP6pPDbovhQIBT GFcFg9uHk5OogcGNs0y8CA56MDRn86jc+OYUDgk5TAqEsVjPgfY+nIsK7 yL2Mpz05OfGAthsLvjC7VkE7MggnJvWJ8EiBEeCTx47hdlZsaxRhJCBjs SY5c2KjDIEsEQoCKnKoP3Gtkt9NCQJ3cHcEA66ADEAN5mdLkemOdNvzI0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="334258491" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="334258491" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 23:32:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="700135745" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="700135745" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga007.jf.intel.com with ESMTP; 28 May 2023 23:32:54 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.23; Sun, 28 May 2023 23:32:51 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 28 May 2023 23:32:50 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Sun, 28 May 2023 23:32:50 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Sun, 28 May 2023 23:32:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N8QW6UPgG8Pu9GY24UP42gc0wloCXYAmLTZbOuZQhi1dc64MXyww2keyIDGK8NzWVvbsd0MXOPIhqdB089eci81zRQnHntdzf5qmtApOMlL8lAyI5DcC//IFSWu41/fycm5m48R5X5TJ2aVWXhA+JyL7lVYaGD3Ci8bKN4jH2vIXAFHamFhiRCiQIF+ZpIgBW8KctEeX7NuvIXaqPB/fYPGwOUEzPknf3/uptOKwgK8xosRgfe3j3D0NZaGUkhnxEcttH+HV/URq3c+0ZaFllLQJXrsug//1imacrHpUxikkzzOKClsm/JR4W7DPcTJnX8aPTiaKqe2uin6eIAAxBw== 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=k7kSaNaVas4M5ytsP/xdUmPhXY9wMDJv7b/HXNFZd1A=; b=gTo7/emCAOc5GupGJdassEzXMHKQ/FEGB2IKpBUIoSR6kI+2kt+JYgH9JBOi3TUQmbKgZNxPTLg7eK+4WfBrA2XyoCbCkRi0CudtkQNo3KIVWiX6+AzDGgfWXumPlyDT6Qcut6IqkztwHexd1rfZod5W0A7Zwml3GI5i1h/fljc9cQZVvAVbdDZE9t7fs1LyoOWpFtnY8asUQsO6EOHHAorcP+3ysouixKRS2qd7dGppuwM22gJLTQ/LrcmRG1uit9ljZPFMLSVks2EbJ+bOY8C+T3FTU4eRGeHY7eDr6HxVCD7LifEDdpl+WhgbG99WJVwEV2HVeVd1WASg7/BAbA== 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 IA0PR11MB7838.namprd11.prod.outlook.com (2603:10b6:208:402::12) by CH3PR11MB7204.namprd11.prod.outlook.com (2603:10b6:610:146::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.22; Mon, 29 May 2023 06:32:47 +0000 Received: from IA0PR11MB7838.namprd11.prod.outlook.com ([fe80::25bd:1586:f523:bb3]) by IA0PR11MB7838.namprd11.prod.outlook.com ([fe80::25bd:1586:f523:bb3%6]) with mapi id 15.20.6433.022; Mon, 29 May 2023 06:32:47 +0000 Message-ID: Date: Mon, 29 May 2023 14:32:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.11.0 Subject: Re: [PATCH v3 4/4] bus/pci: add VFIO sparse mmap support Content-Language: en-US To: Miao Li , CC: , , , , , Anatoly Burakov References: <20230515094124.722431-1-miao.li@intel.com> <20230525163116.682000-1-miao.li@intel.com> <20230525163116.682000-5-miao.li@intel.com> From: "Cao, Yahui" In-Reply-To: <20230525163116.682000-5-miao.li@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR02CA0039.apcprd02.prod.outlook.com (2603:1096:3:18::27) To IA0PR11MB7838.namprd11.prod.outlook.com (2603:10b6:208:402::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR11MB7838:EE_|CH3PR11MB7204:EE_ X-MS-Office365-Filtering-Correlation-Id: 12b35e64-c8c0-406f-340d-08db600e8439 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2cGa0flWlBAofdS1R4t3vAEN4h0uQ16Ca9o0L4PKru1e213enbObpUCvPJJzUnjtLEVejEFFnCpDJTnt2EEEjhNJ4NIdqczr8J2uxivHdAtcboDWtcwHRToIoIq6bpxfbJfZiHWTSLhFROCNVWFVnIUv56uQBz+u8631PlRGn4G80zsFueIVtXXkdGXGt1rSEsIosfi1E/wnylN0qNq8wEjw2LxmQnYxQtaqrAHUBu0Gti0U5g8TvoOZ3f3+bBMZxWBlot8ZvwoiAlaZDqzPw7MjBQg9Q21QdqgsjesL8/aOy9GqqEI6BpIlWPSC+AL3wYoRPqnckNo3FFsQR1nwG7Tb8pXf2zz1hXsQjZBZ37tjapfD2tRqMVtbfCcl6D/sE8NCNA+EeTWHeMzOSyRCtihLMcyhR0WqXFMPmJpxrzNWOzu41C9hSHzMA+CLwyXl4YnS5IiO66aJvquHI7+a6N4AqLrTKLbtttEAAe7SmFC426+xpgzOC8MkGdO7fcWw8fr9Gf2xQS588P/9GuyXCalF/LB9fPF5+gUFD+waHBUhftQRZvFxGblfidYmB+zMGz9kgp5kKv/nawA48l13EPmaNXZ/rbBumyzpf3GIouRIQ7LNQ4WI+Bftl5gi80xbMc/wV7l14l33tEDJlzsbuw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA0PR11MB7838.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(39860400002)(346002)(136003)(366004)(451199021)(31686004)(82960400001)(478600001)(38100700002)(86362001)(66946007)(66476007)(83380400001)(2616005)(66556008)(31696002)(4326008)(4744005)(2906002)(6666004)(6512007)(6506007)(53546011)(6486002)(186003)(26005)(316002)(41300700001)(36756003)(5660300002)(107886003)(8936002)(8676002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U0JJMnRuMkZrU29sVHdrYkQ1WnJzeCt2dWdFOTVGY1kxeFcvMjljaEZ1SHJQ?= =?utf-8?B?cHlUcUJuNXR6cU9EMk1sb1BBMEhPTlpRMms5MVBYUFZFWDRrMlQrZWYzdXYy?= =?utf-8?B?M0kzeHFoVHZpcjBFQ0hTL0xydU9WUHNIMGJCY01wTW9XZURKZ1RXWTcyN0ox?= =?utf-8?B?OU5yL2NmaFJLZjUrYmEvZ1VCTDhKdVZVTXNDSURpaUtaYnZmbW05dVdVeE1V?= =?utf-8?B?MTFjZE1rQTNTRGZsSzYwdkxWaVpqSHlUZWNaR1BIUHJLNFY5R1VYNTV3QXg5?= =?utf-8?B?c1duMGpwRkE1K3Z1eGNXbGJ4ckhhNVpSQ1FCcjU2SzJyV2Y4MzMvT3pSSG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-MS-Exchange-CrossTenant-Network-Message-Id: 12b35e64-c8c0-406f-340d-08db600e8439 X-MS-Exchange-CrossTenant-AuthSource: IA0PR11MB7838.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2023 06:32:47.0926 (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: tUfux85y7bD9+qubGQNZ3LqSg4nsmHZQ/SKsESodjBh+SlIMhhJ3ouor1BssIOOFtDcRnRl2veQvFENVA47iOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7204 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 5/26/2023 12:31 AM, Miao Li wrote: > This patch adds sparse mmap support in PCI bus. Sparse mmap is a > capability defined in VFIO which allows multiple mmap areas in one > VFIO region. > > In this patch, the sparse mmap regions are mapped to one continuous > virtual address region that follows device-specific BAR layout. So, > driver can still access all mapped sparse mmap regions by using > 'bar_base_address + bar_offset'. > > Signed-off-by: Miao Li > Signed-off-by: Chenbo Xia > --- > drivers/bus/pci/linux/pci_vfio.c | 104 +++++++++++++++++++++++++++---- > drivers/bus/pci/private.h | 2 + > 2 files changed, 94 insertions(+), 12 deletions(-) > Acked-by: Yahui Cao