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 56ED7C433EF for ; Fri, 22 Apr 2022 07:44:42 +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: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hw6CFZOfLjP3An3RvGAMWsvagbu/nsGbtyyH1VMrIW8=; b=188pj5Ne7JPRqq P9OUOcb2VVaLHD1ikZce8Vbx5DIlXzGQ7igo1f3Ekr3uqpbbVdxNKZbUvXxiBxsAxceBBD6A2vI/q pfITkIz79WNadla9ipTYKuP+NW4MR9XrWezTHU7GyIVI8Lkljw8xuKy9+idGe2k+Ft2rMWDkBwmAv 6dcfwrH+GZ4jbLOa1B9nP5aA3VjPwl/Cccf6ZfZc8sHQ6e3EOFc1iO3I4USYyQ2KhomXlb69Ldaya 8iRr5YrU1L/nGp/4M2VoHuKSyOPN7cptCJCqCpXS3wcRwL5WsTeGXCuu2I0xvS+FTRo7/4JIv3XAP zJRAqCixH/+myTrRIzzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhnwo-00GviI-PB; Fri, 22 Apr 2022 07:43:23 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhnk6-00Gp3f-GS for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2022 07:30:21 +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 2FC87B82ABF; Fri, 22 Apr 2022 07:30:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E617BC385A4; Fri, 22 Apr 2022 07:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650612610; bh=1HqEVoFzhdSuTU4HmfcEo/+y3VU5j3xG/+lwQlr7GuE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=O/cOkqWdzXHteNRsOtjtuNgePZgsS+8JZGOd3oq0adSEoF7gXUkb9DYZXs/InueO0 3ColEcMwfx1ZcOlM9jlWj9jTOn4XUWvSE2IRzu6ry+yb0BxtJ1JOoPV+BeK8P5oKC+ WIioHVSxUC+T4cdXBCaSlvFIfxYiOiXkxIfSB3S5662T7lxBUuGfU+Aeqvqq5Dg1YS baPSoDZAiOyVnjwvSbnj6vgZaOBoE11N78hBfC2HXYI1YPclHSR65jqETez7RcjXmK /bDNrbeMYRv+C0dW9ObjJePMUibCy9ouCWuNNtL+PFA+uJgvMMlYJASqr++ltM3pGE fJ8EjD89oDU7g== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) 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 1nhnk0-0065Zh-C1; Fri, 22 Apr 2022 08:30:08 +0100 Date: Fri, 22 Apr 2022 08:30:08 +0100 Message-ID: <87czh9a83j.wl-maz@kernel.org> From: Marc Zyngier To: Alexandru Elisei Cc: catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, kvmarm@lists.cs.columbia.edu, mark.rutland@arm.com Subject: Re: [PATCH v2 5/5] KVM: arm64: uapi: Add kvm_debug_exit_arch.hsr_high In-Reply-To: References: <20220421100547.873761-1-alexandru.elisei@arm.com> <20220421100547.873761-6-alexandru.elisei@arm.com> <87ee1qa8z7.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: alexandru.elisei@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, kvmarm@lists.cs.columbia.edu, mark.rutland@arm.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-20220422_003014_908355_46F20753 X-CRM114-Status: GOOD ( 28.32 ) 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 On Thu, 21 Apr 2022 16:22:00 +0100, Alexandru Elisei wrote: > > Hi, > > On Thu, Apr 21, 2022 at 01:58:52PM +0100, Marc Zyngier wrote: > > On Thu, 21 Apr 2022 11:05:47 +0100, > > Alexandru Elisei wrote: > > > > > > diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c > > > index 93d92130d36c..fd5b6773e3a2 100644 > > > --- a/arch/arm64/kvm/handle_exit.c > > > +++ b/arch/arm64/kvm/handle_exit.c > > > @@ -121,6 +121,8 @@ static int kvm_handle_guest_debug(struct kvm_vcpu *vcpu) > > > > > > run->exit_reason = KVM_EXIT_DEBUG; > > > run->debug.arch.hsr = lower_32_bits(esr); > > > + run->debug.arch.hsr_high = upper_32_bits(esr); > > > + run->flags |= KVM_DEBUG_ARCH_HSR_HIGH_VALID; > > > > Who will eventually clear this flag? I'm concerned that it could be > > misinterpreted by other userspace paths, as once you get a debug exit > > on this vcpu, it will always be set. > > > > Probably only a matter of clearing flags on all the other exit paths. > > I missed this part, I was under the impression that kvm_run->flags was > already cleared on every exit (that's why it's bitwise OR'ed with the > flag). > > kvm_arch_vcpu_ioctl_run() always sets exit_reason = KVM_EXIT_UNKNOWN, so I > guess if we want to be consistent, kvm_run->flags should be cleared at the > same time. Unless you want KVM to clear flags for all exit reasons *except* > KVM_EXIT_UNKNOWN. > > I prefer clearing flags in kvm_arch_vcpu_ioctl_run() as that looks to me > like the least error prone way to do it, and if in the future an exit > reason wants to preserve flags across KVM_RUN ioctls we can add a check for > that particular situation. It seems entirely reasonable to reset exit_reason and flags together. > > > > > Also, please document the flag in the API file (only a couple of x86 > > flags are there so far). > > Sure thing, will do. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel