Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4815339rwd; Tue, 30 May 2023 10:14:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6MbXGh4G7A83m1+Jmr3n7QJzVoenAUDs0brtwjBgSRwnx3nj9susnpanrcsLA3c8fu/EXx X-Received: by 2002:a17:90b:1d85:b0:255:3f6f:2c6 with SMTP id pf5-20020a17090b1d8500b002553f6f02c6mr2695289pjb.22.1685466849043; Tue, 30 May 2023 10:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685466849; cv=none; d=google.com; s=arc-20160816; b=gzzhvOXN/sgbRA2C+LyvQ87ETYR/dj5Kaui7+SE3JV0AMFlLZzZUp1MO0PlVmTUbqu ++zXys2OrcTrNjrE31DnGHM7mnQvWsh+DiFfVOiSmEPGGfQoi5M7t/ey23607Qo2iY7n J+0Wy613uCRhRXjLMTq2berLnnNenwfArB4gYoKKr892XkStxxGMI1g1ZesiI3nGcr8/ e7zuSMvGrAKaTYI9+8gsH4fkG2FB1LOsXwRMlful40BAS0OgMVdv5c5crvgT/DfIpmSg 3LyiQyOR8oDESQLGTR2PAW3lI86Ua94ln5v03vvBM8AZWUiN8g72K9misJiyVtnNczUz 9BFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=zUIF7qczhJfL0tzqN+Wk4Y8s0fyjf+/encaeJ8i8zo8=; b=KLUJ5DGAH2asD4YdFTS1kpgFXPA8oaRrcvj0QRrFj1+W0QWSoqQtlYbQYyw2KzOkcw CKPieQkQa4NE5Z63UAU3/Fds+f9TA0Rwn/LAG46EYWl6s26rWqPO333uT2E+s01diqhW mPwmwf5Qqy7tcK5M7FC/AZzOdjrhqPUB+vWIdSEr1HdUwzAclMaf096Yug6in693qhAQ d6CHy0/t66PTqev15ThJ2U/lRDKNWyGZdD6+zAIKT80tjSIzKKP9ZnCLzkc6/4IzZ0vb kKw/5ND9898+1fSCSLKdbpavq/xEgOtiIw56TssfTmj5ti2JBqjYG4DaWZBWmcKeUvDq lsJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=RbEfFAAf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a17090a680400b0025359a570fesi369390pjj.19.2023.05.30.10.13.54; Tue, 30 May 2023 10:14:09 -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=@google.com header.s=20221208 header.b=RbEfFAAf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232012AbjE3Q4j (ORCPT + 99 others); Tue, 30 May 2023 12:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbjE3Q4h (ORCPT ); Tue, 30 May 2023 12:56:37 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F7098 for ; Tue, 30 May 2023 09:56:36 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-5340957a1f1so2608336a12.1 for ; Tue, 30 May 2023 09:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685465796; x=1688057796; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=zUIF7qczhJfL0tzqN+Wk4Y8s0fyjf+/encaeJ8i8zo8=; b=RbEfFAAf2kcBOjvt74s5UVZKgWrUGFDUy+sd7fobbo+fCQD0px8ov63e8OeZXSJ8fh HG4hHegtTrDVP700YjLnXteCxE6guE54Vbd8zH/t2rCli4QSiy5tmFSofJYIZgEMn1zj Qsp4LrQqCDZwVqc25d9x6Ot8kXQSMfXIZ9gqaurkMyf4wf+UYa4w1aAbMwazKXlrtuiS Kk616ydOwBRsdeEiUal2WEabr5ltpvlk9LlkPPxhELMLDRXHyhZJZ3Til0KRYe81otj+ tS/p/kiytx6/XARdF4p/h7eKZckIQCkqvbC4w6UMN19z2FxazUFpiFD2Hr1ZsYeU6F4t XCEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685465796; x=1688057796; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zUIF7qczhJfL0tzqN+Wk4Y8s0fyjf+/encaeJ8i8zo8=; b=ejBr37nho4eRmfAtEYEP4qw4ZQaDH0QWV3DQf4IQyfA4ssbBuZcsZeTB5vyt4s+9qN tzMxIZjq/ry5j3DjzuUnVLAV58Eabi116k+u85EGrpiQRjTfYUMZYIwccguvA6ON5IB5 N4jOnHzMO90njc9U1JHJy30ROnWrahzJ7HAkAY+uj0x9Ze3MkzbF9N2fOaBKrS0nTbWb zNkKyFMpM2jgf3kFMH1OQasyyhegg/TSsJabLC97oYgU9iVKBbdUQS82FrMz6d+RXr7g TIqvb7hGPgrpQwN8zYyCEHqrkAkHe+yoLSp3jCUi3FNdLyIjuSzzD++cTL588Lc7dQT4 OjmA== X-Gm-Message-State: AC+VfDzVRMVTTUui7KqKqjwd26qVeRIspm9xL6E/wuhB4ZtYdZmktnzm 8o3imV89Q4jd7GojOV0yAmfsZDHmSjc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a63:512:0:b0:52c:9e55:61ee with SMTP id 18-20020a630512000000b0052c9e5561eemr545525pgf.3.1685465795799; Tue, 30 May 2023 09:56:35 -0700 (PDT) Date: Tue, 30 May 2023 09:56:34 -0700 In-Reply-To: <87wn0pizbl.ffs@tglx> Mime-Version: 1.0 References: <87sfbhlwp9.ffs@tglx> <20230529023939.mc2akptpxcg3eh2f@box.shutemov.name> <87bki3kkfi.ffs@tglx> <20230529203129.sthnhzgds7ynddxd@box.shutemov.name> <20230530005428.jyrc2ezx5raohlrt@box.shutemov.name> <87mt1mjhk3.ffs@tglx> <87jzwqjeey.ffs@tglx> <87cz2ija1e.ffs@tglx> <20230530122951.2wu5rwcu26ofov6f@box.shutemov.name> <87wn0pizbl.ffs@tglx> Message-ID: Subject: Re: [patch] x86/smpboot: Disable parallel bootup if cc_vendor != NONE From: Sean Christopherson To: Thomas Gleixner Cc: "Kirill A. Shutemov" , Tom Lendacky , LKML , x86@kernel.org, David Woodhouse , Andrew Cooper , Brian Gerst , Arjan van de Veen , Paolo Bonzini , Paul McKenney , Oleksandr Natalenko , Paul Menzel , "Guilherme G. Piccoli" , Piotr Gorski , Usama Arif , Juergen Gross , Boris Ostrovsky , xen-devel@lists.xenproject.org, Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , 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, Mark Rutland , Sabin Rapan , "Michael Kelley (LINUX)" , Dave Hansen Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 Tue, May 30, 2023, Thomas Gleixner wrote: > On Tue, May 30 2023 at 15:29, Kirill A. Shutemov wrote: > > On Tue, May 30, 2023 at 02:09:17PM +0200, Thomas Gleixner wrote: > >> The decision to allow parallel bringup of secondary CPUs checks > >> CC_ATTR_GUEST_STATE_ENCRYPT to detect encrypted guests. Those cannot use > >> parallel bootup because accessing the local APIC is intercepted and raises > >> a #VC or #VE, which cannot be handled at that point. > >> > >> The check works correctly, but only for AMD encrypted guests. TDX does not > >> set that flag. > >> > >> Check for cc_vendor != CC_VENDOR_NONE instead. That might be overbroad, but > >> definitely works for both AMD and Intel. > > > > It boots fine with TDX, but I think it is wrong. cc_get_vendor() will > > report CC_VENDOR_AMD even on bare metal if SME is enabled. I don't think > > we want it. > > Right. Did not think about that. > > But the same way is CC_ATTR_GUEST_MEM_ENCRYPT overbroad for AMD. Only > SEV-ES traps RDMSR if I'm understandig that maze correctly. Ya, regular SEV doesn't encrypt register state.