Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4110243pxk; Tue, 29 Sep 2020 14:50:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkpLKbpndG5Op7HJ0yC0Rm5j/B44RdpVfu2EnvDvtKPN45WVDUQw9MNjkWcJyNNr/eIgFc X-Received: by 2002:a17:906:b146:: with SMTP id bt6mr5874131ejb.287.1601416239856; Tue, 29 Sep 2020 14:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601416239; cv=none; d=google.com; s=arc-20160816; b=VSUxvRZDpMwht6c6VNJOeF3XZiOvUBPzZUDkVZDGBi5TQZ473DoRLHmhuk5C/NSceh 7baFToQbrySkKvwZIZMa96tKsEjFN0LlDuSpQKKGLKLPhgxK5O513FCD4JYgwop9v4ht ULXv74v626yb8QweEVvo3RyWcpp6shemGdoB2Skdawh/d71xesThmLYI4c1+s81l/dkl 3PbJjyahATmKWRPI2Zi1Yi4ZDoMeWah0koGPPfF164f1KLnlqe4MKmahH7lgMdBwu1yl nIwoZ4f/Jcf2XPjgFaFBmQnyMe00Fa8fY4lwNws1HzWiylUp0uxldQbeDv5kpsTRP9yH Shbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=YnFARiKS6UDkwdk7WP0wlvbxlnuyKDZd5kTTgvwZzNo=; b=RMl1FnsEeyPjF3nl/z61HgBzmhQA6+nC+XJMfowIM2FsdrsFikUFFcNGeif9nSj/PV 8utBoqX/7RjUt7+qnMFd7CmIXN8Vh2V/3pmbMjrXgtEW0SHux4bBKNJF8U6MiBVeJdcB aHAJUSWFEj0CQC0emeGuaCRvxiz3VJvcynxvd0776DqO3aNOoSRCGusOQtiNbwSss5zX QyDjYkPhr2XStoJU5YTELL1joDbgh1zdOPDsRS9CgrdoaX0CETIve6iEhhGH/VJYCy0J iepRgKpKSZZMPB1FiqKjSFWJg2pZRXq3hhK7L2JNrs7X+Tk3fh5WMVsrUrngirMT6+rv md/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jWS8iUHI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc23si3338424ejb.25.2020.09.29.14.50.17; Tue, 29 Sep 2020 14:50:39 -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=@google.com header.s=20161025 header.b=jWS8iUHI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729421AbgI2Vsi (ORCPT + 99 others); Tue, 29 Sep 2020 17:48:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728099AbgI2Vsh (ORCPT ); Tue, 29 Sep 2020 17:48:37 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A17CCC0613AC for ; Tue, 29 Sep 2020 14:47:38 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id e190so6379010ybf.18 for ; Tue, 29 Sep 2020 14:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=YnFARiKS6UDkwdk7WP0wlvbxlnuyKDZd5kTTgvwZzNo=; b=jWS8iUHI1yEZwlx3KeKvcgfGPXNdJ4L5onYlC3CBBL8D7obZFD5GHWOijlDtJb8Ij7 nRmkWkJefVtEgGfyFLejApsO2VFmeAT9vQpKzbQWErmeV2XzN2V7GUaE7Pe9GHYQRqUr Xv61qqqbIr/UD4HQGH+NeCWqUBIaeXjzSEj5haCz3bHxBeyeFilgtE7h3SBO5qI9TeFI VNBOjzf+qN4PzKeK/ip+sm+V/3xF7iAcrvnH3Y+OXfQISp+lvRlaGKxv9Vs2X9cKIOs1 +Egn3AASlwiipmUBXQC2SS1FvIyAuimNGXi91NcEG22l5xpotuSePeSMxIwf0qHe6n0r 39pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=YnFARiKS6UDkwdk7WP0wlvbxlnuyKDZd5kTTgvwZzNo=; b=kxIp/gTvO2ku97XenlknG/rs6R6ZDaJXZaYFef/eDKtc2dKWf2jY+KNInmXfGudhp9 n3ztc8SCKrpiohmXAx4QvrDN073CPVFUBUUodWoOoSy35Z1kjnwZvd5hu+5H8R4j3WYY Bs4I24lWmwli4Lqvmqpq4BJKD5bGLbHl++2x3ol2nBu/04omFttx2P2AVq7nt5zwS3Xf GfdESQVlb4G04FDR/LLy8znF6wtfiCUKNJ//+JblL/Y8px3leg2IHH6Ih/Q0DvZdfXBm zUAibel7Xsd6vUhlWO0sOMTKbdekjYIrJUdJF4yJ2hmS3C80Gi9lf+OCOS7fUBQKxL7R NJTw== X-Gm-Message-State: AOAM532E2sDRHv3oTveFWBEyZOeY9SWGgKk+0uS7exMgMEVHmL1lCgcY 5z/NudNhY/4V232IqANZxmLk6teIXX5+Ao07g/A= Sender: "samitolvanen via sendgmr" X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:f693:9fff:fef4:1b6d]) (user=samitolvanen job=sendgmr) by 2002:a25:ae9f:: with SMTP id b31mr8477359ybj.437.1601416057863; Tue, 29 Sep 2020 14:47:37 -0700 (PDT) Date: Tue, 29 Sep 2020 14:46:30 -0700 In-Reply-To: <20200929214631.3516445-1-samitolvanen@google.com> Message-Id: <20200929214631.3516445-29-samitolvanen@google.com> Mime-Version: 1.0 References: <20200929214631.3516445-1-samitolvanen@google.com> X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [PATCH v4 28/29] x86, cpu: disable LTO for cpu.c From: Sami Tolvanen To: Masahiro Yamada , Will Deacon , Steven Rostedt Cc: Peter Zijlstra , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org, Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang incorrectly inlines functions with differing stack protector attributes, which breaks __restore_processor_state() that relies on stack protector being disabled. This change disables LTO for cpu.c to work aroung the bug. Link: https://bugs.llvm.org/show_bug.cgi?id=47479 Suggested-by: Nick Desaulniers Signed-off-by: Sami Tolvanen --- arch/x86/power/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/power/Makefile b/arch/x86/power/Makefile index 6907b523e856..5f711a441623 100644 --- a/arch/x86/power/Makefile +++ b/arch/x86/power/Makefile @@ -5,5 +5,9 @@ OBJECT_FILES_NON_STANDARD_hibernate_asm_$(BITS).o := y # itself be stack-protected CFLAGS_cpu.o := -fno-stack-protector +# Clang may incorrectly inline functions with stack protector enabled into +# __restore_processor_state(): https://bugs.llvm.org/show_bug.cgi?id=47479 +CFLAGS_REMOVE_cpu.o := $(CC_FLAGS_LTO) + obj-$(CONFIG_PM_SLEEP) += cpu.o obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o hibernate.o -- 2.28.0.709.gb0816b6eb0-goog