From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BF9EC48260 for ; Fri, 16 Feb 2024 15:38:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D11C46B00A1; Fri, 16 Feb 2024 10:37:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CC1C76B00A2; Fri, 16 Feb 2024 10:37:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8A186B00A5; Fri, 16 Feb 2024 10:37:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A765F6B00A1 for ; Fri, 16 Feb 2024 10:37:59 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 502E88013D for ; Fri, 16 Feb 2024 15:37:59 +0000 (UTC) X-FDA: 81798072678.16.823A91E Received: from smtp-fw-52002.amazon.com (smtp-fw-52002.amazon.com [52.119.213.150]) by imf27.hostedemail.com (Postfix) with ESMTP id 816AA4001E for ; Fri, 16 Feb 2024 15:37:57 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=amazon.de header.s=amazon201209 header.b=gmc3RLnk; dmarc=pass (policy=quarantine) header.from=amazon.de; spf=pass (imf27.hostedemail.com: domain of "prvs=769cabf0f=ptyadav@amazon.de" designates 52.119.213.150 as permitted sender) smtp.mailfrom="prvs=769cabf0f=ptyadav@amazon.de" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708097877; a=rsa-sha256; cv=none; b=HBbBf7C6skPQfg2imbtC06yNuS79r6YXI/AUYM4iXoqU6TkaoIO5pMnx+WU3jFliE7BUmK Dv6D7ZZzM4ws4vlzKpjTlH/ewP1SD/yJpGlPfcy8RFdFrheEJJ9hl/QrCpqLL3P1STxR1Z MqO749FewHAUessk31P8NuR/3YJ73l8= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=amazon.de header.s=amazon201209 header.b=gmc3RLnk; dmarc=pass (policy=quarantine) header.from=amazon.de; spf=pass (imf27.hostedemail.com: domain of "prvs=769cabf0f=ptyadav@amazon.de" designates 52.119.213.150 as permitted sender) smtp.mailfrom="prvs=769cabf0f=ptyadav@amazon.de" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708097877; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0cZh71B0l8IG4uZIp4OIszUKFw5xlrbFMIKov5F9rMU=; b=tytE09ePon+aHEZvzZFQAcsS9+DnBA+U0Y4mC25HqLD/WNua24/UxZBYaU3kyISX968i8V hpppENocOOpprVHuR5SJbSQr5xbms4z6bD3TE6htpUtXOboCfvof9RUYjwiwGWlLZ3OV0I Vbfl2CnqX1Le5zquKJJ1AmQaLOhlkwc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1708097878; x=1739633878; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=0cZh71B0l8IG4uZIp4OIszUKFw5xlrbFMIKov5F9rMU=; b=gmc3RLnki406KhSIyDzlrLXhs60xT4GU23LmmmnOWGxS4T6hfCDSu6pa x4grGGjjJtDqoVUkrGwxLWXfqw3psxUj5uVL5gDHk9fTh44/u4FX1NkDu qMGx5hYqrJ0TOoVk2d6GdC+2ak0L81wJQKP3gYHWKu6nH5sB+s5yKvnPQ 8=; X-IronPort-AV: E=Sophos;i="6.06,165,1705363200"; d="scan'208";a="613548127" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.43.8.6]) by smtp-border-fw-52002.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2024 15:37:56 +0000 Received: from EX19MTAUEC002.ant.amazon.com [10.0.0.204:15970] by smtpin.naws.us-east-1.prod.farcaster.email.amazon.dev [10.0.23.202:2525] with esmtp (Farcaster) id a4a5ea06-05a2-4ef6-b192-ef4a9bf9607e; Fri, 16 Feb 2024 15:37:54 +0000 (UTC) X-Farcaster-Flow-ID: a4a5ea06-05a2-4ef6-b192-ef4a9bf9607e Received: from EX19D008UEA001.ant.amazon.com (10.252.134.62) by EX19MTAUEC002.ant.amazon.com (10.252.135.253) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 16 Feb 2024 15:37:50 +0000 Received: from EX19MTAUEC001.ant.amazon.com (10.252.135.222) by EX19D008UEA001.ant.amazon.com (10.252.134.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 16 Feb 2024 15:37:50 +0000 Received: from dev-dsk-ptyadav-1c-37607b33.eu-west-1.amazon.com (10.15.11.255) by mail-relay.amazon.com (10.252.135.200) with Microsoft SMTP Server id 15.2.1118.40 via Frontend Transport; Fri, 16 Feb 2024 15:37:50 +0000 Received: by dev-dsk-ptyadav-1c-37607b33.eu-west-1.amazon.com (Postfix, from userid 23027615) id BFA7920CE8; Fri, 16 Feb 2024 16:37:49 +0100 (CET) From: Pratyush Yadav To: Alexander Graf CC: , , , , , , , , Eric Biederman , "H . Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Steven Rostedt , Andrew Morton , "Mark Rutland" , Tom Lendacky , Ashish Kalra , James Gowans , Stanislav Kinsburskii , , , , Anthony Yznaga , Usama Arif , "David Woodhouse" , Benjamin Herrenschmidt , Rob Herring , "Krzysztof Kozlowski" Subject: Re: [PATCH v3 05/17] kexec: Add KHO support to kexec file loads In-Reply-To: <20240117144704.602-6-graf@amazon.com> (Alexander Graf's message of "Wed, 17 Jan 2024 14:46:52 +0000") References: <20240117144704.602-1-graf@amazon.com> <20240117144704.602-6-graf@amazon.com> Date: Fri, 16 Feb 2024 16:37:49 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 816AA4001E X-Stat-Signature: butewptncwwwyge9wr74wymd3rm338pf X-HE-Tag: 1708097877-475116 X-HE-Meta: U2FsdGVkX1/7MtcNOCrD4BAzJ1kG04FODX7hGOk9AcOIe+o147YwQM4e7yrNjf0xHGoxi53u9fGBLKsfyUL5LuVbLuvM0GPMKGc5oRBGpxfq8KXiS+0+dLwyCnVYr/DSz+s5aD3yEa/dlLKNQzGWbU7CjIbU50APAUPZDhP4dMqC+MOOXuyYrhFwdF2ncHnpdbW4NK2KQrXu8fjEAOTHMs7QXP/z0h0dVX+a6ZzYRzMHp5MUhXeU5FtIwZEB29nmHocPaB7RFLoqdIl/8/9NuHT8UdbHcDrLKVd5vwlcFtx5go+KNZ0Dr+7e4BZwW8HyerzmZB0zCL3VEhvOe6gTQEZjkJwx7ctH0z9yRNVDmzucvozhDiBFMiELUkKuydow503KGY1/01Hqnyh5fZzGvESP5cmjWy4HYDaAP8apMtmXF5uJWy5tiW6ycmgIx3sEW2huopIuxJJMUgywPj51IvV1RTt/Ji+YAp2PoykOQXDJ7Y1CDAV4bi6iR3T9dUnDaKDf/QCBTfniKSH4HHNg66bEnvImI7YAPBWsjqBFHdisiFRhYK3fUK8Cof/j7lkV3lCLssU2r8kmj4EsXaJw2EfB7UvMSYLQgoWCi2iAJyDAIkBt508e5DBUa/Xi+4EgV6taaVuL6ukyyaGCrcDjSAlpPAgMLrVxy6iF82uCxHrKs5n7z0u7qOFJ/UceY+f012Ur2OdRa1fW24E4qfySKDgUnjT9itNGE4CaP6VIcSqyazSgUdSerpJHJZkIwg9tsLd/dSDP4QrD7U1kVad48TjE8nymE7wq9aHc+xBD/wyLAfLD/gMtdrCdJliydP1o8y6ZmLaS/K6hc6Rw06oPCtQ9yTezthlF2NyM1FA2C1iMnSMIxjlhN2YEHr5XvQnXB+O5DwgrQItbkjdouSvBCPdKAKYvt5H9LfxfPUskKs4hQIHyoc2SO/k5lMDdxAS8blFCP4Pfkcg1A/Wf66A R7c5HLWe ETDZgM/ntF7q5puGNR7jTttpCzxGJyVuCn+0S5TYwKbRsTxfxV/jqhiqYeBKLO/cvHgIlGa6xvNq8MEQLEqG+IYBJklqjq0TfCCs9k9wF8/Rzkikjf3KaY8dlJeFArMKIP1RGrdW8wbDKiUEMR8JWRuixzPQ8h0nWa2g7 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi, On Wed, Jan 17 2024, Alexander Graf wrote: > Kexec has 2 modes: A user space driven mode and a kernel driven mode. > For the kernel driven mode, kernel code determines the physical > addresses of all target buffers that the payload gets copied into. > > With KHO, we can only safely copy payloads into the "scratch area". > Teach the kexec file loader about it, so it only allocates for that > area. In addition, enlighten it with support to ask the KHO subsystem > for its respective payloads to copy into target memory. Also teach the > KHO subsystem how to fill the images for file loads. This patch causes compilation failures when CONFIG_KEXEC_FILE is not enabled. I am not listing them all here since there are a bunch. You can try disabling it and see them for yourself. Since Documentation/kho/usage.rst says: It is important that you use the ``-s`` parameter to use the in-kernel kexec file loader, as user space kexec tooling currently has no support for KHO with the user space based file loader. you can just make CONFIG_KEXEC_FILE a dependency for CONFIG_KEXEC_KHO to get rid of these errors. Or, if you foresee wanting to use the user space tooling to use KHO as well then you should refactor your code to work with the option enabled and disabled. > > Signed-off-by: Alexander Graf [...] -- Regards, Pratyush Yadav Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879