From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751775AbdGRLI7 (ORCPT ); Tue, 18 Jul 2017 07:08:59 -0400 Received: from terminus.zytor.com ([65.50.211.136]:54085 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409AbdGRLI4 (ORCPT ); Tue, 18 Jul 2017 07:08:56 -0400 Date: Tue, 18 Jul 2017 04:00:55 -0700 From: tip-bot for Tom Lendacky Message-ID: Cc: pbonzini@redhat.com, thomas.lendacky@amd.com, corbet@lwn.net, aryabinin@virtuozzo.com, riel@redhat.com, arnd@arndb.de, bp@alien8.de, toshi.kani@hpe.com, peterz@infradead.org, hpa@zytor.com, dyoung@redhat.com, linux-kernel@vger.kernel.org, matt@codeblueprint.co.uk, brijesh.singh@amd.com, tglx@linutronix.de, torvalds@linux-foundation.org, konrad.wilk@oracle.com, mst@redhat.com, dvyukov@google.com, glider@google.com, lwoodman@redhat.com, luto@kernel.org, rkrcmar@redhat.com, mingo@kernel.org Reply-To: mst@redhat.com, dvyukov@google.com, konrad.wilk@oracle.com, lwoodman@redhat.com, glider@google.com, luto@kernel.org, mingo@kernel.org, rkrcmar@redhat.com, thomas.lendacky@amd.com, pbonzini@redhat.com, riel@redhat.com, aryabinin@virtuozzo.com, arnd@arndb.de, corbet@lwn.net, peterz@infradead.org, toshi.kani@hpe.com, bp@alien8.de, hpa@zytor.com, dyoung@redhat.com, brijesh.singh@amd.com, torvalds@linux-foundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, matt@codeblueprint.co.uk In-Reply-To: <0576fd5c74440ad0250f16ac6609ecf587812456.1500319216.git.thomas.lendacky@amd.com> References: <0576fd5c74440ad0250f16ac6609ecf587812456.1500319216.git.thomas.lendacky@amd.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] compiler-gcc.h: Introduce __nostackprotector function attribute Git-Commit-ID: f11988d59f8e1e6f0941e94bd634911f648622ca X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f11988d59f8e1e6f0941e94bd634911f648622ca Gitweb: http://git.kernel.org/tip/f11988d59f8e1e6f0941e94bd634911f648622ca Author: Tom Lendacky AuthorDate: Mon, 17 Jul 2017 16:10:34 -0500 Committer: Ingo Molnar CommitDate: Tue, 18 Jul 2017 11:38:06 +0200 compiler-gcc.h: Introduce __nostackprotector function attribute Create a new function attribute, __nostackprotector, that can used to turn off stack protection on a per function basis. ( This is needed by the SME in-place kernel memory encryption feature, which activates encryption and thus changes the value of the stack protection cookie on function return. ) Signed-off-by: Tom Lendacky Reviewed-by: Thomas Gleixner Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brijesh Singh Cc: Dave Young Cc: Dmitry Vyukov Cc: Jonathan Corbet Cc: Konrad Rzeszutek Wilk Cc: Larry Woodman Cc: Linus Torvalds Cc: Matt Fleming Cc: Michael S. Tsirkin Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Radim Krčmář Cc: Rik van Riel Cc: Toshimitsu Kani Cc: kasan-dev@googlegroups.com Cc: kvm@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-efi@vger.kernel.org Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/0576fd5c74440ad0250f16ac6609ecf587812456.1500319216.git.thomas.lendacky@amd.com Signed-off-by: Ingo Molnar --- include/linux/compiler-gcc.h | 2 ++ include/linux/compiler.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index cd4bbe8..c28cedd 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -166,6 +166,8 @@ #if GCC_VERSION >= 40100 # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) + +#define __nostackprotector __attribute__((__optimize__("no-stack-protector"))) #endif #if GCC_VERSION >= 40300 diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 219f82f..3f8c88e 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -470,6 +470,10 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s #define __visible #endif +#ifndef __nostackprotector +# define __nostackprotector +#endif + /* * Assume alignment of return value. */