From patchwork Wed Aug 2 15:56:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 9876951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B4A660360 for ; Wed, 2 Aug 2017 15:59:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B8F7287E7 for ; Wed, 2 Aug 2017 15:59:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70293287E8; Wed, 2 Aug 2017 15:59:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EEA2C287EA for ; Wed, 2 Aug 2017 15:59:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcw0v-0008CG-PE; Wed, 02 Aug 2017 15:56:49 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcw0v-0008CA-5M for xen-devel@lists.xenproject.org; Wed, 02 Aug 2017 15:56:49 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id 42/1F-03406-046F1895; Wed, 02 Aug 2017 15:56:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHIsWRWlGSWpSXmKPExsUSNTvmoq79t8Z Ig96/TBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aHGXeZCprdKj4evsPawPjbpYuRi4NF4ASb xONfbxhBHCGBDYwSL+d9ZO5i5OTgFTCVmHJoHQuILSwQL7F64U0wm01AW+LAjpNgtoiAssTn5 yvB6pkFfCRuXj7ACGJzCthLtD+exgwx9ByLRPeyfvYuRg6golqJGwsDQGpYBFQlnv+ezQIS5h UQlPi7QxgkLCGgIbHh5jEmCLuNUeLearsJjHyzEJpnITTMAturKdG6/Tc7hK0oMaX7IZRtK7H /6kpmCNtU4vXRj4zIahYwsq9i1ChOLSpLLdI1MtdLKspMzyjJTczM0TU0MNPLTS0uTkxPzUlM KtZLzs/dxAgMZQYg2MG4eG3gIUZJDiYlUV7FnvpIIb6k/JTKjMTijPii0pzU4kOMMhwcShK8l l8bI4UEi1LTUyvSMnOAUQWTluDgURLh5QBJ8xYXJOYWZ6ZDpE4xGnO8mvD/GxPHlt8nvjMJse Tl56VKifMu/QJUKgBSmlGaBzcIFu2XGGWlhHkZgU4T4ilILcrNLEGVf8UozsGoJMzLC7KQJzO vBG7fK6BTmIBO+VMHdkpJIkJKqoFx0ROlr+ZlP7hzl8+ocr9o+ivo6Ny4BXyK+xoL5i5ZxXxa bErDm/cnLTdJ10asf69VvnNTxSfNAIG6P8tD2b+Jsn/h+feop0I1J/b7Cecpv2f1JOT9f5Ku4 H6qavV3BpfsmhmCW/O6my9JMO/8/2F2xHd71+wJTyKexv751FJ8jO0Qk8u1vgMZSizFGYmGWs xFxYkAOcWh2/ECAAA= X-Env-Sender: BATV+f6843280af683c9d313b+5092+infradead.org+dwmw2@twosheds .srs.infradead.org X-Msg-Ref: server-7.tower-27.messagelabs.com!1501689406!105460833!1 X-Originating-IP: [90.155.92.209] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 56599 invoked from network); 2 Aug 2017 15:56:47 -0000 Received: from twosheds.infradead.org (HELO twosheds.infradead.org) (90.155.92.209) by server-7.tower-27.messagelabs.com with AES256-GCM-SHA384 encrypted SMTP; 2 Aug 2017 15:56:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=twosheds.20170209; h=Mime-Version:Date:Content-Type: References:In-Reply-To:Cc:To:From:Subject:Message-ID:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vNExcy3NJZONooUwaJXPqsXfDQ+BKQGHOVXqMIPLP7g=; b=lZwXZpnOlK0i+vsW26YVfSXAZ 3d/UL+LMJZn5RZSwCbgWgcCdB4kGBsPMY4/BEhS0q/b+mDEvJy1IQnbjbxyDfEaE5ezxrc/1lMh6A HB/eWPkd8ko4w33bhnoK6XldcULu1xb8F3wTkJus8C8ayArLv7UeMb+WYmlOxuBNpK2eUFblospma xETQURFcuDdp8GbFNgWI8m76rTOfF4MoMq4mDwOM/+zGK1TJvXjQEGksUD0/a1TKxm+mL1UQdT4A4 bkZ+0Xpr+YCikpcsdDdrQxeh5HdTUtwJRbeYfi9IW4AVgi2Xc4j0cq93+W3PflLhimIrqsRjR8vae dFa0ZL+Qw==; Received: from [2001:8b0:10b:1:55dd:c278:ec30:d8bc] by twosheds.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dcw0Q-0003PP-PH; Wed, 02 Aug 2017 15:56:18 +0000 Message-ID: <1501689378.4771.427.camel@infradead.org> From: David Woodhouse To: Jan Beulich In-Reply-To: <5981ECB402000078001033D6@prv-mh.provo.novell.com> References: <1500564043.4400.15.camel@infradead.org> <597D79BD0200007800102F92@prv-mh.provo.novell.com> <1501498940.4771.251.camel@infradead.org> <597F2D860200007800103049@prv-mh.provo.novell.com> <1501516597.4771.328.camel@infradead.org> <598198C30200007800103235@prv-mh.provo.novell.com> <1501673413.20068.15.camel@infradead.org> <5981BDDB02000078001032AC@prv-mh.provo.novell.com> <1501675860.4771.407.camel@infradead.org> <5981DA94020000780010336A@prv-mh.provo.novell.com> <1501685105.4771.421.camel@infradead.org> <5981ECB402000078001033D6@prv-mh.provo.novell.com> Date: Wed, 02 Aug 2017 16:56:18 +0100 Mime-Version: 1.0 X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 X-SRS-Rewrite: SMTP reverse-path rewritten from by twosheds.infradead.org. See http://www.infradead.org/rpr.html Cc: xen-devel@lists.xenproject.org, jiewen.yao@intel.com, jeff.fan@intel.com Subject: Re: [Xen-devel] [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 2017-08-02 at 09:16 -0600, Jan Beulich wrote: > > Well, I've seen breakage in all sorts of places I wouldn't have expected > anyone to fine a need to fiddle with. This is the nature of 'value subtract', I suppose.  How about something like this? Somewhat complicated by the fact that COFF section names get truncated, so maybe there's a nicer place to put it (or maybe we explicitly include .init.da into the .init.data output section, in the efi.lds linker script, or something?).... --- a/xen/arch/x86/efi/mkreloc.c +++ b/xen/arch/x86/efi/mkreloc.c @@ -346,6 +346,15 @@ int main(int argc, char *argv[])               memcmp(sec1[i].name, ".lockpro", sizeof(sec1[i].name)) == 0 )              continue;   +       /* For sections with relocations, force them to be writeable */ +       if (memcmp(sec1[i].name, ".init.da", sizeof(sec1[i].name)) == 0) +               printf(".pushsection .init.data, \"awx\"\n"); +       else if (memcmp(sec1[i].name, ".init.te", sizeof(sec1[i].name) ) == 0) +               printf(".pushsection .init.text, \"awx\"\n"); +       else +               printf(".pushsection %.*s, \"awx\"\n", (int)sizeof(sec1[i].name), sec1[i].name); +       printf(".popsection\n"); +          if ( !sec1[i].rva )          {              fprintf(stderr, "Can't handle section %u with zero RVA\n", i);