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 F0A08EB64DD for ; Fri, 21 Jul 2023 21:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbjGUVS1 (ORCPT ); Fri, 21 Jul 2023 17:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbjGUVS0 (ORCPT ); Fri, 21 Jul 2023 17:18:26 -0400 Received: from out-13.mta0.migadu.com (out-13.mta0.migadu.com [91.218.175.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4CE8359D for ; Fri, 21 Jul 2023 14:18:23 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230718164522.3498236-3-jingzhangos@google.com> X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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