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

Re: [XEN PATCH v1 1/4] arch/riscv: initial RISC-V support to build/run minimal Xen


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Wed, 28 Dec 2022 18:56:18 +0000
  • Accept-language: en-GB, en-US
  • 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=W+uRrA/iDxo85Xl86a9zay2C0pqsoRdEUq8wtq3Mzmg=; b=IxbRG3i//01tMyX2VNMp0NLGE7RedYTM1hoR39ES/+KOGo5uTKNlWbdmVfThCiGFEmL/fbs/s28S6FX69bMH/RZICRu+qa52erJjSzj0eb/G3pj7GJjz3A9XZsTseNlgLNxsMEzv84BJ0w7FWs88O1FC1m6+R7WgL7UtPYtiGqSXkJxteVUKugiEQBvQLVsvuo7TgvGQuNs5+ShTCzCnTHWq5YF6bs8fs9mE+amrjv+1Fkb+tEhouvDSABWOQpiBjarOPeoUdWHomhroaoIML/gY072aNEEZSdRlJ15u/LG5VWNkNKi3lzJMz1JhFbBtajd0gelxiUpBk6bL0R6W/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQ4s2eFthkrCd5pUqrsvvsoyCSIE34lf1h6GivDRBScKJ45fUjpVmX43APZeZDDDsOdprKuzKQ3L+UqmxmD71ycVPUEgP9v0ivCD3E9Tt36UEHHJ7RtqaxpAcN1UgWl0rMirtkoK4pAR3bpoxiKqSf74IHba01iBbvaQJi3XUshkteBAAVIyl1WQ4RCULvz7uOgAEWwwuZ5LeltwDZzwlvUWVe756n6aJXEjmw5hTRS/MWV2EnQCFJbDSM+gvNBBiTt04rqnOBE0Wg2NA66HW0LrMHX1oZOu0UteZ/mygPlHZ4KXBeI373vUZ69xw31vVww+CRS6AFY7k9tqr8Zp9w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 28 Dec 2022 18:56:37 +0000
  • Ironport-data: A9a23:FespD6D/QTILHRVW/7Hiw5YqxClBgxIJ4kV8jS/XYbTApGl032dVm zAZDz+Cb6uNYzb0eowkO4jk/RxT6JTVzt9lQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nNHuCnYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbyRFtcpvlDs15K6o4WlC7gRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIwxrZ1H0Zc9 OUiNxNcUzyIpduGx5SgY7w57igjBJGD0II3nFhFlGucJ9B2BJfJTuPN+MNS2yo2ioZWB/HCa sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI+OxuvDS7IA9ZidABNPL8fNCQSNoTtUGfv m/cpEzyAw0ANczZwj2Amp6prr6XwnOrCd5PfFG+3u5xrESYyE4/MkIPBHai8NidiVWXR/sKf iT4/QJr98De7neDSd3wXAa5oTiHowQbUNpTFMU17QiMzuzf5APxLngJSHtNZcIrsOcyRCc2z RmZktXxHzttvbaJD3WH+d+8tiiuMCIYKWsDYy4sTgYf5dTn5oYpgXrnQddqFqqohdTdAzDux CuLqiN4jLIW5eYB0K+x7F3cgzaho5HPZgEw7wTTGGmi62tRbYqkfJCh6EKd4+xJKo2YVXGes HNCkM+bhMgFCpeLky6BSfsMB5mm4v+ENHvXhlsHInU63zGk+nrmd4YA5jh7fR1tKpxdJmOvZ 1LPswRM4pMVJGGtcaJ8f4O2DYIt0LTkEtPmEPvTa7Kif6RMSeNOxwk2DWb44ownuBFEfX0XU XtDTfuRMA==
  • Ironport-hdrordr: A9a23:2Qf1mqCozG86SajlHenP55DYdb4zR+YMi2TDtnoQdfUxSKelfq +V8cjzuSWftN9zYhAdcK67V5VoKEm0naKdirN8AV7NZmfbhFc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZFsAJYhXYxlPpRkqmFf35I9Ktpq6DrqGA
  • Thread-topic: [XEN PATCH v1 1/4] arch/riscv: initial RISC-V support to build/run minimal Xen

