From patchwork Fri Apr 30 04:22:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daniel Walker (danielwa)" X-Patchwork-Id: 1471958 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256 header.s=iport header.b=dkbMWdgV; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FWfPG1s0Bz9sV5 for ; Fri, 30 Apr 2021 14:23:14 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FWfPG1Rbxz3bT5 for ; Fri, 30 Apr 2021 14:23:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256 header.s=iport header.b=dkbMWdgV; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=cisco.com (client-ip=173.37.86.73; helo=rcdn-iport-2.cisco.com; envelope-from=danielwa@cisco.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256 header.s=iport header.b=dkbMWdgV; dkim-atps=neutral Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FWfNL3xCQz2xZ2 for ; Fri, 30 Apr 2021 14:22:23 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1687; q=dns/txt; s=iport; t=1619756546; x=1620966146; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TkQgQOtm5mZuEq1qK8DidKTwwGyVW3o6m8nKOrtHYls=; b=dkbMWdgV4f8DifQ1Jt1OG8sI6IWh0jh83Q56cCdG3EfOjeNfzRhS9wwA xvuUjW0knQltbNaTCvKzoQWf/ciY7yO88OGdbtg0GkiZFB4dgOD+bZBV0 2+qvzmrktPeFstAYguA0CdqJ8dLuyLKpukhPGOQnSiiBEq/pDiCASj6Q+ I=; IronPort-HdrOrdr: A9a23:mM+Zj6N7o1EybMBcT5z155DYdL4zR+YMi2QD/UoZc3BoW+afkN2jm+le6AT9jywfVGpltdeLPqSBRn20z+8Q3aA9NaqvNTOJhEKGN4dnhLGJ/xTBHGnE+vdZxeNcdcFFeb7NJHxbqeq/3wWiCdYnx7C8gcWVrMPT1W1kQw0vS6wI1WZEIz2WGEF3WwVKbKBRfPGhz/FKqDa6dXMcYt7TPAhmY8H4u9bJmJj6CCRoOzcb7mC14A+A2frTDwWfmiwTSSpIxq0vtVLYihXj6r+42svLrSP05iv255RSlMCJ8Lt+Lf3JrNQJITPxjQvtQ4JtV9S5zUkIidDqzko2m9/RpBplBeBP0jf6e2G4pgaF4XiH7AoT X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BVAADbhItg/4cNJK1aHAEBAQEBAQcBARIBAQQEAQGCAwcBAQsBAYIpgU0BOTGMaKRRgXwLAQEBDzQEAQGEUAKBewIlNAkOAgQBAQwBAQUBAQECAQYEcROFXUMWAYVrBjIBRhBRVwYBEoJxgwioVIIsgQGIMoFEFIEmAYhsdIN2ByAcgUlChHWIB4IzBIJHgQ+CcpQKinKcPYMagSebcxAmpR2VKp9UhDA1gR86gVkzGggbFYMkUBkOjisWjkshAy84AgYKAQEDCYlOg0EBAQ X-IronPort-AV: E=Sophos;i="5.82,260,1613433600"; d="scan'208";a="892827651" Received: from alln-core-2.cisco.com ([173.36.13.135]) by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 30 Apr 2021 04:22:21 +0000 Received: from zorba.cisco.com ([10.24.18.92]) by alln-core-2.cisco.com (8.15.2/8.15.2) with ESMTP id 13U4MHxw023118; Fri, 30 Apr 2021 04:22:20 GMT From: Daniel Walker To: linuxppc-dev@lists.ozlabs.org, x86@kernel.org, Andrew Morton , Dave Hansen , Andy Lutomirski , Peter Zijlstra Subject: [PATCH 3/3] x86: switch amd mem encrypt to early string functions Date: Thu, 29 Apr 2021 21:22:16 -0700 Message-Id: <20210430042217.1198052-3-danielwa@cisco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210430042217.1198052-1-danielwa@cisco.com> References: <20210430042217.1198052-1-danielwa@cisco.com> MIME-Version: 1.0 X-Auto-Response-Suppress: DR, OOF, AutoReply X-Outbound-SMTP-Client: 10.24.18.92, [10.24.18.92] X-Outbound-Node: alln-core-2.cisco.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xe-linux-external@cisco.com, linux-kernel@vger.kernel.org, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This switched x86 early string users to use the early string variants and re-enabled KASAN on general string functions use thru out the rest of the system. Cc: xe-linux-external@cisco.com Signed-off-by: Daniel Walker --- arch/x86/mm/mem_encrypt_identity.c | 4 ++-- lib/Makefile | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c index 6c5eb6f3f14f..212fe90cf5e2 100644 --- a/arch/x86/mm/mem_encrypt_identity.c +++ b/arch/x86/mm/mem_encrypt_identity.c @@ -575,9 +575,9 @@ void __init sme_enable(struct boot_params *bp) cmdline_find_option(cmdline_ptr, cmdline_arg, buffer, sizeof(buffer)); - if (!strncmp(buffer, cmdline_on, sizeof(buffer))) + if (!early_strncmp(buffer, cmdline_on, sizeof(buffer))) sme_me_mask = me_mask; - else if (!strncmp(buffer, cmdline_off, sizeof(buffer))) + else if (!early_strncmp(buffer, cmdline_off, sizeof(buffer))) sme_me_mask = 0; else sme_me_mask = active_by_default ? me_mask : 0; diff --git a/lib/Makefile b/lib/Makefile index 25cc664f027e..314db12c0e98 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -28,13 +28,6 @@ KASAN_SANITIZE_early_string.nosan.o := n CFLAGS_early_string.nosan.o += -fno-stack-protector -# Early boot use of cmdline, don't instrument it -ifdef CONFIG_AMD_MEM_ENCRYPT -KASAN_SANITIZE_string.o := n - -CFLAGS_string.o += -fno-stack-protector -endif - $(obj)/early_string.nosan.o: $(src)/early_string.c $(recordmcount_source) $(objtool_dep) FORCE $(call if_changed_rule,cc_o_c) $(call cmd,force_checksrc)