From patchwork Tue Nov 26 12:25:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wieczorkiewicz, Pawel" X-Patchwork-Id: 11262093 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 0EB46913 for ; Tue, 26 Nov 2019 12:26:29 +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 DF42820722 for ; Tue, 26 Nov 2019 12:26:28 +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="tmRC7YRZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF42820722 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 1iZZud-0004Yh-9P; Tue, 26 Nov 2019 12:25:47 +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 1iZZuc-0004YL-Dv for xen-devel@lists.xenproject.org; Tue, 26 Nov 2019 12:25:46 +0000 X-Inumbo-ID: dbf9f51e-1047-11ea-a39f-12813bfff9fa Received: from smtp-fw-33001.amazon.com (unknown [207.171.190.10]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dbf9f51e-1047-11ea-a39f-12813bfff9fa; Tue, 26 Nov 2019 12:25: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=1574771141; x=1606307141; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ZXAJjfmjhp5i95fpbuZn3bmZpshZMAdvbhZBgLG/CAQ=; b=tmRC7YRZdRoDDow1RAeCcSHA2mLH5VRbx3l+kOG/OaBkUdEkc8nAowtA CbVw2r963lPqiDBaOm8vgbwtzpqmTqUjqktPDRpoY6b6ADYIRrgj2LJ9p H5sWawdE4SSlPDuKnArnlWTlqlNhZ5ag6vq3Bpo/Ng043OsNwvoA98j09 k=; IronPort-SDR: Cp+alx7SbV8IYhB+g9t7n5hN/byFmDN3bn835+lcF/vId2tDGXccyxQDC3zasCZfG5hy6sx/n8 aTS55vH6ZBVw== X-IronPort-AV: E=Sophos;i="5.69,245,1571702400"; d="scan'208";a="11319307" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2c-87a10be6.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 26 Nov 2019 12:25:30 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2c-87a10be6.us-west-2.amazon.com (Postfix) with ESMTPS id 5534DA21D9; Tue, 26 Nov 2019 12:25:29 +0000 (UTC) Received: from EX13D05EUC003.ant.amazon.com (10.43.164.207) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 26 Nov 2019 12:25:28 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13D05EUC003.ant.amazon.com (10.43.164.207) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 26 Nov 2019 12:25:27 +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; Tue, 26 Nov 2019 12:25:25 +0000 From: Pawel Wieczorkiewicz To: Date: Tue, 26 Nov 2019 12:25:07 +0000 Message-ID: <20191126122511.7409-4-wipawel@amazon.de> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20191126122511.7409-1-wipawel@amazon.de> References: <20191126122511.7409-1-wipawel@amazon.de> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v3 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: Pawel Wieczorkiewicz , Ross Lagerwall , mpohlack@amazon.com, Konrad Rzeszutek Wilk 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 7ff56c7..fed47cd 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); \ })