From patchwork Thu May 16 13:20:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viktor Mitin X-Patchwork-Id: 10946593 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 90EB51395 for ; Thu, 16 May 2019 13:23:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8181128BB1 for ; Thu, 16 May 2019 13:23:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F93728BF3; Thu, 16 May 2019 13:23:17 +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.7 required=2.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM, 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 1799928BB1 for ; Thu, 16 May 2019 13:23:17 +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 1hRGKX-00069j-Uu; Thu, 16 May 2019 13:21:53 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hRGKW-00069e-Q7 for xen-devel@lists.xenproject.org; Thu, 16 May 2019 13:21:52 +0000 X-Inumbo-ID: 908ca502-77dd-11e9-8980-bc764e045a96 Received: from mail-lj1-x243.google.com (unknown [2a00:1450:4864:20::243]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 908ca502-77dd-11e9-8980-bc764e045a96; Thu, 16 May 2019 13:21:51 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id d15so3075760ljc.7 for ; Thu, 16 May 2019 06:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qSw0F03P/izFXLYzXdvZZ7Fc5VHruxkPAjVQ9AAO9gc=; b=PvWVEgbv6hzWlUjooWvjpFfhfTpbekdQ/bRc9ee31DdNnj63oPwIePtkiBGEQ95PvC ZGzhERwGr/AAsZqspt6+FnKoE7BwVQVlfU4/zyj0TQ0gnur4yc+y7UuX9vAbVeN4eKxa PQgZNoqHmtyxlzO/ayMaGJV4HQIntm5xZY9Xa+FIf7QdmOeYB6PyXUx/SegD5pv6T2EN /Eg6QRqh1ANOgnsDh8MpT3xJHN/Aj6o0MkaIjIRb+LlT65zZVJoJ2ZcPZnnRm83bnQ0n 3ubSYCzh8E5lqdygBYmmxFtqCIGnrefQRO1Xcz46XlZHTZJcQg8Hj/+Kw1I9cSL02tyh O6ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qSw0F03P/izFXLYzXdvZZ7Fc5VHruxkPAjVQ9AAO9gc=; b=UBSbazb8ODAWe0inFJJO2NpL+9DfM9lSiYvnfsbzpVh53aPe9zn4M8rHw9iZhKHRTX HdLeP5Pmq3rFhw1BVqyZOhY5+nwfhN7BpacM953ShLn37E119qeSbL8YOEvDpISJr6Fw VtlBNkKkTGUjaUOQcqU+vSJ6QLbLl3ktjHEWXsPqYMNr5rgLadcNHR48WxEHuQ8z1/Iz Y6Z7tlfUcQhknx4MPU7HEyDxPI96N5hXolZpBR6/ReV7RFR73TAsyp1k6cEGxnCyLTZU gwP7wjp8LOu3X3yT/IbzWRPaYxreoZJ4vJ3w7JlzfSih7wXjT513KayUHKQsXX6JERih kMRg== X-Gm-Message-State: APjAAAVTnABVDvF96nWCXEqgkKmT5UklsBhsBOcrO2nDpBGO9bk11+D4 Zyal6DAZZNhRfu9YaBB+F+VSEZ5Hf3eO/g== X-Google-Smtp-Source: APXvYqzofJIvYa2MPd5Ok1dR/t2oJpw14CLTukA2WOBfR/2ToRUwmB9gNucZAE7PFq8BMJE5r5MANA== X-Received: by 2002:a2e:9a8f:: with SMTP id p15mr23922525lji.191.1558012910080; Thu, 16 May 2019 06:21:50 -0700 (PDT) Received: from 3489.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id o7sm879335ljh.57.2019.05.16.06.21.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 06:21:49 -0700 (PDT) From: Viktor Mitin To: xen-devel@lists.xenproject.org Date: Thu, 16 May 2019 16:20:16 +0300 Message-Id: <20190516132016.8032-1-viktor.mitin.19@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [Xen-devel] [PATCH v2] coverage: filter out libfdt.o and libelf.o X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Viktor Mitin MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The patch resolves 'xencov' crashes in case of Aarch64. All the .init.* sections are stripped after boot, it means that anything in .init.data cannot be accessed anymore. The build system explicitly compiles any .init binary without gcov option. The problem is coming from libfdt and libelf. The entire library is moved to .init using: $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@ So we need to tell the top Makefile to filter out libfdt and libelf. Reported-by: Viktor Mitin Suggested-by: Julien Grall Signed-off-by: Viktor Mitin Acked-by: Andrew Cooper Reviewed-by: Wei Liu Tested-by: Viktor Mitin --- Changes from v1: - coverage: filtered out libelf as well --- xen/common/libelf/Makefile | 1 + xen/common/libfdt/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile index 5bf8f764f1..3d9e38f27e 100644 --- a/xen/common/libelf/Makefile +++ b/xen/common/libelf/Makefile @@ -1,4 +1,5 @@ obj-bin-y := libelf.o +nocov-y += libelf.o SECTIONS := text data $(SPECIAL_DATA_SECTIONS) diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile index d81f54b6b8..c075bbf546 100644 --- a/xen/common/libfdt/Makefile +++ b/xen/common/libfdt/Makefile @@ -3,6 +3,7 @@ include Makefile.libfdt SECTIONS := text data $(SPECIAL_DATA_SECTIONS) obj-y += libfdt.o +nocov-y += libfdt.o CFLAGS += -I$(BASEDIR)/include/xen/libfdt/