Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7428520rwr; Tue, 25 Apr 2023 12:52:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/0A1KYgqRyl4wF5+p97LssXf+L1jJI1W5k4xdCvmZqF9br3h5eaAh1y2cgty0HKX94nQ/ X-Received: by 2002:a17:902:ec8b:b0:1a9:7f45:8721 with SMTP id x11-20020a170902ec8b00b001a97f458721mr6996372plg.48.1682452363155; Tue, 25 Apr 2023 12:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682452363; cv=none; d=google.com; s=arc-20160816; b=QLyg1ri5uztjXCJgx8vtnIjQZK57U+kHXPstEjKtYDJp7loI/MglqiQtnQ4bDY/QBf JFhTD1+Jf0VuuzmFyWagvQpwtFnVlWpTEE5VJEfs9TcVsaz904NhCOIy+3kN6GuVO80Y 266/ATDj/tJlxYmxLzM3lHUOgV8KvFrKT1Hdsk8caZX6ONijufnGiRc5pO8QRptCdBb0 mI5flrecHeM+gf+iCfFQw4b03SsQdcJDJRd7yars7Zm/Mh8aufMGAK4goBfsHn9Giu5V 1AXo6DxuU8ElYCH0J9ju8WXxySf9jAxf+OP2doS3QL9IrOPPt+lWpXFooI+5YI5lmVZX 5izg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=epqrrIP9XVMR1rQYOgUv6OMHFSXsoKyAhdvov9JTG3c=; b=XAB4p7QFKWn1fvZfK1kFPstRyxph+XxneJQ6Dw+6NUl0aeei80NX05dmQ/BZtcvBRJ t3nX2rpy/9gn6xm3HiZHD1LPghmF9ok41bcC+Jsrhov6is6YgFmxSk2jwd8LDuBD+0Tx KIdkMIpHKYCsTV+dPMO5wKT0PXeWl5k2M7MpI6kMi41qhjMeIqfEFKz6wd9boGxR2BKN TGaLnOXDoKHOiPDiaWx3jDRhxbG40AVSFgwe7lMoPxpOadYM2zbPL8PmGNv+k/CK2WYT u1HExwHSrp6n26bT63kaFZItPpDzsJcR08Pz5PnswaF4NxAhRKTDELTTj4HG3awfQK+s rlsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hcfCyrdf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk6-20020a17090308c600b001a197aa18fesi14350100plb.121.2023.04.25.12.52.22; Tue, 25 Apr 2023 12:52:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hcfCyrdf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236188AbjDYTvT (ORCPT + 99 others); Tue, 25 Apr 2023 15:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235087AbjDYTvR (ORCPT ); Tue, 25 Apr 2023 15:51:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B79BC122; Tue, 25 Apr 2023 12:51:15 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682452273; 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=epqrrIP9XVMR1rQYOgUv6OMHFSXsoKyAhdvov9JTG3c=; b=hcfCyrdfQ/+yHnKF3T+I49mLvnN7Y7S69gBRQL7PhhKJcZIQM6dUY5pvAbw4x5UtKBksj5 +gNdAWyqbtppxTS6xk/OOGkQEgCKZ50daZMUpYiSsjHUolnRQ63od8fRIwCIy22iqsL7Jz ptuYgLF2Vyi6TxSoYJlRddHoLRBh0aBb/2ut263viqoCn4L8IM34OuGeUFz0vHjf3uDsn9 kzIwMYp79iEd+cDm0M3l/TvJoQ8Ebljb98ttQPEip+uioS6jdgokPZm34PxDLgh8kTLkX7 Tk0Brm7tWOMbl31MYKpF+X1fNVmxtHUKna8IUJdeJdt+TiqryaL2tjxt/WxUaA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682452273; 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=epqrrIP9XVMR1rQYOgUv6OMHFSXsoKyAhdvov9JTG3c=; b=mlbSRhNUu/9kpluKPqwDbDiOM+hdImwLPmR+/CiZOtx2CU7HgipiQ7bg9V2pgBimVEqMmi qqHiWR0zzWYsg/Bg== To: Mark Rutland Cc: LKML , x86@kernel.org, David Woodhouse , Andrew Cooper , Brian Gerst , Arjan van de Veen , Paolo Bonzini , Paul McKenney , Tom Lendacky , Sean Christopherson , Oleksandr Natalenko , Paul Menzel , "Guilherme G. Piccoli" , Piotr Gorski , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, David Woodhouse , Usama Arif , Juergen Gross , Boris Ostrovsky , xen-devel@lists.xenproject.org, Russell King , Arnd Bergmann , Guo Ren , linux-csky@vger.kernel.org, Thomas Bogendoerfer , linux-mips@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Sabin Rapan Subject: Re: [patch 22/37] arm64: smp: Switch to hotplug core state synchronization In-Reply-To: References: <20230414225551.858160935@linutronix.de> <20230414232310.569498144@linutronix.de> Date: Tue, 25 Apr 2023 21:51:12 +0200 Message-ID: <87ttx3zqof.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 17 2023 at 16:50, Mark Rutland wrote: > On Sat, Apr 15, 2023 at 01:44:49AM +0200, Thomas Gleixner wrote: > I gave this a spin on arm64 (in a 64-vCPU VM on an M1 host), and it seems to > work fine with a bunch of vCPUs being hotplugged off and on again randomly. > > FWIW: > > Tested-by: Mark Rutland > > I also hacked the code to have the dying CPU spin forever before the call to > cpuhp_ap_report_dead(). In that case I see a warning, and that we don't call > arch_cpuhp_cleanup_dead_cpu(), and that the CPU is marked as offline (per > /sys/devices/system/cpu/$N/online). Nice! > As a tangent/aside, we might need to improve that for confidential compute > architectures, and we might want to generically track cpus which might still be > using kernel text/data. On arm64 we ensure that via our cpu_kill() callback > (which'll use PSCI CPU_AFFINITY_INFO), but I'm not sure if TDX and/or SEV-SNP > have a similar mechanism. > > Otherwise, a malicious hypervisor can pause a vCPU just before it leaves the > kernel (e.g. immediately after the arch_cpuhp_cleanup_dead_cpu() call), wait > for a kexec (or resuse of stack memroy), and unpause the vCPU to cause things > to blow up. There are a gazillion ways for a malicious hypervisor to blow up a 'squint enough to be confident' guest. The real question is whether it can utilize such a blow up to extract confidential information from the guest. If not then it's just yet another way of DoS which is an "acceptable" attack as it only affects availability but not confidentiality. Thanks, tglx