Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp740959pxj; Wed, 16 Jun 2021 12:28:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwASwd0KBuz9Kx+THuLd/4fHqbyH8eSuqeYRrANutWfmaP/H5qFA7dIkj63P8CsysjPFAC6 X-Received: by 2002:a05:6e02:dc8:: with SMTP id l8mr806090ilj.286.1623871716718; Wed, 16 Jun 2021 12:28:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623871716; cv=pass; d=google.com; s=arc-20160816; b=smzEILkWXaHNmgFvKTeEt5NoA2TzlLqeJGDm9SS4/piWIWVWh8FqjsQaegz85ypwUp vR47ScfSGwgy2q1cW/07piF9Paj7YxlWVIEzwM/Vngqe9qmHStRrvN7gyoaGcnpAmVJv Cd22U0au9k6nbRAqfBoIxgV5HjvyX3EjcCKeIysZ1hiBMOUHX3oQ91rnL1ptguNFIptr gX9kCwtbdChlyGXa7QuSsCbJuwe3KkW5Gc/GRHtz0P9oCCYxaPNPKKlpGJmseni8sgUi VoA7Dk5Ct7w2yW1lwAhbdVvt1f/pxXOMKL5trOebQNlgTw5cUVzfjgg47mfrTUES/+BV buqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-language :content-transfer-encoding:in-reply-to:user-agent:date:message-id :from:references:cc:to:subject:dkim-signature:dkim-signature; bh=0UVoaecywuccJw/TpunixyYtBjn6fc61YbswWJ1qBDg=; b=PC0JELb2oSOUZNm2cyAn24cG0IUMJOKC+oz5QbI/A0b1jMMONO983dbzE7ZFUNQS+N zjmGqR5OYZBhA+7t4HxRRKpz1ZgDTYWkljKYNvG0mt41g+IPqt/JZ009zB8PfSSSU7zw zPAdEGuOFrTyE5bg/Hvsuus0QEetUozsId3Ndp4D8ObDB2PfF7yQWucQWCRZa6pYY2CT xmtcvFLwBLr5zyDWekZ+/HjpKAbdayZ6NZGYiCda29aHYCfckzC0qSCLFzSrj1tZCVfL hDZ7EZohKkrsacBnuZ2hpkdblYrOUSw8LxWljVVcBjNQ8yMiawL/1t96qKa7sJ4GVSr9 zhqA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=xzYNaGlm; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=WwYocbkN; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si4373359ilm.103.2021.06.16.12.28.23; Wed, 16 Jun 2021 12:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=xzYNaGlm; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=WwYocbkN; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234652AbhFPPgU (ORCPT + 99 others); Wed, 16 Jun 2021 11:36:20 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:24236 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234640AbhFPPgT (ORCPT ); Wed, 16 Jun 2021 11:36:19 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15GFWNBK009743; Wed, 16 Jun 2021 15:34:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=0UVoaecywuccJw/TpunixyYtBjn6fc61YbswWJ1qBDg=; b=xzYNaGlmS81YcWGLdCXWjDeqK3qHaVRTaZppPscrNcgiQKthPyTEvrLp12IleqbFchCn 3fqHKLCzrP0WtIayRpQXHVxDEUs6DMX9Pub1WZG+/WPzDhOyei4Wu95RYOMHm9RKjet+ 0sKNFEO9vYUHY1sPPHz4dWPtGapHn8zbd/AKJ4NaCbeCvAwrQmw0CscTiTBZvywQA47b 6Zcj0bwKMj5K3Mc8/3TNv3yKGKgXrEJHnZon39SIZe6XhhHG1eaqiy6eXdIvkPuDtQ9d oywuvdPaitRcty5oBqunOWGpME60nQMD0wFNBffuN5IO59VxsuG5nHePAPhSVD/7j/lf uA== Received: from oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 397h4bgenf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Jun 2021 15:34:00 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 15GFXw3m083559; Wed, 16 Jun 2021 15:33:58 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by userp3020.oracle.com with ESMTP id 396wawf7yw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Jun 2021 15:33:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rg2n1noyrhwtCwVqdSSlxhvxsIrcvjeGHvnlXovhVl0qIPcq+tsEHWYnOGqA8lbum1UHUqjsmi7gDpo6zf86ArJk/KhUk+wdqXvt1DevePru21nrG67BRVaHg7W4jq53YnrUoz00zbnTMGL3HSCLDyg7BwCQhh2NLmdHBdSExhecJs8xvzHKOGdRhK1Na04e1puxSLOnmU0qsplwR2Bo9RL3CGZmQkotq9LhzQdArDX9ZIUrUE3FA8VitciAHhEa8IRzVs+CqZZe5W/S0bb6mxwW2Q8OADbt7ouBMHFd/MZdqigPw65/dQxC/LT7dNUsB3KwUv2IJQSeCs/YJvhZEw== 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-SenderADCheck; bh=0UVoaecywuccJw/TpunixyYtBjn6fc61YbswWJ1qBDg=; b=HeNgp0assIB3YXP+Dlyn0Ha0p85OqyXh5tgI1WYn3tQyqqc5ON0fIXbD8EKJCUnCBX4zmI5MxIFQvAS2pvCqizgxM9yCB7UtNbTXIjZEK6nfbwqi8w4PvlStwwwyBAek+vHNR9N/pTjq6F8hCQzFCwC27wXG2kDzJ6sKQeDqkt1IogDXn2grnH3yxW6mR3hoPKR0/C5JS2eDCSGP2RfHuoOG0S4eJkn74k82adNar0MglDBmkhEM+5hpTyl4BUzu3vD8Z/hm5ohCF2r566IMAhXJd/52qgPwDxJ3Aa6gLpRV/jc+JKPhCxyciIPuLKseiZ0o084cfFAg6GM1cZ+nNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0UVoaecywuccJw/TpunixyYtBjn6fc61YbswWJ1qBDg=; b=WwYocbkNqIm7NTJS71Za0BtUV0/8JymR9QDiJEJqMn7AeGUDQKKzQyJ9YEoiC2+8hMmu6xlhkrlvY0Kaslwo6r2KfMcTE9AAUlbXFVj4q0UDWHSxDIVMS0/fu+z+m+j+9zxUgANfkmen8kyBj7cTDhbBZ9pdjlOuFzWELx8XFaQ= Authentication-Results: epam.com; dkim=none (message not signed) header.d=none;epam.com; dmarc=none action=none header.from=oracle.com; Received: from BLAPR10MB5009.namprd10.prod.outlook.com (2603:10b6:208:321::10) by MN2PR10MB4302.namprd10.prod.outlook.com (2603:10b6:208:199::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16; Wed, 16 Jun 2021 15:33:56 +0000 Received: from BLAPR10MB5009.namprd10.prod.outlook.com ([fe80::78a3:67d:a8ca:93cf]) by BLAPR10MB5009.namprd10.prod.outlook.com ([fe80::78a3:67d:a8ca:93cf%7]) with mapi id 15.20.4242.019; Wed, 16 Jun 2021 15:33:56 +0000 Subject: Re: [PATCH 2/2] swiotlb-xen: override common mmap and get_sgtable dma ops To: Christoph Hellwig Cc: Roman Skakun , Konrad Rzeszutek Wilk , Juergen Gross , Stefano Stabellini , xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Oleksandr Tyshchenko , Oleksandr Andrushchenko , Volodymyr Babchuk , Roman Skakun , Andrii Anisov References: <855a58e2-1e03-4763-cb56-81367b73762c@oracle.com> <20210616114205.38902-1-roman_skakun@epam.com> <20210616114205.38902-2-roman_skakun@epam.com> <2834cdc0-534c-4f07-1901-e468a7713c1f@oracle.com> <20210616142148.GA764@lst.de> From: Boris Ostrovsky Message-ID: <83353b34-2abb-9dfc-bed6-21d500abf49f@oracle.com> Date: Wed, 16 Jun 2021 11:33:50 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: <20210616142148.GA764@lst.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [138.3.201.8] X-ClientProxiedBy: SN4PR0201CA0056.namprd02.prod.outlook.com (2603:10b6:803:20::18) To BLAPR10MB5009.namprd10.prod.outlook.com (2603:10b6:208:321::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.74.102.136] (138.3.201.8) by SN4PR0201CA0056.namprd02.prod.outlook.com (2603:10b6:803:20::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 16 Jun 2021 15:33:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ccfe135f-8924-4ce1-5686-08d930dc2757 X-MS-TrafficTypeDiagnostic: MN2PR10MB4302: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IkwnElf5yfGgg7noxftFNzPVp08pj/U0UCUGUYm/PJljPJxJwy+tr3zvTwcYYrQgWeupXHEN+NmhF+G9smoCUZQfsLhndz4qKN6qereBElAwod6M6SsDKEzf9NTZwzasxO+Rcmvzb5yJtiQC6OhendVZymQLbY9VOu1tMaHdifjpiMNhg9YxbxWFM/QO0rSqv+hNqNDSgJ+DI+tAw5vK7SzgFlXk0DFepC2t58Qs5Jlrt0BS8xOs5LcZFKpFyCnR/pd1geGoKeWB2GoPx2B0ui04LP/htq42HjfaFdUzBD1DcthY5b4kGLLYadWrhAeMV1ZhzAd6ImC8YgxA2VcxAc+yc/aw7AfMjYskIJCrIf6Rs3TO953sfpLaibccs9BCbgwc+vPLXt9etKqZDa9dHDXjhty2VCfsTVby3raDH1faVTdG9MZineFCpWALwuneU8DZO8PGo54lZMXRnA70/1VEz9Yzi/8Z0H5NX7v7grEBkJZUWVCiXlaihSXaHGiFKS9jYqeZ8amDoWkFgQy0+W/BBgXNUZIBERHNf/golH2ZsUk5u+zdklY52H57dPC/NZ7olkdNLfZoX2w2/J0TltQnv2rX/y4ulFkZtLn9lCFrMUjWud6nLGB+DfZwBLBT44Frvh7jPqPWwqAWP9xY+gojZxmwq8DPKf0LhCTPUr7qEoeqALk6cxGC4odJ6+Co X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5009.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(39860400002)(346002)(136003)(366004)(396003)(2906002)(8676002)(316002)(4744005)(4326008)(36756003)(54906003)(186003)(2616005)(8936002)(956004)(16526019)(31686004)(44832011)(7416002)(31696002)(86362001)(6916009)(66946007)(5660300002)(6486002)(478600001)(16576012)(66556008)(6666004)(53546011)(38100700002)(66476007)(26005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SGw3a05mdjZiNFEvV3l4S1lkck1HWUttdVdYZVNra3hFazRhdGw2bGw0eWtV?= =?utf-8?B?T2I5czBPRWsrdWFiUDB6QUxkc0dvT050Q09SaHh6bkViR01EWmYwVXN0VkZM?= =?utf-8?B?WkxxeVFCZTdhVDdtWU1sT09tbWdLNFlMUTRFT3ZId2FTTVlMZklEcmUxOWZp?= =?utf-8?B?bmt4ZFhpU3E2YXlKR0xIbVhwM2lZYzdscWcwTnNhK1JHaFg5WFk3WTJhcURo?= =?utf-8?B?L2UvV1RWcW1nbVc4RE1qcTB6RHR4cVEzbXZKcU9iVkt1cjVVdEhPamh4TGpH?= =?utf-8?B?NWRHQi9LYTlWZmFVZFVVd2V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EEzdEt2T0VVcW44K0JZMC9FR2xuQU1IZndESDlKaVdJcFExVENtbWF2?= =?utf-8?B?dTViT3NIMm4xU3liNUpXSFBtYXNzdTBrb0pBUUQ0R0VYM2lZaWtJczhkTHlo?= =?utf-8?B?SnZzd3dFQlVhUE5iT05TZDcva1REMGNNYm1nVWNLUjh4UU1YZy8xaEpiL2E5?= =?utf-8?B?VjIyTzNGQzZpVzVCcEo3Tmg5NmxRSnBRbHVzT3lGelpWTm5TRnplelVLWjRB?= =?utf-8?B?ZVpEc1pPcXdqVlVqTUh4a2hBRnd5TmxoUHVSWkZKNkQ5YWxqZFpBRmNhOWZG?= =?utf-8?B?aGFuaWlQZE4yWXVaR1ZuM2NMV1VWaUJCWlZIODZxOXB3S1ZseUI3UDl0cS9j?= =?utf-8?B?YmQyTGJ0OHJLM1hldXlraWFwY0drTklybnlVZkttYWErb1Zrb1Q4VVAzdE1T?= =?utf-8?B?QStXYnc4VE9Camp2Y1l1QWk3S0lBcWlydHBXbVdxT3BZK1ZjbGNsSWJBSDFE?= =?utf-8?B?OEtwSUVqRTF5L1ZzWHQ4Q0RpU2JRN1V2cXdPbVU1MW5oakJKNXlUMFZ3d1J1?= =?utf-8?Q?WSNHruuYoNZyWdLKt+pYnAFdULGUq060N5TkWCA?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccfe135f-8924-4ce1-5686-08d930dc2757 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5009.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2021 15:33:56.2451 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: erxKNzPRbruHC/K18avd5iS39eZ0XqN14JHxHYH5TUulaKNdM4zBFHW58NtPXdqKdjmt7MQcNIfqJb+3L5RaqaknhiqjWpfrsOnXuNM0uJU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4302 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10016 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106160089 X-Proofpoint-ORIG-GUID: Lv6eqeZvCVRLAZrZKufO7wDmYVG0EeVG X-Proofpoint-GUID: Lv6eqeZvCVRLAZrZKufO7wDmYVG0EeVG Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/16/21 10:21 AM, Christoph Hellwig wrote: > On Wed, Jun 16, 2021 at 10:12:55AM -0400, Boris Ostrovsky wrote: >> I wonder now whether we could avoid code duplication between here and dma_common_mmap()/dma_common_get_sgtable() and use your helper there. >> >> >> Christoph, would that work?  I.e. something like > You should not duplicate the code at all, and just make the common > helpers work with vmalloc addresses. Isn't the expectation of virt_to_page() that it only works on non-vmalloc'd addresses? (This is not a rhetorical question, I actually don't know). -boris