Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1994860ybv; Sun, 23 Feb 2020 20:16:08 -0800 (PST) X-Google-Smtp-Source: APXvYqzsqSi7j5oPEMY0WT6BmPFjuiA1urYQw54nYtMTrNa5emGkjLIBpViR4hrm3mmaDMzqUuYJ X-Received: by 2002:a9d:6b17:: with SMTP id g23mr39311122otp.139.1582517768321; Sun, 23 Feb 2020 20:16:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582517768; cv=none; d=google.com; s=arc-20160816; b=1DLGhI0UzAuf8nFRG7Uhlsre4mKR+GeYmYIvQ8BhWbBCpE/GkQ9mJztBXIMxVpQUEg x4iCW2Dnzr2W6HeOyRZITrNmlK3Hm451RdVSVbtCfa1bx8U9oMcKSqoIHry4Y0TiSRa+ q7VZ57qPQBlEyp2XDijWwrNtRlelpFnwCrIJG24lz1f4dSqlYjkm5tHd+TBTL9Zp4RA2 PwarzRjcYm73ENCQK8iLetVLk6M31qRv7gNvh5w7XNWInjTqsExH8ZekdteI18sDkiHA EB5+qIslACndQWWkGMO/UFRWrDzjR6RZPIt4N26O9hyQj/19ym8gJ4T6UNfSHEtyfNBA pmmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FtOOndOWZSDXybYasUpcnffIRI9DWgK6w/MiME7iIyA=; b=bLDaVMU3YAtO/r/4/Vu9sBulAdgTzB8mVbwP8wCQgvVv1hA9ZRySbiz2EeX+nRvYXF 2gdet0Neq8ttNW+9Kq9hsWM1EWHTdj3/T+X7WeZc7eBEnE5djknHFvXgKfowUHYVuHxH 3pY61E6eOWiTF/ENrEQSZE9J0UgFOT1ZgGeLGzkFNcCuB6WtgSDcerx22MD9/s10Wn5A VZIjSlmyu6nD7hcaLKfTtnpwqD5x7nmGhHmECERAySyuVjZ3S0KAnMX+hKXNqbSAPh1G 1brwpkWuUyNvfXwnUGQBuCQZbI/177yITclgbWThWENQQskDpaumMEt0SC27UD8RDtq+ vr9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ubxAfdRS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si5653033otq.40.2020.02.23.20.15.54; Sun, 23 Feb 2020 20:16:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ubxAfdRS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727218AbgBXEPp (ORCPT + 99 others); Sun, 23 Feb 2020 23:15:45 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:47083 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727188AbgBXEPp (ORCPT ); Sun, 23 Feb 2020 23:15:45 -0500 Received: by mail-oi1-f195.google.com with SMTP id a22so7703085oid.13 for ; Sun, 23 Feb 2020 20:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FtOOndOWZSDXybYasUpcnffIRI9DWgK6w/MiME7iIyA=; b=ubxAfdRSx4t292O11yEtyiS45hr76kV1ZivVX31imh2sVv75jLafbyUz7Sk1vhKyxp U13Q/QyCrb1aj+hIbtw0GbB38ZxZTf8ujH/gF/AoxXfgmJIQZRUmNB+wz9ovq7qGobWp G44SlHNyrlhH9etlitz8Coe5/JG8nsbDkfJCXZEdB2d57vC+27jxfoP7pvkjpGMwE2tv UKWS3Qba+HfkFV3b9bj1Lw+a0LCULnCBDhQAcmEbJZatno/M2G5bGIAYZAF+xe3JMZSb MpBmk1MgsDydiP+3bWDi+e8VGZtDdj2UKTO7P8FWNWodW+Olv4cSOHD49ywVJrYVUDsr 1ksA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FtOOndOWZSDXybYasUpcnffIRI9DWgK6w/MiME7iIyA=; b=Fgb0QQb6Ak7phZ9iF1Ap2MbPUnik/uBW7+qgY8558YjtblooxzZBn16aTvyGYzfO+p ufuzWmaRKG4l6GICczxaQUWWuxPGiL3eBQMXnuDNf7OaQ2GMJERTuzbZsTHfD5Ccaljp Q/q06w/Crno/gQRhtN9uC3zuk3tmVInpL7zUyECq58+HtuMT4zgZX5R0EHuyOXVYUhwc 9Yjj1gyvfyKGjaptMxaZezjuVaj7+bZaZjC4XkotfOqbUDFUL8V33CvL4BAU0O9PK4/W YhJ4p1d9vsYLO/KiIVXusj9zvXea0RC2MWzrFdgCkbfX6mq6jGlvlGszFqcxwzyMXAFj SEtQ== X-Gm-Message-State: APjAAAXq3TVJ4AQiB9uNbF1bLOD9nTgGwY9anLhC0tK02sHhrKX2MbhW y+5Zqvw1e6m7ih6qhZNzGW0= X-Received: by 2002:aca:5f87:: with SMTP id t129mr11397800oib.36.1582517744531; Sun, 23 Feb 2020 20:15:44 -0800 (PST) Received: from ubuntu-m2-xlarge-x86 ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id j13sm3701944oii.14.2020.02.23.20.15.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Feb 2020 20:15:43 -0800 (PST) Date: Sun, 23 Feb 2020 21:15:42 -0700 From: Nathan Chancellor To: Arvind Sankar Cc: Nick Desaulniers , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Michael Matz , Fangrui Song , Kees Cook Subject: Re: [PATCH 0/2] Stop generating .eh_frame sections Message-ID: <20200224041542.GA55909@ubuntu-m2-xlarge-x86> References: <20200222235709.GA3786197@rani.riverdale.lan> <20200223193715.83729-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200223193715.83729-1-nivedita@alum.mit.edu> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 23, 2020 at 02:37:13PM -0500, Arvind Sankar wrote: > In three places in the x86 kernel we are currently generating .eh_frame > sections only to discard them later via linker script. This is in the > boot code (setup.elf), the realmode trampoline (realmode.elf) and the > compressed kernel. > > Implement Fangrui and Nick's suggestion [1] to fix KBUILD_CFLAGS by > adding -fno-asynchronous-unwind-tables to avoid generating .eh_frame > sections in the first place, rather than discarding it in the linker > script. > > Arvind Sankar (2): > arch/x86: Use -fno-asynchronous-unwind-tables to suppress .eh_frame sections > arch/x86: Drop unneeded linker script discard of .eh_frame > > arch/x86/boot/Makefile | 1 + > arch/x86/boot/compressed/Makefile | 1 + > arch/x86/boot/setup.ld | 1 - > arch/x86/kernel/vmlinux.lds.S | 3 --- > arch/x86/realmode/rm/Makefile | 1 + > arch/x86/realmode/rm/realmode.lds.S | 1 - > drivers/firmware/efi/libstub/Makefile | 3 ++- > 7 files changed, 5 insertions(+), 6 deletions(-) > > -- > 2.24.1 > With both of these patches applied on top of next-20200221 and a revert of commit e11831d0ada3 ("x86/boot/compressed: Remove unnecessary sections from bzImage"), I do not see any .eh_frame sections in the following files: $ readelf -S arch/x86/boot/setup.elf \ arch/x86/realmode/rm/realmode.elf \ arch/x86/boot/compressed/vmlinux \ vmlinux |& grep eh_frame Additionally, I can see -fno-asynchronous-unwind-tables get added to files that didn't previously have it. Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor