Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp295351lqb; Tue, 4 Jun 2024 11:31:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9RkH7stGvEjBIc1cXKZ5/mXH/VKobZttA5ptrlkeqZ03Y8gKAsuPF/1JRynql09+ktYBJaze9peX9BZ2qFdBFV2uX1YA+L8ZnNdHyUw== X-Google-Smtp-Source: AGHT+IF5/1unT85oP9KMvgeYg0EsWE6H1J9LDEAr1HAL0yNKYqwm365vAeuqRiDsGqUMiucLrQDB X-Received: by 2002:a05:6a00:4fcf:b0:702:60d0:2de7 with SMTP id d2e1a72fcca58-7027fba23e5mr6072240b3a.1.1717525914296; Tue, 04 Jun 2024 11:31:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717525914; cv=pass; d=google.com; s=arc-20160816; b=fkWKOByL/wSXW1WI+lUz515BUZ7nSlr8W7lYwk9I4c9Cg0n5IGeGThxjAQUUen1Dlx 7Gi4408n5NKKzWLFRJMH5TloQntzM0d+gsw+f2QM0qY9Vjzm6Tma6d1Bthdui+0P8A4/ PL8jXy0NX0sHbmyo2iUq2RsiKJ3NRTOCb93HWX8fM5joAOGnUhX22SZG2NnvN8gi1O5J W5w5kxch73bkK28Gx/5XsB9dbsm+xr5Z+Re65/VOMfnEPNk8gYFolC6YWFSXS2CO5O9F KsXws9D1DmqTl5XgKxVyGc9TS3ydIzxxTDG9e+BKVXRByODNpvP+rDtwflBJNZ9y7OFX 9UoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=meS63MnlFXX/qkUgab/1h3yFeTOB2Up4cbcyhv6eQF0=; fh=8SVu7eOiNfdn0J115vIqQmpyRYlobuU3R5X1PcNYpY4=; b=AyKWUAHpnyB5GCTLW8vMHhZbkekPd1EnfcE5Z9i2XtWTgJ6bSynBx0ZpIe41WJNND/ ZS8YXfVpFQwcLyGD1/tXfaFk14cd/Hrxv9FDqPTjML43KcqIbV7o67WUA8Sz768uKLtE MdOdhld1U+N5wNmvKwn3QtkQ1+3EEbimjjtYIHjFqP2uJtX+UusJRi+mBpLKBi2gCZqn xziwrY5Hl3OV808E5B/g98VHvn3AYKlLRxJSDkJgQgazEdQ924ox5eD0eo3ghQ0KVFUc cKIeGLqyZ8V5BHp0QXFWKmfnNLXrtcZsNhKPxTPXk2TyvJLH2xir4cw8igTZyWuYsx4B AEcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=Qcd3QTnu; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-201226-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-70242c29c7fsi8623824b3a.299.2024.06.04.11.31.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 11:31:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201226-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=Qcd3QTnu; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-201226-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B302AB2388C for ; Tue, 4 Jun 2024 18:06:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E446314A4DB; Tue, 4 Jun 2024 18:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="Qcd3QTnu" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A40F4149006; Tue, 4 Jun 2024 18:06:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717524392; cv=none; b=F42oYbWXWDS8TAhusjENPn8h95SXoN8bWrKuA08Q7QfShkXHdlO9rFXKojo/hsv4secAqpRFin0+BpTNh93dtxIN3WY6N4pD9qnogpmF3PRBlkgVKiq9UFg0Yajc90QE+2X+VSWFUfqzOnUSqYE5DELM1VUEFNaEHC1XlpgZw/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717524392; c=relaxed/simple; bh=wO7W7vb+/AxcklDnL0MSQsYaiZgoy9/y22Xrp2mnyfg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ejAPPvsJ8qtDaN7FkObSuqYnEwRn/ONIbsw6vqoWcofpbhZCIZqVTChAon/oFrZqmrSDrF1XwKeZfsWbsgN3EGU6eO+dcTFrBXfgqL67pahudy+oLzn3hKzDZci7rMqOZOJVa9tbhkH3BOgLxbMUN6IwTGhEjJ9qFLiRBCjtpbc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=Qcd3QTnu; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 0479840E0081; Tue, 4 Jun 2024 18:06:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aODJicEVTnQO; Tue, 4 Jun 2024 18:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1717524384; bh=meS63MnlFXX/qkUgab/1h3yFeTOB2Up4cbcyhv6eQF0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qcd3QTnuRZDQQm/WVb/kDGKGIpKkoDMDIl29qUOVk6IaxfBNHQnzuQDtyt3xEbmAH IOM9C4JdKAGGTQXzVzIzefFqProE8Rt4rDQVjOV9kNQF9DUtTllwV+9FLs08PyBlGY q+bJelC25FNaCJkKW857MzL7VncyvOyYS6aCpZhFHUmQ1lW7V5RmvTWjXUZDfw3k81 TNSnu8YrHoI2PL8KtLePPs9P3iF3SPGJWtYUbpeeTnafko0PVz65UuMt9VtWA5pjcI fdVZlnTjckoOiFrxcmVsoYv49oM6R+GqdtVlQtmhZfJvgFws8n0ofh42pG13ggDO+Y D7twSe/5QDvNqlY9hRtyqNJn9uqtUc7WVSQjWvLIgNEYgiCAPvTIiFpbOkmMzrUrp6 MeG7p3zMGl6w7Z0FM6ibJvMdlW4l3wMlZTN57RvoXToXJnBELOqoYv7KLTY1s5InD+ bOdkt8HsRuCXWXLxgAz9NkFSJzI8IQK6jYt/lh6FhwqBo5Zbh2KO9ZMbvmUqqGtAY+ VMk0ek/yLx7IS7AHpI/CfdH6AXooAyDqNwTLcQjEpmipTiAwUA9BmVhOt2MPqCP5/e DbnB9bTDYGSNTsIJk7mxnKbAB7Du7Rfm+s7W5czyESBY91PK4AlHZ9QnV2JDOKUDyi 95STKxzaeIVOQ4XnMKySMkIs= Received: from zn.tnic (p5de8ee85.dip0.t-ipconnect.de [93.232.238.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id CCCBA40E016A; Tue, 4 Jun 2024 18:05:55 +0000 (UTC) Date: Tue, 4 Jun 2024 20:05:54 +0200 From: Borislav Petkov To: "Kirill A. Shutemov" Cc: Dave Hansen , adrian.hunter@intel.com, ardb@kernel.org, ashish.kalra@amd.com, bhe@redhat.com, dave.hansen@linux.intel.com, elena.reshetova@intel.com, haiyangz@microsoft.com, hpa@zytor.com, jun.nakajima@intel.com, kai.huang@intel.com, kexec@lists.infradead.org, kys@microsoft.com, linux-acpi@vger.kernel.org, linux-coco@lists.linux.dev, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, ltao@redhat.com, mingo@redhat.com, peterz@infradead.org, rafael@kernel.org, rick.p.edgecombe@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, seanjc@google.com, tglx@linutronix.de, thomas.lendacky@amd.com, x86@kernel.org Subject: Re: [PATCHv11.1 11/19] x86/tdx: Convert shared memory back to private on kexec Message-ID: <20240604180554.GIZl9XgscEI3PUvR-W@fat_crate.local> References: <20240531151442.GMZlnpYkDCRlg1_YS0@fat_crate.local> <20240602142303.3263551-1-kirill.shutemov@linux.intel.com> <20240603083754.GAZl2A4uXvVB5w4l9u@fat_crate.local> <78d33a31-0ef2-417b-a240-b2880b64518e@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Tue, Jun 04, 2024 at 07:14:00PM +0300, Kirill A. Shutemov wrote: > /* > * If tdx_enc_status_changed() fails, it leaves memory > * in an unknown state. If the memory remains shared, > * it can result in an unrecoverable guest shutdown on > * the first accessed through a private mapping. "access" So this sentence above can go too, right? Because that comment is in tdx_kexec_finish() and we're basically going off to kexec. So can a guest even access it through a private mapping? We're shutting down so nothing is running anymore... > * The kdump kernel boot is not impacted as it uses > * a pre-reserved memory range that is always private. > * However, gathering crash information could lead to > * a crash if it accesses unconverted memory through > * a private mapping. When does the kexec kernel even get such a private mapping? It is not even up yet... > * pr_err() may assist in understanding such crashes. "Print error info in order to leave bread crumbs for debugging." is what I'd say. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette