From patchwork Wed Aug 14 08:37:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wieczorkiewicz, Pawel" X-Patchwork-Id: 11093503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B20A13B1 for ; Wed, 14 Aug 2019 08:40:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4334A287B6 for ; Wed, 14 Aug 2019 08:40:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 326D8287C1; Wed, 14 Aug 2019 08:40:14 +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,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CA3AF287B6 for ; Wed, 14 Aug 2019 08:40:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxonU-0005G9-EO; Wed, 14 Aug 2019 08:38:20 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxonS-0005G4-Bk for xen-devel@lists.xen.org; Wed, 14 Aug 2019 08:38:18 +0000 X-Inumbo-ID: da2ce712-be6e-11e9-b99f-77212d4951d7 Received: from smtp-fw-33001.amazon.com (unknown [207.171.190.10]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id da2ce712-be6e-11e9-b99f-77212d4951d7; Wed, 14 Aug 2019 08:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1565771895; x=1597307895; h=from:to:cc:subject:date:message-id:mime-version; bh=hgF5KtlUrzKZdER7dHnu2iWFp+5EfDQd214BaFuATeQ=; b=cVV5mOLnWH4nGcbFmtuYqhMqa7BjK1kcYbW416Q+HeQr+sIBbdEiPdpM QoOlEQX01Y+ZEjYkVsM1wOB6VUnzzeXZ/7gTMzvO0YmDozylnfGQ1dBq6 3JGXW+EJsWRq9tFZRlAX0Np8tPdzLF4sv3/JaX6zuIP29KDlarbIq4LpJ 0=; X-IronPort-AV: E=Sophos;i="5.64,384,1559520000"; d="scan'208";a="819722882" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-2a-c5104f52.us-west-2.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 14 Aug 2019 08:38:10 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2a-c5104f52.us-west-2.amazon.com (Postfix) with ESMTPS id 5E651A2342; Wed, 14 Aug 2019 08:38:09 +0000 (UTC) Received: from EX13D03EUA004.ant.amazon.com (10.43.165.93) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 14 Aug 2019 08:38:08 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13D03EUA004.ant.amazon.com (10.43.165.93) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 14 Aug 2019 08:38:07 +0000 Received: from dev-dsk-wipawel-1a-0c4e6d58.eu-west-1.amazon.com (10.4.134.33) by mail-relay.amazon.com (10.43.162.232) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 14 Aug 2019 08:38:05 +0000 From: Pawel Wieczorkiewicz To: Date: Wed, 14 Aug 2019 08:37:59 +0000 Message-ID: <20190814083759.88961-1-wipawel@amazon.de> X-Mailer: git-send-email 2.16.5 MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [livepatch-hooks-2 PATCH 1/4] create-diff-object: Handle optional apply|revert hooks X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: mpohlack@amazon.de, ross.lagerwall@citrix.com, wipawel@amazon.de, konrad.wilk@oracle.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Include new sections containing optional apply and revert action hooks. The following new section names are supported: - .livepatch.hooks.apply - .livepatch.hooks.revert Signed-off-by: Pawel Wieczorkiewicz --- create-diff-object.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/create-diff-object.c b/create-diff-object.c index 3493fe1..263c7d2 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -1118,6 +1118,14 @@ static struct special_section special_sections[] = { .name = ".livepatch.hooks.postrevert", .group_size = livepatch_hooks_group_size, }, + { + .name = ".livepatch.hooks.apply", + .group_size = livepatch_hooks_group_size, + }, + { + .name = ".livepatch.hooks.revert", + .group_size = livepatch_hooks_group_size, + }, {}, }; @@ -1483,6 +1491,7 @@ static void kpatch_include_debug_sections(struct kpatch_elf *kelf) #define IS_ACTION_HOOK_SECTION(section, action) ({ \ IS_HOOK_SECTION(section, "pre" action) || \ + IS_HOOK_SECTION(section, action) || \ IS_HOOK_SECTION(section, "post" action); \ }) @@ -1492,6 +1501,7 @@ static void kpatch_include_debug_sections(struct kpatch_elf *kelf) #define IS_ACTION_HOOK_SYM_NAME(symbol, action) ({ \ IS_HOOK_SYM_NAME(symbol, "pre" action) || \ + IS_HOOK_SYM_NAME(symbol, action) || \ IS_HOOK_SYM_NAME(symbol, "post" action); \ })