From patchwork Fri Jul 7 13:42:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9830367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D276D60352 for ; Fri, 7 Jul 2017 13:43:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C905B26E3E for ; Fri, 7 Jul 2017 13:43:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD2FB2853B; Fri, 7 Jul 2017 13:43:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D73526E3E for ; Fri, 7 Jul 2017 13:43:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753103AbdGGNnD (ORCPT ); Fri, 7 Jul 2017 09:43:03 -0400 Received: from mail-dm3nam03on0049.outbound.protection.outlook.com ([104.47.41.49]:23100 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753115AbdGGNm5 (ORCPT ); Fri, 7 Jul 2017 09:42:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RlOSin9mKIzn1Bq9OWTDW+2tr+FUHEUJGQ24Dz9wFB4=; b=MWBuWtXFlvu6H+XSkzcv51+4kUOETMu5DDL/faF3doNztLUwyIKAT0FI1m66944vNHnNuRmJoYN+tcStWONBydxxkwm03CuJF785LOr2ff+aSfL+T3HVEj/EA8EWP8WDCF8cEjBpqSLfIqRv9gfCGcVvVdX2ynCjUGsvtCY2FOg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by CY4PR12MB1142.namprd12.prod.outlook.com (10.168.163.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Fri, 7 Jul 2017 13:42:51 +0000 From: Tom Lendacky Subject: [PATCH v9 25/38] swiotlb: Add warnings for use of bounce buffers with SME To: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, xen-devel@lists.xen.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org Cc: Brijesh Singh , Toshimitsu Kani , Radim =?utf-8?b?S3LEjW3DocWZ?= , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , Jonathan Corbet , Joerg Roedel , "Michael S. Tsirkin" , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Borislav Petkov , Andy Lutomirski , Boris Ostrovsky , Dmitry Vyukov , Juergen Gross , Thomas Gleixner , Paolo Bonzini Date: Fri, 07 Jul 2017 08:42:49 -0500 Message-ID: <20170707134249.29711.3050.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170707133804.29711.1616.stgit@tlendack-t1.amdoffice.net> References: <20170707133804.29711.1616.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR16CA0045.namprd16.prod.outlook.com (10.172.42.159) To CY4PR12MB1142.namprd12.prod.outlook.com (10.168.163.150) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4765ccb1-2375-45ba-8c5f-08d4c53e110e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR12MB1142; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1142; 3:Sm85bQo+42tM7btBfHNdBIcupCtvVvyAo4u/1rMs5G6dxO8eyNw7RJtNsf6TeuxC4xGl+ryrZsx5HzJ7zQc02ZoMO45ZTGZYTbkE9Q77gaseXWtrl37vd5Iy9cBQN4hHsojXHtQAusx9wEVhJ9HLJSnys2QDcMdKboDbDBmNm0buX9aYEHJ2eQcd46HEg7aIPZZR7HtNsDCWikU/PWoYMj4MWU2w00Ahwy2r4926nomrchqZ4iZGsCSSLJ9Uer+q5hHNRrp8Se0ygC1RVv1ihJmE0VPqHs7QFnetYVDyv0jRk4R8iQecjMaoBkp3HmO8MPAD4qbzYuA5wMAu5ZVUQlF7lzIe+i6PleLxopouOV+zSsQEoqHeywB/BZQa7TktHkDrKjQtoQ3tziEjJpE13ny+r5K4YowuQcOTd/0xMtu+3KLtx0R+6ahmzD44rH5bq2OybwiP2x81CswF4avt7VbgTs4vWXPZVcFRYcA6eCLUCPKC4xOa4ScGc76YGCJT3k6LjvI8wzG+lOamSLchnR0pZjzn4FSjMQEsktScvUWnuK+70iO/l9r7a5FpTa80h2F3UbBSXN5iIJuzYeDlvPa9mnOZXtVWbz04/Oy7QwrMcJEtKDbag1t4mHniZMIAs5giGh69UjCJUR/Ug0KtMYdqJHyz+sPjEdtaF7wGSmBJYF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5ct7f9GYSyTPWFSWLCgdruQTwh0xbU5d6AkjzQOloohu7xlE60QeFh3Yb/vMiizZqDIT1Fc65BOgfNjiWZbFe7PqrsdKFKXThYfRoxQvlLp1UYzbGbDZG3X3jOdejI+F9rQZe+o0ew+kAzU99u62lyIaGBNJVdLrD53ULxswcReQW8O1/QvspI97TgJKqg8U3LX6U9uC526I1fPfnLdI05gUcPBc3jp4q13JnahPMws6BY53Z8l97H X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(2017060910064)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1142; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1142; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQyOzQ6WElaVFAxVEhZTmY2Z1pYRENVRk5xY2VWT2hw?= =?utf-8?B?d3M2TlREN3l1UXVzK2x5djhTREpqRmoxRXZWd2ZMOGs5UjBwVDl4VVFvbksw?= =?utf-8?B?cUFkU0p0dW14MHExeHhvY04zLzV0QnFQSWN5cFF4VzFPN1FiVzlGZEhZZTJo?= =?utf-8?B?QSt3dXBzU2k4YTBKUk9tbS80b0RQZmtIUVNqUnRKZndTRTRkK2E4Zmhvem80?= =?utf-8?B?Q1pPRUdNWmJOejY2SWJFUkU2TExrRFpvQ2FuTVBYa0xZdGhycW9BL1FOQWhv?= =?utf-8?B?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Z?= =?utf-8?B?Y29nSTRnaTlJcVYyaGpsTDVqU016KytQVXl1V2hQd1ordVlLWXEzTnVaK21P?= =?utf-8?B?emtkOXBzdktzUWl1Z0NITnZkeVlaMm0wY0ZyRDk5M0NGSGRiVkZpY2U5cTRl?= =?utf-8?B?M3NTeWc3a3M5MHZxUFZrWWorS3BCQndoLy91NlR6ckZhRTBaQ2tKTGhDUlZh?= =?utf-8?B?QjNqOGZ4a3ROVWNDdmZFQm9XQ0l6S0FaNzNaNG5KV3FOMVdUNkJuNGRLMmNK?= =?utf-8?B?NTJ6SnRXWm1BQnVGRlBjYUdSajRiWXhzU0M5azJoVHFMMVRQQ1FhdGdkTklt?= =?utf-8?B?Tkxmd3cvcWhxVVBCUS8zRXZmeFRFcEdPTVpNaVpMZ1lJUEFGc3VQUUsrc2dn?= =?utf-8?B?UjNveWZTaDhKY0ZOT3QrZHl3Q3lsbDJkU2RhYVhQM0xZeEFwLzJocnZkVWd3?= =?utf-8?B?dTUzMk0yZkZma01FelRZY2RVT3J2N3FyQ2VtMlpqTmtJYU9xQnU0eTUxNFBq?= =?utf-8?B?ZDlDNktKSDBZdFRKMDRHdXZab2ZMVnMvMEo2YUdYUUZ5NEQvQ2FSV2JhOUI3?= =?utf-8?Q?4QoyZ8BJbhvVzKOU3M3xv12e2AlYu6XkN2LY=3D?= X-Forefront-PRVS: 0361212EA8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39860400002)(39850400002)(39400400002)(39410400002)(39840400002)(103116003)(23676002)(7406005)(86362001)(2906002)(305945005)(110136004)(6506006)(47776003)(38730400002)(230700001)(33646002)(72206003)(53936002)(25786009)(97746001)(50986999)(54356999)(4326008)(7416002)(189998001)(7736002)(5660300001)(54906002)(6116002)(83506001)(81166006)(9686003)(478600001)(2950100002)(53416004)(3846002)(55016002)(1076002)(8676002)(76176999)(66066001)(42186005)(50466002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY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ostics: 1; CY4PR12MB1142; 20:daB3eQdzTmRydkDarc32yZf7FGKRqi1Kd6zPx+lJON+iPiXKIYTpWNnseXGSD18v3YxXbbwbYke718KAPKnqkfpqxqbvzpzN0Ra7TZdA6MLjDIHJtLF8YrLI0QquNtO8mVoX+4iCXG5c2E3q56ud28y16NvF90ryv2oxgIvk4zRmekfOgrcflwyUL9DloOZB1OwXk+X8dBwh5u6vTpZjLJ8HTesQw4jn6W8uASnvwqK0s28/GOBl/QdYaTEubvwM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 13:42:51.7767 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1142 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add warnings to let the user know when bounce buffers are being used for DMA when SME is active. Since the bounce buffers are not in encrypted memory, these notifications are to allow the user to determine some appropriate action - if necessary. Actions can range from utilizing an IOMMU, replacing the device with another device that can support 64-bit DMA, ignoring the message if the device isn't used much, etc. Signed-off-by: Tom Lendacky --- include/linux/dma-mapping.h | 13 +++++++++++++ lib/swiotlb.c | 3 +++ 2 files changed, 16 insertions(+) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 4f3eece..a156c40 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -10,6 +10,7 @@ #include #include #include +#include /** * List of possible attributes associated with a DMA mapping. The semantics @@ -554,6 +555,12 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) #endif } +static inline void dma_check_mask(struct device *dev, u64 mask) +{ + if (sme_active() && (mask < (((u64)sme_get_me_mask() << 1) - 1))) + dev_warn(dev, "SME is active, device will require DMA bounce buffers\n"); +} + #ifndef HAVE_ARCH_DMA_SUPPORTED static inline int dma_supported(struct device *dev, u64 mask) { @@ -577,6 +584,9 @@ static inline int dma_set_mask(struct device *dev, u64 mask) if (!dev->dma_mask || !dma_supported(dev, mask)) return -EIO; + + dma_check_mask(dev, mask); + *dev->dma_mask = mask; return 0; } @@ -596,6 +606,9 @@ static inline int dma_set_coherent_mask(struct device *dev, u64 mask) { if (!dma_supported(dev, mask)) return -EIO; + + dma_check_mask(dev, mask); + dev->coherent_dma_mask = mask; return 0; } diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 04ac91a..8c6c83e 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -507,6 +507,9 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, if (no_iotlb_memory) panic("Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer"); + if (sme_active()) + pr_warn_once("SME is active and system is using DMA bounce buffers\n"); + mask = dma_get_seg_boundary(hwdev); tbl_dma_addr &= mask;