From patchwork Fri Sep 16 16:38:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9336209 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 0F2B660839 for ; Fri, 16 Sep 2016 16:41:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFE962A039 for ; Fri, 16 Sep 2016 16:41:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E42D42A03D; Fri, 16 Sep 2016 16:41:45 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY 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 CC57F2A03C for ; Fri, 16 Sep 2016 16:41:44 +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 1bkwA7-0002gc-4C; Fri, 16 Sep 2016 16:38:51 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkwA5-0002f8-SB for xen-devel@lists.xenproject.org; Fri, 16 Sep 2016 16:38:49 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 0A/71-09561-9102CD75; Fri, 16 Sep 2016 16:38:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRWlGSWpSXmKPExsXSO6nOVVdC4U6 4wb6Nqhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa0bj/YksBU+FK34+2cfSwPiMt4uRk0NIoINJ Yucbhy5GLiD7C6PExfvvWCCcjYwS9y6fZoRwuhklZizcyQbRUiRxZfYi5i5GDg42AROJN6scQ WpEBPoYJW4f/csIUsMM4uw7zQxiCwvESOy58xzMZhFQlfi46zkLiM0r4C7x5sNZsLiEgJzEti 17GEFmcgLFe85lQqxyk1iyfi0TRImxRN+sPpYJjPwLGBlWMaoXpxaVpRbpGuslFWWmZ5TkJmb m6BoamOrlphYXJ6an5iQmFesl5+duYgSGDwMQ7GDc+8/pEKMkB5OSKG9x4e1wIb6k/JTKjMTi jPii0pzU4kOMMhwcShK8X+XuhAsJFqWmp1akZeYAAxkmLcHBoyTCGy4PlOYtLkjMLc5Mh0idY tTlODT92lomIZa8/LxUKXHeJyAzBECKMkrz4EbAouoSo6yUMC8j0FFCPAWpRbmZJajyrxjFOR iVhHkTQFbxZOaVwG16BXQEE9ARq2fdBjmiJBEhJdXAGN/pfywvpuqSqHldl+DWA9P8pk36UCP oqO/rdnim+SuDsLLy/dG24XY1SxS3clU///45u/D5Oa/fhe9vGH8+6XywPmDtvC6PmcaNbFNi b3LduyR/oyo5IE66QDOKQz1dtKp13iyni5f+sB99L7lB4N4+RmdWnQWnnT5U9Qs1ZvZZrJwXd bdMiaU4I9FQi7moOBEAXRR9TKUCAAA= X-Env-Sender: konrad@char.us.oracle.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1474043927!43979435!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1733 invoked from network); 16 Sep 2016 16:38:48 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-2.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 16 Sep 2016 16:38:48 -0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8GGcb6Y001726 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Sep 2016 16:38:37 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u8GGcaNV020936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Sep 2016 16:38:36 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u8GGcZTq006149; Fri, 16 Sep 2016 16:38:36 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 16 Sep 2016 09:38:35 -0700 Received: by char.us.oracle.com (Postfix, from userid 1000) id C5E196A0E1E; Fri, 16 Sep 2016 12:38:33 -0400 (EDT) From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, konrad@kernel.org, ross.lagerwall@citrix.com, julien.grall@arm.com, sstabellini@kernel.org Date: Fri, 16 Sep 2016 12:38:28 -0400 Message-Id: <1474043908-12101-17-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1474043908-12101-1-git-send-email-konrad.wilk@oracle.com> References: <1474043908-12101-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: Andrew Cooper , Jan Beulich , Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v4 16/16] livepatch: In xen_nop test-case remove the .bss and .data sections 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP As they are not needed for the livepatch to work. Also this allows us to properly test: "livepatch: Disallow applying after an revert" as the livepatch will now only have the minimalistic sections: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .note.gnu.build-i NOTE 0000000000000000 00000040 0000000000000024 0000000000000000 A 0 0 4 [ 2] .text PROGBITS 0000000000000024 00000064 0000000000000000 0000000000000000 AX 0 0 4 [ 3] .livepatch.depend PROGBITS 0000000000000000 00000064 0000000000000024 0000000000000000 A 0 0 1 [ 4] .livepatch.funcs PROGBITS 0000000000000000 000000a0 0000000000000040 0000000000000000 WA 0 0 32 [ 5] .note.GNU-stack PROGBITS 0000000000000000 000000e0 0000000000000000 0000000000000000 X 0 0 1 [ 6] .comment PROGBITS 0000000000000000 000000e0 000000000000002d 0000000000000001 MS 0 0 1 [ 7] .shstrtab STRTAB 0000000000000000 0000010d 0000000000000071 0000000000000000 0 0 1 [ 8] .symtab SYMTAB 0000000000000000 00000400 00000000000000c0 0000000000000018 9 7 8 [ 9] .strtab STRTAB 0000000000000000 000004c0 000000000000000f 0000000000000000 0 0 1 In which only .livepatch.funcs is write-able. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Jan Beulich Cc: Andrew Cooper v4: New submission --- xen/test/livepatch/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile index d7a4735..41ad59d 100644 --- a/xen/test/livepatch/Makefile +++ b/xen/test/livepatch/Makefile @@ -104,6 +104,8 @@ xen_nop.o: config.h .PHONY: $(LIVEPATCH_NOP) $(LIVEPATCH_NOP): xen_nop.o note.o $(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH_NOP) $^ + $(OBJCOPY) --remove-section=.bss --remove-section=.data $@ + $(OBJCOPY) --strip-unneeded $@ .PHONY: livepatch livepatch: $(LIVEPATCH) $(LIVEPATCH_BYE) $(LIVEPATCH_REPLACE) $(LIVEPATCH_NOP)