[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Xen vs Trenchboot: TXT AP bringup


  • To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "trenchboot-devel@xxxxxxxxxxxxxxxx" <trenchboot-devel@xxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Thu, 27 Oct 2022 19:37:20 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f1BXe0ubGZbIk1FGJFtnHrxTWNaUlcWBAyux02VQSfg=; b=gsRGPsrl+ZH/1oGuroNQqh6WJGwTZdj3iRMPcyORFohe5DW8jugEsJGPKx3s5ZRHlEgGHlks7be+EcwS57YTOFNtG+JQKRBGQohD9fO0w3lF3+zFHBOUwwKpkZzSnmebtYlzzod/KuUlG01+BhN1yjSYk/svZ8mgRcanuy7dz08MTFyXkPyUKN+/pEyOJt5tarEuUDxzRwwsC91fTinF0ocUdP2KSplxH4U6Icef84czNUZRD+gYCoybDkA3+FH5mNeqVa2lNV9gYm9dy6JCyxhQhA/JWhnsExWx1gkr7/F0oqH4DN8272BfQx9YQVuQMtyBlDkPnhSEu6g52j/kWg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cv0Dl6JeifO8wIv9FSF/cIqpwukC3IkodiYf7RxIue8hP4zAyw6L6Ki2q4knZvoePPeoXpz+kEFQSSUteNwKAlHYRUKY86IUQ2Vn2r/2CS/o/8VtrVVWsMK6ViSyNti05TB4RqvxaOrW7YtPAAMEyUn/72XCz4IPMPKPHjM4D8ewt+E/UKokFkNfxGSyfGE21OhYGoajf/H7WyBsz7/o8CZSvMZw3hQWmY4vQ5A8Osb3q5lKvT1Wb4e1B++DD2flDP0HlVOik6D0qykXkA9hSrQvGY/SmEnRaWfL8vU8UJdmbRbGnobxvTILGDw/bWA3N0WXbEMh98iKq/lsPKWEaA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Krystian Hebel <krystian.hebel@xxxxxxxxx>, Daniel Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 27 Oct 2022 19:37:55 +0000
  • Ironport-data: A9a23:/79RFK+w+Wu7GNgWh6OiDrUDd3+TJUtcMsCJ2f8bNWPcYEJGY0x3m GUeUT2EbPuOZDOhedh1YI6z9E4OuZ+GxoAyTFdprCs8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOC6UIYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9Suv/rRC9H5qyo4mpA5ANmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0vxqLTxK/ OA1EQlTRT7ehsys35nlT/Y506zPLOGzVG8ekldJ6GiDSNoDH9XESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PtxujeLpOBy+OGF3N79U9qGX8hK2G2fo XrL5T/RCRAGLt2PjzGC9xpAg8efx3ymCdlLS9VU8NZAsQeZhXwOLSQ2RH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en-devel.lists.xenproject.org>
  • Thread-index: AQHY6juH8lNOUE9lmEK2XF+extU0lQ==
  • Thread-topic: Xen vs Trenchboot: TXT AP bringup

Hello,

Krystian is working on the next bit of the Trenchboot project's plans,
specifically getting Xen able to operate with TXT directly (i.e. without
tboot in the middle).

The way TXT releases APs back to the BSP is causing some fun.  All APs
release simultaneously, at a point of the BSP's choosing.  (SDM Vol2 6.2)

While the APs do release in 32bit flat unpaged mode (so much nicer than
16bit mode), it is still inherently a parallel boot, and the APIC_ID is
the only sensible piece of uniquely identifying information.


The simple bodge is probably to have a variable similar to smpboot's
booting_cpu, where all APs spin until they find their own APIC_ID.  This
serialises the APs around the existing boot sequence.


However, we're also very close to supporting parallel boot.  The
serialising point we currently have is __high_start loading %rsp from
stack_start, because that's a single pointer adjusted by do_boot_cpu(). 
Everything else, even the processor's idea of Xen's CPU id is derived
from the stack; specifically in the cpu_info block on the top of the
stack, which is prepared by the BSP.

All we need to do full parallel boot is an array mapping APIC_ID -> Xen
CPU index.  The AP boot path doesn't use the trampoline stack at all. 
Given some way of transforming APIC_ID into a Xen CPU index, the APs
could pull their stack pointer straight out of the stack_bases[] array. 
This would allow us in the general case to boot APs using an
all-but-self INIT-SIPI-SIPI.  (This is how firmware does AP bringup anyway.)


Thoughts?  In particular, is there an obvious option I've missed[1]?

~Andrew

[1] There is another way of doing this with multiple copies of the AP
trampoline at different positions, where trampoline_realmode_entry() can
derive the Xen CPU ID from %cs, but this is already horrible and isn't a
sensible approach to consider.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.