Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752551AbdFONXg (ORCPT ); Thu, 15 Jun 2017 09:23:36 -0400 Received: from mail-sn1nam02on0089.outbound.protection.outlook.com ([104.47.36.89]:2592 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751662AbdFONX2 (ORCPT ); Thu, 15 Jun 2017 09:23:28 -0400 Authentication-Results: google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=none action=none header.from=amd.com; Subject: Re: [PATCH v6 25/34] swiotlb: Add warnings for use of bounce buffers with SME To: Borislav Petkov Cc: 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, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Rik van Riel , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Toshimitsu Kani , Arnd Bergmann , Jonathan Corbet , Matt Fleming , "Michael S. Tsirkin" , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Larry Woodman , Brijesh Singh , Ingo Molnar , Andy Lutomirski , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Dave Young , Thomas Gleixner , Dmitry Vyukov References: <20170607191309.28645.15241.stgit@tlendack-t1.amdoffice.net> <20170607191732.28645.42876.stgit@tlendack-t1.amdoffice.net> <20170614165052.fyn5t4gkq5leczcc@pd.tnic> <33d1debc-c684-cba1-7d95-493678f086d0@amd.com> <20170615090832.ncmq2kgom32cchhw@pd.tnic> From: Tom Lendacky Message-ID: Date: Thu, 15 Jun 2017 08:23:17 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170615090832.ncmq2kgom32cchhw@pd.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR17CA0008.namprd17.prod.outlook.com (10.173.147.18) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR12MB1141: X-MS-Office365-Filtering-Correlation-Id: 8fc1433e-af2a-49c7-81af-08d4b3f1b3fd X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;3:/FxLQTh7oOFmUMarTjgV40b78bbI+DZVMONaEzI/OhFbTdy+f4zewrApbSzdqxhC0SNDg10Ki1LCRXoHSs1K2NQCQ9aBY3qwRUckzAIs0wyX8QF1KZ8v0NdgAPTrSE0Rl6gXWv3Vpjjrr4PV/pg2fT5QWTDX4aCvX6QLYXHU7IZ/znQn9TYdVF9iGnWcPB38Fw73PU3qdpasJ/0AZdfzfRIcliMkox8teQ8ehae/2+3SC1Hz0JRSRUgOI86z5CLe9pu7VeuEJYcoxik7RJTPKreMWZb/hvNj5KLOByAPuQzHAfywrkLrczLjjjmvQGnbzJAPZ4UcVTPZJCc6EiWiTirYM0f9TYIsVbnNXA9vVrg=;25:WnXQqIQ9jSpMUGa6KxvOqXM6Ln9DyjmSKEyTT6T0L2/lZHhkNjsgZ744/Mbwpfv5ug/EyTXBYzAd8XUb9CqnoASGLFscTTKi2GZFzKIxI3whxKXJkFuG/Blj0SCOALZPuSnNXUDeyIHlhzSHVOQQfjo/j8Lt68RtbdLxLXskz5Bhh0zh0PfcomhKsZm32V6zCgnTDXyLWPX16IYFwJgnz0gHWuIx2CBA6gvmyObftOFIjNNPwRsgeaFOs3Fm0EqIZXRPuDbtl7/zLMtCkKnKO9HueTpLtuYlqb8VbQPj09eAEk37lZFeBqqG9k/IuU2NKnjP+gVzX7CazS+WXFskvtTxP+k8jcKfHBLP78z7zm6+46MN5w0cR3WJ7Mf+TcFy3Pr+ydsJe8hQgT8YnFETpJ3YfnVw7tJBZN3y2C7cXi0ZppLobgMT5/iaTnARdY+9D9GLq0eWpC/oMwXf68XFTemmB+9II/dHBvkwDWbct88= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;31:F/+m2qLvuBvrgE0QTwslNNGUV+VWHXF7Tp1rs3tq44N9f4bUr4WTcXQXBRVIz0nyUW1g6xQAZjOd0OBWR0dUEJ80Dya1mRLG/V8A7tcpnLu0He14QSuRHSijP1n4kgasbGdyUbmSEIOoGHKvciAqyu59Xwn7YjNzk2FxWJZWUDBtbW8XLwpxnsLouCvPjhY33dnvVsS3bYelJERh299F7zxagdmRbMIXybSOtRXNUXM=;20:4zD2/Gcf6wdksoyG66xKLqvrJhtin++jVvzKf6xzA+7rWEOVQL7bprXcpWMFz256TIuE+zs8ayMRKT0dTSOl6zyKWi6h1IkfFwHdQ2EloIJwjPpI9cHwbvS6cYDZd0eWdjZ+eSijkxyPAxbS3+DzO/ChYBgPghGFXn2/834+A3IpEApQ5/t0gmmMYZp8M+Izk+nHJOue6VEQzs9GLMvG5zv4Xc8nwnYAnB6P69Zcj/TW1gubi12x4vkX9LuQhRPvo/m9EE2gphDiM8IYIzoOYSJiwAgJR7/8PQROQeL9VdnUEDMUdtW8wcqvZvdfKwIzLE1tdqZeeVJ+xfG6xQkyHClvekuJNgfssxRhZB0gjUdfEnze76iy8Qj2qB1zDGhEen5xBh/NPhRIM9TiItEgkUOo573fTQw095RhPa0wRsflFYAeuzIEsnh7jsrJibKNKO+8pdcL+/A5jwW7GMi/qE+fyFcgLaEeyumWSbxFsZoDccoN/Pwoy2zrzTyZxToH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR12MB1141;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzQ6OE4wRkFES2tncngzV1FWYStFeXlzdm41RUlU?= =?utf-8?B?eWd5WGxSbjNlQ2EzKzY1aDNteXdJeHNVaVJFbHIxUzBtQUlrMkgzNWQvZDJj?= =?utf-8?B?MTRWYTBpZ3FYeVVwTGY2a1JhbndnMW9lZXRnZk4va1hVTkY2Q2FVY3g1SWgx?= =?utf-8?B?UVpaMXU3ODFWVEdFNEE2RmRGb3VDckpPQ0pNL1ludXdGYlNMMlVXZm95am5Y?= =?utf-8?B?T2F1cXNhN1N5RHcxZG1hL3NWamp6Z1EyMGRtU0NySUxLeGtZb21tcmJNV2I2?= =?utf-8?B?T3JDUCtGV2d3eld6WHdxTUd5RldTYlZMK2hvNkJmdG43WG1ycDJmNWFOQmMr?= =?utf-8?B?eFJmbktWcjhsYVlTT2xmTXVzOXRwbDNnd090SDZNU3duNzk4NjJ2VzFwaUNR?= =?utf-8?B?TFVDQ2dDZlFneDA3NHU4WWNXTzVJMjBDd1pSNmNSNkhZTkpMWjVkcTNyQktC?= =?utf-8?B?QXJEbnVEakh5Q0g0b0tnckhsK3dUMCtibEtmTGtmcmlOc1dIWU8rL0toTmRx?= =?utf-8?B?TG9kMzg2TEdPK0NpVFNOeFdoYzJ3MGd4N1p2Vko5VFc4T2tURkFrSGNPMDZL?= =?utf-8?B?N0NUS1BDU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?utf-8?B?N2xnV2tEOFRsVjlQWFJwRFloVlZmSUQvL2hyUTJVeWVSdWhueVVPQTNNL3VZ?= =?utf-8?B?aDc5TzNlbkFZUENSa0RKeU5sNG90Zz09?= X-Forefront-PRVS: 0339F89554 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(39410400002)(39400400002)(39850400002)(39840400002)(39860400002)(39450400003)(24454002)(377454003)(81166006)(72206003)(4326008)(8676002)(65956001)(65806001)(478600001)(33646002)(66066001)(5660300001)(47776003)(38730400002)(230700001)(6246003)(110136004)(6116002)(3846002)(229853002)(6666003)(2950100002)(6916009)(90366009)(83506001)(50466002)(2906002)(7406005)(7416002)(53936002)(4001350100001)(189998001)(6486002)(77096006)(23676002)(54356999)(42186005)(31686004)(76176999)(86362001)(31696002)(93886004)(54906002)(305945005)(53546009)(50986999)(3260700006)(25786009)(36756003)(7736002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1141;H:[10.236.64.250];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzIzOmk2WU1OVDc1NWx5RWZDZVU1RVpaem9mLzZJ?= =?utf-8?B?a25CZTlKZmNVdzdqeG1zQUVvL0xhM1Vibm1BTk9vQ0JkUTZDakFrRGtvN3Vx?= =?utf-8?B?VWVIRk1idGk4RzhyZ1FqVktiWjAzUisyQUFPYmRpVEdaekRGR3NIcUlsVkVU?= =?utf-8?B?d3BEWXVxTjlSVWt0VXBMa2JtVCt6clRwMkhPejN6eS9oYjdRekxSRm5uVnor?= =?utf-8?B?L3V0RlpEaitGN0NJRk5oSG1INmhmSmtWM1RZVjlRc1pWdEtzNzEwOHNNWXhq?= =?utf-8?B?ZHM0NWQxeTM5Wm1vVUtwdGI1MGFZdHk4VEZtZDBmVDhYOEllODFaa2VuMXRa?= =?utf-8?B?NWtyOFVjSzNGN0NHaE1LRCtzejdwdEc4YkY4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IxQERKZOFn9Aj5Ds+qj9ej5OYTf9CZWdv7vvdWXB/GfhKZHR5DFK34fTWr6kXafvsWNsdrrtyLUKJ1HePji5QWTwyX0juqxskqE02RUPAnejSsgWW4kU91p8xUrm1WXBwcT09q313VHJtpMpeua58Eg//HTg4mA2KWRr4IpHXanR64d77m8VuPO69AIbu5hfMLdi5TxI2IyxFm1F7myTqGTOHpnqbWB84/iVcb/YRz/1E/wm9zQiOmlyBqVpFJuIq9x47N0OsR57dKHBWjEeTDLrhXNYev9PhcCAtKVFE8A8fxnLSokp+DeP/FwyjNshi2nL7BnD1bimbtQWH4kOuLkIyztkc= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;5:/vCg1jiYpkjx4+a09eXf3fceM4nxvGRphufC+jpwJBtWYb3567GEXH12IFwa8odJ1FyqL7gc9OwF7+McS6OjbWsUXi93Yq8+KyUkDgV6w/q4fkM7XfdoAZ5HkTmf7Vv795zMmrHDupnZX+9OInd02QxI8Rf1Bb4qO2OahzDN5tM/LAL/N5XKeSYfoIvdy9E6IzeaCog3UBtZtev2ddtf3ve8GYXdNGwGxxp/pfWC42PahMxiu62n6ivRHc0xQwloyloWfAyMtWAu6Z9RRRaou78r8QTLOlb7Jpb/HeSJp3FZiVDG8yVSM64w9d2nm9mSFn/v7xFtEO6FYffCIQEEw7QWcd35TbYCCjxMPRSA+EMS9BOJ0fybIb/oB2/AgjyBIKgNN7RkYo/IbWOXv2S8O+zV4IGOxRPnnHgaP6J1OZ7sQ8Y5wpBUvNw2oisI3etbVZQEX4wqZjGnv5ctsij/XhLOtweLKyV1dZvTVjunOpkVpH2xrRmTMDi8Vbx/mUTQ;24:uIJocaI4qCMzBrwtvoswg7IOG5SUFu1qslwVlMYtrdVd9iNdcLSvg6hF4ShNVh8FctH3mx4J/ItNT9bOuWyFumldeA8McYEt2mSVpDljjZE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;7:263CQuhpbo7mNgoFDy5Rq4eXOHA06p7lPiPQkmPUIEsT8XYW2e8tL93GETRHE34QstJfQ0P3Zi0lssvTo9SSWL+02bd8UIXQXiZ9sRrZdy/VXyXI+KmwrFy7KIvg3lfM3mg5rljRZmpWgWz50mIZ2Io3pZ24omhnvZdBLgKjp2Mb5yWTy6OeTuBZJkkzzVTifL+kMnODC+gFkGaQunwPxxj4XJbiDvl6WOSmKQZeQ4LdHR/vpp9Xr97YUMuT0BEh55FGb1SPXWdS8s/jQnGnlcNizXFxO2RxTP9sSZmxb4CLDhFfM0vRccMudwzJ8OulsPuRgaCT+8nYltfEIR0/iw==;20:WgfHgPq8au8zdvguboq7dySCWSyrFvUQNDKm2vpn/R4uM/24ZXwiXAi8Mbba/M43T9T0VDHZLO31RvmpDnUe3MsVwf60k6Y3BSMcTHfUH3jeseXJLd34zA/vq4Wbu7OyXO19pD5wUWNTBcVtY4+DcbJ4HaEWYFCc1iTDYLujEjq87Y3CzLJNUbQwqkjDmVrDV3WgnlrmYV3Vkm+SNrNy+I3IaPx40QjVa4FHP/sIKli9iNZ+EqLgJ6NJCVjeYUka X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 13:23:21.8721 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1141 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 592 Lines: 17 On 6/15/2017 4:08 AM, Borislav Petkov wrote: > On Wed, Jun 14, 2017 at 02:49:02PM -0500, Tom Lendacky wrote: >> I guess I don't need the sme_active() check since the second part of the >> if statement can only ever be true if SME is active (since mask is >> unsigned). > > ... and you can define sme_me_mask as an u64 directly (it is that already, > practically, as we don't do SME on 32-bit) and then get rid of the cast. Let me look into that. There are so many places that are expecting an unsigned long I'll have to see how that all works out from a build perspective. Thanks, Tom >