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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AAE82C3DA4A for ; Thu, 8 Aug 2024 17:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PU9td7ADQRBZGj/enYPCIZwtkacU55RbD4RR/gJI18M=; b=Ptd3zWQcYrCLlzwGwW6+yBzqCD uXCc3M/AXSxp+QBvUGD0ciK3oFOsXbD9jsIxxJdq5VA+2A2vrA28WtZCMsMDq4vxjKVJLHiBDuR7E x3pkYUz9a7uu1TVDnwJx9Uhh9+X2C5oteVop8c4F1r3+8Sega2Ga+pX4CxYiGM2+0HtLAbUDIAT+G 3Z0H+6kS8eJmnWRmsKE2AepktkooZykXrcMMSOhuUw2C0ES+4+DYvIglfHBxiAkNE7DqsPQiOrf51 N/Vy1YEIqjrjWCjgXqfMfOJTrd1p72tYviAki8NPscTktco5iGB5ZZa5atnsQ32tuJSpZhuNEOLtU B3XIEnvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc77o-000000097ez-0Q2g; Thu, 08 Aug 2024 17:40:32 +0000 Received: from out-173.mta1.migadu.com ([95.215.58.173]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc77F-000000097cX-0VRx for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 17:39:58 +0000 Date: Thu, 8 Aug 2024 17:39:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723138794; 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=PU9td7ADQRBZGj/enYPCIZwtkacU55RbD4RR/gJI18M=; b=X2xZWzrARBuj/9WT796oJ0R2HSxjkM4tTAS3fB93Kbk1JUe4BRlvfYoTuHyZmJxo/tzUMQ G0UC1MScRwlDskelMxCrhNVeVtPo82F4uA+xYr5nl/o7kPa4h/ALKPi5+2b3VrQz6F2eEg QuK1ycDpg4nccV98pPUI0V2iofQpf6g= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Shameer Kolothum Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, maz@kernel.org, will@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, wangzhou1@hisilicon.com, linuxarm@huawei.com Subject: Re: [PATCH] KVM: arm64: Disable OS double lock visibility by default and ignore VMM writes Message-ID: References: <20240808125711.14368-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240808125711.14368-1-shameerali.kolothum.thodi@huawei.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_103957_450426_4DEC711E X-CRM114-Status: GOOD ( 12.21 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Shameer, I find myself asking *why* we need this, could you share some details on the issue you're encountering? Indeed, RAZ/WI is not a faithful implementation of FEAT_DoubleLock, but I wouldn't expect it to be used in a VM in the first place. On Thu, Aug 08, 2024 at 01:57:11PM +0100, Shameer Kolothum wrote: > KVM exposes the OS double lock feature bit to Guests but returns > RAZ/WI on Guest OSDLR_EL1 access. Make sure we are hiding OS double > lock from Guests now. However we can't hide DoubleLock if the reported > DebugVer is < 8.2. So report a minimum DebugVer of 8.2 to Guests. What if a user wanted to virtualize an exact CPU model that only implemented v8.0? > All this may break migration from the older kernels. Take care of > that by ignoring VMM writes for these values. Ignoring userspace writes is a pretty big hammer. In situations where KVM had advertised a feature that was outright not supported (e.g. IMP DEF PMUs) it _might_ make sense. But with this change we're messing with a CPU feature we *do* support. Would allowing userspace to downgrade ID_AA664DFR0_EL1.DoubleLock to 0b1111 be enough? -- Thanks, Oliver