Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp246761rdf; Tue, 21 Nov 2023 01:10:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcVf7ArlhpqudmFHPX05sWGxvzGhxw2ElJSulh8jCL2eTLmpCwXpcGN+M5wcouQhu1uUYm X-Received: by 2002:a17:90a:46c8:b0:27c:fa10:fc82 with SMTP id x8-20020a17090a46c800b0027cfa10fc82mr8548764pjg.28.1700557847390; Tue, 21 Nov 2023 01:10:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700557847; cv=none; d=google.com; s=arc-20160816; b=RhtzgdkvVKv0YmOLOR/jYnuKDEQNbhwEFMn1k61ZZEd4J+sdjsaX9072aPOj9RO6us xdePZH177FTyZ5IKIoXUJlkTuq+R9V3XYwcxGVOd78w2FxYTAA37U4uyo1pQK7myd5PS zBCl9gF5bpPXHZlJ6RHPd+pdkX8fS0Q0bxPMN0YyIDGPs22YYC9YALJh8iVLUVFYf/Jc gzKWto5XWqb4Bgov4e76tVutCzmLuIX8pBhVcvm0TnShpyW1RHce2gaThxjnGfknrRHF TT6yzNndKbjBGyNlnnB04YlQxYs5V/UcvDp+9NVdQOuBRpXTzagl5csW/zUH2SYC+sLm ncUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=l8VqgPmAQ7EIQTV/xERi+bscdvu2asecBTlQhyi8tn8=; fh=IrKYjvXbkn44WL1hQWAgrAoGInBfPB4JMhw9p79i2p0=; b=JpuKZhsqi+fJ5ROZYXPfW36LJuKcdX8NcGO1deBKpLkEBAVXyjW4ujim+LM2JAoqA7 VQKqqoIOg34hlIKnRONakynoljUSADwJ+83TrA7ox+ThGSUpsjnPWEMYf8km92G64gJN Qj/mWvYK+TcuZThT4TP2jdMm0D4L7w/LUpAAOL5QaUlTYrn/Q9llTcTYtuLxxOBubDcl xJrF1So1IiJUw+aAKkiKPrAjpjIBguJfstf4ctzOeBy+I7UdScfeDCHYbYsPFENwtfNR 75GuzbgyVMHIA1a808sqU4+nkCnOCWR5OeoZ5KLFJtBDzMEEgQe0Wsv+y1nn4tywJpIe o9iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Me/MYWes"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id qj13-20020a17090b28cd00b0027d60ad5caesi10638913pjb.110.2023.11.21.01.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 01:10:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Me/MYWes"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 086ED80E0730; Tue, 21 Nov 2023 01:10:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230127AbjKUJKq (ORCPT + 99 others); Tue, 21 Nov 2023 04:10:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjKUJKp (ORCPT ); Tue, 21 Nov 2023 04:10:45 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7A68E7 for ; Tue, 21 Nov 2023 01:10:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700557840; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l8VqgPmAQ7EIQTV/xERi+bscdvu2asecBTlQhyi8tn8=; b=Me/MYWesMvAPQ4EXrw2ESgW6F8qtyQcH5dQGnOs9Zyobe2OwrgqJmSTVVkJAjb4W/a/QNn CO0eUUHPDwl7/UQOT2IfP+hnHfh5urCcUq2TVwrO9+Dh+IsN+qHORttsqK/a8dS6CIy60E XhxxXYxDuFpOctFBOUbwtjDyOBdwvd8= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-399-CXoNiWknOUmDbWKqhEa7RQ-1; Tue, 21 Nov 2023 04:10:39 -0500 X-MC-Unique: CXoNiWknOUmDbWKqhEa7RQ-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a02d1c4adc9so8328566b.0 for ; Tue, 21 Nov 2023 01:10:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700557838; x=1701162638; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l8VqgPmAQ7EIQTV/xERi+bscdvu2asecBTlQhyi8tn8=; b=WiFnatLrh+aK6gB+PLIKgBI8zwfnTFD5RJmWcABiCtt9boMcD/SWn59r6K3ibbGdvq 0Z8wdbTFGuWJH1T7KHFKt0DdeFt0xpUfCq1QvfmmXo4pOtEeybEj/nH0yTtZKCMd46eH przSh9hkC3GKhXoOYvRq5q2rQJ6X89ekW00v1LjqZtiB8hHzZqfvjL9xYmwuuG+jO2At +JcpQfiOx8P2BwaaEl+M5IwvqLq/0z0KuXsMGhRdu6UaAdJqgJaToY0ernyClA1RfhWZ kT0W/yU924PQwd4GYOhbpYAB+uTUqBysBn8FV6vln3fCG27RKzop3kj/W2neUu2tkFQh Uqyg== X-Gm-Message-State: AOJu0YxQWMzNzhjcQUjQq6Q3m/NqWoXEt7IrllWFDqNx6J2OVPr5S32Q JQtd0sH34O/AOWzEHDzWuL9PTvPtWM8YqjFQeRl822uKo9VREGL/60d94o55rYaslmko8zruK9K ++bQsMrGiHwYUj3V9Npr+UlTXDVTENt6JqJNdvBkH X-Received: by 2002:a50:8d11:0:b0:548:4f16:ecfc with SMTP id s17-20020a508d11000000b005484f16ecfcmr1597922eds.0.1700557838113; Tue, 21 Nov 2023 01:10:38 -0800 (PST) X-Received: by 2002:a50:8d11:0:b0:548:4f16:ecfc with SMTP id s17-20020a508d11000000b005484f16ecfcmr1597896eds.0.1700557837682; Tue, 21 Nov 2023 01:10:37 -0800 (PST) MIME-Version: 1.0 References: <20231115120044.8034-1-kirill.shutemov@linux.intel.com> <20231116125612.daxettqcapled7ac@box.shutemov.name> <20231117124748.umfuc3no2qvh4shj@box.shutemov.name> <20231117154632.zvi6g6lblmtvikzt@box> <20231121084321.t44ntae5ohslgrme@box.shutemov.name> In-Reply-To: <20231121084321.t44ntae5ohslgrme@box.shutemov.name> From: Tao Liu Date: Tue, 21 Nov 2023 17:10:01 +0800 Message-ID: Subject: Re: [PATCHv3 00/14] x86/tdx: Add kexec support To: "Kirill A. Shutemov" Cc: Baoquan He , Thomas Gleixner , Ingo Molnar , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 01:10:46 -0800 (PST) Hi Kirill, On Tue, Nov 21, 2023 at 4:43=E2=80=AFPM Kirill A. Shutemov wrote: > > 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 w= ill > > > > 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 multipl= e > > cpus are specified; > > That's expected. Until you have new BIOS. See below. > > > 2) kdump kernel need more crashkernel memory to boot up, > > crashkernel=3D512M 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 r= esult. > > 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 i= n > kernel command line). > > BIOS folks work on proper patch, but it is not ready yet. > > [1] https://gist.github.com/kiryl/e1dc1719e0c990b3ceee5d8de8dbf332 > Thanks a lot for providing the BIOS patch. One more question, is the patched BIOS image for the host physical machine or for the tdx guest vm? Thanks, Tao Liu > > 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 > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec >