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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4948C433F5 for ; Fri, 22 Apr 2022 07:30:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 158D74B280; Fri, 22 Apr 2022 03:30:17 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9igeoc2JUSuI; Fri, 22 Apr 2022 03:30:15 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DCEFB4B26D; Fri, 22 Apr 2022 03:30:15 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id BCA014B26D for ; Fri, 22 Apr 2022 03:30:14 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8pOpt6CpKspy for ; Fri, 22 Apr 2022 03:30:13 -0400 (EDT) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8F8A44B1FB for ; Fri, 22 Apr 2022 03:30:13 -0400 (EDT) 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 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 Cc: catalin.marinas@arm.com, will@kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm