[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 1/7] xen/riscv: introduce boot information structure


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 21 Mar 2023 11:56:57 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FTu87o57m8+2mucMQg98cYlH9LpZQWWQjrhThqWhdF0=; b=Q0axLU1ne+N++Fzp2mMRi5H3ZME89o+sB2H2EoMoPmapxLw6v+8FBkB36h99Ul7WWJrgG1aEN43dHz3UvFqBDr571Ax7aqYIMmZHN/1QlFfYK8fwq4AAVIoQ3Jqj5VIkQatoYXNEy9wT0ZWyLQAOxO367n7XwGxjT8uw3ycyjFxZrlkn9JlGbqz2mTVqzLOfhqkRY84fU5mKuz698AYkVxCRBslxk6hfSkRqyPb4kjZCHMV5ga4aXgZkrDE3n/y36kzqO/Iu76nYeDVovgG19yT3SGTz5bLQZOMnyyVsUUh/kLSQSADvyJxMCgqHurhP/mhnvyUWVxRcvHGxPPopGw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFUNsko8SxFM6HC1ujOAHC87/BMs6/q4kdPb22JleMZsy7rMM7cm9Tk4V/0w/Q3VD/9cQd/fDvUm6GZ1776lMuauj3KCbwJ/XffXbaqEQVLSGaWHK6hWnRtUgZmh690gOInmuIGvDDjF4bkhiOwjc87RBgWVFDhmBSeVOi6ydt0dohbHby1vuG8C2LrLiccRrrNsoB/EwfoD/zSn1/35ye87zB+83vef6i/nX2s6lzdL/ozrAmMGjcZ0ybZLW+HGFgMp/KQ32TQLQYopd/dDBzA1pkyEcT8+0fwgrpWFuNvhJx3lCevLnmai/P+jqDbILcqRTIv+J/M6/YI3If9j2w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>
  • Delivery-date: Tue, 21 Mar 2023 11:57:31 +0000
  • Ironport-data: A9a23:VAwrZq9ZfuAK37Yi8Tm/DrUDxH6TJUtcMsCJ2f8bNWPcYEJGY0x3n GcXDGmEPKqPMDP2eI0kaomx90IHucKBndI1SQts/ik8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kI/1BjOkGlA5AdmPqoS5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklpy Po8BxkJciq73dy156vlScxwxfsseZyD0IM34hmMzBn/JNN/G9XpZfWP4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWOilUujNABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTAdpOTeXpp6Mx6LGV7k4aWSYzbQq8mtqWoAm3BMBOd EII9CV7+MDe82TuFLERRSaQp3qJvQUdWpxTDvc94wGOzYLb5g+YAi4PSTspQMwrsoo6SCIn0 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkA9L3IGZCICZRsI5Z/kuo5bphDFQ8tnEaW1psboAjy2y DePxAAlnKkah8MP06S9/HjEjiiqq5yPSRQ6ji3YX2uj6h5ybaa/ZpKv8lnd5rBLK4PxZlOGt nIVltOe6O0LBJelmymEQeFLF7asj96MNDzHnVduBd8v7T2r8H+4VZ9c63d1I0IBGs0DfznuY kPapwJKzJBWNXquK6RwZuqM598CyKHhEZHvUKDSZ98XOJxpLlbYoGdpeFKa2H3rnA40i6YjN JyHcMGqS3EHFaBgyznwTOAYuVM2+h0DKarobciT53yaPXC2PRZ5lZ9t3IOyU90E
  • Ironport-hdrordr: A9a23:6YW9cqgl9M8s+I4X5mUBMjOIgnBQXg4ji2hC6mlwRA09TySZ// re+cjzsiWE8wr5OUtQ4+xoXZPtfZqyz+8T3WB8B8bAYOCkghrXEGgA1/qb/9SDIVyZygcH79 YeT0EWMrSZZjIW46eb3ODSKadF/DDoytHLuQ7Z9RhQpHlRGthdxjY8Lg6aF01wSk1iBYAlfa Dsl/avvwDQBUj/cP7Le0U4Yw==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/03/2023 2:39 pm, Oleksii Kurochko wrote:
> The structure holds information about:
> 1. linker start/end address
> 2. load start/end address
>
> Also the patch introduces offsets for boot information structure
> members to access them in assembly code.
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> ---
> Changes in V5:
>  * the patch was introduced in the current patch series (V5)
> ---
>  xen/arch/riscv/include/asm/boot-info.h | 15 +++++++++++++++
>  xen/arch/riscv/riscv64/asm-offsets.c   |  3 +++
>  2 files changed, 18 insertions(+)
>  create mode 100644 xen/arch/riscv/include/asm/boot-info.h
>
> diff --git a/xen/arch/riscv/include/asm/boot-info.h 
> b/xen/arch/riscv/include/asm/boot-info.h
> new file mode 100644
> index 0000000000..cda3d278f5
> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/boot-info.h
> @@ -0,0 +1,15 @@
> +#ifndef _ASM_BOOT_INFO_H
> +#define _ASM_BOOT_INFO_H
> +
> +extern struct boot_info {
> +    unsigned long linker_start;
> +    unsigned long linker_end;
> +    unsigned long load_start;
> +    unsigned long load_end;
> +} boot_info;
> +
> +/* LINK_TO_LOAD() and LOAD_TO_LINK() works only when MMU isn't enabled. */
> +#define LINK_TO_LOAD(addr) ((addr) - boot_info.linker_start + 
> boot_info.load_start)
> +#define LOAD_TO_LINK(addr) ((addr) - boot_info.load_start + 
> boot_info.linker_start)
> +
> +#endif
> \ No newline at end of file

As a minor point, you should have newlines at the end of each file.

However, I'm not sure boot info like this is a clever move.  You're
creating a 3rd different way of doing something which should be entirely
common.  Some details are in
https://lore.kernel.org/xen-devel/115c178b-f0a7-cf6e-3e33-e6aa49b17baf@xxxxxxxx/
and note how many errors I already found in x86 and ARM.

Perhaps its time to dust that plan off again.  As Jan says, there's
_start and _end (or future variations therefore), and xen_phys_start
which is all that ought to exist in order to build the common functionality.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.