From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DBB1C433EF for ; Wed, 16 Feb 2022 10:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbiBPKeB (ORCPT ); Wed, 16 Feb 2022 05:34:01 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiBPKd5 (ORCPT ); Wed, 16 Feb 2022 05:33:57 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C8BB2B1644 for ; Wed, 16 Feb 2022 02:33:45 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 687F81EC054C; Wed, 16 Feb 2022 11:33:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1645007619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=4O6P6Bd8YAaCuifrnqVgvcR1H2vua8DbkApbjkory2g=; b=qLG0G+lrqyKebvs/LDjbNEU+/iV9y0rTf2MGK5IOEcztD5O0OjmQQU3qsMXGIjn2+wT6IU IpfQwlkSzyGahTOqu/XVxhlUkTxHiquE0q1ARXrOz9QC/toVIpA2yjHFyfQW5GsB7wSU4h jKu784k/Mew+rHQeOPYXXflze03mGJU= Date: Wed, 16 Feb 2022 11:33:46 +0100 From: Borislav Petkov To: Mario Limonciello Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Kees Cook , Thomas Lendacky , hughsient@gmail.com, Martin Fernandez , linux-kernel@vger.kernel.org, Brijesh Singh Subject: Re: [PATCH v4] x86/cpu: clear SME feature flag when not in use Message-ID: References: <20220216034446.2430634-1-mario.limonciello@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220216034446.2430634-1-mario.limonciello@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 15, 2022 at 09:44:46PM -0600, Mario Limonciello wrote: > @@ -607,6 +609,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c) > if (IS_ENABLED(CONFIG_X86_32)) > goto clear_all; > > + if (!sme_me_mask) > + setup_clear_cpu_cap(X86_FEATURE_SME); Why not "goto clear_all;" ? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette