Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp710488pxb; Wed, 16 Feb 2022 02:41:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmM3C+Z/g4yh02BmW8UCvkzi99OJD8WteUrPUZkZmV9w2YptTLWeFbo4wYWbT/+T4z4jnV X-Received: by 2002:aa7:cdd3:0:b0:410:8042:4549 with SMTP id h19-20020aa7cdd3000000b0041080424549mr2229801edw.335.1645008070064; Wed, 16 Feb 2022 02:41:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645008070; cv=none; d=google.com; s=arc-20160816; b=u1Q3bzbHukj8+IRDP91AeR7a+UgWjGWvQJe31CzDcWoQ6OT9DBJ/sdoTlRwHwZ8EMF GvvEiCP0oWiy7be7yVBwSrP9JK3syL3Z97WazC9YjOREOwRmKnYRHP70mXqeb3JbbzUN yWotc7My1XchItD0353YOtyhOsThKNDyR7z3x02JXtJmhdh8nXXB5JGjdoWl4A966fpL iW9mixIlAZq56+fjw0r/H8X18DHJfRtblAXTdyr1Jladf6DCeT7JMpIViV6owS2C9vj9 Q5p8tLbF2X8FmrAv4MS5V3cKIeuhwXEF69CuAy17EMEdfa5kQRzraVTgRBzonqEz7tFa 0CFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4O6P6Bd8YAaCuifrnqVgvcR1H2vua8DbkApbjkory2g=; b=MU12nwyGb6Ve/Dz5aYNCCJFfbaCLNK1nv20dWSwUn8LKtx0/NxrGutLL1wsgMfwhjD Snh+Y82KSFNB9UmUp59CpVZnMK+mp4pxZuk8/Pt2HS9ULRAfLC0qeOuDvu4sa+c9eYIm yiNOxf7INasLRkSkJ10bR+X9n2tO7cwu4P+GdHvfy1g5jfYcXStsewIg8TDeVcwtOaEE QCkCDr1oo3UHdGVmBUkci6hhBPsyjCXUQVLEwMzoTntwOo9W2yl1LUVkive0oSftmQSj /4jno+2X1h3MiEue/Jmr9U+1V7GIqMmT6HTLJgtES8Ta11cesdU1saOWFMhsHrmiWzyW JRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=qLG0G+lr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb11si1921286edb.149.2022.02.16.02.40.45; Wed, 16 Feb 2022 02:41:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=qLG0G+lr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbiBPKeA (ORCPT + 99 others); Wed, 16 Feb 2022 05:34:00 -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> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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