Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1396879pxp; Thu, 17 Mar 2022 08:35:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfSYXsSrUOoVBKCkA3qMmNDquPsqTtvZ4bgMzDwiY7a+k0gl5FosniYta93vY48sgQh5IG X-Received: by 2002:a05:6402:368f:b0:418:e826:1f19 with SMTP id ej15-20020a056402368f00b00418e8261f19mr5109833edb.98.1647531331413; Thu, 17 Mar 2022 08:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647531331; cv=none; d=google.com; s=arc-20160816; b=PsBLekpWjR2gS1Q5ibDEk2euYIc3Gf1kRlR6T555Y/vvoXczCPr5YElmBMjhcWGKhB KcJ5YlC2fZv98HvZ4b9ON+nwc5X52hSlh52Qe/njARObTMK9i2BUMITKziZzNxguW33k 2Jwm7ICURfYN5JxfKRWYEqa1VCZX1P/ECKBhulB03tMi6IZqnInn+dbCGHrZ3AZFDs6M nag8Q9nMpbMNhagI5BjXvub6BJq1Dfp4kPKnmdYMWaoYgigj339iAqSGEsDwl+Gy/GsR KPXQgKkRqXkMfZVbHBwhMyQqei/u/ioBfWLecT/xvTOdZqXFygaThcRwTm9ULjoNdb11 d0ug== 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=FzHveh5D0wbhES3zxBscZvsLRFNqiz1ukGIu06eCWMU=; b=twIxuHsbspew7LL7Nq5g6dE0zGUcqYw99JAlpKfaa6SO5UlkpE63S8hkYMNMvp2aFH OTyIhz52pJaSDq0C090Tzvf9+bLyzuyVgndzrHX3dOU9AzFCiERhtNC6TL5zcVFie7fQ asCgH2q2SV0WYwRsnqOLBl6Kg592FgI7fBM7rNzXoVDTvTlZNYjo7jgH+YCh8KOkJ2GL jajdE8OrqURIdmABQFMQvgsVyySEk/oMtMxI8OaUAm3tmkY26eEa2jRg7tbjemBI2scj 821JQN1y/kSVK3d3GaZkhG8fpESqNIqSN0ynOAX4VDHHMzrePZ2YN+2VpGBZmSxF/TfK yLwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WKJZJMah; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=uJMNE2+X; 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 b3-20020a50e383000000b00418e91d3b3esi1891151edm.32.2022.03.17.08.34.54; Thu, 17 Mar 2022 08:35:31 -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=WKJZJMah; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=uJMNE2+X; 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 S234127AbiCQMzJ (ORCPT + 99 others); Thu, 17 Mar 2022 08:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234032AbiCQMwg (ORCPT ); Thu, 17 Mar 2022 08:52:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D021A1F89E5 for ; Thu, 17 Mar 2022 05:50:09 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647521408; 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=FzHveh5D0wbhES3zxBscZvsLRFNqiz1ukGIu06eCWMU=; b=WKJZJMahz2mUkwbptb+bSgPX48IJBDSFAVuI9iIoidmfuR9fE0AMMLJctsZsG8Hs6ns6xW gXGqH0O36/lZeEJ/dbVJCVOLCDbhwSb9q5hBX6ZDHIkba3tLz8STpeRd60cg9laRnj7ySl cPJo2neV+QrszN8JnBHgWJEOphh5kAE1Jc+oT/vhGWIltwhwFMvPthVSmQncy+DAWMY97c e9DlGqpd3FtBlOjQTrzPNOspu5Y2E1cgiSpDVTJ1o+beiaVG9X+pW1rUlSN8eOVTZQFP2Q ElBURo6Z/NFstXHMmPP+Bkp4H7cb75j9RK/zeidfs/rEYh0I5RmfJZoop2IQeA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647521408; 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=FzHveh5D0wbhES3zxBscZvsLRFNqiz1ukGIu06eCWMU=; b=uJMNE2+XTeTms+lOWaDn1Qvk/Ygye29Gs9naxwKIu3B7T8a8c9ydV8ejkcJL9TSEeT5vhP 6kvCAf4O9sZja9AQ== To: "Kirill A. Shutemov" , mingo@redhat.com, bp@alien8.de, dave.hansen@intel.com, luto@kernel.org, peterz@infradead.org Cc: sathyanarayanan.kuppuswamy@linux.intel.com, aarcange@redhat.com, ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, jgross@suse.com, jmattson@google.com, joro@8bytes.org, jpoimboe@redhat.com, knsathya@kernel.org, pbonzini@redhat.com, sdeep@vmware.com, seanjc@google.com, tony.luck@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, thomas.lendacky@amd.com, brijesh.singh@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org, "Kirill A . Shutemov" Subject: Re: [PATCHv6 24/30] x86/topology: Disable CPU online/offline control for TDX guests In-Reply-To: <20220316020856.24435-25-kirill.shutemov@linux.intel.com> References: <20220316020856.24435-1-kirill.shutemov@linux.intel.com> <20220316020856.24435-25-kirill.shutemov@linux.intel.com> Date: Thu, 17 Mar 2022 13:50:08 +0100 Message-ID: <87r170zqtb.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 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 Wed, Mar 16 2022 at 05:08, Kirill A. Shutemov wrote: > From: Kuppuswamy Sathyanarayanan > > Unlike regular VMs, TDX guests use the firmware hand-off wakeup method > to wake up the APs during the boot process. This wakeup model uses a > mailbox to communicate with firmware to bring up the APs. As per the > design, this mailbox can only be used once for the given AP, which means > after the APs are booted, the same mailbox cannot be used to > offline/online the given AP. More details about this requirement can be > found in Intel TDX Virtual Firmware Design Guide, sec titled "AP > initialization in OS" and in sec titled "Hotplug Device". > > Since the architecture does not support any method of offlining the > CPUs, disable CPU hotplug support in the kernel. > > Since this hotplug disable feature can be re-used by other VM guests, > add a new CC attribute CC_ATTR_HOTPLUG_DISABLED and use it to disable > the hotplug support. > > With hotplug disabled, /sys/devices/system/cpu/cpuX/online sysfs option > will not exist for TDX guests. I can't find any code which removes the online file. The write will fail with -EOPNOTSUPP, right? > Signed-off-by: Kuppuswamy Sathyanarayanan > Reviewed-by: Andi Kleen > Reviewed-by: Tony Luck > Signed-off-by: Kirill A. Shutemov Other than that: Reviewed-by: Thomas Gleixner