Re: [PATCH 1/2] vdso: allow to add architecture-specific vdso data

2020-08-03 Thread Sven Schnelle
Thomas Gleixner  writes:

> just a few nits.
>
> Can you please spare that #ifdef and do:
>
> #ifdef CONFIG_ARCH_HAS_VDSO_DATA
> #include 
> #else
> struct arch_vdso_data {};
> #endif

Ok.

> Please keep the tabular alignment of the struct members and add kernel
> doc in the comment above the struct.

Ok.

> Aside of that 'arch' is not really a intuitive name. 'arch_data' or
> something like that. Hmm?

arch_data is fine, thank you for your comments.

Regards
Sven


Re: [PATCH 1/2] vdso: allow to add architecture-specific vdso data

2020-08-03 Thread Thomas Gleixner
Sven,

Sven Schnelle  writes:
>  source "scripts/gcc-plugins/Kconfig"
> diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
> index 7955c56d6b3c..74e730238ce6 100644
> --- a/include/vdso/datapage.h
> +++ b/include/vdso/datapage.h
> @@ -19,6 +19,10 @@
>  #include 
>  #include 
>  
> +#ifdef CONFIG_ARCH_HAS_VDSO_DATA
> +#include 
> +#endif
> +
>  #define VDSO_BASES   (CLOCK_TAI + 1)
>  #define VDSO_HRES(BIT(CLOCK_REALTIME)| \
>BIT(CLOCK_MONOTONIC)   | \
> @@ -97,6 +101,9 @@ struct vdso_data {
>   s32 tz_dsttime;
>   u32 hrtimer_res;
>   u32 __unused;
> +#ifdef CONFIG_ARCH_HAS_VDSO_DATA
> + struct arch_vdso_data arch;
> +#endif

just a few nits.

Can you please spare that #ifdef and do:

#ifdef CONFIG_ARCH_HAS_VDSO_DATA
#include 
#else
struct arch_vdso_data {};
#endif

Please keep the tabular alignment of the struct members and add kernel
doc in the comment above the struct.

Aside of that 'arch' is not really a intuitive name. 'arch_data' or
something like that. Hmm?

Thanks,

tglx




[PATCH 1/2] vdso: allow to add architecture-specific vdso data

2020-08-02 Thread Sven Schnelle
Add the possibility to add architecture specific vDSO
data to struct vdso_data. This is useful if the arch specific
user space VDSO code needs additional data during execution.
If CONFIG_ARCH_HAS_VDSO_DATA is defined, the generic code will
include asm/vdso/data.h which should contain 'struct arch_vdso_data'.
This structure will be embedded in the generic vDSO data.

Signed-off-by: Sven Schnelle 
Reviewed-by: Heiko Carstens 
---
 arch/Kconfig| 3 +++
 include/vdso/datapage.h | 7 +++
 2 files changed, 10 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 8cc35dc556c7..e1017ce979e2 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -979,6 +979,9 @@ config HAVE_SPARSE_SYSCALL_NR
  entries at 4000, 5000 and 6000 locations. This option turns on syscall
  related optimizations for a given architecture.
 
+config ARCH_HAS_VDSO_DATA
+   bool
+
 source "kernel/gcov/Kconfig"
 
 source "scripts/gcc-plugins/Kconfig"
diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
index 7955c56d6b3c..74e730238ce6 100644
--- a/include/vdso/datapage.h
+++ b/include/vdso/datapage.h
@@ -19,6 +19,10 @@
 #include 
 #include 
 
+#ifdef CONFIG_ARCH_HAS_VDSO_DATA
+#include 
+#endif
+
 #define VDSO_BASES (CLOCK_TAI + 1)
 #define VDSO_HRES  (BIT(CLOCK_REALTIME)| \
 BIT(CLOCK_MONOTONIC)   | \
@@ -97,6 +101,9 @@ struct vdso_data {
s32 tz_dsttime;
u32 hrtimer_res;
u32 __unused;
+#ifdef CONFIG_ARCH_HAS_VDSO_DATA
+   struct arch_vdso_data arch;
+#endif
 };
 
 /*
-- 
2.17.1