From patchwork Mon Sep 16 11:30:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wieczorkiewicz, Pawel" X-Patchwork-Id: 11146865 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7CDE17E6 for ; Mon, 16 Sep 2019 11:33:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8414E2067B for ; Mon, 16 Sep 2019 11:33:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.de header.i=@amazon.de header.b="Bv2RtKrv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8414E2067B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i9pER-0003CE-Mp; Mon, 16 Sep 2019 11:31:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i9pEP-00039A-3q for xen-devel@lists.xen.org; Mon, 16 Sep 2019 11:31:45 +0000 X-Inumbo-ID: 8dce3f12-d875-11e9-b299-bc764e2007e4 Received: from smtp-fw-6002.amazon.com (unknown [52.95.49.90]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8dce3f12-d875-11e9-b299-bc764e2007e4; Mon, 16 Sep 2019 11:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1568633501; x=1600169501; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=h/EcPi67Ay019LWMfejEBMe1LxzOgE+GmoRJDs9Vapk=; b=Bv2RtKrvj1Txnlpoab2hjs7y/dvNuXKsu9GujKahVAqHaBcHcVlfNngz sXabX9GqqxyV9xD/V4AmRPrvWvZHGESfAL2QbIQepei+TnX4f8V5iHaOo fr6JuP9lGoeMrCV24XBjQitgYExf9SQ6U0TKtGtjACjqUWWp+OJjTWTJd g=; X-IronPort-AV: E=Sophos;i="5.64,512,1559520000"; d="scan'208";a="421366317" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-af6a10df.us-east-1.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 16 Sep 2019 11:31:40 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1a-af6a10df.us-east-1.amazon.com (Postfix) with ESMTPS id EE796A22BF; Mon, 16 Sep 2019 11:31:36 +0000 (UTC) Received: from EX13D03EUC001.ant.amazon.com (10.43.164.245) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 16 Sep 2019 11:31:23 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13D03EUC001.ant.amazon.com (10.43.164.245) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 16 Sep 2019 04:31:22 -0700 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; Mon, 16 Sep 2019 11:31:19 +0000 From: Pawel Wieczorkiewicz To: , Date: Mon, 16 Sep 2019 11:30:52 +0000 Message-ID: <20190916113056.16592-4-wipawel@amazon.de> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20190916113056.16592-1-wipawel@amazon.de> References: <20190916113056.16592-1-wipawel@amazon.de> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v2 3/7] 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: wipawel@amazon.com, Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , mpohlack@amazon.com, Tim Deegan , Pawel Wieczorkiewicz , Julien Grall , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Reviewed-by: Ross Lagerwall --- create-diff-object.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/create-diff-object.c b/create-diff-object.c index 44f4e6b..9918b6e 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, + }, {}, }; @@ -1488,6 +1496,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); \ }) @@ -1497,6 +1506,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); \ })