lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <548EC841.2000107@citrix.com>
Date:	Mon, 15 Dec 2014 11:38:41 +0000
From:	David Vrabel <david.vrabel@...rix.com>
To:	Juergen Gross <jgross@...e.com>, <linux-kernel@...r.kernel.org>,
	<x86@...nel.org>, <xen-devel@...ts.xensource.com>,
	<konrad.wilk@...cle.com>, <david.vrabel@...rix.com>,
	<boris.ostrovsky@...cle.com>, <tglx@...utronix.de>,
	<mingo@...hat.com>, <hpa@...or.com>, <mmarek@...e.cz>,
	<linux-kbuild@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/4] xen: build infrastructure for generating
 hypercall depending symbols

On 11/12/14 18:04, Juergen Gross wrote:
> Today there are several places in the kernel which build tables
> containing one entry for each possible Xen hypercall. Create an
> infrastructure to be able to generate these tables at build time.

Does arm and arm64 need something similar?  If so are the tools here
suitable for them?

> --- a/arch/x86/syscalls/Makefile
> +++ b/arch/x86/syscalls/Makefile

Why are these changes here and not in arch/x86/xen/Makefile?

> @@ -19,6 +19,9 @@ quiet_cmd_syshdr = SYSHDR  $@
>  quiet_cmd_systbl = SYSTBL  $@
>        cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@
>  
> +quiet_cmd_hypercalls = HYPERCALLS $@
> +      cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<,$^)
> +
>  syshdr_abi_unistd_32 := i386
>  $(uapi)/unistd_32.h: $(syscall32) $(syshdr)
>  	$(call if_changed,syshdr)
> @@ -47,10 +50,16 @@ $(out)/syscalls_32.h: $(syscall32) $(systbl)
>  $(out)/syscalls_64.h: $(syscall64) $(systbl)
>  	$(call if_changed,systbl)
>  
> +$(out)/xen-hypercalls.h: $(srctree)/scripts/xen-hypercalls.sh
> +	$(call if_changed,hypercalls)
> +
> +$(out)/xen-hypercalls.h: $(srctree)/include/xen/interface/xen*.h

The generated header should end up in asm/xen/

> --- /dev/null
> +++ b/scripts/xen-hypercalls.sh
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +out="$1"
> +shift
> +in="$@"
> +
> +for i in $in; do
> +	eval $CPP $LINUXINCLUDE -dD -imacros "$i" -x c /dev/null
> +done | \
> +awk '$1 == "#define" && $2 ~ /__HYPERVISOR_[a-z][a-z_0-9]*/ { v[$3] = $2 }
> +	END {for (i in v) if (!(v[i] in v))
> +		print "HYPERCALL("substr(v[i], 14)")"}' | sort -u >$out

Include a comment in the generated output saying what generated it. e.g.,

/* auto-generated by scripts/xen-hypercall.sh */

David

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