From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64FE2C43461 for ; Thu, 17 Sep 2020 19:56:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F02EC20717 for ; Thu, 17 Sep 2020 19:56:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="fnDxZUej" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727751AbgIQOpc (ORCPT ); Thu, 17 Sep 2020 10:45:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727239AbgIQOlB (ORCPT ); Thu, 17 Sep 2020 10:41:01 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A9AFC0612F2; Thu, 17 Sep 2020 07:41:00 -0700 (PDT) Received: from zn.tnic (p200300ec2f1053001db76021617d6ec9.dip0.t-ipconnect.de [IPv6:2003:ec:2f10:5300:1db7:6021:617d:6ec9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C42331EC0260; Thu, 17 Sep 2020 16:39:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1600353567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=kTdpctjr26+hadEPAalxUdZ4IHHCvTX0roS3TMkt6bQ=; b=fnDxZUejBlcEL1dJreJ2gTSVjd0tdD7ozJi6uNPbe2/LV10xJTqaOiO1WGzuHHpWUivcPV IKKnRdQgbsK5HGvs2ZhPrKT6U7h/I5hkHmOkYIsHo7n6TBB5agBEEkgBGYqFsrYYRkFvOk mimTMJp1UL0YcNXTEOOT5K/ct5ozFgM= Date: Thu, 17 Sep 2020 16:39:20 +0200 From: Borislav Petkov To: David Laight Cc: Andrew Cooper , Andy Lutomirski , Nick Desaulniers , Andy Lutomirski , Bill Wendling , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , LKML , Greg Thelen , John Sperbeck , "# 3.4.x" , clang-built-linux Subject: Re: [PATCH] x86/smap: Fix the smap_save() asm Message-ID: <20200917143920.GJ31960@zn.tnic> References: <441AA771-A859-4145-9425-E9D041580FE4@amacapital.net> <7233f4cf-5b1d-0fca-0880-f1cf2e6e765b@citrix.com> <20200916082621.GB2643@zn.tnic> <20200917060432.GA31960@zn.tnic> <20200917115733.GH31960@zn.tnic> <823af5fadd464c48ade635498d07ba4e@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <823af5fadd464c48ade635498d07ba4e@AcuMS.aculab.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 02:25:50PM +0000, David Laight wrote: > I actually wonder if there is any code that really benefits from > the red-zone. The kernel has been without a red zone since 2002 at least: commit 47f16da277d10ef9494f3e9da2a9113bb22bcd75 Author: Andi Kleen Date: Tue Feb 12 20:17:35 2002 -0800 [PATCH] x86_64 merge: arch + asm This adds the x86_64 arch and asm directories and a Documentation/x86_64. ... +CFLAGS += $(shell if $(CC) -mno-red-zone -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mno-red-zone"; fi ) Also, from the ABI doc: "A.2.2 Stack Layout The Linux kernel may align the end of the input argument area to a 8, instead of 16, byte boundary. It does not honor the red zone (see section 3.2.2) and therefore this area is not allowed to be used by kernel code. Kernel code should be compiled by GCC with the option -mno-red-zone." so forget the red zone. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette