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

Re: [PATCH 06/12] xen: generate hypercall interface related code


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 18 Oct 2021 14:58:22 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=vBh4PhXUiSGM5y0kJRwhAu9vswK+nC6+vxL0JOCcpYA=; b=AqYHvvc5cnmhZ2wEPJLjsfW4J1Zc0YAONkzXt6UXG9G1RsWp04uPdKJBln1gJJGVsZ812R2O412SeCMkGigyE+uJ4Bwra300yVM0mPGcKcpY3hTYHTHaMVdrYcNWdyr5nGCWIsEx6JKxQOrbwLgEqrkfLzZnNiBPkYRFx0TA1c3QyzfLbl7nne5YA0AQH5nY6i5j0uVzxOrTZOLjPegHfOoBcXQ5j1DZt1ywrgeAQVzv8fV1AZeuiD2TBq+wKAOkYOAhgJ3H/WeCSiEGRMRjOUf7sueqYc1JATxgAUDxAolvgx3yz2ZjadXq1hynpJq6QkYIujTR/BpvKAKiMvj2/Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lMr9Z7EWTMZ7OkSVzn/bqffpF5fQD+MKEb10kwH0IffmJim20uB1VLTSf7r4rGtSyoX7+rFZ6LLMj+GBawsOjsfPW5+IblRg/8OMef8r2kpRHnizx8WVhsmP1Nu3yK8V0yAgipJRcPIrAtQ8kk61rEfOC94ODeSLhCUNsUTcKEqgrzITuBPh1UXKgh8aBP1Q1IdHSchdLUYxki0XrrPtBR5Gkyt3BrArGaeBOt/XMKm9KHjaP+/R9BXQn/ea2FOa3ipVd0mq6TkND+4hMC1wFcuWBvne0zu80FdhXs2ThOydKH8xlJoJ+N5IA4wy5AZtjjiM9s8xcIb9d4dltYBP+A==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 18 Oct 2021 12:58:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.10.2021 14:51, Juergen Gross wrote:
> Instead of repeating similar data multiple times use a single source
> file and a generator script for producing prototypes and call sequences
> of the hypercalls.
> 
> As the script already knows the number of parameters used add generating
> a macro for populating an array with the number of parameters per
> hypercall.

Isn't that array intended to go away?

