Message ID | aa2ff1df494f82f7c045f913371d3b9d04962a5e.1700761381.git.oleksii.kurochko@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Enable build of full Xen for RISC-V | expand |
On 24.11.2023 11:30, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/arch/riscv/include/asm/nospec.h > @@ -0,0 +1,25 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ > + > +#ifndef _ASM_RISCV_NOSPEC_H > +#define _ASM_RISCV_NOSPEC_H > + > +static inline bool evaluate_nospec(bool condition) > +{ > + return condition; > +} > + > +static inline void block_speculation(void) > +{ > +} > + > +#endif /* _ASM_RISCV_NOSPEC_H */ This being identical between Arm, PPC, and now RISC-V, wouldn't this be another asm-generic/ candidate? (Whether such trivial stubs are copyrightable is, as per earlier remarks, at least questionable to me.) Jan
On Thu, 2023-12-07 at 15:28 +0100, Jan Beulich wrote: > On 24.11.2023 11:30, Oleksii Kurochko wrote: > > --- /dev/null > > +++ b/xen/arch/riscv/include/asm/nospec.h > > @@ -0,0 +1,25 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights > > Reserved. */ > > + > > +#ifndef _ASM_RISCV_NOSPEC_H > > +#define _ASM_RISCV_NOSPEC_H > > + > > +static inline bool evaluate_nospec(bool condition) > > +{ > > + return condition; > > +} > > + > > +static inline void block_speculation(void) > > +{ > > +} > > + > > +#endif /* _ASM_RISCV_NOSPEC_H */ > > This being identical between Arm, PPC, and now RISC-V, wouldn't this > be another > asm-generic/ candidate? (Whether such trivial stubs are copyrightable > is, as > per earlier remarks, at least questionable to me.) It is a good candidate to be moved to asm-generic. Thanks for notice that. I'll update move this patch to generic headers patch series. I am not sure too but the copyright was presented in Arm's file and RISC-V's version is just a copy so I decided to leave it. Does any documented rule exist in which cases copyright should be and not? ~ Oleksii
On 08.12.2023 10:33, Oleksii wrote: > On Thu, 2023-12-07 at 15:28 +0100, Jan Beulich wrote: >> On 24.11.2023 11:30, Oleksii Kurochko wrote: >>> --- /dev/null >>> +++ b/xen/arch/riscv/include/asm/nospec.h >>> @@ -0,0 +1,25 @@ >>> +/* SPDX-License-Identifier: GPL-2.0 */ >>> +/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights >>> Reserved. */ >>> + >>> +#ifndef _ASM_RISCV_NOSPEC_H >>> +#define _ASM_RISCV_NOSPEC_H >>> + >>> +static inline bool evaluate_nospec(bool condition) >>> +{ >>> + return condition; >>> +} >>> + >>> +static inline void block_speculation(void) >>> +{ >>> +} >>> + >>> +#endif /* _ASM_RISCV_NOSPEC_H */ >> >> This being identical between Arm, PPC, and now RISC-V, wouldn't this >> be another >> asm-generic/ candidate? (Whether such trivial stubs are copyrightable >> is, as >> per earlier remarks, at least questionable to me.) > It is a good candidate to be moved to asm-generic. Thanks for notice > that. I'll update move this patch to generic headers patch series. > > I am not sure too but the copyright was presented in Arm's file and > RISC-V's version is just a copy so I decided to leave it. > Does any documented rule exist in which cases copyright should be and > not? I'm afraid there's nothing. But see how PPC has dropped the copyright, too. Generally I'm of the opinion that purely trivial stubs aren't sensible to put under a copyright. Jan
diff --git a/xen/arch/riscv/include/asm/nospec.h b/xen/arch/riscv/include/asm/nospec.h new file mode 100644 index 0000000000..55087fa831 --- /dev/null +++ b/xen/arch/riscv/include/asm/nospec.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ + +#ifndef _ASM_RISCV_NOSPEC_H +#define _ASM_RISCV_NOSPEC_H + +static inline bool evaluate_nospec(bool condition) +{ + return condition; +} + +static inline void block_speculation(void) +{ +} + +#endif /* _ASM_RISCV_NOSPEC_H */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> --- Changes in V2: - Nothing changed. Only rebase. --- xen/arch/riscv/include/asm/nospec.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 xen/arch/riscv/include/asm/nospec.h