From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-28.mta0.migadu.com (out-28.mta0.migadu.com [91.218.175.28]) (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 16441DDD4 for ; Fri, 21 Jul 2023 21:18:23 +0000 (UTC) Date: Fri, 21 Jul 2023 21:18:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689974302; 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=dW9NP/U3Lw4IrnYzKtHyEmbm5SYrC7sHbcRAwqr1Q6g=; b=htfKD0iphw+LxaE/ciCC0u+nKsmGLVDB03x9kKT3fNnaWGEs+s9aHLHT9Y9dfNJmsU68iN CcR9XMxhZkPpuvAZ9bADXUYm5+D9dxQiq5k/RClu4UZ8ze9Y1pxr2TkNEd+Bd6jx20Cov0 mBokEEOl3Gu6UpKc/cJo5Jamw5zqWbQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Jing Zhang Cc: KVM , KVMARM , ARMLinux , Marc Zyngier , Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Reiji Watanabe , Raghavendra Rao Ananta , Suraj Jitindar Singh , Cornelia Huck Subject: Re: [PATCH v6 2/6] KVM: arm64: Reject attempts to set invalid debug arch version Message-ID: References: <20230718164522.3498236-1-jingzhangos@google.com> <20230718164522.3498236-3-jingzhangos@google.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230718164522.3498236-3-jingzhangos@google.com> X-Migadu-Flow: FLOW_OUT On Tue, Jul 18, 2023 at 04:45:18PM +0000, Jing Zhang wrote: > From: Oliver Upton > > The debug architecture is mandatory in ARMv8, so KVM should not allow > userspace to configure a vCPU with less than that. Of course, this isn't > handled elegantly by the generic ID register plumbing, as the respective > ID register fields have a nonzero starting value. > > Add an explicit check for debug versions less than v8 of the > architecture. > > Signed-off-by: Oliver Upton > Signed-off-by: Jing Zhang This patch needs to be broken up. You're doing a couple things: 1) Forcing the behavior of the DebugVer field to be FTR_LOWER_SAFE, and adding the necessary check for a valid version 2) Changing KVM's value for the field to expose up to Debugv8p8 to the guest. The latter isn't described in the changelog at all, and worse yet the ordering of the series is not bisectable. Changing the default value of the field w/o allowing writes breaks migration. So, please split this patch in two and consider stacking like so: - Change #1 above (field sanitization) - "KVM: arm64: Enable writable for ID_AA64DFR0_EL1 and ID_DFR0_EL1" - Change #2 above (advertise up to v8p8) -- Thanks, Oliver 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 A44AEEB64DD for ; Fri, 21 Jul 2023 21:18:50 +0000 (UTC) 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=N6JHEgXZjZmmsMUKP0DKP4jjMis1TmiV5jtrKVAPlq4=; b=PVSRPJscsP0j4i wANftkL/85LsWgSotI4CMsKzX4tZhyuNxt9LrlIVcvuIZSySftcXikxCiWURAkf8zQvQtQBW/IcRy isVyMyFxIavsQNUZEujciEdvwZV0Tapx6jwifgKFbmbGi4ejHBqyJZAjNjdLX4tg7YOADAHAGNBx6 qq5JP0hLqQAQMGGtBgCsACvwxpm1L8E5nE7Fgrte1Aa5pjTTpyzgwuOCNZXyXeOvj8NO3JvOTgu2o 0u+jc0CBRZFChXMQNkN3WvYA773dUdapczxwjgJ5K3jIlPDMI1aOS592XDj6VlHMby/U3pDsa9ESK /wOIHJaYiJP6AuX3JdWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMxW6-00F8qN-2e; Fri, 21 Jul 2023 21:18:26 +0000 Received: from out-56.mta0.migadu.com ([91.218.175.56]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMxW4-00F8p2-2A for linux-arm-kernel@lists.infradead.org; Fri, 21 Jul 2023 21:18:26 +0000 Date: Fri, 21 Jul 2023 21:18:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689974302; 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=dW9NP/U3Lw4IrnYzKtHyEmbm5SYrC7sHbcRAwqr1Q6g=; b=htfKD0iphw+LxaE/ciCC0u+nKsmGLVDB03x9kKT3fNnaWGEs+s9aHLHT9Y9dfNJmsU68iN CcR9XMxhZkPpuvAZ9bADXUYm5+D9dxQiq5k/RClu4UZ8ze9Y1pxr2TkNEd+Bd6jx20Cov0 mBokEEOl3Gu6UpKc/cJo5Jamw5zqWbQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Jing Zhang Cc: KVM , KVMARM , ARMLinux , Marc Zyngier , Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Reiji Watanabe , Raghavendra Rao Ananta , Suraj Jitindar Singh , Cornelia Huck Subject: Re: [PATCH v6 2/6] KVM: arm64: Reject attempts to set invalid debug arch version Message-ID: References: <20230718164522.3498236-1-jingzhangos@google.com> <20230718164522.3498236-3-jingzhangos@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230718164522.3498236-3-jingzhangos@google.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230721_141824_855426_47D1C4CD X-CRM114-Status: GOOD ( 14.46 ) 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 Tue, Jul 18, 2023 at 04:45:18PM +0000, Jing Zhang wrote: > From: Oliver Upton > > The debug architecture is mandatory in ARMv8, so KVM should not allow > userspace to configure a vCPU with less than that. Of course, this isn't > handled elegantly by the generic ID register plumbing, as the respective > ID register fields have a nonzero starting value. > > Add an explicit check for debug versions less than v8 of the > architecture. > > Signed-off-by: Oliver Upton > Signed-off-by: Jing Zhang This patch needs to be broken up. You're doing a couple things: 1) Forcing the behavior of the DebugVer field to be FTR_LOWER_SAFE, and adding the necessary check for a valid version 2) Changing KVM's value for the field to expose up to Debugv8p8 to the guest. The latter isn't described in the changelog at all, and worse yet the ordering of the series is not bisectable. Changing the default value of the field w/o allowing writes breaks migration. So, please split this patch in two and consider stacking like so: - Change #1 above (field sanitization) - "KVM: arm64: Enable writable for ID_AA64DFR0_EL1 and ID_DFR0_EL1" - Change #2 above (advertise up to v8p8) -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel