Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1183032rdb; Fri, 16 Feb 2024 07:41:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVfMoI1TP3z26HAPOc++fYMe3Dtk55Kj85aMRPLdTZnpiVAZp3n/Q5UcHttxLs2m8kbtB4/qxpmq4X7pNSWc0BJdqLktqdU5H/xjYb8NA== X-Google-Smtp-Source: AGHT+IFDNd2onBXt8Ma+k8gUm9ZgSQIvAb8gZmRKxniAVByjcq71WYiW3d5wis/jQh7CoNO+uEqY X-Received: by 2002:a05:6214:d81:b0:68f:385d:1f9e with SMTP id e1-20020a0562140d8100b0068f385d1f9emr1218695qve.0.1708098117991; Fri, 16 Feb 2024 07:41:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708098117; cv=pass; d=google.com; s=arc-20160816; b=E02ZSt1pJcDuCCnE+zct/rsEGs5jRu0zMFYOSfwj/eJUtMJsAYRiUwc1TCPW6hJXd0 QoUFqeAd2C6bkBdaKvXC2zB0Yun6jWQFMbmxnW2VsQ3JJyrEyTUhZ2wbBfZG6AVHjqQf osQ7MQ4T6Dk55r+oK4dJ2LipNDO1TfBFnyYuQfaypThm9rVkzTWhIq5l/CyWjHWjWNYf 6+EuyeAw69yBxNjNFXvJgWgmURhDi2wTma7nGTr1ohY3mkqZEuihP3UvgnAXfGAqWt5u /bIaBRwgQWUnTYEOWoP6Nuxx+JKrLntn/Vrz48d/SKCE/PXuLeDob6Sjw36ekMZCwBqE vMqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=0cZh71B0l8IG4uZIp4OIszUKFw5xlrbFMIKov5F9rMU=; fh=2vqwfHVmyRWNuYus6s2/j1TUOhpv1xcf6Ud1rWEg7s0=; b=asMZT63binpUhd1IEV3lGWM4cL6ZjjfNiyJa01muSrkqXhFTQHzTKux1GRze3lokte YNztUjPEY2DoDpucmdkJHev0cDH3vxFVmGaWGaDKtl3lfbstnShx43jVckG/TgZSVCkf sHiTdT7Vvs4zb7H5ZtFM2cjOaG4JhIhzBLW3LiD72YYA/+I0Fuamy4AVbwmihcYDprRI Kk+cu/vIoT4OYVGdkmyU3vwOKYk61wKwNeRy8uOJOvOyjvm4Eb+1YFsHzTp+7HY5eQSb EPbkCDoiN1bC10XhTAcIy6x5SDYpv3HoMqPD0VbRO3cFnDK8TP/uiVjNAqHjNGpy69Dt UuZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=gmc3RLnk; arc=pass (i=1 spf=pass spfdomain=amazon.de dkim=pass dkdomain=amazon.de dmarc=pass fromdomain=amazon.de); spf=pass (google.com: domain of linux-kernel+bounces-68892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u2-20020ad45aa2000000b0068ccc5108b1si210qvg.405.2024.02.16.07.41.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:41:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=gmc3RLnk; arc=pass (i=1 spf=pass spfdomain=amazon.de dkim=pass dkdomain=amazon.de dmarc=pass fromdomain=amazon.de); spf=pass (google.com: domain of linux-kernel+bounces-68892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id ACE691C20FD7 for ; Fri, 16 Feb 2024 15:41:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 259F812FF8E; Fri, 16 Feb 2024 15:38:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.de header.i=@amazon.de header.b="gmc3RLnk" Received: from smtp-fw-52002.amazon.com (smtp-fw-52002.amazon.com [52.119.213.150]) (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 6864B5465D; Fri, 16 Feb 2024 15:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.119.213.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708097879; cv=none; b=i8tDbXqFS9d7Ue8esDNdgXBRUMsf2n45TcqU7oxDGPgqKGnJhyDNS/HKbH8V11LKSsxHCR0o96nCcul2Y2IZqWyNTs63+MH1GZwCG8mDsxIuJUW091TNHxnyu6/QXwAAhPUxiKLEtf0KPd35Ufoo0QSSAYyfn5FtWYUUh56HmFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708097879; c=relaxed/simple; bh=y9Q3fD2tnKTk+FgvsD0F3JDBSD+nj+VyEVSlrWNPkAQ=; h=From:To:CC:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=d3ZX8atQlO2qbkHGfRnNtc9PQcItouKytwVOQFzMDrxc9gxb77AYMCHX4KoEX/Q6D60bObo8z4HzTV3ejeSx1K1yicdwtjIOTTfd1OO7vymUVl8Pm3ESqdlQroh9mIcjOnQ6pUhtQOAO+n109TOYVP8mJzMh7YuwoX4v4Jyfn3k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.de; spf=pass smtp.mailfrom=amazon.de; dkim=pass (1024-bit key) header.d=amazon.de header.i=@amazon.de header.b=gmc3RLnk; arc=none smtp.client-ip=52.119.213.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.de 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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