Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3377841pxu; Mon, 19 Oct 2020 10:31:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDRNb/4hLkKjLvng1nlPtwb65/4LwQb4fK68ifLpmEr31/hlmSSn7h3abEkWA2dmFYwYcp X-Received: by 2002:aa7:d8cf:: with SMTP id k15mr914674eds.110.1603128661950; Mon, 19 Oct 2020 10:31:01 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si279474edj.155.2020.10.19.10.30.39; Mon, 19 Oct 2020 10:31:01 -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=@nvidia.com header.s=n1 header.b=hflumUd4; arc=fail (signature failed); 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731202AbgJSR0m (ORCPT + 99 others); Mon, 19 Oct 2020 13:26:42 -0400 Received: from nat-hk.nvidia.com ([203.18.50.4]:54926 "EHLO nat-hk.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730095AbgJSRZO (ORCPT ); Mon, 19 Oct 2020 13:25:14 -0400 Received: from HKMAIL101.nvidia.com (Not Verified[10.18.92.77]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 20 Oct 2020 01:25:11 +0800 Received: from HKMAIL101.nvidia.com (10.18.16.10) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 19 Oct 2020 17:25:10 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 19 Oct 2020 17:25:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVIcJnbikLrwBj7xpDOjAf3ueq6t991lWTlZhTAfIeqJH4M9EFIz0Y+uML5c304yuWH75liz8qDIiVxx9COwJ25X1i2U1NVX5/XFxcl33hlEoMdNwzl8xYgFVrRZs/9qVcXk6TuLBopWW27UX1nhrTLEAsTB8RKYlddHxjQ0wz35+1rosoNUyNDbpg7TMH9TMpzYjMHHHIZwTDacb3+mVx7+cyYuuPY5npy/f6YfYECkvTb48/hUHsNO3IqXiraQFd4/diO7SYa9KorTQQlLYRoVKnfuBu7ohjrAd6ZaJu++KwaHcCO8FD6oghyQ1Xvn/cNsmpGLbcv6ZZ4c8pUssQ== 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=+RYXBXHcRflICjlHYqIevLJYA1M+Lqj3fKVCCM8NL18=; b=gHnhgPX8DuggNHk1A+oAinWsH0vNbS+7XpD0mr6COZQztZvXPZmQJW8hXaL6mmUMnHt3I3LfS2LwoUQt08v+n9vitsSz/0Q+ZyDZ53nfoSTe9mXqIMWjXp0k5IRM4QYMiXYNHpCPUL2tTB+ZiORKQwvND3R36B8qpbe5Kof7qiyQ7KPVcT6i3OPG2Yp+Ss3P43rKQ+CHyG/PVO1nCxTM8uAHeNFTl+CidcIQHfToKdOELChZgiRw9rk6vt0RgHEfPdH5hwVu3Fs35Lelh/VNcdzFVavaxaeTszwPi4UQbGpL9uEfcsHv+g7zvco/3e6U5G4G7OTjeYQBFV8kHAcl7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) by DM6PR12MB4619.namprd12.prod.outlook.com (2603:10b6:5:7c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22; Mon, 19 Oct 2020 17:25:07 +0000 Received: from DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::cdbe:f274:ad65:9a78]) by DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::cdbe:f274:ad65:9a78%7]) with mapi id 15.20.3477.028; Mon, 19 Oct 2020 17:25:07 +0000 Date: Mon, 19 Oct 2020 14:25:06 -0300 From: Jason Gunthorpe To: Tom Lendacky CC: , , , , , Radim =?utf-8?B?S3LEjW3DocWZ?= , Arnd Bergmann , Matt Fleming , "Konrad Rzeszutek Wilk" , Andrey Ryabinin , Ingo Molnar , Borislav Petkov , "Andy Lutomirski" , "H. Peter Anvin" , "Paolo Bonzini" , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov , Rik van Riel , Larry Woodman , "Dave Young" , Toshimitsu Kani , "Michael S. Tsirkin" , Brijesh Singh Subject: Re: AMD SME encrpytion and PCI BAR pages to user space Message-ID: <20201019172506.GV6219@nvidia.com> References: <20201019152556.GA560082@nvidia.com> <4b9f13bf-3f82-1aed-c7be-0eaecebc5d82@amd.com> <20201019170029.GU6219@nvidia.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: YTOPR0101CA0061.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:14::38) To DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (206.223.160.26) by YTOPR0101CA0061.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:14::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Mon, 19 Oct 2020 17:25:07 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kUYuA-002PCS-4j; Mon, 19 Oct 2020 14:25:06 -0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603128311; bh=+RYXBXHcRflICjlHYqIevLJYA1M+Lqj3fKVCCM8NL18=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Date: From:To:CC:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:X-ClientProxiedBy:MIME-Version: X-MS-Exchange-MessageSentRepresentingType; b=hflumUd4UYce+WaEmkheM/m4iewe/t0yUJdb0gAtIY/x7CMxQ4tuJA/u0k4xJFfAx y4+dwlQqZ8zwS5awXyQoiRycrldWmVK1m9MFAzH5iFa4z69Im2R1EaptdEAG8DN406 5rb74a1Ik0zOoiGqc1kzgetn5q9sP7nsV5TShFdENtkzNXVN39C17OsIGdQ7nYVM8o 9zudwozdnjQSWeRLVRR98YmQkCOD3CmapRPaG3KRNdikDlergnTh8GYSH1JgK0nLyX 9geKjCNI8BoSIpmCRm+NfcXPCQkPvXFyJ5+t2c3DkvrFphy6Nmh9nuRmn4tg0jPKuF CffhOhVYw9s7w== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 19, 2020 at 12:11:36PM -0500, Tom Lendacky wrote: > > Hum, I assume it is broken also. Actually quite a swath of drivers > > and devices will be broken under this :\ > > Not sure what you mean by the last statement - in general or when running > under VFIO/DPDK? In general, traditional in kernel drivers work just fine > under SME without any changes. Split user/kernel drivers are common enough. Looks like maybe ~50 drivers in the kernel potentially are mmaping IO memory so would be broken here. Looking for pgprot_noncached() or pgprot_writecombine() around VMA mappings is a pretty good clue it is working on IO memory. I checked through the infiniband ones and they seem to be using io_remap vs remap properly, but other places may need fixing. Jason