Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp235425rdf; Tue, 21 Nov 2023 00:43:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8NaI0mzNazwRWFO8tvi1v8/09+7a8l/mu+f/9koEvciaEqu6j19eZtXZ5zgdy+mw31SqD X-Received: by 2002:a17:90a:183:b0:280:2609:6d51 with SMTP id 3-20020a17090a018300b0028026096d51mr7333796pjc.18.1700556235127; Tue, 21 Nov 2023 00:43:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700556235; cv=none; d=google.com; s=arc-20160816; b=Kp2DpMdnR951yl0lMTcE+OJJIdQFKJPuEpbV7iZ/kOTaPEicjcBU3Roqfk6w+J+eOO n7cac9BgYfpPnP1tTAMu2vhsPfgoTYHgbXyIvrxR6iMRgpF8mBXYWweuc6khqADU7F1F My5UVbpXtJoJl/ixBpy5rGi6+Fo3wzz1wnbfUSREepuapOrPD0XQlbdxdvSgAov/urBG eeKB0y9gwHNy/tT4QZG0KITgNhcxIqfi3CxvNTX0VC9aS5UveHBuycoQ/u/Vc5fI6Lkl iXv3297E2hI5Pf9ob74YBqq76LpvXeVReWyBHDfE9DIhQFZvkWM3WHeA9cLQTp8y8Dt1 2+Cw== 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=s1drHgpEZjg94OvDi1vTCbwo5nwnSA02hwqV+tuU278=; fh=iOZghAKC083os1BXdNj8wCoLtfyaNfpkyldPXRaZZno=; b=Iz/YIPnMdJefeZD6INBU/2+x8PfGhgqDLJqU4LjCNNo9af3v44wbCJsqCLkyPxPqFx fM1r45NGDZwm6Ctr/0MdJ0JXQyngpjBDAZnDbewr9wMcs32PyxhrqMrnrxZd1yQ+rowE bBuizCbnbBkekHLSZWB1jz0ujuWoVQLQuQcnDXJc5IJcbtvdnBEn36TXJa7iFEhSGo8G VmqdHWRv967NDRpu2I9P23UYD0ELR91CZAV5YrfYdKMFpLFOtsE4hx33Wkar1ZtBPBFV Fc+xa4Q1nc+eK95VEHjgSXldrCrKTvhSzf7TczlvyYjImz5zC2YSFw0SyDExp+27YSli TLgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UWgXUeZP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id rm14-20020a17090b3ece00b00280277d721dsi10308319pjb.83.2023.11.21.00.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 00:43:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UWgXUeZP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 51F88802F0A4; Tue, 21 Nov 2023 00:43:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbjKUInn (ORCPT + 99 others); Tue, 21 Nov 2023 03:43:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbjKUInh (ORCPT ); Tue, 21 Nov 2023 03:43:37 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB41D4B for ; Tue, 21 Nov 2023 00:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700556210; x=1732092210; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ZvXdjvxl4OFx/rOJ2HyXP09UhjsWaOEHhJzpQc00a48=; b=UWgXUeZPPDsQ5cxEDHQLg3nDj+BlYtgr6YnEhGKGoRpT6ALE1fU2UaAL 4+Dr9wH0/dsRa4lLua2WQ5r+hS7YoaAgsHu6LwofrGX6u0yGtB7pb+LmH RtHPUZAYYILtTwUyfTqANvUkc+mciN0PvYxm/dwMVZPkf3XzMfvCOFKnn FLwGzsxEQzS+IOg3TyD9YoHhL4X6JSqPXugsGtZrPvyW+l4yFcMqlVG1s 106tDb0uM67aznLNbJY94IMPp8YArVN/QJ3ZbkdJQlCASHLgtvAhz2V0F SxRKgdbgOamtcYmDeOMRQSzzmJvvSrTdTXGqSgPyp0fsqmD8nqX55mxJB g==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="4919947" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="4919947" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 00:43:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="1097998545" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="1097998545" Received: from ikosarev-mobl1.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.40.84]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 00:43:24 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 7AD2510A36E; Tue, 21 Nov 2023 11:43:21 +0300 (+03) Date: Tue, 21 Nov 2023 11:43:21 +0300 From: "Kirill A. Shutemov" To: Baoquan He Cc: Thomas Gleixner , Ingo Molnar , ltao@redhat.com, Borislav Petkov , Dave Hansen , x86@kernel.org, "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Kuppuswamy Sathyanarayanan , Elena Reshetova , Jun Nakajima , Rick Edgecombe , Tom Lendacky , "Kalra, Ashish" , Sean Christopherson , "Huang, Kai" , kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCHv3 00/14] x86/tdx: Add kexec support Message-ID: <20231121084321.t44ntae5ohslgrme@box.shutemov.name> References: <20231115120044.8034-1-kirill.shutemov@linux.intel.com> <20231116125612.daxettqcapled7ac@box.shutemov.name> <20231117124748.umfuc3no2qvh4shj@box.shutemov.name> <20231117154632.zvi6g6lblmtvikzt@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 21 Nov 2023 00:43:52 -0800 (PST) On Tue, Nov 21, 2023 at 02:41:08PM +0800, Baoquan He wrote: > > > > > > Still failed. And I found the normal reboot does't work either. I will > > > do more testing tomorrow, e.g use the tdx-tools's own rhel9 kernel > > > config and rebuild, and update host kernel too. > > I did more tests, resuls are summarized as below: > > 1) kexec reboot works, but always fallback to 1 cpu even though multiple > cpus are specified; That's expected. Until you have new BIOS. See below. > 2) kdump kernel need more crashkernel memory to boot up, > crashkernel=512M works well in our case. I guess it is due to SWIOTLB memory which requres at least 64M. > But it failed in vmcore > saving process, either makedumpfile or cp can't access the 1st > kernel's old memory; Will look into it. > 3) Normal reboot always failed; It is expected. TD vCPUs are not resettable. So we need to destroy TD and construct a new one to emulate "reboot". I guess we can try to add some glue on QEMU side to make reboot more seamless. > My colleague Tao helped to double check this, he got the same testing result. > Plesae > 1) what can we do to enable the multiple cpu support for kexec reboot? You would need a patched BIOS image. I've hacked one[1] for my testing. But it only works if kernel runs in 4-level paging mode (specify no5lvl in kernel command line). BIOS folks work on proper patch, but it is not ready yet. [1] https://gist.github.com/kiryl/e1dc1719e0c990b3ceee5d8de8dbf332 > 2) anything missing to allow makedumpfile/cp access 1st kernel's memory? It worked before for us, but I have not checked for a while. I expected you've dropped my "if (crash) return;" debug patch I asked you to tested before, right? If not, failure is expected. > 3) not sure if this is particular case on the system we tested on. -- Kiryl Shutsemau / Kirill A. Shutemov