From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 323B0C433F5 for ; Sat, 28 May 2022 11:52:31 +0000 (UTC) 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=kcUCqjQfcIS2NuLZFe8FHQGWP2cRWR+anbtTl3CzAeI=; b=j6DDAigCH24yZ0 jY6N1YR9GW3YmUGaIRFslWQEyGpfihuIBWMNA5W9dwzz3iVgNHEzEmwrY78KO2XfaCrQT6I80G7LW rBcFvmHdkzFYgMVdHC5yAZLlXloDSc+BxCmmOVoGUdhof5pZ9y6683W8lx9ZX3qgu0s7sV29P3AC1 NcLH1fYeQl6Xvct74LlYRUYztKBjBXqC2iYPpRFrOEypvFtWAVZufMOkoXJ0Xv7oBQzDB+NRSwg5x EOizvyy0UA3Br7Nak/gKS1FE0NPHyxCLRE2q4lUXNNWKjosg6d0X/j+fnYtQtf2sZG0WABMUMG6mM C2PoTLR4PjDLNNGVl75A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuuyN-0024IB-Sp; Sat, 28 May 2022 11:51:12 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuuxK-0023sr-QY for linux-arm-kernel@lists.infradead.org; Sat, 28 May 2022 11:50:08 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6BBFFB816FE; Sat, 28 May 2022 11:50:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2088AC34118; Sat, 28 May 2022 11:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653738604; bh=KMwi+oCF55/vO8plIgUNFSEzhuYgMbACCUE98soIwB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T3hI8rfuQBsgLszaqhqU15iR8sD+Z2zDQM27dvaj32XX2yhaZztqlT4xRjLMiJ8Qa 3/6YpzAeXwhtl2a7vx6Q/effM1FskrKMbYFpP1CCmjTbHWY8oQ1yKl8+WhYBFhcq8L +MJWCI7UweKTJ4bQ+IX3quF1bNxiP43mfy+SsgZpEiZvHnEmW4yJL625/VtTBwVJc3 9aU/UfBkibE18T1Z0v/DjcM8Hb9j+wJLqw+gfD/voc4fZmIIeU9pcPRKLeYd9VwVkd B4fEX2XBEiSqwQ/PsgUwmSXy7O/+8rAn33kK6J/s10cmr6ZRH3hmtqEaC5Uqw2ZhyN BpIMfC7v0kTsQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nuumD-00EEGh-Tr; Sat, 28 May 2022 12:38:37 +0100 From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse , Suzuki K Poulose , Alexandru Elisei , Oliver Upton , Will Deacon , Fuad Tabba , Quentin Perret , Mark Brown , kernel-team@android.com Subject: [PATCH 18/18] KVM: arm64: Document why pause cannot be turned into a flag Date: Sat, 28 May 2022 12:38:28 +0100 Message-Id: <20220528113829.1043361-19-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220528113829.1043361-1-maz@kernel.org> References: <20220528113829.1043361-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.com, oupton@google.com, will@kernel.org, tabba@google.com, qperret@google.com, broonie@kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220528_045007_208007_15280C5F X-CRM114-Status: GOOD ( 17.10 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It would be tempting to turn the 'pause' state into a flag. However, this cannot easily be done as it is updated out of context, while all the flags expect to only be updated from the vcpu thread. Turning it into a flag would require to make all flag updates atomic, which isn't necessary desireable. Document this, and take this opportunity to move the field next to the flag sets, filling a hole in the vcpu structure. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_host.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 83f3dae4333a..8c47b7f8ef92 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -344,6 +344,15 @@ struct kvm_vcpu_arch { /* State flags, unused by the hypervisor code */ u8 sflags; + /* + * Don't run the guest (internal implementation need). + * + * Contrary to the flags above, this is set/cleared outside of + * a vcpu context, and thus cannot be mixed with the flags + * themselves (or the flag accesses need to be made atomic). + */ + bool pause; + /* * We maintain more than a single set of debug registers to support * debugging the guest from the host and to maintain separate host and @@ -397,9 +406,6 @@ struct kvm_vcpu_arch { /* vcpu power state */ struct kvm_mp_state mp_state; - /* Don't run the guest (internal implementation need) */ - bool pause; - /* Cache some mmu pages needed inside spinlock regions */ struct kvm_mmu_memory_cache mmu_page_cache; -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel