From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62B61202C46 for ; Tue, 16 Jun 2026 12:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781613318; cv=none; b=YESbVkXap3E6EPf3IJ6F1WK7GjPPoc4UvB2bQigzVUp1R9b47sV+BD2/tgfAuJ35mOIrytSk7udRmQIUPctLosEG4oiGxH/LvKEZsZ9RTofKLkUy8AIZh+zDJ0ZaeTwXmwzq7GcnoAJ+/hMSHWVM33KFPasWIVGGPqL4P08IoNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781613318; c=relaxed/simple; bh=ETdUkWmUMOLSm7TtxUX69mqgYG8eFTikRfIxPw/5Ih4=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References; b=MRcHDCoQBob/ukg6DtmSlbNqmOylXLcvoyRtCu189R4ccr5Pw1GsOPakJXMLF8A7z7QKlRMEwZXPG1XCGGobPjeaHvL5Qo/tUvSV+rxT1TXa/UMux8GgFjcs6AdlMJ2cFikamBSZMlmAmBQheV6G5lw8wV2pqPtSlbFa51WBI3k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FM/NYQm/; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FM/NYQm/" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-84237c55ef9so2830441b3a.0 for ; Tue, 16 Jun 2026 05:35:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781613317; x=1782218117; darn=vger.kernel.org; h=references:message-id:date:in-reply-to:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=BAYzqTyjLrIOI8jk2lCoOCBWo5ysdxV0s0gT6irQrOA=; b=FM/NYQm/8LrA97/fvrCWZk6U4G4g4e9p9Z2mftaAOAGbVgp/b6qPHOYV3eNbgb68rv cUn0vjocNW2krYtwXTJO7XdKyKBuMdTtHXgWpyDfOuU2eYYjdMtFCywmtqPai4FVp9Bk bislPeYh4C2Pmaqfi/0fEFKsd1+mXYNg0noye+YUZw9vXSW4z6/a+PQdRcTxFgj+5XRm x4aHkNcIxIvNr/skAae4XqqjQ+GqyUgFYyuf56QGKquUQSpkSEbBZEAaPG/4ZfS8KaET isFV9ERBHQXhhMsLvJfJZdUPpSlabN7gT6MoppR84l3KUhHrmX9lh8eTZz5oLzT7ozbZ MNiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781613317; x=1782218117; h=references:message-id:date:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BAYzqTyjLrIOI8jk2lCoOCBWo5ysdxV0s0gT6irQrOA=; b=PWzd7G1AUB/ax5pjF/3VxDNTPlY8+HS2E5pI7aGwHFJ8HhEIe9Sp9XB3dspLkLTpyT EmhX+Ft/7rPR3RttpSRaf7AMwvDZKO6ghyNaRoNaeSYOSg4xYXinYM1lzoNSoQdpdbx4 XW+69OzmLgzpDPLiLqd9pimuTJP2dOQz9ndsH8EQPJL/KNEq/iVJVbd+1Csxuzh9gYfk tt8ckXH7X/5iEUZ9pjp4w3pKGAon7reWqb2VemSiuKCs3S2f/PdaiR4ot8xy74e7UwDu EBSQzYhDztsddhf0D4R1LiNHB8sNRCKzAzSHB23b4KVDJXEfs6PvA1KH494rIa47IodE 921w== X-Forwarded-Encrypted: i=1; AFNElJ+kLWKAsr4kXyuZCF+wO7NRlnc/VdaNfjMez8/pq1/Y3LQoNctHC9gwgO2c+ADh5gaE5wPalrPcqyYcgSU=@vger.kernel.org X-Gm-Message-State: AOJu0YzHsrr9xyg67ZbiUTizF4oxW3cTvLeMS1l1tOGyrNLfELeM0N0N HsGgHPEH+v8fa4ZJ3yfReRsd3PjOX8pKhfsC11kvGCc02/+9TTzdFhGsUFIlXA== X-Gm-Gg: Acq92OGwu8aPEx/C2P/RHRcgRb8eBJ5BRCHlEONIeQ9tmqjzTpxUOVmx1tV10PhTGj9 TSUMMfCb1qjsIqSFH493HselYnTFAKUZ9E7vAMp2CRkWlGdXiSgGjAlwCRTFfEWEtf7p1f5+FeC r1qtRBBfEeYptL1fve0/DZoB5dqh7eVCfdxH1oBGXGUiLO/gWxOAJKUzGH52WLSQWCcImQeLwYH Epb9KesnoSO7gP6+9vhcDi/DYGMkRD+qC7LFts5vhPU1FvguzaYJh5AT/yyPFmr7FBtqmaJK7Kl 5JD3oOX0OwANXiR3o+40jS9a1pfIg2ppvFujhn5OgsWL1fmulLqjS0FhJ+UEWVEWh2i9av0iwRj 88EBgWBU6wsl32me27GTbT7aMLbOFoYxUW3c42llBNjS8mcyCyzhkxAFCP818IIN/VMRZjyEURa koU4EXorc8/0G68KDLshm4lU0OaA== X-Received: by 2002:a05:6a00:8d6:b0:842:688f:3089 with SMTP id d2e1a72fcca58-8434ce832c2mr18655919b3a.30.1781613316626; Tue, 16 Jun 2026 05:35:16 -0700 (PDT) Received: from pve-server ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8434ac9c4c0sm11794275b3a.3.2026.06.16.05.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2026 05:35:15 -0700 (PDT) From: Ritesh Harjani (IBM) To: Amit Machhiwal Cc: Amit Machhiwal , linuxppc-dev@lists.ozlabs.org, Madhavan Srinivasan , Vaibhav Jain , Harsh Prateek Bora , Anushree Mathur , Gautam Menghani , Mukesh Kumar Chaurasiya , Nicholas Piggin , Michael Ellerman , "Christophe Leroy (CS GROUP)" , Thomas Huth , kvm@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] KVM: PPC: Book3S HV: Validate arch_compat against host compatibility mode In-Reply-To: <20260616161011.835c90f0-38-amachhiw@linux.ibm.com> Date: Tue, 16 Jun 2026 17:38:37 +0530 Message-ID: References: <20260609053327.61563-1-amachhiw@linux.ibm.com> <20260616161011.835c90f0-38-amachhiw@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Amit Machhiwal writes: >> > diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h >> > index 3449dd2b577d..7472b9522f71 100644 >> > --- a/arch/powerpc/include/asm/reg.h >> > +++ b/arch/powerpc/include/asm/reg.h >> > @@ -1356,6 +1356,7 @@ >> > #define PVR_ARCH_300 0x0f000005 >> > #define PVR_ARCH_31 0x0f000006 >> > #define PVR_ARCH_31_P11 0x0f000007 >> > +#define PVR_ARCH_INVALID 0xffffffff >> >> Logical processor version is defined as part of the PAPR spec. We should >> ensure that this invalid PVR is also documented in the PAPR spec. >> >> If you have already taken care of that, then please confirm and feel free to add: > > Regarding the PAPR specification documentation: The PAPR spec documents > the valid Processor Version Register (PVR) values for each processor > generation (POWER8, POWER9, POWER10, POWER11, etc.). However, the > PVR_ARCH_INVALID value (0xffffffff) introduced in this patch series is a > KVM implementation detail used internally to mark invalid compatibility > mode requests - it's not an architectural value that would be defined in > PAPR itself. > > The validation logic and the use of PVR_ARCH_INVALID as a sentinel value > are documented in the kernel code and commit message. > But that still worries me on what if PAPR wants to re-use this value for some other purpose in future. BTW, thinking more about it, if we purely want this to be in kernel only, can we instead add, something like: bool kpvr_compat; /* Does kernel supports this PVR */ rather than re-using & overloading arch_compat which has values that comes from PAPR spec? Thoughts? -ritesh