Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1648126imm; Thu, 19 Jul 2018 05:38:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcKl9zIFQKB8yHrbL0iwPpWiMyY36QifOcsdosnN+kzyTKx1fWYxhTDUbx5O8a6k8PwrI+O X-Received: by 2002:a17:902:28aa:: with SMTP id f39-v6mr4753897plb.150.1532003926722; Thu, 19 Jul 2018 05:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532003926; cv=none; d=google.com; s=arc-20160816; b=ZuIK6G6cQOrZzR5lFm3UDogd5dsf1d8R1O1AXcGBvLdcNJ0QGEHfZC4i0YLC8dBw6T yFX0ycfPYYgmGzFI7vdPl7Hlh9vS/fSPg9vHMolnlBQmyTlM/kkSzMo9Okm601/aee7G s/RRQHtO83l4P/JU5D4uywdkCbM/XdiUipj+SraaUK9wiWps3WMbEhbE8y4jG1e/Gf72 p5SV21QKxaCiwC8T7Ez+axp3PzsMRZoyU5wUkmFVlVsQLIX6f2qsjgEA3rbS6bc7l6pB ck8fnquBAt3cA45rzHW21Nf3dYNBd1WoZu/ocvkw27SmqhxTQwaMCu1JjfJt+dwm9KTO 6gyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=vSOX/gj/YTcKEP9OxfQ3sNIFNNMhTz52y/BoqCEpIjA=; b=WqSSh7krwDHzeE6dcjph4Onevb7NY1pdc86iREhorzWSbx8idCuCop8uIZHOu+zVoT Oc761wXRXIErDUxgupCeJDcZF8oBgwiLD7A+q7mW760ciY2mFD46WRHqGcMyHsxFisbI taQVHimJ8Jyk0XuVFuiVwEQjIhsjRCjrD27iIrYaUXNyWFTh6XHfZerMhLWAfeTfCm9k TeG9sq8P4cZh2FCITL7YUXrlas/EY+ibm9CI3e2saYxPvdhySdP9lP6J6ZMNhGzM5P3j mW8tXg1lD228Lo1UYmQMKBilElGE/pgVKfP2SULsc9wgeGALeEsEwyjl5wB3sI/VTXns VAQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15-v6si6520513plk.508.2018.07.19.05.38.32; Thu, 19 Jul 2018 05:38:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730663AbeGSNUz (ORCPT + 99 others); Thu, 19 Jul 2018 09:20:55 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:32869 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727441AbeGSNUz (ORCPT ); Thu, 19 Jul 2018 09:20:55 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fg8Bb-00079X-Ul; Thu, 19 Jul 2018 14:37:36 +0200 Date: Thu, 19 Jul 2018 14:37:35 +0200 (CEST) From: Thomas Gleixner To: "Kirill A. Shutemov" cc: Dave Hansen , "Kirill A. Shutemov" , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Tom Lendacky , Kai Huang , Jacob Pan , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv5 08/19] x86/mm: Introduce variables to store number, shift and mask of KeyIDs In-Reply-To: <20180719102130.b4f6b6v5wg3modtc@kshutemo-mobl1> Message-ID: References: <20180717112029.42378-1-kirill.shutemov@linux.intel.com> <20180717112029.42378-9-kirill.shutemov@linux.intel.com> <1edc05b0-8371-807e-7cfa-6e8f61ee9b70@intel.com> <20180719102130.b4f6b6v5wg3modtc@kshutemo-mobl1> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Jul 2018, Kirill A. Shutemov wrote: > On Wed, Jul 18, 2018 at 04:19:10PM -0700, Dave Hansen wrote: > > > } else { > > > /* > > > * Reset __PHYSICAL_MASK. > > > @@ -591,6 +592,9 @@ static void detect_tme(struct cpuinfo_x86 *c) > > > * between CPUs. > > > */ > > > physical_mask = (1ULL << __PHYSICAL_MASK_SHIFT) - 1; > > > + mktme_keyid_mask = 0; > > > + mktme_keyid_shift = 0; > > > + mktme_nr_keyids = 0; > > > } > > > > Should be unnecessary. These are zeroed by the compiler. > > No. detect_tme() called for each CPU in the system. And then the variables are cleared out while other CPUs can access them? How is that supposed to work? Thanks, tglx