> --- a/.gitignore
> +++ b/.gitignore
> @@ -332,10 +332,12 @@ xen/include/asm-x86/asm-macros.h
>  xen/include/compat/*
>  xen/include/config/
>  xen/include/generated/
> +xen/include//hypercall-defs.i

Nit: Stray double slash (unless this has a meaning I'm unaware of).

Yet then I wonder: Shouldn't *.i be among the patterns at the top of
the file, like *.o is?

> @@ -466,6 +468,14 @@ include/asm-$(TARGET_ARCH)/asm-offsets.h: asm-offsets.s
>         echo ""; \
>         echo "#endif") <$< >$@
>  
> +quiet_cmd_genhyp = GEN     $@
> +define cmd_genhyp
> +    awk -f scripts/gen_hypercall.awk <$< >$@
> +endef
> +
> +include/xen/hypercall-defs.h: include/hypercall-defs.i 
> scripts/gen_hypercall.awk FORCE
> +     $(call if_changed,genhyp)

As per patch 5 there are quite a few sources including xen/hypercall.h
and hence (in one of the next patches) the header generated here. If
this one gets re-generated for a benign reason (i.e. without changing
the header), all dependents will get rebuilt for no reason. Use
$(move-if-changed ...)?

> +prefix: do
> +set_timer_op(s_time_t timeout)
> +console_io(unsigned int cmd, unsigned int count, char *buffer)
> +vm_assist(unsigned int cmd, unsigned int type)
> +event_channel_op(int cmd, void *arg)
> +mmuext_op(mmuext_op_t *uops, unsigned int count, unsigned int *pdone, 
> unsigned int foreigndom)
> +multicall(multicall_entry_t *call_list, unsigned int nr_calls)
> +#ifdef CONFIG_PV
> +mmu_update(mmu_update_t *ureqs, unsigned int count, unsigned int *pdone, 
> unsigned int foreigndom)
> +stack_switch(unsigned long ss, unsigned long esp)
> +fpu_taskswitch(int set)
> +set_debugreg(int reg, unsigned long value)
> +get_debugreg(int reg)
> +set_segment_base(unsigned int which, unsigned long base)
> +mca(xen_mc_t *u_xen_mc)
> +set_trap_table(const_trap_info_t *traps)
> +set_gdt(xen_ulong_t *frame_list, unsigned int entries)
> +set_callbacks(unsigned long event_address, unsigned long failsafe_address, 
> unsigned long syscall_address)
> +update_descriptor(uint64_t gaddr, seg_desc_t desc)
> +update_va_mapping(unsigned long va, uint64_t val64, unsigned long flags)
> +update_va_mapping_otherdomain(unsigned long va, uint64_t val64, unsigned 
> long flags, domid_t domid)
> +#endif
> +#ifdef CONFIG_IOREQ_SERVER
> +dm_op(domid_t domid, unsigned int nr_bufs, xen_dm_op_buf_t *bufs)
> +#endif
> +#ifndef CONFIG_PV_SHIM_EXCLUSIVE
> +sysctl(xen_sysctl_t *u_sysctl)
> +domctl(xen_domctl_t *u_domctl)
> +paging_domctl_cont(xen_domctl_t *u_domctl)
> +#endif
> +#ifdef CONFIG_HVM
> +hvm_op(unsigned long op, void *arg)
> +#endif
> +#ifdef CONFIG_HYPFS
> +hypfs_op(unsigned int cmd, const char *arg1, unsigned long arg2, void *arg3, 
> unsigned long arg4)
> +#endif
> +#ifdef CONFIG_X86
> +xenpmu_op(unsigned int op, xen_pmu_params_t *arg)
> +#endif
> +
> +#ifdef CONFIG_PV
> +caller: pv64
> +#ifdef CONFIG_PV32
> +caller: pv32
> +#endif
> +#endif
> +#ifdef CONFIG_HVM
> +caller: hvm64
> +#ifdef CONFIG_COMPAT
> +caller: hvm32
> +#endif

HVM selects COMPAT, so I don't see a point in this inner conditional.

> +#endif
> +#ifdef CONFIG_ARM
> +caller: arm
> +#endif
> +
> +table:                             pv32    pv64    hvm32   hvm64   arm
> +set_trap_table                     compat  do      -       -       -
> +mmu_update                         do      do      -       -       -
> +set_gdt                            compat  do      -       -       -
> +stack_switch                       do      do      -       -       -
> +set_callbacks                      compat  do      -       -       -
> +fpu_taskswitch                     do      do      -       -       -
> +sched_op_compat                    do      do      -       -       dep
> +#ifndef CONFIG_PV_SHIM_EXCLUSIVE
> +platform_op                        compat  do      compat  do      do
> +#endif
> +set_debugreg                       do      do      -       -       -
> +get_debugreg                       do      do      -       -       -
> +update_descriptor                  compat  do      -       -       -
> +memory_op                          compat  do      hvm     hvm     do
> +multicall                          compat  do      compat  do      do
> +update_va_mapping                  compat  do      -       -       -
> +set_timer_op                       compat  do      compat  do      -
> +event_channel_op_compat            do      do      -       -       dep
> +xen_version                        compat  do      compat  do      do
> +console_io                         do      do      do      do      do
> +physdev_op_compat                  compat  do      -       -       dep
> +#if defined(CONFIG_GRANT_TABLE) || defined(CONFIG_PV_SHIM)
> +grant_table_op                     compat  do      hvm     hvm     do
> +#endif
> +vm_assist                          do      do      do      do      do
> +update_va_mapping_otherdomain      compat  do      -       -       -
> +iret                               compat  do      -       -       -
> +vcpu_op                            compat  do      compat  do      do
> +set_segment_base                   do      do      -       -       -
> +#ifdef CONFIG_PV
> +mmuext_op                          compat  do      compat  do      -
> +#endif
> +xsm_op                             compat  do      compat  do      do
> +nmi_op                             compat  do      -       -       -
> +sched_op                           compat  do      compat  do      do
> +callback_op                        compat  do      -       -       -
> +#ifdef CONFIG_XENOPROF
> +xenoprof_op                        compat  do      -       -       -
> +#endif
> +event_channel_op                   do      do      do      do      do
> +physdev_op                         compat  do      hvm     hvm     do
> +#ifdef CONFIG_HVM
> +hvm_op                             do      do      do      do      do
> +#endif
> +#ifndef CONFIG_PV_SHIM_EXCLUSIVE
> +sysctl                             do      do      do      do      do
> +domctl                             do      do      do      do      do
> +#endif
> +#ifdef CONFIG_KEXEC
> +kexec_op                           compat  do      -       -       -
> +#endif
> +tmem_op                            -       -       -       -       -
> +#ifdef CONFIG_ARGO
> +argo_op                            compat  do      compat  do      do
> +#endif
> +xenpmu_op                          do      do      do      do      -
> +#ifdef CONFIG_IOREQ_SERVER
> +dm_op                              compat  do      compat  do      do
> +#endif
> +#ifdef CONFIG_HYPFS
> +hypfs_op                           do      do      do      do      do
> +#endif
> +mca                                do      do      -       -       -
> +#ifndef CONFIG_PV_SHIM_EXCLUSIVE
> +paging_domctl_cont                 do      do      do      do      -
> +#endif

I assume the intention here is to sort by hypercall number. This results
in 3 PV_SHIM_EXCLUSIVE conditionals when one might do. Just a remark for
consideration, not strictly a request to change anything.

Jan




 


Rackspace

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