From patchwork Wed Jul 14 09:56:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12376523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B89C07E9A for ; Wed, 14 Jul 2021 09:58:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8289C6115A for ; Wed, 14 Jul 2021 09:58:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8289C6115A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w2uhULGj5vKPtZJ35bk7qAGPHz3PRBlGqkEK8UAiIS8=; b=fDQEyYlfsRGCcv ycZ+e6+nVucCodUWomBfr0WEBEiWmzgZyZJr5XLwRZNv91b1jkAArFbo/iJ4CNujbUmEeAhPhkKor 8PQNp2w5rnSirSnRVlIXOs927ZbvBllDWlkCoMOz6SW2WgPHY2fMmHURl9ya6YhzvWdk4R3YedUk1 DB878ENuvEwtpeCnWeLmU+F/gbiJTqsYHZQOOQvmNIhb6V2ErPktjEU2R3wM/wzyNH/tWglhEJeVE S6PCWxkgZi74X/024o6qO5rTMa0HEEE8Ng/0jM8cF5Gr1OqjSjseoSyeac39qlNhn4aeDy4uHDZQP oFdIsGTVXY2n93VhJmeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3bcv-00CyMv-HJ; Wed, 14 Jul 2021 09:56:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3bbq-00CxxL-R9 for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 09:55:20 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0A1001396; Wed, 14 Jul 2021 02:55:14 -0700 (PDT) Received: from monolith.cable.virginm.net (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CAB173F774; Wed, 14 Jul 2021 02:55:12 -0700 (PDT) From: Alexandru Elisei To: maz@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Cc: james.morse@arm.com, suzuki.poulose@arm.com, Will Deacon Subject: [PATCH 5/5] KVM: arm64: nVHE: Remove unneeded isb() when modifying PMSCR_EL1 Date: Wed, 14 Jul 2021 10:56:01 +0100 Message-Id: <20210714095601.184854-6-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210714095601.184854-1-alexandru.elisei@arm.com> References: <20210714095601.184854-1-alexandru.elisei@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210714_025518_996259_4ACE0E13 X-CRM114-Status: UNSURE ( 9.59 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org According to ARM DDI 0487G.a, page D9-2930, profiling is disabled when the PE is executing at a higher exception level than the profiling buffer owning exception level. This is also confirmed by the pseudocode for the StatisticalProfilingEnabled() function. During the world switch and before activating guest traps, KVM executes at EL2 with the buffer owning exception level being EL1 (MDCR_EL2.E2PB = 0b11). As a result, profiling is already disabled when draining the buffer, making the isb() after the write to PMSCR_EL1 unnecessary. CC: Will Deacon Signed-off-by: Alexandru Elisei --- arch/arm64/kvm/hyp/nvhe/debug-sr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/debug-sr.c b/arch/arm64/kvm/hyp/nvhe/debug-sr.c index 7d3f25868cae..fdf0e0ba17e9 100644 --- a/arch/arm64/kvm/hyp/nvhe/debug-sr.c +++ b/arch/arm64/kvm/hyp/nvhe/debug-sr.c @@ -33,7 +33,6 @@ static void __debug_save_spe(u64 *pmscr_el1) /* Yes; save the control register and disable data generation */ *pmscr_el1 = read_sysreg_s(SYS_PMSCR_EL1); write_sysreg_s(0, SYS_PMSCR_EL1); - isb(); /* Now drain all buffered data to memory */ psb_csync();