From patchwork Wed Sep 20 22:31:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9962711 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 8DB0F6056A for ; Wed, 20 Sep 2017 22:34:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D9A329258 for ; Wed, 20 Sep 2017 22:34:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 728692926F; Wed, 20 Sep 2017 22:34:47 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,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 1887429273 for ; Wed, 20 Sep 2017 22:34:46 +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 1dunXV-0007JK-2K; Wed, 20 Sep 2017 22:32:17 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dunXT-0007HI-NA for xen-devel@lists.xenproject.org; Wed, 20 Sep 2017 22:32:15 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id 4B/5D-01911-E6CE2C95; Wed, 20 Sep 2017 22:32:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRWlGSWpSXmKPExsVyMfTOEd3cN4c iDZYu17X4vmUykwOjx+EPV1gCGKNYM/OS8isSWDP2L/vLXPBIqOL800csDYyXBboYuTiEBGYy SlzZ/IsNxGER+MAise3HU2YQR0JgGqvExFkX2bsYOYGcLIk5/98yQthpEgfeNULZ5RKzmj8xg 9hCAkoSWyY/ZoQYe4hJYsmm52DNwgJ6EpO/3QZrYBPQl3i69hpQAwdQs5vEp2tcIPUiAu2MEr Ov/GIFqWEWMJRofXuUDaI3QeL5rrNgNouAqsT+GwuYQGxeARuJg5/uQh0hLzGxdxqYzQkU3/+ pE+oga4knW0+zTWAUXsDIsIpRvTi1qCy1SNdCL6koMz2jJDcxM0fX0MBYLze1uDgxPTUnMalY Lzk/dxMjMEQZgGAH44V250OMkhxMSqK81i8PRQrxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4P31C ignWJSanlqRlpkDjBaYtAQHj5II7wKQNG9xQWJucWY6ROoUoyXHhTuX/jBxHNhzC0h23Lz7h0 mIJS8/L1VKnPcrSIMASENGaR7cOFhEX2KUlRLmZQQ6UIinILUoN7MEVf4VozgHo5Iwr+BroCk 8mXklcFtfAR3EBHRQ9oYDIAeVJCKkpBoYdy9+Zxy55vNizZPyXz/li887+WPJ8fl3aw8kvVzm mvTYLtCh9H+Je1Qct039/heCe9eWuTBy9U4w1czUN9jAnuTm2b9M6eKd1obz/+ebPT6isfOU5 NzXpeurTyy0iuGUD3bxX2Uyn1HLxynjRPvEbdGS501+lZ3SmJu9RGb7M02Zi2ac3cbeSizFGY mGWsxFxYkADAadD+MCAAA= X-Env-Sender: ketuzsezr@gmail.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1505946732!84835807!1 X-Originating-IP: [209.85.220.196] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 883 invoked from network); 20 Sep 2017 22:32:13 -0000 Received: from mail-qk0-f196.google.com (HELO mail-qk0-f196.google.com) (209.85.220.196) by server-11.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 20 Sep 2017 22:32:13 -0000 Received: by mail-qk0-f196.google.com with SMTP id g128so2583827qke.0 for ; Wed, 20 Sep 2017 15:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=oIvtsQxPxyUGAbxv5UFus+AYIxCvOpuaANm94F7IgUs=; b=pAAzPFXgmoFhyK5RkEEkoR39AueypTFNqYlimyG1uHaF5ScMRAK+qXLz9mJqh9BeTc SEcquaaALVOZR5NFBJr4bYzdPcRKJLgoU8VQaMTOqXjXSi+AKJE8NT/95vxYCj/WeAyT wtUnMOsO3tBvpz4S20HrEe1BteOorV+zdIXBW7gLlBpGpTlh+dv8xk2W1OVEGDY8Fmrp QT29+nWmuijwkgYQ3JWlEGTcSMAse84O3ixYoT3ZflWtfmKWjXzOIh9tlFoUDnfFf82u J8T5UiEAn/Qyz0PPkCRS8eQ1bZXKOzLmg3VJ+uO/sjd3K6iJNxOKQqLKUNzPYCj0KEuR 4hEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=oIvtsQxPxyUGAbxv5UFus+AYIxCvOpuaANm94F7IgUs=; b=GuqtoWN4dg7aQkWIVJL0EUOnwIQHazY6Fa4FScpBTux19BtUPKgi1+NoTXnVJwAvg4 wNcytc0HoOhafn6jZyIwQZE4EsKlKleegOJ5JyePGDHFPbewSSSPcAVa21dplUyPVPea UlN/3V0LJJkDB5RX0S3Txso1ombtYcPIeTSzRV3ZeYBYXAOrk3aedt9CThhwsypevWQv DYiUjMkRGmF1R+Upnj1InnOKH15il7ZY6+FwmlAgUjxB5jxImZEwSQWSnR8bB8O0+IPo ACtnWhZSZfSQucb4L9Is4+Afmhbcr6ouUM+faOiYgJ/FPC5qtsKlzuP+isHS1cB1F2Z9 PaIw== X-Gm-Message-State: AHPjjUh8AqB4tVKbviTltUUBkHJGoA9+hOcqzo6K557Vfpd7olUgNQFD SMaWxCTU12U6X/NCa+Y2s4Pa1w== X-Google-Smtp-Source: AOwi7QC7/scJWCFKY7jrwpTn7c5QEOr/6o4s6GJHJzxMr4wr3Oz0i08+iTb4GbuqxZe8WlmhGRogdg== X-Received: by 10.233.237.5 with SMTP id c5mr314733qkg.309.1505946732436; Wed, 20 Sep 2017 15:32:12 -0700 (PDT) Received: from localhost.localdomain (209-6-200-48.s4398.c3-0.smr-ubr2.sbo-smr.ma.cable.rcncustomer.com. [209.6.200.48]) by smtp.gmail.com with ESMTPSA id z192sm2012656qka.91.2017.09.20.15.32.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Sep 2017 15:32:11 -0700 (PDT) From: Konrad Rzeszutek Wilk X-Google-Original-From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, ross.lagerwall@citrix.com, konrad.wilk@oracle.com, julien.grall@arm.com, sstabellini@kernel.org Date: Wed, 20 Sep 2017 18:31:46 -0400 Message-Id: <20170920223148.13137-10-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170920223148.13137-1-konrad.wilk@oracle.com> References: <20170920223148.13137-1-konrad.wilk@oracle.com> Cc: andrew.cooper3@citrix.com, jbeulich@suse.com Subject: [Xen-devel] [PATCH v4 09/11] livepatch/tests: Make sure all .livepatch.funcs sections are read-only 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 Instead of being writable (.data). This mimics the behavior of what livepatch-build-tools do. Other approaches such as 'struct const livepatch_funcs' still result in the WA section attributes. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ross Lagerwall v2: First posting. v3: Don't do multiple objcopy invocations. --- xen/test/livepatch/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile index b48669cc13..9e45a81452 100644 --- a/xen/test/livepatch/Makefile +++ b/xen/test/livepatch/Makefile @@ -53,7 +53,8 @@ xen_hello_world.o: config.h livepatch_depends.h .PHONY: $(LIVEPATCH) $(LIVEPATCH): xen_hello_world_func.o xen_hello_world.o $(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH) $^ - $(OBJCOPY) --redefine-sym $(NOTE_SYMBOL)=$@_$(NOTE_SYMBOL) $@ + $(OBJCOPY) --redefine-sym $(NOTE_SYMBOL)=$@_$(NOTE_SYMBOL) \ + --set-section-flags .livepatch.funcs=alloc,readonly $@ # # This target is only accessible if CONFIG_LIVEPATCH is defined, which @@ -89,21 +90,24 @@ xen_bye_world.o: config.h hello_world_livepatch_depends.h .PHONY: $(LIVEPATCH_BYE) $(LIVEPATCH_BYE): xen_bye_world_func.o xen_bye_world.o $(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH_BYE) $^ - $(OBJCOPY) --redefine-sym $(NOTE_SYMBOL)=$@_$(NOTE_SYMBOL) $@ + $(OBJCOPY) --redefine-sym $(NOTE_SYMBOL)=$@_$(NOTE_SYMBOL) \ + --set-section-flags .livepatch.funcs=alloc,readonly $@ xen_replace_world.o: config.h livepatch_depends.h .PHONY: $(LIVEPATCH_REPLACE) $(LIVEPATCH_REPLACE): xen_replace_world_func.o xen_replace_world.o $(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH_REPLACE) $^ - $(OBJCOPY) --redefine-sym $(NOTE_SYMBOL)=$@_$(NOTE_SYMBOL) $@ + $(OBJCOPY) --redefine-sym $(NOTE_SYMBOL)=$@_$(NOTE_SYMBOL) \ + --set-section-flags .livepatch.funcs=alloc,readonly $@ xen_nop.o: config.h livepatch_depends.h .PHONY: $(LIVEPATCH_NOP) $(LIVEPATCH_NOP): xen_nop.o $(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH_NOP) $^ - $(OBJCOPY) --redefine-sym $(NOTE_SYMBOL)=$@_$(NOTE_SYMBOL) $@ + $(OBJCOPY) --redefine-sym $(NOTE_SYMBOL)=$@_$(NOTE_SYMBOL) \ + --set-section-flags .livepatch.funcs=alloc,readonly $@ .PHONY: livepatch livepatch: $(LIVEPATCH) $(LIVEPATCH_BYE) $(LIVEPATCH_REPLACE) $(LIVEPATCH_NOP)