From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932489AbdJZOIg (ORCPT ); Thu, 26 Oct 2017 10:08:36 -0400 Received: from mga03.intel.com ([134.134.136.65]:40673 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932384AbdJZOIb (ORCPT ); Thu, 26 Oct 2017 10:08:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,434,1503385200"; d="scan'208";a="914035597" Subject: Re: [tip:x86/mm] x86/mm: Add support for early encryption/decryption of memory To: Tom Lendacky , arnd@arndb.de, aryabinin@virtuozzo.com, dvyukov@google.com, mingo@kernel.org, pbonzini@redhat.com, peterz@infradead.org, torvalds@linux-foundation.org, toshi.kani@hpe.com, matt@codeblueprint.co.uk, corbet@lwn.net, hpa@zytor.com, konrad.wilk@oracle.com, dyoung@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, riel@redhat.com, bp@suse.de, lwoodman@redhat.com, glider@google.com, luto@kernel.org, mst@redhat.com, brijesh.singh@amd.com, rkrcmar@redhat.com, bp@alien8.de, linux-tip-commits@vger.kernel.org References: <8a3b1467-a802-1a34-2f8d-7e4d0098cee6@intel.com> <5384d7fd-b05b-917c-e89a-f2cb5603da77@amd.com> From: Dave Hansen Message-ID: Date: Thu, 26 Oct 2017 07:08:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <5384d7fd-b05b-917c-e89a-f2cb5603da77@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/2017 06:05 AM, Tom Lendacky wrote: >>> >>> +static void __init __sme_early_enc_dec(resource_size_t paddr, >>> +                       unsigned long size, bool enc) >>> +{ >>> +    void *src, *dst; >>> +    size_t len; >>> + >>> +    if (!sme_me_mask) >>> +        return; >>> + >>> +    local_flush_tlb(); >>> +    wbinvd(); >> >> What is this TLB flush for?  WBINVD is mentioned in "Volume 2, Section >> 7.10.8", but TLB flushes are not.  Is it OK that this does not flush >> global pages? > > The local_flush_tlb() is not needed and can be removed. I had that in > there from early development and testing and just missed removing it. > I can queue up a patch to delete it and remove the ambiguity with this > routine and the APM document. Cool, I was just doing a little audit of those TLB flushes and this one stuck out at me. It would be great if it can be removed.