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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C397DC433F5 for ; Sat, 16 Oct 2021 10:50:05 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 344F5611C3 for ; Sat, 16 Oct 2021 10:50:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 344F5611C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id A8BE34B152; Sat, 16 Oct 2021 06:50:04 -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 p9t2uFu6lRqB; Sat, 16 Oct 2021 06:50:03 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6A7A84B154; Sat, 16 Oct 2021 06:50:03 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0CCA34B152 for ; Sat, 16 Oct 2021 06:50:02 -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 ADpWJQp+v2qV for ; Sat, 16 Oct 2021 06:50:01 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 054CB4B0D7 for ; Sat, 16 Oct 2021 06:50:01 -0400 (EDT) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 06CC1611C1; Sat, 16 Oct 2021 10:50:00 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.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 1mbhGH-00HBKp-Pv; Sat, 16 Oct 2021 11:49:57 +0100 Date: Sat, 16 Oct 2021 11:49:57 +0100 Message-ID: <87k0idutuy.wl-maz@kernel.org> From: Marc Zyngier To: Andrew Jones Subject: Re: [PATCH 0/5] KVM: arm64: Reorganise vcpu first run In-Reply-To: <20211015100548.4yd2ukon5rypexoo@gator> References: <20211015090822.2994920-1-maz@kernel.org> <20211015094900.pl2gyysitpnszojy@gator> <20211015100548.4yd2ukon5rypexoo@gator> 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: drjones@redhat.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, will@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 Cc: linux-arm-kernel@lists.infradead.org, kernel-team@android.com, Will Deacon , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.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 Fri, 15 Oct 2021 11:05:48 +0100, Andrew Jones wrote: > > On Fri, Oct 15, 2021 at 11:49:00AM +0200, Andrew Jones wrote: > > On Fri, Oct 15, 2021 at 10:08:17AM +0100, Marc Zyngier wrote: > > > KVM/arm64 relies heavily on a bunch of things to be done on the first > > > run of the vcpu. We also do a bunch of things on PID change. It turns > > > out that these two things are pretty similar (the first PID change is > > > also the first run). > > > > > > This small series aims at simplifying all that, and to get rid of the > > > vcpu->arch.has_run_once state. > > > > > > Marc Zyngier (5): > > > KVM: arm64: Move SVE state mapping at HYP to finalize-time > > > KVM: arm64: Move kvm_arch_vcpu_run_pid_change() out of line > > > KVM: arm64: Merge kvm_arch_vcpu_run_pid_change() and > > > kvm_vcpu_first_run_init() > > > KVM: arm64: Restructure the point where has_run_once is advertised > > > > Maybe do the restructuring before the merging in order to avoid the > > potential for bizarre states? Yup, can do. > > Also, before we do the merge I think we need to duplicate the > > if (unlikely(!kvm_vcpu_initialized(vcpu))) > return -ENOEXEC; > > that we currently have above the call of kvm_vcpu_first_run_init() > into kvm_arch_vcpu_run_pid_change() because > kvm_arch_vcpu_run_pid_change() is called before kvm_arch_vcpu_ioctl_run() > in KVM_RUN. Well spotted. I think this check should be moved into kvm_arch_vcpu_run_pid_change() instead of duplicated though, just like we have the check for 'finalized' there. After all, they are the two sides of the same coin. This nicely moves all checks on the slow path. 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