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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51710E7D0BF for ; Thu, 21 Sep 2023 21:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232492AbjIUVFx (ORCPT ); Thu, 21 Sep 2023 17:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232831AbjIUVFD (ORCPT ); Thu, 21 Sep 2023 17:05:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDFEA8331E for ; Thu, 21 Sep 2023 10:37:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7229C116B9; Thu, 21 Sep 2023 08:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695284726; bh=74vh6V73pULXyQIRIgeHdHXBYgp/GqF+WvTX6MQGVas=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U5ogQN8RZ6dw/RJal/lMysBtR9SFPRk9zP7amQxbic1BFzuSfdEzlPLgm4HDm6aSU cLvi//znvEjhxMHvQUVQxLKdEKhRSl9jAyPx2RuGtBO+swikeZcly86SImHZvtBU4n 3CPUmQSA+53lD2HH3MIkkjUe9fXugFPRjq6ZyCiGmJYjmIlE+r9srvRQokaNW+YHR3 EF4EkcOYfM/sDGuYXr+KZTADlj5QgxauzhPNPmUe4aN+6LdAHStZXKa/H+hpJ9epI8 TkhBoAOZIOLtv+L5nRFm0gVXB06GqNgjFBucwnSUNI6+xFwCkV9UiwvZRor21m81yg o7ZnVABirpprQ== Received: from 82-132-232-12.dab.02.net ([82.132.232.12] 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.95) (envelope-from ) id 1qjEzy-00EsbV-VB; Thu, 21 Sep 2023 09:25:24 +0100 Date: Thu, 21 Sep 2023 09:25:13 +0100 Message-ID: <87y1h02as6.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu Subject: Re: [PATCH 5/8] KVM: arm64: Prevent NV feature flag on systems w/o nested virt In-Reply-To: <20230920195036.1169791-6-oliver.upton@linux.dev> References: <20230920195036.1169791-1-oliver.upton@linux.dev> <20230920195036.1169791-6-oliver.upton@linux.dev> 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/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 82.132.232.12 X-SA-Exim-Rcpt-To: oliver.upton@linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, 20 Sep 2023 20:50:33 +0100, Oliver Upton wrote: > > It would appear that userspace can select the NV feature flag regardless > of whether the system actually supports the feature. Obviously a nested > guest isn't getting far in this situation; let's reject the flag > instead. The current code is definitely odd. We rely on vcpu_has_nv() to return false, meaning that we go all the way and initialise it as an EL1-only guest. Duh. Well-behaved userspace would check the KVM_CAP_ARM_EL2 capability, which isn't upstream yet... :-( Thanks for fixing this. I'll review the series as a whole. M. -- Without deviation from the norm, progress is not possible.