From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AA2BA374FD for ; Wed, 29 Nov 2023 19:19:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="U0GzArZp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B159C433CA; Wed, 29 Nov 2023 19:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701285549; bh=3pW6xnsAUeog7q7Ocl3eZrX2dSAdjHdesiwXTdeS3mk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U0GzArZp8Rf+CuBUmj+By2MGTuVUkY8RTLbOVYHy+AGUJXVluE7T9uXE3Ep5iwTWF FzXw4iQqF32CAuEnP+NEVAbW/7EJeo0r/zRbP55H4+y9gfBqb4HwVjkKWJdhdm1zAH kPexp7o/GRy0wAu/UilidpTzuHtjeTvJ6NWqKSwJms51RMgm2VLdpCsw0AVgyLoeFc WXrouSahovfbi90Wz4DKezr4/a4IGDkfZ+A2RmL4T358YrXTXBR08SBMOIa2aUty09 nOqS5uysbDSY1cFv7dO8Q9SZlkpZrDmTKTJsVyDyuXmM75q+3BIW5IQSOLQLRPW2ey 4M8HnysKdORLA== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r8Q5S-0001gi-Hm; Wed, 29 Nov 2023 19:19:06 +0000 Date: Wed, 29 Nov 2023 19:18:42 +0000 Message-ID: <87il5k8j1p.wl-maz@kernel.org> From: Marc Zyngier To: l00313349 Cc: , , , , , , , , , Subject: Re: [PATCH] KVM: arm64: fix MPIDR to vcpu index cache to support vcpu change at runtime In-Reply-To: <20231128135402.1943-1-liting8@huawei.com> References: <20231128135402.1943-1-liting8@huawei.com> 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/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev 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.104.136.29 X-SA-Exim-Rcpt-To: liting8@huawei.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, zhengchuan@huawei.com, xiexiangyou@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 28 Nov 2023 13:54:02 +0000, l00313349 wrote: > > From: Ting Li > > Consider vcpu change at runtime, for example online_vcpus is 8, > but only start 2 vcpu threads, MPIDR to vcpu index 0 may be overwrited > and vm hangs. When start other vcpu threads, cache will be outdated > and always get mismatch. If userspace creates two vcpus with the same vcpu_id, and therefore the same MPIDR value, that's userspace's problem. Don't do that. Why should we do anything else? M. -- Without deviation from the norm, progress is not possible. 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 9E26CC4167B for ; Wed, 29 Nov 2023 19:19:45 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CSyYJFl6Q0f5yYsuVMvwqVPToVFWaGhpG+UqRQ5jUOc=; b=AxXVmrvqmHsZHi zQ/HK+MpKHkXokW+7986q0zADrwTRuLERime1sjV4u/1OKuBNCqOk1PetY4Eh+pZXKFuSI0sQN5ku l4t+G39MB6apX0KpaRFeWpmLpW8z8/kfSKTRt5luhqW8piQgkG/CwH48AUdQak7PYeqwz4lvzqSjy FzZOiKqsC5MEWnthrgaSXgQ+DxLPa9lN+yq2EUQGOh7aPEGKw2qvIMpr2NoeO6pC+mWD+l12kpQ2F fuF7M+PndDkam1Im3mGASVVYp4Yd6sW4zRc3o72Uu3tbzWgC+zdtEemNWAN6SLlNETRc9s1tmftxq zB7fa7TcZXHBXkp6gTMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8Q5d-0099HF-2h; Wed, 29 Nov 2023 19:19:17 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r8Q5a-0099G9-1Q for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2023 19:19:16 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id E546ECE1F5C; Wed, 29 Nov 2023 19:19:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B159C433CA; Wed, 29 Nov 2023 19:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701285549; bh=3pW6xnsAUeog7q7Ocl3eZrX2dSAdjHdesiwXTdeS3mk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U0GzArZp8Rf+CuBUmj+By2MGTuVUkY8RTLbOVYHy+AGUJXVluE7T9uXE3Ep5iwTWF FzXw4iQqF32CAuEnP+NEVAbW/7EJeo0r/zRbP55H4+y9gfBqb4HwVjkKWJdhdm1zAH kPexp7o/GRy0wAu/UilidpTzuHtjeTvJ6NWqKSwJms51RMgm2VLdpCsw0AVgyLoeFc WXrouSahovfbi90Wz4DKezr4/a4IGDkfZ+A2RmL4T358YrXTXBR08SBMOIa2aUty09 nOqS5uysbDSY1cFv7dO8Q9SZlkpZrDmTKTJsVyDyuXmM75q+3BIW5IQSOLQLRPW2ey 4M8HnysKdORLA== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r8Q5S-0001gi-Hm; Wed, 29 Nov 2023 19:19:06 +0000 Date: Wed, 29 Nov 2023 19:18:42 +0000 Message-ID: <87il5k8j1p.wl-maz@kernel.org> From: Marc Zyngier To: l00313349 Cc: , , , , , , , , , Subject: Re: [PATCH] KVM: arm64: fix MPIDR to vcpu index cache to support vcpu change at runtime In-Reply-To: <20231128135402.1943-1-liting8@huawei.com> References: <20231128135402.1943-1-liting8@huawei.com> 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/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: liting8@huawei.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, zhengchuan@huawei.com, xiexiangyou@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231129_111914_698954_3BE98093 X-CRM114-Status: GOOD ( 12.51 ) 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, 28 Nov 2023 13:54:02 +0000, l00313349 wrote: > > From: Ting Li > > Consider vcpu change at runtime, for example online_vcpus is 8, > but only start 2 vcpu threads, MPIDR to vcpu index 0 may be overwrited > and vm hangs. When start other vcpu threads, cache will be outdated > and always get mismatch. If userspace creates two vcpus with the same vcpu_id, and therefore the same MPIDR value, that's userspace's problem. Don't do that. Why should we do anything else? M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel