Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2411275pxb; Thu, 3 Feb 2022 06:11:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJycAwkX+SLpVqiSswKgHmHM3VSI8UhSaBZ+BmupkMHyZu5qPlI/HYlZysHAx+4GZrOBysdX X-Received: by 2002:a05:6a00:1c4b:: with SMTP id s11mr34502811pfw.51.1643897463938; Thu, 03 Feb 2022 06:11:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643897463; cv=none; d=google.com; s=arc-20160816; b=SvndhEpTEf27fHzUYilR9bwl8tuCQGHCagoKcW6OYOXyXvEbnN/Rzo5ItQx282YSH7 +9PVnnn6TLYyI/B+k1wz0C6K+Synzok5mLf4bthNnLO+iRwHjWwLUk+RwtnWYQDTIawf 84bIs+oe1FURAqvQ7ExUL0ikW6s3CX55q9hEUaio5NERxGM4+1UmpO/AusMUl1ID0NNr PSGKMVH6L57XutM+6S9ZsC89qnTBbHpygyntgVZACnNCAcmG2u6mrLt3K9QXFIl3NWTo RzQ4r9Yusvr8oqFM/LO8cyBY/TZCy7UxCDrGtycdcgnRtKADL/Fmk01wP8IJi7N1fnee yNdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6U0VnmNfGDUReCoshGyJhk0zAJfFhYADT+EeJhXO21s=; b=wmBCIBG+3Q3UpDb9av5TZMNj9v8sfMVuvGun7M54gWScssi73ZddFwIcDhQ44JMu5Z JEzm6zoaa3D7yCLa/tmpelweJuVomhiO3iCwmbj58XzCzWXuVbABIYWWqC5Sc5eDA3fg fSrAp+6vymBrF6pRnhlt91lvCft3y8qh0iKR4iUN8eCBZLM5PrgKf+uFwNMebvv9DzxJ 48W0Xdxhq5xtl9ptqkryuDJIzzJacu1rmOrql+Ph0cuaTHfVaPaiOXpqBBHTnllb/9Qc ds+TrCLSidxz33cgS4XNt2gdqKyTEw2ygo2xPJ+pY5dFqRPCZ32rZX5Lp2MFTjG0hLk+ OD6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=rJwpIZCt; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np10si9228091pjb.174.2022.02.03.06.10.51; Thu, 03 Feb 2022 06:11:03 -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=@alien8.de header.s=dkim header.b=rJwpIZCt; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237767AbiBBL11 (ORCPT + 99 others); Wed, 2 Feb 2022 06:27:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231717AbiBBL1Z (ORCPT ); Wed, 2 Feb 2022 06:27:25 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45CE4C061714 for ; Wed, 2 Feb 2022 03:27:25 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 8C23C1EC0513; Wed, 2 Feb 2022 12:27:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1643801239; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=6U0VnmNfGDUReCoshGyJhk0zAJfFhYADT+EeJhXO21s=; b=rJwpIZCtK06pLBa7yV8YFPpJNZ41vZkAFYf2zIpkCOWoV0PXia5fbYcJo56kbfEDUi1h/W 4u8oFtpCuE3wScUH54AQBsAc3iArAn2tqNudTx3iUTyw4pWT+r5jZqpEZ4Vyw2FYfKlM9D Y33Twp5PfhNo4FuHRJTZB1NtE0vRjuA= Date: Wed, 2 Feb 2022 12:27:15 +0100 From: Borislav Petkov To: "Kirill A. Shutemov" Cc: tglx@linutronix.de, mingo@redhat.com, dave.hansen@intel.com, luto@kernel.org, peterz@infradead.org, 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 Subject: Re: [PATCHv2 16/29] x86/boot: Add a trampoline for booting APs via firmware handoff Message-ID: References: <20220124150215.36893-1-kirill.shutemov@linux.intel.com> <20220124150215.36893-17-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220124150215.36893-17-kirill.shutemov@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 24, 2022 at 06:02:02PM +0300, 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 I wonder what that Reported-by tag means here for this is a feature patch, not a bug fix or so... > diff --git a/arch/x86/include/asm/realmode.h b/arch/x86/include/asm/realmode.h > index 331474b150f1..fd6f6e5b755a 100644 > --- a/arch/x86/include/asm/realmode.h > +++ b/arch/x86/include/asm/realmode.h > @@ -25,6 +25,7 @@ struct real_mode_header { > u32 sev_es_trampoline_start; > #endif > #ifdef CONFIG_X86_64 > + u32 trampoline_start64; > u32 trampoline_pgd; > #endif Hmm, so there's trampoline_start, sev_es_trampoline_start and trampoline_start64. If those are mutually exclusive, can we merge them all into a single trampoline_start? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette