From patchwork Wed Aug 21 08:20:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wieczorkiewicz, Pawel" X-Patchwork-Id: 11106075 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 9B8AF1395 for ; Wed, 21 Aug 2019 08:23:14 +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 77EB922DA7 for ; Wed, 21 Aug 2019 08:23:14 +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="RiWIzlAr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77EB922DA7 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 1i0Lsd-0002K0-7S; Wed, 21 Aug 2019 08:22:07 +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 1i0Lsb-0002Gg-98 for xen-devel@lists.xen.org; Wed, 21 Aug 2019 08:22:05 +0000 X-Inumbo-ID: b5db70b2-c3ec-11e9-adc2-12813bfff9fa Received: from smtp-fw-33001.amazon.com (unknown [207.171.190.10]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b5db70b2-c3ec-11e9-adc2-12813bfff9fa; Wed, 21 Aug 2019 08:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1566375704; x=1597911704; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=crehptxpzZcn/w9rVVjYZL9Nt7ha3q+3YwrmhUOuDNo=; b=RiWIzlAriqWHvkWMKXoBDBz4B8fEtVDbzc2jTDSdsjzLXmlPxjw+hzb7 jIag+ny+MVmMFeYpeGB1zwpTCcAGUTK1SqH6nbhSWDo213eO2764TRsg8 SKveV7Tic8iBQpJV1A8bKvCwyEPGnNhV2mCRjUHeLUoode8TxXyV4/AsI k=; X-IronPort-AV: E=Sophos;i="5.64,412,1559520000"; d="scan'208";a="822132882" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-2b-baacba05.us-west-2.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 21 Aug 2019 08:21:40 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-baacba05.us-west-2.amazon.com (Postfix) with ESMTPS id E2F6CA2460; Wed, 21 Aug 2019 08:21:39 +0000 (UTC) Received: from EX13D05EUB003.ant.amazon.com (10.43.166.253) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 08:21:25 +0000 Received: from EX13MTAUEB001.ant.amazon.com (10.43.60.96) by EX13D05EUB003.ant.amazon.com (10.43.166.253) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 08:21:24 +0000 Received: from dev-dsk-wipawel-1a-0c4e6d58.eu-west-1.amazon.com (10.4.134.33) by mail-relay.amazon.com (10.43.60.129) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 21 Aug 2019 08:21:22 +0000 From: Pawel Wieczorkiewicz To: Date: Wed, 21 Aug 2019 08:20:47 +0000 Message-ID: <20190821082056.91090-12-wipawel@amazon.de> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20190821082056.91090-1-wipawel@amazon.de> References: <20190821082056.91090-1-wipawel@amazon.de> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH 11/20] create-diff-object: Do not create empty .livepatch.funcs section 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, Konrad Rzeszutek Wilk , Andrew Cooper , Ross Lagerwall , mpohlack@amazon.com, Pawel Wieczorkiewicz Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When there is no changed function in the generated payload, do not create an empty .livepatch.funcs section. Hypervisor code considers such payloads as broken and rejects to load them. Such payloads without any changed functions may appear when only hooks are specified. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Martin Mazein Reviewed-by: Martin Pohlack Reviewed-by: Ross Lagerwall --- create-diff-object.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/create-diff-object.c b/create-diff-object.c index a90cf37..4e0f3be 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -1843,6 +1843,11 @@ static void livepatch_create_patches_sections(struct kpatch_elf *kelf, if (sym->type == STT_FUNC && sym->status == CHANGED) nr++; + if (nr == 0) { + log_debug("No changed functions found. Skipping .livepatch.funcs section creation\n"); + return; + } + /* create text/rela section pair */ sec = create_section_pair(kelf, ".livepatch.funcs", sizeof(*funcs), nr); relasec = sec->rela;