From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbdGRSgX (ORCPT ); Tue, 18 Jul 2017 14:36:23 -0400 Received: from terminus.zytor.com ([65.50.211.136]:59343 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbdGRSgV (ORCPT ); Tue, 18 Jul 2017 14:36:21 -0400 Date: Tue, 18 Jul 2017 11:27:55 -0700 From: tip-bot for Tom Lendacky Message-ID: Cc: lwoodman@redhat.com, glider@google.com, dvyukov@google.com, peterz@infradead.org, aryabinin@virtuozzo.com, brijesh.singh@amd.com, corbet@lwn.net, tglx@linutronix.de, hpa@zytor.com, mst@redhat.com, bp@alien8.de, dyoung@redhat.com, mingo@kernel.org, pbonzini@redhat.com, torvalds@linux-foundation.org, riel@redhat.com, luto@kernel.org, arnd@arndb.de, matt@codeblueprint.co.uk, linux-kernel@vger.kernel.org, thomas.lendacky@amd.com, konrad.wilk@oracle.com, toshi.kani@hpe.com, rkrcmar@redhat.com Reply-To: arnd@arndb.de, matt@codeblueprint.co.uk, torvalds@linux-foundation.org, luto@kernel.org, riel@redhat.com, pbonzini@redhat.com, mingo@kernel.org, mst@redhat.com, hpa@zytor.com, dyoung@redhat.com, bp@alien8.de, rkrcmar@redhat.com, konrad.wilk@oracle.com, toshi.kani@hpe.com, linux-kernel@vger.kernel.org, thomas.lendacky@amd.com, glider@google.com, dvyukov@google.com, lwoodman@redhat.com, tglx@linutronix.de, aryabinin@virtuozzo.com, brijesh.singh@amd.com, corbet@lwn.net, peterz@infradead.org 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: 7375ae3a0b79ea072f4c672039f08f5db633b9e1 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: 7375ae3a0b79ea072f4c672039f08f5db633b9e1 Gitweb: http://git.kernel.org/tip/7375ae3a0b79ea072f4c672039f08f5db633b9e1 Author: Tom Lendacky AuthorDate: Mon, 17 Jul 2017 16:10:34 -0500 Committer: Ingo Molnar CommitDate: Tue, 18 Jul 2017 20:23:20 +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. 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. */