From patchwork Wed May 22 17:47:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10956403 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 14EB6112C for ; Wed, 22 May 2019 17:47:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0378528AE6 for ; Wed, 22 May 2019 17:47:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB68128C19; Wed, 22 May 2019 17:47:30 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 97DEA28AE6 for ; Wed, 22 May 2019 17:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=u2N5ZV8HllK1bo3BjUVpuMQ+0If0z+axo7ZCNxHbGhk=; b=CnNSk0dKTQH26X iiXBrggk7IIjAIaOD7xzmkAbbYQYx/BPPh6Z1CQ2plLThH4JIkVMj18tzlNQIeXkkZ6RN1dWmApOw 7viuPruQCDnJ4v2om2TJL2hJ+wLc4bPSXWrABFpHw5xfeN//E3yv4PAySk819nzUytOp+7VeumaCl PZo/XTdCzrcNfEEyXLWJx50+yVYgR9XbC9SSQmXV1DVA9F6bu7yltz2Y9vZTCKtB/MFHW1xo40NyY ddzJ4owHBp7KqPwubYG90Bf8Awg2kEFw7rvAbz66ug4r9jighEYWkft5N872+TxyTPdTVhDEIZZgg oX037tuVqsT7G6ZlBxkw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTVKn-0008Rk-H0; Wed, 22 May 2019 17:47:25 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTVKk-0008R4-CR for linux-arm-kernel@lists.infradead.org; Wed, 22 May 2019 17:47:23 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 687B4341; Wed, 22 May 2019 10:47:20 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E1B4F3F5AF; Wed, 22 May 2019 10:47:18 -0700 (PDT) From: James Morse To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH v2 0/2] Move __hyp_text code under no-asan Makefiles Date: Wed, 22 May 2019 18:47:03 +0100 Message-Id: <20190522174705.236469-1-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190522_104722_425317_67E8F822 X-CRM114-Status: GOOD ( 11.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Suzuki K Pouloze , Marc Zyngier , Julien Thierry , Christoffer Dall , James Morse , Andrew Murray 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 The fancy new pmu code added its __hyp_text code in part of the tree that doesn't get covered by the no-asan/no-kcov kconfig decorations. This shows up as a hyp-panic on v8.0 hardware when the host kernel is built with debug options like kasan. This same bug has been living happily in the aarch32 emulation code since v4.9. (commit 8cebe750c4d9a "arm64: KVM: Make kvm_skip_instr32 available to HYP"). Patch 2 has the two relevant fixes tag, but won't apply cleanly before v4.19 due to the churn. Fix them both by shuffling the code around. --- Changes since v1: * Made the two functions static in patch 1, removed the header entries. Thanks, James Morse (2): KVM: arm64: Move pmu hyp code under hyp's Makefile to avoid instrumentation KVM: arm/arm64: Move cc/it checks under hyp's Makefile to avoid instrumentation arch/arm/kvm/hyp/Makefile | 1 + arch/arm64/include/asm/kvm_host.h | 3 - arch/arm64/kvm/hyp/Makefile | 1 + arch/arm64/kvm/hyp/switch.c | 39 +++++++++ arch/arm64/kvm/pmu.c | 38 --------- virt/kvm/arm/aarch32.c | 121 -------------------------- virt/kvm/arm/hyp/aarch32.c | 136 ++++++++++++++++++++++++++++++ 7 files changed, 177 insertions(+), 162 deletions(-) create mode 100644 virt/kvm/arm/hyp/aarch32.c