From patchwork Thu Jun 16 16:39:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 9181341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF5BD6075D for ; Thu, 16 Jun 2016 16:41:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A01B02835E for ; Thu, 16 Jun 2016 16:41:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94E8828365; Thu, 16 Jun 2016 16:41:35 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2F9C02835E for ; Thu, 16 Jun 2016 16:41:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDaL9-0003W1-O8; Thu, 16 Jun 2016 16:40:23 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDaL7-0001xY-C4 for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2016 16:40:22 +0000 Received: by mail-wm0-x233.google.com with SMTP id m124so77659357wme.1 for ; Thu, 16 Jun 2016 09:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=dsYNU3aRg0RSocaEhENbbXAkDvCL9iMhIXEw2iVLEeA=; b=BZkqpYwrFfPRQKlM1Drn2oWJ7q5a8OAALNNBSlixhMzf6QHOoTv1rqdJ+RgCvdge+A BTzhFCuNsP/yeZ5MAddjWmRaa4TmmVJzDlj/z+ZhFDds9d2qEjFJf7vhJHjp0S3KJyan Wbeg43VNG/kt3GRwQxAyZS4jUctrw7AuAL3bOtzeNIeVTfE/LrVh/SC0kuHfDJOcLF40 +QRxYOpD8B58a/fGfoEma1Wc4H3WRouqNLYxOTg4l7sEY/bHJEyXSNVVWifKGBXzOCjm GKYLeXeGyJvfy+XvPWkAnOd3vjB9mmdTA5A1y63xNsRgaaA3Z49LwMQKjpg0+brHP9G+ FKWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dsYNU3aRg0RSocaEhENbbXAkDvCL9iMhIXEw2iVLEeA=; b=iK/qsafOerZcf/amfxmOL5bU0c8EkpTKggLmaIBiFhAyoqFFqEQ/1SBJClX5iQ428S CBa8tHGZvnf1XhtSfhrn/aVuU4nJYEgfhB1FoNkw1SSPVyf2q82Pw58ChgnFkcF2TQwU DB5fDoS63On6z3aHaSWJq/TEIoOh7ujUUk3iMihlI5R4z0bZZBav0VIKeJoWnkdvX3xv nWdvesLEq7vtyIqydvF46HoxoDC/vjzngmcQF3NgDixMlOIiOlC6kPIhz9GuKcY2/9hj GOlZRn6x0avp/UP2fpPMx/q41wLfMgINm30E854wn/f+B9Y7XgiLJPYwYnCb2k+u15EE jm4Q== X-Gm-Message-State: ALyK8tKFSgyzNuqSbJBqPUs2TooHr71ltQhWaRLx+6iTlpOEKjK4OToBeTQisNo6AuWqhh3U X-Received: by 10.28.24.82 with SMTP id 79mr17379072wmy.42.1466095199518; Thu, 16 Jun 2016 09:39:59 -0700 (PDT) Received: from glider0.muc.corp.google.com ([100.105.12.50]) by smtp.gmail.com with ESMTPSA id ue1sm23648560wjc.44.2016.06.16.09.39.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Jun 2016 09:39:58 -0700 (PDT) From: Alexander Potapenko To: dvyukov@google.com, catalin.marinas@arm.com, quentin.casasnovas@oracle.com, will.deacon@arm.com, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, christoffer.dall@linaro.org, james.morse@arm.com Subject: [PATCH v4] arm64: allow building with kcov coverage on ARM64 Date: Thu, 16 Jun 2016 18:39:52 +0200 Message-Id: <1466095192-106891-1-git-send-email-glider@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160616_094021_579886_3A9081EE X-CRM114-Status: GOOD ( 10.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kcc@google.com, akpm@linux-foundation.org, syzkaller@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add ARCH_HAS_KCOV to ARM64 config. To avoid potential crashes, disable instrumentation of the files in arch/arm64/kvm/hyp/*. Signed-off-by: Alexander Potapenko Acked-by: Mark Rutland Acked-by: Marc Zyngier Tested-by: James Morse --- v4: - added ack from Marc Zyngier and Tested-by from James Morse v3: - reverted arch/arm64/boot/Makefile, there's no code in that dir - added ack from Mark Rutland v2: - disable instrumentation of arch/arm64/{boot,kvm/hyp} - enable instrumentation of arch/arm64/lib/delay.c --- arch/arm64/Kconfig | 1 + arch/arm64/kvm/hyp/Makefile | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 5a0a691..eb0b0a0 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -7,6 +7,7 @@ config ARM64 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_GCOV_PROFILE_ALL + select ARCH_HAS_KCOV select ARCH_HAS_SG_CHAIN select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_USE_CMPXCHG_LOCKREF diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile index 778d0ef..0c85feb 100644 --- a/arch/arm64/kvm/hyp/Makefile +++ b/arch/arm64/kvm/hyp/Makefile @@ -17,6 +17,10 @@ obj-$(CONFIG_KVM_ARM_HOST) += tlb.o obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o +# KVM code is run at a different exception code with a different map, so +# compiler instrumentation that inserts callbacks or checks into the code may +# cause crashes. Just disable it. GCOV_PROFILE := n KASAN_SANITIZE := n UBSAN_SANITIZE := n +KCOV_INSTRUMENT := n