Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1434837pxb; Wed, 2 Feb 2022 05:05:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKauBAIbzH6UuHSyXONh2kzR/vkhOHTlyT6Ba+7d2q9R8jnXZVmbUG6TeRV0SS7euEhWI4 X-Received: by 2002:a17:907:2d94:: with SMTP id gt20mr25117807ejc.118.1643807115909; Wed, 02 Feb 2022 05:05:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643807115; cv=none; d=google.com; s=arc-20160816; b=e7YoD4626he+ie9dbiVQfRHw4V6IJFbQryP3GeEjkt+JTVfjuuBVFkMdWzI4yZc50L bv+Qm+rmWy3AFOYpJPBBhqZtDZ7LV09vIwj9bNZo9/zAcmQY9175fxA8fWAuM0mhmsIM 86jdATFgIQM2QEqDJE98foL0NiyOqb4QbsdknSz1boQWt7goSRZ8axub8AnMpM8If4DO rykWLjnQ3lxKnBduxYm93SN5EBzrp0T1rrIx33eWPhF38WgbQEtABXsU4ervZaJ8B9ZY Z4QKJ+7dxOHM1KUsSLOlVtGRh3ocgb3XcTmI4ZKybmJPSQxmPZF6BPfwW/bMLVuZsuOH R+RA== 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=QsIbqrvI/zARQdc/D4KLBMZ/ArgLCUOgCsV2CDm2CBw=; b=jd8wvg/9AsB+KEH6+hg+ArYTIaCtL47CDOKYAP7GyAHxEuLaXX066CAS9oI6wV6qFG SLg8sygZFWpAaJ4kf8Tpvc+OFl5JEMXQpO5lKc8sSh6Su5W1n20TIufL7nXPdNQocppB /CC4xSkoRaiC/yeuG6dIBMwkzi8lmKZJrFgZEpMjUiq1TSVTlJYdq2XuC+xNdDXt1Nvr nezhehWJ6aE/wGuS97c8JY+L+Bwnc4KZta70Ks3AzubNa79pfqo5k1LuGbCmBvoNsmRr Hh32tU+Kn5rZN4IIJe/Lpu43Dxt6dOGDp/96ng9kTt8DGzJaL0X4KkoYeXXtBA2EYiMI xp9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sHPTeiCb; dkim=neutral (no key) header.i=@linutronix.de header.b=3GZ8WNf2; 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 hv19si3195129ejc.865.2022.02.02.05.04.47; Wed, 02 Feb 2022 05:05:15 -0800 (PST) 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=sHPTeiCb; dkim=neutral (no key) header.i=@linutronix.de header.b=3GZ8WNf2; 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 S242744AbiBAXGn (ORCPT + 99 others); Tue, 1 Feb 2022 18:06:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbiBAXGm (ORCPT ); Tue, 1 Feb 2022 18:06:42 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F490C061714 for ; Tue, 1 Feb 2022 15:06:42 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643756800; 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=QsIbqrvI/zARQdc/D4KLBMZ/ArgLCUOgCsV2CDm2CBw=; b=sHPTeiCbmIfTcTtiCeKPy3qTrSoc6L72A7bGLhNyUUmZJW2mIDeviCzdLwuhxjjA1+ef8l AIdiXoIj8eS1GBTQWxE3Cjga+eaV+EobN6V4IOyC50brt9dhf7goOqbPNFmxtljPMV5RM3 pEAPiYTT4pPBk8I+S8sFFOcHw+r1/8da5Sj1pwwZa4D6DkXngE5caViQ958XvD7Mcm6Zoh 7yH9LcVYQ/w00Jtm1Ztn9QZoKUqgRu7V3D4tOp6QQi7q81dkB1A4SELOia3nYpCCkpZqbQ q0mKrb2L0ZaHxQLKyz43IGo7KPion6hWC1aXQ1bHljm1zyWhFT2uncDmbtskPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643756800; 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=QsIbqrvI/zARQdc/D4KLBMZ/ArgLCUOgCsV2CDm2CBw=; b=3GZ8WNf28mUAHBi2YJMfb0IY2bmXlNmLMF47ruvXp9iqdzqzgYS4d5ztHHdMJ12ss9qjZv pN9l+l7ioLtUzRDQ== 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, x86@kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson , Kai Huang , "Kirill A . Shutemov" Subject: Re: [PATCHv2 16/29] x86/boot: Add a trampoline for booting APs via firmware handoff In-Reply-To: <20220124150215.36893-17-kirill.shutemov@linux.intel.com> References: <20220124150215.36893-1-kirill.shutemov@linux.intel.com> <20220124150215.36893-17-kirill.shutemov@linux.intel.com> Date: Wed, 02 Feb 2022 00:06:40 +0100 Message-ID: <87y22uw5j3.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 24 2022 at 18:02, Kirill A. Shutemov wrote: > From: Sean Christopherson > > Historically, x86 platforms have booted secondary processors (APs) > using INIT followed by the start up IPI (SIPI) messages. In regular > VMs, this boot sequence is supported by the VMM emulation. But such a > wakeup model is fatal for secure VMs like TDX in which VMM is an > untrusted entity. To address this issue, a new wakeup model was added > in ACPI v6.4, in which firmware (like TDX virtual BIOS) will help boot > the APs. More details about this wakeup model can be found in ACPI > specification v6.4, the section titled "Multiprocessor Wakeup Structure". > > Since the existing trampoline code requires processors to boot in real > mode with 16-bit addressing, it will not work for this wakeup model > (because it boots the AP in 64-bit mode). To handle it, extend the > trampoline code to support 64-bit mode firmware handoff. Also, extend > IDT and GDT pointers to support 64-bit mode hand off. > > There is no TDX-specific detection for this new boot method. The kernel > will rely on it as the sole boot method whenever the new ACPI structure > is present. > > The ACPI table parser for the MADT multiprocessor wake up structure and > the wakeup method that uses this structure will be added by the following > patch in this series. > > Reported-by: Kai Huang > Signed-off-by: Sean Christopherson > Reviewed-by: Andi Kleen > Reviewed-by: Dan Williams > Signed-off-by: Kuppuswamy Sathyanarayanan > Signed-off-by: Kirill A. Shutemov Reviewed-by: Thomas Gleixner