Message ID | 20220609005553.30954-6-dongli.zhang@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <xen-devel-bounces@lists.xenproject.org> 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 3B6A7CCA47E for <xen-devel@archiver.kernel.org>; Thu, 9 Jun 2022 00:59:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.344438.569964 (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1nz6WK-0001NR-Uh; Thu, 09 Jun 2022 00:59:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 344438.569964; Thu, 09 Jun 2022 00:59:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1nz6WK-0001NK-S4; Thu, 09 Jun 2022 00:59:32 +0000 Received: by outflank-mailman (input) for mailman id 344438; Thu, 09 Jun 2022 00:59:31 +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 <SRS0=RtT8=WQ=oracle.com=dongli.zhang@srs-se1.protection.inumbo.net>) id 1nz6WI-0001NE-61 for xen-devel@lists.xenproject.org; Thu, 09 Jun 2022 00:59:31 +0000 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6880e2e3-e78f-11ec-b605-df0040e90b76; Thu, 09 Jun 2022 02:59:27 +0200 (CEST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 258LTarE020255; Thu, 9 Jun 2022 00:58:49 GMT Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gfydqss4h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Jun 2022 00:58:49 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 2590ub32032517; Thu, 9 Jun 2022 00:58:48 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gfwu433k8-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Jun 2022 00:58:48 +0000 Received: from BYAPR10MB2663.namprd10.prod.outlook.com (2603:10b6:a02:a9::20) by BN0PR10MB5126.namprd10.prod.outlook.com (2603:10b6:408:129::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Thu, 9 Jun 2022 00:58:45 +0000 Received: from BYAPR10MB2663.namprd10.prod.outlook.com ([fe80::7081:e264:cc58:37b9]) by BYAPR10MB2663.namprd10.prod.outlook.com ([fe80::7081:e264:cc58:37b9%3]) with mapi id 15.20.5314.019; Thu, 9 Jun 2022 00:58:45 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion <xen-devel.lists.xenproject.org> List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xenproject.org> List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help> List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe> Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org> X-Inumbo-ID: 6880e2e3-e78f-11ec-b605-df0040e90b76 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=AFRDbEqu5zmJCte4xJD2iO6rtVuuAhsG60fCY4JHBq8=; b=gDOfPRTVfJBGUiamq1Dx5kN8F1arWpKRQawNtWH7QiCaNf0KcaDUL73cvaLCdPXaVOrC iKJFVcq1uaX7otlciAJJDx7/5tPjA3KWbDevRLiJA1k2GR3gO3yb6oYMoelkfPlGzJ/z V+o8o+836hNBncDu3DVkBKcFsFAT+R5VtHhT6bu20CY2M2lKNL61t0DkXfCLrHsIGCAK N8lYol9wo0ZhAkTN4RVjQap4UV4GvP0m+hTwHi9pw6YEXglojgPswWUBhzI7ED7hJ2yk 9Q4+3lgSeCHSGYFl4D6PIoTsn6v3BD4+SABJ4910DTJjRIZcdMGNneFxjJP9ifpafSK9 +Q== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EdTiufipmwD2ag4/7wOWhJZgzqIvnb3SE7aQpB1SIL3+cWicA1lGG7q8r6gxOYiSyt+UddfWr+oUGJ+T4CwC4Ks7B1QAWxgBi2AyL6z4UdsSLFsUFIUAPS/KzG9wzeHIXCpz9gWBPmV2MdiojsXllCYwLbFsousUQL408eFihTZuRIzoiXb4nuxM50b51G4yVGtdPDcdyGDhlDMKSss9jshZPI/TapEsX3WZaxWVa4mS6LIaQVPEIBt5isfguL86vhlk3r0mDJ8a/mN89ik38Uyj4ZzBFpWC/5sRQd3FnD2FiXr0jLhYHE0nBTyKXcoNzedNMSmfEg0MEfOF+xQGZQ== 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=AFRDbEqu5zmJCte4xJD2iO6rtVuuAhsG60fCY4JHBq8=; b=gPH/IRag3x0LijN2SrdYttT7/FAlhx7HzhJIdJEngCDUrj6tKM+h8C3hOF8fNzF6tobvxDyehI+sfrrZ9SHWXzpGbCDmYx6KVp9AS5/5CJ+c3IirsrqUspeC5CJ7NH8glgqR1gtz3/6P9kxZGv/+Dr6TFscfjXU8VJVeoBcUOvW1P9eCkFUTDJJ5D7sQrQbTHY5tSUmjiZF2HregBZKYPq1/TfDsZY5UE1LgcwFG634I5g+HjDfimognLFCXUamicsSKm3ERkwHEjI+MokQ8/1DKf17VGBing/6ipLahuKfsN2Qa3TYTZwdb+7fIBIcoJnNEMVTb88m41e0P7H6WqA== 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=AFRDbEqu5zmJCte4xJD2iO6rtVuuAhsG60fCY4JHBq8=; b=VO1LAZBovLMvGkMmlUIi8iVMK9Vcpb8f+1Z5ml3xKOTlcO646GV7KwlyaP7PzCbqb04xA3HYcj26g4vQhGZUnneaLWjQCmQrBeEzsQzqLYjZubgxJXqmdvsEgcmEMDVQcJkc6tFuAffKWwa8uck+uyQZBv+eETRB/bmpx3GXxZo= From: Dongli Zhang <dongli.zhang@oracle.com> To: iommu@lists.linux-foundation.org, xen-devel@lists.xenproject.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, virtualization@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org, hch@infradead.org, m.szyprowski@samsung.com, jgross@suse.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, sstabellini@kernel.org, mpe@ellerman.id.au, konrad.wilk@oracle.com, mst@redhat.com, jasowang@redhat.com, joe.jin@oracle.com Subject: [PATCH RFC v1 5/7] swiotlb: add interface to set dev->dma_io_tlb_mem Date: Wed, 8 Jun 2022 17:55:51 -0700 Message-Id: <20220609005553.30954-6-dongli.zhang@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220609005553.30954-1-dongli.zhang@oracle.com> References: <20220609005553.30954-1-dongli.zhang@oracle.com> Content-Type: text/plain X-ClientProxiedBy: SJ0PR05CA0075.namprd05.prod.outlook.com (2603:10b6:a03:332::20) To BYAPR10MB2663.namprd10.prod.outlook.com (2603:10b6:a02:a9::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 98e30956-dd49-46d7-b758-08da49b333b1 X-MS-TrafficTypeDiagnostic: BN0PR10MB5126:EE_ X-Microsoft-Antispam-PRVS: <BN0PR10MB512694566F1AE8AC5204E513F0A79@BN0PR10MB5126.namprd10.prod.outlook.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eo6mTZhpT+LeYbsiAQpywSST18f0/OTlhdpZbh14ogf/ywMB62Jpkafs9VIOTG/Vm959hqLo4VYWLNyZZGO/XXkn3BXIHu18LAQL7gaK1TZ/RoWSK7xgELYIvlmlyEDQyHEz0EJJoEtTiQ7oVaxGfdM75TQ97fpiianExRIYoJRvvHoDiApm4xB6sbr8uO9RJsL4D8lC8DWRGk3IuJUGX+PFeEtIIkzhOcxpO0/3+mBP51dCqLmri4XbdgZ1Ch2d4wVQsOUCOYfcZp7yXAYi1kZrCC+lFpWhWaQ5uKi/bnvZCfAJkJTHk3DG9PdZGpjhyJbtv8QsZMlHtL8jr0LrBiDtrDGSMygdeMRQYB7SBbkJFpOjZt5aXk+QWuXer6ILhh8g8uEWvHucQxBw5j+6+DQIrpIAz6eZiL6+re8y8ERAW0X+wllc0ei5vIHcUzHYNWpGqpfT+shCJqIlmJQx3F1cZaGKVV6KdLtWJ0zSAObXK/gRVqkqeadPkGbPpDGvj9H5ZbFgNmPEwd9OhQEVXi1xMGgXznIEhsd4hHF0e69O7xTyGQASoW8FO1n7fZqReBPAvLAfH2JE98yDMaZssY1gGG/LtgfoVrjwk1PbfXaN3rwghmOWTB8I5D1DAMwTHuaRiSW/PhvIPelSSIwWZ/3ARDSmSQpBgRrbOOjPkUlERvB6pRndyCEGYbLq402lqghoiYxNJnid3AJ8B23nhQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB2663.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(8936002)(6486002)(5660300002)(186003)(66556008)(508600001)(4326008)(66946007)(7416002)(66476007)(2616005)(8676002)(107886003)(1076003)(2906002)(38100700002)(38350700002)(26005)(6666004)(316002)(6512007)(36756003)(83380400001)(86362001)(44832011)(6506007)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7Ctv44MLU4FssVzQB8FUAgT+Zf8xZTolAx2orqFrRI8ZbFIRuDKfB70HRZAqNDOP9RhC3XpPmW6UMojspkCFoetrkpMhNvXJOBASxW+jAQ4QTV7i7IfjlCycKQ7y1aGNQvlZDCDW44RKGEZTQaCFziHIZtQsMgshf92AKEHiSdmnrh7FklXuhTQg4jxpQLVjXwb8PPwZIEbF5bYPQ+eq7yWXi8OsOGy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PU3aKjKhNvUU8Ip5Fv+UyxvERii5E9ZMs3aemTg/Ii0a9UT04XIbdsxLFDzUeYchiIhilpzEp4QLdT0XLmy+gdRCHiH7Dl4TOQHbFSWRdERXGE7Gkaq++Fr/qmwbT17dTDvjoGpDXIJYjy26F+VNeEdu7J+UCvHSsOsQOnOBUN2qOdkzmI5O1p+OLPNA+24vSEnTpwVwGW9MztojYay4gzzjYSp5GBcBC9fs95DItYu2JH70ywPp3+PHqOja49oWJhkzQrPDilOCPcu363AufRgIaGZcGxmvcSb9aVHZSmgSSPU8sZH10IpJ1Rrh4uO5s7ID+Iva2k2WPlFhNhsidsLBEESot6UUqeNAtthaEHb8VlJ9AtFCZqfVCpzitWErJbl2dNqMoF5Sb4uCfVailwB/h7Avg6EYMXcGN9q1Hx7+mMy9eMpGLBRtWJy2amksb+NZhljTlsM5w= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98e30956-dd49-46d7-b758-08da49b333b1 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2663.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 00:58:44.2854 (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: n3lY1NrAlt7noMAHkn6b+9NJkykI9dZEIaSm/1GB1FA6f9mkLXclXdYbdT3y9VoDyShIOhPy7+9U2OLeJeIJBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5126 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-08_04:2022-06-07,2022-06-08 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206090001 X-Proofpoint-GUID: Qnr6QbV_IucdMdA0svBJTgRweeORWUAO X-Proofpoint-ORIG-GUID: Qnr6QbV_IucdMdA0svBJTgRweeORWUAO |
Series |
swiotlb: extra 64-bit buffer for dev->dma_io_tlb_mem
|
expand
|
This should be handled under the hood without the driver even knowing.
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 8196bf961aab..78217d8bbee2 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h @@ -131,6 +131,7 @@ unsigned int swiotlb_max_segment(void); size_t swiotlb_max_mapping_size(struct device *dev); bool is_swiotlb_active(struct device *dev); void __init swiotlb_adjust_size(unsigned long size); +bool swiotlb_use_high(struct device *dev); #else static inline void swiotlb_init(bool addressing_limited, unsigned int flags) { @@ -163,6 +164,11 @@ static inline bool is_swiotlb_active(struct device *dev) static inline void swiotlb_adjust_size(unsigned long size) { } + +static bool swiotlb_use_high(struct device *dev); +{ + return false; +} #endif /* CONFIG_SWIOTLB */ extern bool swiotlb_high_active(void); diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index ff82b281ce01..0dcdd25ea95d 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -121,6 +121,16 @@ bool swiotlb_high_active(void) return high_nslabs && io_tlb_high_mem.nslabs; } +bool swiotlb_use_high(struct device *dev) +{ + if (!swiotlb_high_active()) + return false; + + dev->dma_io_tlb_mem = &io_tlb_high_mem; + return true; +} +EXPORT_SYMBOL_GPL(swiotlb_use_high); + unsigned int swiotlb_max_segment(void) { if (!io_tlb_default_mem.nslabs)
The interface re-configures dev->dma_io_tlb_mem conditionally, if the 'io_tlb_high_mem' is active. Cc: Konrad Wilk <konrad.wilk@oracle.com> Cc: Joe Jin <joe.jin@oracle.com> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> --- include/linux/swiotlb.h | 6 ++++++ kernel/dma/swiotlb.c | 10 ++++++++++ 2 files changed, 16 insertions(+)