On 23/12/2022 11:16 am, Oleksii Kurochko wrote:
> diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
> index 942e4ffbc1..893dd19ea6 100644
> --- a/xen/arch/riscv/Makefile
> +++ b/xen/arch/riscv/Makefile
> @@ -1,2 +1,32 @@
> +obj-$(CONFIG_RISCV_64) += riscv64/
> +
> +$(TARGET): $(TARGET)-syms
> +     $(OBJCOPY) -O binary -S $< $@
> +
> +$(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
> +     $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
> +             $(SYMBOLS_DUMMY_OBJ) -o $(@D)/.$(@F).0
> +     $(NM) -pa --format=sysv $(@D)/.$(@F).0 \
> +             | $(objtree)/tools/symbols $(all_symbols) --sysv --sort 
> >$(@D)/.$(@F).0.S
> +     $(MAKE) $(build)=$(@D) $(@D)/.$(@F).0.o
> +     $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
> +             $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
> +     $(NM) -pa --format=sysv $(@D)/.$(@F).1 \
> +             | $(objtree)/tools/symbols $(all_symbols) --sysv --sort 
> >$(@D)/.$(@F).1.S
> +     $(MAKE) $(build)=$(@D) $(@D)/.$(@F).1.o
> +     $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
> +             $(@D)/.$(@F).1.o -o $@

The conditional emptying of SYMBOLS_DUMMY_OBJ in arch.mk will break this
logic if it actually gets emptied, but you can drop almost all of it.

This should be just

$(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
    $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@

in the short term, I think.

> +     $(NM) -pa --format=sysv $(@D)/$(@F) \
> +             | $(objtree)/tools/symbols --all-symbols --xensyms --sysv 
> --sort \
> +             >$(@D)/$(@F).map
> +     rm -f $(@D)/.$(@F).[0-9]*
> +
> +$(obj)/xen.lds: $(src)/xen.lds.S FORCE
> +             $(call if_changed_dep,cpp_lds_S)

You've got a tab and some spaces here.  It wants to be just one tab.

> diff --git a/xen/arch/riscv/include/asm/config.h 
> b/xen/arch/riscv/include/asm/config.h
> index e2ae21de61..756607a4a2 100644
> --- a/xen/arch/riscv/include/asm/config.h
> +++ b/xen/arch/riscv/include/asm/config.h
> @@ -36,6 +36,30 @@
>    name:
>  #endif
>  
> +/*
> + * Definition of XEN_VIRT_START should look like:
> + *   define XEN_VIRT_START _AT(vaddr_t,0x00200000)
> + * It requires including of additional headers which
> + * will increase an amount of files unnecessary for
> + * minimal RISC-V Xen build so set value of
> + * XEN_VIRT_START explicitly.
> + *
> + * TODO: change it to _AT(vaddr_t,0x00200000) when
> + *       necessary header will be pushed.
> + */
> +#define XEN_VIRT_START  0x80200000
> +/*
> + * PAGE_SIZE is defined in <{asm,xen}/page-*.h> but to
> + * remove unnecessary headers for minimal
> + * build headers it will be better to set PAGE_SIZE
> + * explicitly.
> + *
> + * TODO: remove it when <asm/page-*.h> will be needed
> + *       defintion of PAGE_SIZE should be remove from
> + *       this header.
> + */
> +#define PAGE_SIZE       4096

I've committed Alistair's patch which adds page-bits.h, so this section
can go away.

We still need XEN_VIRT_START, but we don't really need the commentary
explaining that it's temporary - that is very clear from the subject of
the patch.

> diff --git a/xen/arch/riscv/include/asm/types.h 
> b/xen/arch/riscv/include/asm/types.h
> new file mode 100644
> index 0000000000..afbca6b15c
> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/types.h
> @@ -0,0 +1,11 @@
> +#ifndef __TYPES_H__
> +#define __TYPES_H__
> +
> +/*
> + *
> + * asm/types.h is required for xen-syms.S file which
> + * is produced by tools/symbols.
> + *
> + */

Again, no need for this comment.

However, I think we want to rearrange the build system to have a final
-I option for xen/include/stub/asm/ or so, so we can put some empty
files there and avoid having architectures needing to provide empty files.

If this file is needed, then it needs a more specific header guard than
__TYPES_H__.  That's the general guard for xen/types.h meaning that
nothing inside this file will actually survive preprocessing.

~Andrew

 


Rackspace

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