Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3326312rdb; Thu, 16 Nov 2023 06:45:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGyt6yO5CovuxTfGdHi8FiTF1F7GfvxKYNCtFm8UxZvajTOOAOePWFdJV38IlkumKU8fjr X-Received: by 2002:a17:90b:380c:b0:27c:fafd:f785 with SMTP id mq12-20020a17090b380c00b0027cfafdf785mr14689002pjb.47.1700145950263; Thu, 16 Nov 2023 06:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700145950; cv=none; d=google.com; s=arc-20160816; b=w/H8GBy9vtjINSsQaxvvQe8M1DcfC/nHmlmyur2INSSV9TKnl1PUH1wiWYBftN5Y4S crS/mZVGHXk+KP8inAWWX5LkQMpg0jsPyKpQ8Ze4uU5DMrisBZ6nrkmLkTQB7DBxME5e 7Vl3UqOppkCxMaXQj6Biy5xcfGdEvtZjHcc4ian6SFQTJ7yOkxTmpTgwNSJ8kELbArkE aMhQ2BL3fjEHGuuUUX234voHDv4+0vISokbMVFplbAc/FEO99QTmofwzcOUyK4rzeD0g nvoSQe6Az+WRbmbRw1W9/DOye8rFzpOYgGM9FjH9pvRsrXXCbA8d3iGNAgK2x+uxO28j GG1w== 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=SvB9iGs9vD1rRk7cd40qT87db5HVxelOOnL3if3kxBw=; fh=n4OnCdto9ks8g3/ozZ8KTfkEmd/DPhDnPmomDuJFCko=; b=WZw4RWXm+W/VsyhT4kK7XxXgue6cax9EGg48dtJBmULwfUyy6spvF19e52U/Uz+QtR ZFDCEbyo46h2Abguc02yLq63mmqJBmMQ8IzCdhMG8XmAZhi8IQ8XobHyevvES8DA8DZe 5V3/YJuSfSoJ/X7lphhq/qiKGAlmHaH1W5lYEIRBHvy+FlkheqI1C0MRZtu4UgNxtLws I9HuYZa1yU2zIAeL623MF7+fSwAmcrsx89qkVaoNF2Gs2i8lRKthoVHfK6CSrOivHw1m rgatY23oTDoSpgyef6CArWA8AJnCFccEagZwyubbnk4wSYgTnbXngh6yAw2uo4V/9/vH yugg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XsP0MUr4; 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=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l16-20020a17090b079000b00280216d7e28si2157824pjz.45.2023.11.16.06.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 06:45:50 -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=@redhat.com header.s=mimecast20190719 header.b=XsP0MUr4; 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=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8EF30807D691; Thu, 16 Nov 2023 06:45:47 -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 S1344251AbjKPOph (ORCPT + 99 others); Thu, 16 Nov 2023 09:45:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231269AbjKPOpf (ORCPT ); Thu, 16 Nov 2023 09:45:35 -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 28E68130 for ; Thu, 16 Nov 2023 06:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700145931; 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=SvB9iGs9vD1rRk7cd40qT87db5HVxelOOnL3if3kxBw=; b=XsP0MUr48hvJMqaopJkmpBUVWaP4+4pcwIeiiUs+uaDh1xBMXUiXOfK8hZJY6PRIztaXGg LJHAbyDS5e2DdHuK6llihDI1sesAtcb5ke6NTGu5KdmY4sAbD9wJWm9zai8/L/1gGQO7U1 dylDCisC153tiRZTTysLvJkvsdhoLBI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-509-r9EpGFd-MUK_I6xzkaYdeA-1; Thu, 16 Nov 2023 09:45:28 -0500 X-MC-Unique: r9EpGFd-MUK_I6xzkaYdeA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F7213806100; Thu, 16 Nov 2023 14:45:27 +0000 (UTC) Received: from localhost (unknown [10.72.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A18F1C060AE; Thu, 16 Nov 2023 14:45:26 +0000 (UTC) Date: Thu, 16 Nov 2023 22:45:23 +0800 From: Baoquan He To: "Kirill A. Shutemov" Cc: 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 Subject: Re: [PATCHv3 00/14] x86/tdx: Add kexec support Message-ID: References: <20231115120044.8034-1-kirill.shutemov@linux.intel.com> <20231116125612.daxettqcapled7ac@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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]); Thu, 16 Nov 2023 06:45:47 -0800 (PST) On 11/16/23 at 10:17pm, Baoquan He wrote: > On 11/16/23 at 03:56pm, Kirill A. Shutemov wrote: > > On Thu, Nov 16, 2023 at 08:10:47PM +0800, Baoquan He wrote: > > > On 11/15/23 at 03:00pm, Kirill A. Shutemov wrote: > > > > The patchset adds bits and pieces to get kexec (and crashkernel) work on > > > > TDX guest. > > > > > > I finally got a machine of intel-eaglestream-spr as host and built a > > > tdx guest to give it a shot, the kexec reboot is working very well, > > > while kdump kernel always failed to boot up. I only built kernel and > > > installed it on tdx guest. > > > ------------------------------------------ > > > [ 1.422500] Run /init as init process > > > [ 1.423073] Failed to execute /init (error -2) > > > [ 1.423759] Run /sbin/init as init process > > > [ 1.424370] Run /etc/init as init process > > > [ 1.424969] Run /bin/init as init process > > > [ 1.425588] Run /bin/sh as init process > > > [ 1.426150] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. > > > [ 1.428122] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc1-00014-gbdba31ba3cec #3 > > > [ 1.429232] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 2/2/2022 > > > [ 1.430328] Call Trace: > > > [ 1.430717] > > > [ 1.431041] dump_stack_lvl+0x33/0x50 > > > [ 1.431581] panic+0x324/0x340 > > > [ 1.432037] ? __pfx_kernel_init+0x10/0x10 > > > [ 1.432629] kernel_init+0x174/0x1c0 > > > [ 1.433149] ret_from_fork+0x2d/0x50 > > > [ 1.433690] ? __pfx_kernel_init+0x10/0x10 > > > [ 1.434277] ret_from_fork_asm+0x1b/0x30 > > > [ 1.434850] > > > [ 1.435345] Kernel Offset: disabled > > > [ 1.439216] Rebooting in 10 seconds.. > > > qemu-kvm: cpus are not resettable, terminating > > > > Could you shared your kernel config and details about your setup (qemu > > command, kernel command line, ...)? > > We followed tdx-tools README to setup the environment and built host and > guest kernel, qemu command is as below. I copied the > tdx-tools/build/rhel-9/intel-mvp-tdx-kernel/tdx-base.config to the > latest upstream linxu kernel then execute 'make olddefconfig'. Because > your patchset can't be applied to the stable kernel with the 731 > patches. > > cd /home/root/tdx-tools > ./start-qemu.sh -i /home/root/guest_tdx.qcow2 -b grub This is the qemu command when execute above line of command, just for your reference if you happen to not take this way. [root@intel-eaglestream-spr-03 tdx-tools]# ./start-qemu.sh -i /home/root/guest_tdx.qcow2 -b grub WARN: Using HVC console for grub, could not accept key input in grub menu ========================================= Guest Image : /home/root/guest_tdx.qcow2 Kernel binary : OVMF : /usr/share/qemu/OVMF.fd VM Type : td CPUS : 1 Boot type : grub Monitor port : 9001 Enable vsock : false Enable debug : false Console : HVC ========================================= Remapping CTRL-C to CTRL-] Launch VM: /usr/libexec/qemu-kvm -accel kvm -name process=tdxvm,debug-threads=on -m 2G -vga none -monitor pty -no-hpet -nodefaults -drive file=/home/root/guest_tdx.qcow2,if=virtio,format=qcow2 -monitor telnet:127.0.0.1:9001,server,nowait -bios /usr/share/qemu/OVMF.fd -object tdx-guest,sept-ve-disable=on,id=tdx -object memory-backend-memfd-private,id=ram1,size=2G -cpu host,-kvm-steal-time,pmu=off -machine q35,kernel_irqchip=split,confidential-guest-support=tdx,memory-backend=ram1 -device virtio-net-pci,netdev=mynet0 -netdev user,id=mynet0,net=10.0.2.0/24,dhcpstart=10.0.2.15,hostfwd=tcp::10026-:22 -smp 1 -chardev stdio,id=mux,mux=on,logfile=/home/root/tdx-tools/vm_log_2023-11-16T0658.log -device virtio-serial,romfile= -device virtconsole,chardev=mux -monitor chardev:mux -serial chardev:mux -nographic char device redirected to /dev/pts/1 (label compat_monitor0)