Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp280880lqb; Tue, 4 Jun 2024 11:04:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9Oqigj2x6yIlNQQWGAxKqqdVloDrr/AjbNsbaB569i+uamoslKfgYFNFEgzLU43mPZJjLW0IFmRwd5w85s5O9DXwwFJ7uBrAtwIh7nA== X-Google-Smtp-Source: AGHT+IEvLEkZ1UE+0sGz3NE0rufS46NnH550i8OuqU+85erPcrn5JIaETzc/UQ/rVECeGK4qDXcu X-Received: by 2002:a05:6a20:1584:b0:1ac:3d3c:c1e7 with SMTP id adf61e73a8af0-1b2a2bf361dmr5330483637.12.1717524275958; Tue, 04 Jun 2024 11:04:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717524275; cv=pass; d=google.com; s=arc-20160816; b=04dDE7EOd9mxiMUvRKdrh2Zl7+mHrAVSAEdgmpVCeSNgXB2Hrq5D1NkHfm9R1p6+GL f32TaN2u5mxFUwNlmvhlKuaXIIwTDYp0v9cgJsU3MK4nkkuKcQ4WtZTt7CxH5i0a2/Np Cs6AENIKOkah3G6nXqwXCkbaIrjQq39X6eXehHE3gzv1cDgOuq1Ih1nq/Rhz2yX6qEu5 8O0qD3uXOYPceAmHHK1LlgHP3wQssUcQ3DhlcmJ3VMCvuNkYp8g7IFRAcQM6DTI/yfWz 0MWi0aoXCtVfdZQab9xUWzX1wKSY71fH8+jC+xoR1xREla3PPiP9t0uSNI+j6t7xL38W AHYQ== 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=GWrStZRjxuM92GFSBVDFKrufEIiFs1jygww4NQi9psE=; fh=dx9n0/v/qaOtVxjiDcZg78mf4LinLMYi3T5/oLqee7s=; b=u6SJt32KmRxG3wZXK59eQdmfO48Z0MgO5cgGnF02IdsNEQKnJF5sIpGrn5L8VNX09N kt5S3ud4kehQipDB4x9Iw3t5Z/AuC0gRIqIsu3h0hwuPTzytTFfupHdwxL3/Tjz55zMr Ge3HFLZjg/cIn9tWyQ/8lRXx1a3oSG7WPOTKiQ3YXAPy2klexY5eSftfRXLOCij+NPtF dZz4YbnQBvkw0CSeyYqbX6C19i5I7Ijg9NBxq+qu1ODVVirBAcr1dYxw+1ViIx++Y3Bj jaG/veboQcbOHa0j4g5C01J1yHZvMjvHUKEGbdsZZ4PPi7Co7tGQ6x2nuf7lDkFj21Iy L/hA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=DLU+I6Sn; 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-201223-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6ca8bd75fd5si5422272a12.893.2024.06.04.11.04.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 11:04:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201223-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=DLU+I6Sn; 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-201223-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201223-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F2F2128499D for ; Tue, 4 Jun 2024 18:03:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAF6514A4D1; Tue, 4 Jun 2024 18:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="DLU+I6Sn" 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 8674914A09E for ; Tue, 4 Jun 2024 18:02:49 +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=1717524170; cv=none; b=XfDx6M4ZddyHPIKORNXRYnBkPhoeZfxK8Rq57WEQDj0ht7H3aX5EC3g4yaMC9HH5NPZ3JEZAc06Xrw0/LKNogN1xZOGSm0maIAhH2bdYfF1KNEWJRdaHuMNOim36WWGnYWV0XrTKdBZzhXG0XZ7JGol24+zlUKYqUSP5h4j77n4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717524170; c=relaxed/simple; bh=Gb/snQsBVNfy1o6BzXAP6qQrBBYg5gFWkOAd71sStzQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XOCfzdqHfjdAM2BnrIoktGL5GfsABHLjNZqgMobHxFAci0U74hENnmjvn3fYi5zn/rYWCp8F6j6u6s65PJ2X8g5tnhGNQIAS82FuO7mN6nijVmpe6KXneBQgpjXYkOd+eV+IchRCWs+NrfU4jeeD+0WoidYfmqvJ5Se+bJR9JVQ= 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=DLU+I6Sn; 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 1992040E016E; Tue, 4 Jun 2024 18:02:47 +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 cMhfAxGU5kPl; Tue, 4 Jun 2024 18:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1717524163; bh=GWrStZRjxuM92GFSBVDFKrufEIiFs1jygww4NQi9psE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DLU+I6SnPlxE3Vi8Wxe3ScNZB3EkLajXpOeoexSJ3FsF11DOmq/kF7mUQWCTh2ZZU 9zC+xV6TAt4Ah13vFL2KhnpeImQh5VqXLrXNCRxgdqmPuwF/2lM+rMy/J4yj4Iozin ZxTnySap2CgtkGMC9pdh3ly0va5Ab2W92LnO+AaAjUsYECWulD852NoRmi59uFRFfU 72PgimdmMwcBk0tvmwsfVjcFEczVP9MQnuu4DKwdb8Sc7lOB+dIw/7406ijBYvLDS3 b07CVT9qArX/RZjTB+qzs9rI0AfKYtNuRqP+YF+HaJPYra36zyWQ2mAMZE0hpL/ZAc BPWBKnbypK0uhFRN23NWzm/KCqpEWOShUSmPDaIGJebyCKUafVrsVelPv36dLxzxH7 uvDy4Lm1OXwjTEnCvLQVj+3ePXJ1qXVcnsEE4Ie0oO0I0A7dhS1FRyuHujx94CEY+p ZlAsAnS98zWsf5NoLQSrMoJ548mt0Hu8T6gCJN1CLkwqcX5ErL2aTWMb8iIXGlZpxQ DTTlQ7UKT4e2wsy/0C9wHlbpIynoCuu3EpPYAu9jiQvD8OWDe3+nypU5dr7ChFcwLp eg1R8UeQgPrdpM4heVAXU4L3nloB0w/+1MUkg/RNSYuKWIjoRUPTgMUrp2BvirSN17 C96SzSZAINkxGsML4ERfHRHc= 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 B340740E016A; Tue, 4 Jun 2024 18:02:13 +0000 (UTC) Date: Tue, 4 Jun 2024 20:02:12 +0200 From: Borislav Petkov To: Dave Young Cc: Mike Rapoport , "Kalra, Ashish" , tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, rafael@kernel.org, hpa@zytor.com, peterz@infradead.org, adrian.hunter@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, jun.nakajima@intel.com, rick.p.edgecombe@intel.com, thomas.lendacky@amd.com, michael.roth@amd.com, seanjc@google.com, kai.huang@intel.com, bhe@redhat.com, kirill.shutemov@linux.intel.com, bdas@redhat.com, vkuznets@redhat.com, dionnaglaze@google.com, anisinha@redhat.com, jroedel@suse.de, ardb@kernel.org, kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 1/3] efi/x86: Fix EFI memory map corruption with kexec Message-ID: <20240604180212.GHZl9WpAfNVERTjMqw@fat_crate.local> References: <20240603085654.GBZl2FVjPd-gagt-UA@fat_crate.local> <8e3dfc15-f609-4839-85c7-1cc8cefd7acc@amd.com> <1ef36309-8d7f-447b-a54a-3cdafeccca64@amd.com> <20240603144639.GCZl3XTwmFHwi-KUZW@fat_crate.local> <20240604094358.GBZl7h3otTCYJ5rkkt@fat_crate.local> 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:09:56PM +0800, Dave Young wrote: > Anyway there is not such a helper for all cases. But maybe there should be... This is not the first case where the need arises to be able to say: if (am I a kexeced kernel) in code. Perhaps we should have a global var kexeced or so which gets incremented on each kexec-ed kernel, somewhere in very early boot of the kexec-ed kernel we do kexeced++; and then other code can query it and know whether this is a kexec-ed kernel and how many times it got kexec-ed... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette