From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 43E053563E1; Thu, 18 Jun 2026 12:32:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781785941; cv=none; b=DVgqr0ql1q1wwMLpcXQOqgJl5O1NajyMJrWuW+gMudIqugH0aDl2+BqFM1nOwBgroO92T2Ew+S6jHZtIpgfme8FLrFKLCimVojAKXVZNMeoNQMja0yZ4OOhIkEh6Xjip2WzNDmrlVM9zv7qy/4lrZsqnAkXcJ0heKgKGAzp9HK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781785941; c=relaxed/simple; bh=mhiPymvyTBciJhHSsc3Xa9aK6fmiH6D8M6oTv+7qw30=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=W4nDHqvWSe71giObr9SepvlsgzGBzIfSOYYLoR5CpVk/jjLHk+LnvalhoegD6vmvvUARFvAMENYlYLp6eAGj1TzFguIlEzcG3jrWpm/g+gHQNtabaavHSx7CeTVBE0m3q1MX6BA9Q0KkaNjxVe7g9aFl6smd4+UKZGnZQb5Z76w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dStsYpvO; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dStsYpvO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D431C1F000E9; Thu, 18 Jun 2026 12:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781785939; bh=NU/2gv7WCcNEU37rgp5ZvLy8WyLmN9W6pSeXPOCI7PY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=dStsYpvOljP99BQ6+adKrH6Eq5deNaLgc0bzyWsO5P/UhxF4SSkIsaCphOgpH0ReG Ew04tsBeBzg3KnkBGK5PeDLic3aWX8/yHuJoiQl7puCVe99WZFXrv8b9yP25VkZzy2 6JnV2Dv7ttSiqmwfkgixifcaF8IIWV2Q3el36ULpw8wdS1xFkBiKYxqupSeZb/vmqi 1L0RsL2ipCuJ5cqO2oTWwp38IoLHR0daq1ydiGTv96QPDuAKHVn+57sNeibCAoBosW qFaW4r5O2VzmSqZlwmNsBL4YutGdwq6SRAkxBARiXh69Y0NgLDKaJil/sc8CHHw2by D+AqPOFLrABqg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1waBur-0000000E0h7-47cG; Thu, 18 Jun 2026 12:32:18 +0000 Date: Thu, 18 Jun 2026 13:32:17 +0100 Message-ID: <86eci4rpv2.wl-maz@kernel.org> From: Marc Zyngier To: fuqiang wang Cc: Oliver Upton , Zenghui Yu , linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, dongxu zhang , wangfuqiang49 , "diaojiaqing.1" Subject: Re: [PATCH v2 2/2] KVM: arm64: Skip unreset vCPUs in MPIDR lookup table In-Reply-To: References: <20260611144042.97981-1-fuqiang.wng@gmail.com> <20260611144042.97981-3-fuqiang.wng@gmail.com> <87o6hd8oc7.wl-maz@kernel.org> <87cxxs86bg.wl-maz@kernel.org> 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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: fuqiang.wng@gmail.com, oupton@kernel.org, yuzenghui@huawei.com, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, xu910121@sina.com, wangfuqiang49@jd.com, diaojiaqing.1@jd.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Thu, 18 Jun 2026 12:38:54 +0100, fuqiang wang wrote: > > However, could we detect collisions within the init function and, upon > detection, notify userspace without taking any corrective or fallback > action? This would serve as a stronger reminder to userspace of its > non-compliant behavior. > > e.g. > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 3732ee9eb0d4..7563feab1a11 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -893,6 +893,17 @@ static void kvm_init_mpidr_data(struct kvm *kvm) > data->cmpidr_to_idx[index] = c; > } > > + kvm_for_each_vcpu(c, vcpu, kvm) { > + u64 aff = kvm_vcpu_get_mpidr_aff(vcpu); > + u16 index = kvm_mpidr_index(data, aff); > + > + if (data->cmpidr_to_idx[index] != c) { > + pr_warn("Multiple vCPUs share the same MPIDR value, " > + "it may cause the guest to hang or run slower\n"); > + break; > + } > + } > + That's not reporting anything to userspace. That's just screaming in the kernel log, and a random user does not have access to that. If you wanted the user to take notice, you'd need to fail the entry into the guest. M. -- Without deviation from the norm, progress is not possible.