Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4268006ybz; Tue, 28 Apr 2020 08:27:35 -0700 (PDT) X-Google-Smtp-Source: APiQypKT1jIwNytW8V9YWsFs4ViLhhQOmy41LX6P4u7E1qKagwRf1cmlCl3Rf11hEeTn7BKA3f9s X-Received: by 2002:a17:906:38c:: with SMTP id b12mr24668575eja.332.1588087655424; Tue, 28 Apr 2020 08:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588087655; cv=none; d=google.com; s=arc-20160816; b=Q96mqQLJ4JvBKvw1htitwFObfpBGFCqtANimroJAI6PDIUVYH/Fl8weMr2ph0gYYNv veMKb3CISiTYId7hTJmSSQcr+EYKDjYFFIJHG1FaUsQT2F4QXQajdm5PumahBoSH3t9H MRXTPCLgWT8W+lCxYyi7zUalC1pr2wPku1ZhnwbpMvaIMk1/LlTgaIGoqHrOwCQ6Zrdv rTU6zZSl/N9XakcT1F7fvkG8NyIrsrNn7i9FHDjj2LIXL0YLsR4zmp2U7SBH2V2WCT49 vgKO+Tgfida0XYA4USW41iW/hEqAvja22pieEZYqIHxyvS2PJeJmw1gI+u1yUb3CykC8 nKeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=PdpR2Ue/VJFmlNL8ioPHP8ZGN48kiCUpY362vNNa3hg=; b=QdStZILYl8hoS0Uf0rAoGtT1zkw5pRxJAOf9Ll1668HcwGOZ022LSbbmUFJ0ONwDSt oTYh/2qW7l2iUKyIMTAWKDatGFMg1ZVOCMwoCuHH4l0yn4DcWpQVtT+Et9LXaIiV7Oko Kra8gPWhO12LJN2ZRTaqs2DKkwaDDrAlVR0cVmGEfJreiSV6mypo512tlus1lo3Fm+Xd NAi9nSuv3pxwnMrk6FKoh3vbNFr5dHk8lmbsuxpzjRPq3N8YTfZX1o+H00kffzKDTOcm 7YyJZSTehjlaSqXSyTwxJmbje4YbUuXu2V+exg9ZfhBsJt1CAd6CMxr3DNZMAsNWeCey FiNA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si1897901edh.318.2020.04.28.08.27.05; Tue, 28 Apr 2020 08:27:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728811AbgD1PW3 (ORCPT + 99 others); Tue, 28 Apr 2020 11:22:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728291AbgD1PSG (ORCPT ); Tue, 28 Apr 2020 11:18:06 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9E47C03C1AC; Tue, 28 Apr 2020 08:18:05 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id B2847F15; Tue, 28 Apr 2020 17:17:48 +0200 (CEST) From: Joerg Roedel To: x86@kernel.org Cc: hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Joerg Roedel , Joerg Roedel , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH v3 35/75] x86/head/64: Build k/head64.c with -fno-stack-protector Date: Tue, 28 Apr 2020 17:16:45 +0200 Message-Id: <20200428151725.31091-36-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200428151725.31091-1-joro@8bytes.org> References: <20200428151725.31091-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel The code inserted by the stack protector does not work in the early boot environment because it uses the GS segment, at least with memory encryption enabled. Make sure the early code is compiled without this feature enabled. Signed-off-by: Joerg Roedel --- arch/x86/kernel/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index ba89cabe5fcf..1192de38fa56 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -35,6 +35,10 @@ ifdef CONFIG_FRAME_POINTER OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o := y endif +# make sure head64.c is built without stack protector +nostackp := $(call cc-option, -fno-stack-protector) +CFLAGS_head64.o := $(nostackp) + # If instrumentation of this dir is enabled, boot hangs during first second. # Probably could be more selective here, but note that files related to irqs, # boot, dumpstack/stacktrace, etc are either non-interesting or can lead to -- 2.17.1