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 97D26C433F5 for ; Fri, 15 Oct 2021 10:05:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C21E60EE5 for ; Fri, 15 Oct 2021 10:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237556AbhJOKIE (ORCPT ); Fri, 15 Oct 2021 06:08:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58365 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbhJOKIA (ORCPT ); Fri, 15 Oct 2021 06:08:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634292353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b0uHWXZnqeTxhuKyqKx8y/HRcY8yBSsrr8AiAitLaHk=; b=UD/PEFeyM/xCZx3njuGiQNg2mHfVPV1syzCnDVybQVjnPg2sz5dqOIHxCPNheMcmDrft0x m1Y2MDHoWxQxPSd3FJ6rwc8uNOd1gCJ6r4TcQ+v397PkVVr95pKwTlix4rPMLqxCK2bcxp c31HrJCfr+jwVyARG5IZBcscsVgP1iY= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-515-BtMFqJs2M8GsPntUw7-eQw-1; Fri, 15 Oct 2021 06:05:52 -0400 X-MC-Unique: BtMFqJs2M8GsPntUw7-eQw-1 Received: by mail-wr1-f72.google.com with SMTP id a15-20020a056000188f00b00161068d8461so5777300wri.11 for ; Fri, 15 Oct 2021 03:05:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=b0uHWXZnqeTxhuKyqKx8y/HRcY8yBSsrr8AiAitLaHk=; b=iAangSOXStJYlKq1qXuoTmGp+AW31Gsms9ZofEcS7ByZTk4cbpYadwFfAp1JI5Knnk DUnCo1WdWp2h09SJZvf8xWkyrxYY6wtBfHEKAjuMu9BAV9hR04aYVcD/iv13TALqkwAT sXZDVbirEb5BRKmM66ZVwdeDkSranMf058RvKiIr9fHUDniFh7xxwHnZgBquk32/B93O cxDTTeZYzLSZNbxPxVI4eIOxoZ51LoboMTjJ4qE4QD09Eg98Kote+SMEuH29cxwjd9bh TO5zn1WYOKdh2ru1FpoTCqgwIVuFTnR436FLmVRd8sKZ2SCAzOoPEoImGTJhhlmmS4D9 KTbQ== X-Gm-Message-State: AOAM530jTqKWx+CHSaPngOuyXHbYTwruNpHy4w1Dg1j0P9MkzA9JscAW ylq4dRoYUPYLuY77xXlDLfwyws3jxDIlv9diF/bg4cGBE8Ut55z9kzIRnnErcQm1rtCpqIFg/XX V6ovriJSbyWS/ X-Received: by 2002:a1c:a791:: with SMTP id q139mr11551237wme.102.1634292351349; Fri, 15 Oct 2021 03:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfXBNIKizN+SJiZFGqzqQgnO0A5xN/k3JphvbQHlTMEeg7cXSlABUxCwsJlYSRI54rXUqToQ== X-Received: by 2002:a1c:a791:: with SMTP id q139mr11551220wme.102.1634292351151; Fri, 15 Oct 2021 03:05:51 -0700 (PDT) Received: from gator (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id a2sm4558837wru.82.2021.10.15.03.05.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 03:05:50 -0700 (PDT) Date: Fri, 15 Oct 2021 12:05:48 +0200 From: Andrew Jones To: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon , kernel-team@android.com Subject: Re: [PATCH 0/5] KVM: arm64: Reorganise vcpu first run Message-ID: <20211015100548.4yd2ukon5rypexoo@gator> References: <20211015090822.2994920-1-maz@kernel.org> <20211015094900.pl2gyysitpnszojy@gator> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211015094900.pl2gyysitpnszojy@gator> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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? 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. Thanks, drew > > > KVM: arm64: Drop vcpu->arch.has_run_once for vcpu->pid > > > > arch/arm64/include/asm/kvm_host.h | 12 +++------ > > arch/arm64/kvm/arm.c | 43 ++++++++++++++++++------------- > > arch/arm64/kvm/fpsimd.c | 11 -------- > > arch/arm64/kvm/reset.c | 11 +++++++- > > arch/arm64/kvm/vgic/vgic-init.c | 2 +- > > 5 files changed, 39 insertions(+), 40 deletions(-) > > > > -- > > 2.30.2 > > > > _______________________________________________ > > kvmarm mailing list > > kvmarm@lists.cs.columbia.edu > > https://lists.cs.columbia.edu/mailman/listinfo/kvmarm > > > > For the series > > Reviewed-by: Andrew Jones > > Thanks, > drew 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 504E5C433EF for ; Fri, 15 Oct 2021 10:05:57 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id B81E160F56 for ; Fri, 15 Oct 2021 10:05:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B81E160F56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 302944B178; Fri, 15 Oct 2021 06:05:56 -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=@redhat.com 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 lzwRV3LQDIS3; Fri, 15 Oct 2021 06:05:55 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2B9AF4B17B; Fri, 15 Oct 2021 06:05:55 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E5C554B172 for ; Fri, 15 Oct 2021 06:05:54 -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 ZPeLVLsZBBWV for ; Fri, 15 Oct 2021 06:05:53 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D26DF4B161 for ; Fri, 15 Oct 2021 06:05:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634292353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b0uHWXZnqeTxhuKyqKx8y/HRcY8yBSsrr8AiAitLaHk=; b=UD/PEFeyM/xCZx3njuGiQNg2mHfVPV1syzCnDVybQVjnPg2sz5dqOIHxCPNheMcmDrft0x m1Y2MDHoWxQxPSd3FJ6rwc8uNOd1gCJ6r4TcQ+v397PkVVr95pKwTlix4rPMLqxCK2bcxp c31HrJCfr+jwVyARG5IZBcscsVgP1iY= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-p_cUjvwsOImVz3f2Fp3IFw-1; Fri, 15 Oct 2021 06:05:52 -0400 X-MC-Unique: p_cUjvwsOImVz3f2Fp3IFw-1 Received: by mail-wm1-f71.google.com with SMTP id s22-20020a1ca916000000b0030dcdcd37c5so687926wme.8 for ; Fri, 15 Oct 2021 03:05:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=b0uHWXZnqeTxhuKyqKx8y/HRcY8yBSsrr8AiAitLaHk=; b=2ZvoNhsXtCli1pVOR/lLzDVRLA2Jhls1YnhFLLKiyQ8gbAazTzmd3yg7K3BtLpMxx6 5a76Ld64dofnBYPRGJajL9yRfcfu6PVnNXfEaVP+IaqEK2nJwu7C97TS8ooYwbslGcxb lLlRX3XKxGJYFiH7RCO+9HcEPbER4wZDQk7vDuPWrdMfn21JxwfU85XAf2xpX8MSgfWs v6mt1nPIN8N52QwgCDploiUX+2N6uUPfL/KNMtJT9eCfxqnGac+aKInTGQHtt198CGCc c3aeej5q19DMQKj2QHuluQ1y6lm3/GR6tHVFf2VFf4Oo9M/8NUTuL0vTwhNSeB9aAmCj ZThg== X-Gm-Message-State: AOAM533ohNIHGoe+he9llnDZhG/3dH4IvmWgtgmvX2+c++D7wF0xO1Fc DVwQMBGW9dbltBjILj0rxf74McNa5E1kgFOIVAatTVBGXaKEc9rrTPSUVMY0crVfYbD4/5enPTI LVx35jWT/XDSh/zVMJrOj3Lnd X-Received: by 2002:a1c:a791:: with SMTP id q139mr11551235wme.102.1634292351348; Fri, 15 Oct 2021 03:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfXBNIKizN+SJiZFGqzqQgnO0A5xN/k3JphvbQHlTMEeg7cXSlABUxCwsJlYSRI54rXUqToQ== X-Received: by 2002:a1c:a791:: with SMTP id q139mr11551220wme.102.1634292351151; Fri, 15 Oct 2021 03:05:51 -0700 (PDT) Received: from gator (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id a2sm4558837wru.82.2021.10.15.03.05.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 03:05:50 -0700 (PDT) Date: Fri, 15 Oct 2021 12:05:48 +0200 From: Andrew Jones To: Marc Zyngier Subject: Re: [PATCH 0/5] KVM: arm64: Reorganise vcpu first run Message-ID: <20211015100548.4yd2ukon5rypexoo@gator> References: <20211015090822.2994920-1-maz@kernel.org> <20211015094900.pl2gyysitpnszojy@gator> MIME-Version: 1.0 In-Reply-To: <20211015094900.pl2gyysitpnszojy@gator> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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, 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? 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. Thanks, drew > > > KVM: arm64: Drop vcpu->arch.has_run_once for vcpu->pid > > > > arch/arm64/include/asm/kvm_host.h | 12 +++------ > > arch/arm64/kvm/arm.c | 43 ++++++++++++++++++------------- > > arch/arm64/kvm/fpsimd.c | 11 -------- > > arch/arm64/kvm/reset.c | 11 +++++++- > > arch/arm64/kvm/vgic/vgic-init.c | 2 +- > > 5 files changed, 39 insertions(+), 40 deletions(-) > > > > -- > > 2.30.2 > > > > _______________________________________________ > > kvmarm mailing list > > kvmarm@lists.cs.columbia.edu > > https://lists.cs.columbia.edu/mailman/listinfo/kvmarm > > > > For the series > > Reviewed-by: Andrew Jones > > Thanks, > drew _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 B547BC433EF for ; Fri, 15 Oct 2021 10:07:30 +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 81D6960EFF for ; Fri, 15 Oct 2021 10:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 81D6960EFF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=C2Bi91/F68f0BvBXH7wZmDOXIgSqD1AWYrkTMk2sDpk=; b=EA08phkQhPlpgp 0g2N5r5satItVas2DQgLN3sAsmo4DzLTuJftnrcnUY9JlIV/wKRM25aMjVyopT+UyabXxjG1v+hIi lv8aaZ7ZYTR230pQd+0wqWEyxxH8Y7eujjhCgqjDgGaqJ+/8wmtF8ZQUSZLbqRpbHr4S3Ce6Jw13x h9V/MIarCbVINKj+XYK/YYIkysDR3CAXWpPHkvU5QMNp7OAwOlUb/N3LD+DUVUVvJ94azj+MT/ERq d+nb/S99QeVTaYC9Gies5pGiJE/SBic4aP1lY4CGrkXcOR7wdlVXH8k2HYJuT0CBdhVV2JfP0Tc8J CU6Ur+KhNdfDYh+vR0gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbK6B-006QKz-Rm; Fri, 15 Oct 2021 10:06:00 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbK67-006QK3-Lb for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 10:05:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634292353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b0uHWXZnqeTxhuKyqKx8y/HRcY8yBSsrr8AiAitLaHk=; b=UD/PEFeyM/xCZx3njuGiQNg2mHfVPV1syzCnDVybQVjnPg2sz5dqOIHxCPNheMcmDrft0x m1Y2MDHoWxQxPSd3FJ6rwc8uNOd1gCJ6r4TcQ+v397PkVVr95pKwTlix4rPMLqxCK2bcxp c31HrJCfr+jwVyARG5IZBcscsVgP1iY= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-475-nUbFjfShMyKPvOTm71B4DQ-1; Fri, 15 Oct 2021 06:05:52 -0400 X-MC-Unique: nUbFjfShMyKPvOTm71B4DQ-1 Received: by mail-wr1-f69.google.com with SMTP id y12-20020a056000168c00b00160da4de2c7so5765158wrd.5 for ; Fri, 15 Oct 2021 03:05:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=b0uHWXZnqeTxhuKyqKx8y/HRcY8yBSsrr8AiAitLaHk=; b=RbyeiumYIlbnX9N26OFZsikdCqI7tm+S2UpslQgxb0DkHq0CMcKdn9XlkH5Kh5kGMg ya449LqWpLt4edc86JQfkGQnlZykqqA3uOGuOdsqcqfuml5RdvF14BemY55u5O7E1GoL le4fe9QOA9bgJ/7QUTfrW+UMS2PcZqPOGHeLW56oGyQj/Ww0BAJoM6IeJ9FRlWKeDX/M Yc0RL3GOuyktHom+lH77K6+WUEUmEDe5Tm1+73VwdVx/7sV72xzVwKIkESiTITmsRCoc CCwIBxNXvn/muS4uBU4V+noa2YsjYSi3mbUoU+nzDbvMXas15vgTNK7Auqb//Cf5FSjP +YXg== X-Gm-Message-State: AOAM532LxsMnOpGDjXyjHsloa6/LBcCMf4D+XOSP/K+KGoqjR6zMmScb /SMC3wrU4oJpLTqmHZ7GuTFMbfxzoqYnRVaqBKyRIGahq6z6PhvC8e72oxbRoof283CjMNGLVmN B8EZ+dQf3TRYBNNTXMNu2WnpN4i5pPl0Klm0= X-Received: by 2002:a1c:a791:: with SMTP id q139mr11551239wme.102.1634292351351; Fri, 15 Oct 2021 03:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfXBNIKizN+SJiZFGqzqQgnO0A5xN/k3JphvbQHlTMEeg7cXSlABUxCwsJlYSRI54rXUqToQ== X-Received: by 2002:a1c:a791:: with SMTP id q139mr11551220wme.102.1634292351151; Fri, 15 Oct 2021 03:05:51 -0700 (PDT) Received: from gator (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id a2sm4558837wru.82.2021.10.15.03.05.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 03:05:50 -0700 (PDT) Date: Fri, 15 Oct 2021 12:05:48 +0200 From: Andrew Jones To: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon , kernel-team@android.com Subject: Re: [PATCH 0/5] KVM: arm64: Reorganise vcpu first run Message-ID: <20211015100548.4yd2ukon5rypexoo@gator> References: <20211015090822.2994920-1-maz@kernel.org> <20211015094900.pl2gyysitpnszojy@gator> MIME-Version: 1.0 In-Reply-To: <20211015094900.pl2gyysitpnszojy@gator> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_030555_807905_D6E78E6B X-CRM114-Status: GOOD ( 22.70 ) 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 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? 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. Thanks, drew > > > KVM: arm64: Drop vcpu->arch.has_run_once for vcpu->pid > > > > arch/arm64/include/asm/kvm_host.h | 12 +++------ > > arch/arm64/kvm/arm.c | 43 ++++++++++++++++++------------- > > arch/arm64/kvm/fpsimd.c | 11 -------- > > arch/arm64/kvm/reset.c | 11 +++++++- > > arch/arm64/kvm/vgic/vgic-init.c | 2 +- > > 5 files changed, 39 insertions(+), 40 deletions(-) > > > > -- > > 2.30.2 > > > > _______________________________________________ > > kvmarm mailing list > > kvmarm@lists.cs.columbia.edu > > https://lists.cs.columbia.edu/mailman/listinfo/kvmarm > > > > For the series > > Reviewed-by: Andrew Jones > > Thanks, > drew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel