Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2936173rdb; Tue, 6 Feb 2024 02:10:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhqj6IMAIFpJrOEZzkX736adr5VUCmIsNLQxDhzUcqi64v2rqB0/2LfAsNsRaxE9f11/aW X-Received: by 2002:a17:90a:fb53:b0:296:530:996e with SMTP id iq19-20020a17090afb5300b002960530996emr3209628pjb.20.1707214208569; Tue, 06 Feb 2024 02:10:08 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVx1T3TGe6g+IFFpR9NZFouDU/43WfuyoTV1AaAAOVRpuXtA/0g4Mk/uWK2PEirzxmgiUzZS1bcRLuI0mybRTMewZ2TO+REhrkTKKTreg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id r15-20020a17090a4dcf00b0029636adfd23si884719pjl.188.2024.02.06.02.10.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 02:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54653-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ellerman.id.au header.s=201909 header.b="qJZ/R1KK"; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-54653-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54653-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 408532823E1 for ; Tue, 6 Feb 2024 10:10:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 304D512E1C1; Tue, 6 Feb 2024 10:10:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="qJZ/R1KK" Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 998E712C7E1; Tue, 6 Feb 2024 10:09:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707214199; cv=none; b=rCn091Zs2Rmp6gcn6e0LxGayxw7yuH1RAU3X+BGa9ZjFIx42hMbRqUoTIRJI94hgte9jbVGj9J7H2WhYulTmnIIksQnSQb3enmEHrP77bdR6L4ngA6XQG5D9yesb7lEebzdAQo9Aef1bPxLOqH1r9d9QVFZ7Ba5yTuiNwCUpwnY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707214199; c=relaxed/simple; bh=ASPBFTN6JvpMCOm0Rs9lW9fp3ECg1irBns2EH3oaCYY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=EL73gJdVV1z3mLghWhQBom1R6qa4lBoIxEfQShQkGIkylqJets7Fs8ZY5qEJk8eykVaVMZeUY/kVeANPHPafYBY8sA4NEZp3011jgUgrYusiSS0+1nZtqdF9+F4+ni8xt7osjCZnIOC12yeQLbf8n7wlm1krrZIDTYU9VO+hudo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=qJZ/R1KK; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1707214191; bh=RP5a0ngO4G8agxTcnKwbqd1t/bpdOgoBCm2CsXxO2i8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=qJZ/R1KK16stykfOA9nmlGuWZ5InS09F4RhGl/V4xPS71GVG2TnIZj8uLywVGoXTe HEi5DB7PK//MlMiG2lQiNkt+yMNnjLvuhjJYj4YH4WvPfgUEqeYeaORyn57goS0foX PZCpoEBMuEorR6dGtrmt/uaItDpqbojjLjPbGU1HqCJuPUoaMbI1b5of3HVYDMtDtf m101EkFRmPkSJod2ewWgdqCV55+bjo4d392eMIEzauV4cS+q5AXW069fYbfOv0jSbk o9mz/jbyuERKNn43KY0/E44VGrnip45yQE5xsG+qhpfOr3onEBfbR4oBrrk1ZnTN7x MTq5vgIDO9AxA== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4TTfB748xTz4wyj; Tue, 6 Feb 2024 21:09:51 +1100 (AEDT) From: Michael Ellerman To: Amit Machhiwal , linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: Vaibhav Jain , Nicholas Piggin , Jordan Niethe , Vaidyanathan Srinivasan , "Aneesh Kumar K . V" , "Naveen N . Rao" , Christophe Leroy , Amit Machhiwal , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat' In-Reply-To: <20240205181833.212955-1-amachhiw@linux.ibm.com> References: <20240205181833.212955-1-amachhiw@linux.ibm.com> Date: Tue, 06 Feb 2024 21:09:48 +1100 Message-ID: <87r0hp9a4z.fsf@mail.lhotse> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Hi Amit, One comment below ... Amit Machhiwal writes: > Currently, rebooting a pseries nested qemu-kvm guest (L2) results in > below error as L1 qemu sends PVR value 'arch_compat' == 0 via > ppc_set_compat ioctl. This triggers a condition failure in > kvmppc_set_arch_compat() resulting in an EINVAL. .. > > diff --git a/arch/powerpc/kvm/book3s_hv_nestedv2.c b/arch/powerpc/kvm/book3s_hv_nestedv2.c > index 5378eb40b162..6042bdc70230 100644 > --- a/arch/powerpc/kvm/book3s_hv_nestedv2.c > +++ b/arch/powerpc/kvm/book3s_hv_nestedv2.c > @@ -347,8 +348,26 @@ static int gs_msg_ops_vcpu_fill_info(struct kvmppc_gs_buff *gsb, > break; > } > case KVMPPC_GSID_LOGICAL_PVR: > - rc = kvmppc_gse_put_u32(gsb, iden, > - vcpu->arch.vcore->arch_compat); > + /* > + * Though 'arch_compat == 0' would mean the default > + * compatibility, arch_compat, being a Guest Wide > + * Element, cannot be filled with a value of 0 in GSB > + * as this would result into a kernel trap. > + * Hence, when `arch_compat == 0`, arch_compat should > + * default to L1's PVR. > + * > + * Rework this when PowerVM supports a value of 0 > + * for arch_compat for KVM API v2. > + */ Is there an actual plan that PowerVM will support this in future? If so, how will a future kernel know that it's running on a version of PowerVM that does support arch_compat == 0? Similarly how will we know when it's OK to drop support for this workaround? cheers