Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp12101pxy; Thu, 29 Apr 2021 21:26:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVkS3lRBbKfnFy/xRIhoeR/kFKdkjjPXN/DvDMK9BSnFmvQ1wUtd+UZFOYbey7yOOS+3aW X-Received: by 2002:a05:6402:1912:: with SMTP id e18mr3413777edz.184.1619756762201; Thu, 29 Apr 2021 21:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619756762; cv=none; d=google.com; s=arc-20160816; b=Mn7swu+atIHowss9haGC2Ziag+jjc+iypaIt8OmN5BuCuginAjRKYdzt8ax8xkyYmW 2NYK2X07J9BeDOjxu/1N2d0Od+e1UjplXBGRuXkFfI3TZbBiSwWgkDrrSz5OMAIUmD8Y bKz/0Ir981sjY0VNVvKELkH+vyuwmq2DRDVzbY2oIVoqhzblbfYvY308DAYauv5+ahJu PzvWma1s0NLdLRuyAaq7VCinuNzDar+l0d5KEvOHLkdjnC7SgitkOyrKr8FFgZoxU1fA sKSTBdXj0cQtyHaYMkld17Ei0LYBDK2FyCMwITtBjOBq2fXE5xNlsoUQVyz1vRbduSFL iECA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-hdrordr:dkim-signature; bh=TX9ZKrtzADXLunWuRGqT9OZBc0bwzINkS0/4eHoM5ok=; b=po4zQozEsyP3vNbJzc/Se1FBjakpHkIChskcPFD+rOXNNV7XXa5yA0x9swHrXjAoL7 9ueXCo+c9nTyF7RqH6vdsQex9hQUzZ1LWjI7n1cs9ixqtcI3UfYIChE4Cdp/yNUisfrG SFA9iuZ9usbqL5ZtZWNOqKSegVCVqSEs8+lh5OC0IC3Ssgzz3oSPeW69plRa8x6hxljn EDujj4NHDNlnYIcr0MP3xTo/o5UPvYwngY3+MhENjTmJhDf7G6xD5J0EnClXqLcSgquF +4h0JtGflqDyv1LhtY9l9Fb6DizLfRUZeJwE9/OYQh3WNvoCTVMJDHhgwfWWxuIfz6aw Nmaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=HHseR5yJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si2244221ejj.422.2021.04.29.21.25.36; Thu, 29 Apr 2021 21:26:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=HHseR5yJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbhD3EXL (ORCPT + 99 others); Fri, 30 Apr 2021 00:23:11 -0400 Received: from rcdn-iport-2.cisco.com ([173.37.86.73]:6970 "EHLO rcdn-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbhD3EXK (ORCPT ); Fri, 30 Apr 2021 00:23:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1687; q=dns/txt; s=iport; t=1619756543; x=1620966143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TkQgQOtm5mZuEq1qK8DidKTwwGyVW3o6m8nKOrtHYls=; b=HHseR5yJVCcefXTi7hoSlAWnhyUTBzFyxkZJfdupOTYrE/Isc7cRZZat yDf0u3BY0+Q77qcmVlZk/l8KS8xhCkYMECm283RfguhY2ROJw55mdhTvI RnXUixaEVnw9x51iNp2bvzgiSvmXRqlZCoSTSrNVhrmzCNnjgpdQ9wzHK E=; IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AmM+Zj6N7o1EybMBcT5z155DYdL4zR+YMi2?= =?us-ascii?q?QD/UoZc3BoW+afkN2jm+le6AT9jywfVGpltdeLPqSBRn20z+8Q3aA9NaqvNT?= =?us-ascii?q?OJhEKGN4dnhLGJ/xTBHGnE+vdZxeNcdcFFeb7NJHxbqeq/3wWiCdYnx7C8gc?= =?us-ascii?q?WVrMPT1W1kQw0vS6wI1WZEIz2WGEF3WwVKbKBRfPGhz/FKqDa6dXMcYt7TPA?= =?us-ascii?q?hmY8H4u9bJmJj6CCRoOzcb7mC14A+A2frTDwWfmiwTSSpIxq0vtVLYihXj6r?= =?us-ascii?q?+42svLrSP05iv255RSlMCJ8Lt+Lf3JrNQJITPxjQvtQ4JtV9S5zUkIidDqzk?= =?us-ascii?q?o2m9/RpBplBeBP0jf6e2G4pgaF4XiH7AoT?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BVAADbhItg/4cNJK1aHAEBAQEBAQc?= =?us-ascii?q?BARIBAQQEAQGCAwcBAQsBAYIpgU0BOTGMaKRRgXwLAQEBDzQEAQGEUAKBewI?= =?us-ascii?q?lNAkOAgQBAQwBAQUBAQECAQYEcROFXUMWAYVrBjIBRhBRVwYBEoJxgwioVII?= =?us-ascii?q?sgQGIMoFEFIEmAYhsdIN2ByAcgUlChHWIB4IzBIJHgQ+CcpQKinKcPYMagSe?= =?us-ascii?q?bcxAmpR2VKp9UhDA1gR86gVkzGggbFYMkUBkOjisWjkshAy84AgYKAQEDCYl?= =?us-ascii?q?Og0EBAQ?= 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 Cc: Christophe Leroy , xe-linux-external@cisco.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , linux-kernel@vger.kernel.org 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 Content-Transfer-Encoding: 8bit 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.25.1