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=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham 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 B88A6C04EB8 for ; Tue, 4 Dec 2018 18:29:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A5652082B for ; Tue, 4 Dec 2018 18:29:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A5652082B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726083AbeLDS3d (ORCPT ); Tue, 4 Dec 2018 13:29:33 -0500 Received: from mga14.intel.com ([192.55.52.115]:5527 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbeLDS3d (ORCPT ); Tue, 4 Dec 2018 13:29:33 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2018 10:29:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,314,1539673200"; d="scan'208";a="104817444" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.154]) by fmsmga007.fm.intel.com with ESMTP; 04 Dec 2018 10:29:32 -0800 Date: Tue, 4 Dec 2018 10:29:32 -0800 From: Sean Christopherson To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, Andy Lutomirski Subject: Re: [PATCH 1/2] x86/vdso: Remove obsolete "fake section table" reservation Message-ID: <20181204182932.GB17374@linux.intel.com> References: <20181204161741.12292-1-sean.j.christopherson@intel.com> <20181204161741.12292-2-sean.j.christopherson@intel.com> <20181204182239.GA17374@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181204182239.GA17374@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 04, 2018 at 10:22:39AM -0800, Sean Christopherson wrote: > On Tue, Dec 04, 2018 at 08:17:40AM -0800, Sean Christopherson wrote: > > At one point the vDSO image was manually stripped down by vdso2c in an > > attempt to minimize the size of the image mapped into userspace. Part > > of that stripping process involved building a fake section table so as > > not to break userspace processes that parse the section table. Memory > > for the fake section table was reserved in the .rodata section so that > > vdso2c could simply copy the entire PT_LOAD segment into the userspace > > image after building the fake table. > > > > Eventually, the entire fake section table approach was dropped in favor > > of stripping the vdso "the old fashioned way", i.e. via objdump -S. > > But, the reservation in .rodata for the fake table was left behind. > > Remove the reserveration along with a few other related defines and > > section entries. > > > > Removing the fake section table placeholder zaps a whopping 0x340 bytes > > from the 64-bit vDSO image, which drops the current image's size to > > under 4k, i.e. reduces the effective size of the userspace vDSO mapping > > by a full page. > > > > Fixes: da861e18eccc ("x86, vdso: Get rid of the fake section mechanism") > > Cc: Andy Lutomirski > > Signed-off-by: Sean Christopherson > > --- > > diff --git a/arch/x86/entry/vdso/vdso2c.c b/arch/x86/entry/vdso/vdso2c.c > > index 4674f58581a1..2479a454b15c 100644 > > --- a/arch/x86/entry/vdso/vdso2c.c > > +++ b/arch/x86/entry/vdso/vdso2c.c > > @@ -98,12 +98,6 @@ struct vdso_sym required_syms[] = { > > [sym_hpet_page] = {"hpet_page", true}, > > [sym_pvclock_page] = {"pvclock_page", true}, > > [sym_hvclock_page] = {"hvclock_page", true}, > > - [sym_VDSO_FAKE_SECTION_TABLE_START] = { > > - "VDSO_FAKE_SECTION_TABLE_START", false > > - }, > > - [sym_VDSO_FAKE_SECTION_TABLE_END] = { > > - "VDSO_FAKE_SECTION_TABLE_END", false > > - }, > > Doh, I missed removing the definitions for sym_VDSO_FAKE_SECTION_TABLE_*. And with sym_VDSO_FAKE_SECTION_TABLE_* gone all symbols are exported, meaning required_syms can be a char* array and struct vdso_sym can be removed. > > {"VDSO32_NOTE_MASK", true}, > > {"__kernel_vsyscall", true}, > > {"__kernel_sigreturn", true}, > > -- > > 2.19.2 > >