Re: [PATCH v2 11/39] xen/riscv: introduce asm/nospec.h

2023-12-08 Thread Jan Beulich
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



Re: [PATCH v2 11/39] xen/riscv: introduce asm/nospec.h

2023-12-08 Thread Oleksii
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



Re: [PATCH v2 11/39] xen/riscv: introduce asm/nospec.h

2023-12-07 Thread Jan Beulich
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



[PATCH v2 11/39] xen/riscv: introduce asm/nospec.h

2023-11-24 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko 
---
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

diff --git a/xen/arch/riscv/include/asm/nospec.h 
b/xen/arch/riscv/include/asm/nospec.h
new file mode 100644
index 00..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:
+ */
-- 
2.42.0