Re: [PATCH v3 07/34] xen/asm-generic: introdure nospec.h

2024-01-08 Thread Oleksii
On Thu, 2024-01-04 at 12:06 +0100, Jan Beulich wrote:
> On 22.12.2023 16:12, Oleksii Kurochko wrote:
> > The  header is similar between Arm, PPC, and RISC-V,
> > so it has been moved to asm-generic.
> > 
> > Signed-off-by: Oleksii Kurochko 
> 
> Acked-by: Jan Beulich 
> 
> A word may want saying though on ...
> 
> > --- a/xen/arch/arm/include/asm/nospec.h
> > +++ b/xen/include/asm-generic/nospec.h
> > @@ -1,8 +1,8 @@
> > -/* SPDX-License-Identifier: GPL-2.0 */
> > -/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights
> > Reserved. */
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef _ASM_GENERIC_NOSPEC_H
> > +#define _ASM_GENERIC_NOSPEC_H
> 
> ... the removal of the copyright line.
It was automatically decided by Git to do it this way.

I'll try to make it generate a new file instead of moving/renaming
Arm's nospec.h.

~ Oleksii



Re: [PATCH v3 07/34] xen/asm-generic: introdure nospec.h

2024-01-05 Thread Shawn Anastasio
Hi Oleksii,

On 12/22/23 9:12 AM, Oleksii Kurochko wrote:
> The  header is similar between Arm, PPC, and RISC-V,
> so it has been moved to asm-generic.
> 
> Signed-off-by: Oleksii Kurochko 

Acked-by: Shawn Anastasio 

Thanks,
Shawn



Re: [PATCH v3 07/34] xen/asm-generic: introdure nospec.h

2024-01-04 Thread Jan Beulich
On 04.01.2024 12:13, Andrew Cooper wrote:
> On 04/01/2024 11:06 am, Jan Beulich wrote:
>> On 22.12.2023 16:12, Oleksii Kurochko wrote:
>>> The  header is similar between Arm, PPC, and RISC-V,
>>> so it has been moved to asm-generic.
>>>
>>> Signed-off-by: Oleksii Kurochko 
>> Acked-by: Jan Beulich 
>>
>> A word may want saying though on ...
>>
>>> --- a/xen/arch/arm/include/asm/nospec.h
>>> +++ b/xen/include/asm-generic/nospec.h
>>> @@ -1,8 +1,8 @@
>>> -/* SPDX-License-Identifier: GPL-2.0 */
>>> -/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 
>>> */
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +#ifndef _ASM_GENERIC_NOSPEC_H
>>> +#define _ASM_GENERIC_NOSPEC_H
>> ... the removal of the copyright line.
> 
> That isn't a removal of ARM's copyright line.
> 
> The two files are similar enough to trigger git-diff's "this was a
> rename" logic (see the a vs b paths), despite not being a rename.
> 
> It's unfortunate rendering in this case.

Hmm, well, might be. If I had done such a change, I surely wouldn't have
created the file anew, but rather moved one of the existing instances.
Even if it was PPC's that was moved, that was (likely) cloned from Arm's
as well.

Jan



Re: [PATCH v3 07/34] xen/asm-generic: introdure nospec.h

2024-01-04 Thread Andrew Cooper
On 04/01/2024 11:06 am, Jan Beulich wrote:
> On 22.12.2023 16:12, Oleksii Kurochko wrote:
>> The  header is similar between Arm, PPC, and RISC-V,
>> so it has been moved to asm-generic.
>>
>> Signed-off-by: Oleksii Kurochko 
> Acked-by: Jan Beulich 
>
> A word may want saying though on ...
>
>> --- a/xen/arch/arm/include/asm/nospec.h
>> +++ b/xen/include/asm-generic/nospec.h
>> @@ -1,8 +1,8 @@
>> -/* SPDX-License-Identifier: GPL-2.0 */
>> -/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 
>> */
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +#ifndef _ASM_GENERIC_NOSPEC_H
>> +#define _ASM_GENERIC_NOSPEC_H
> ... the removal of the copyright line.

That isn't a removal of ARM's copyright line.

The two files are similar enough to trigger git-diff's "this was a
rename" logic (see the a vs b paths), despite not being a rename.

It's unfortunate rendering in this case.

~Andrew



Re: [PATCH v3 07/34] xen/asm-generic: introdure nospec.h

2024-01-04 Thread Jan Beulich
On 22.12.2023 16:12, Oleksii Kurochko wrote:
> The  header is similar between Arm, PPC, and RISC-V,
> so it has been moved to asm-generic.
> 
> Signed-off-by: Oleksii Kurochko 

Acked-by: Jan Beulich 

A word may want saying though on ...

> --- a/xen/arch/arm/include/asm/nospec.h
> +++ b/xen/include/asm-generic/nospec.h
> @@ -1,8 +1,8 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef _ASM_GENERIC_NOSPEC_H
> +#define _ASM_GENERIC_NOSPEC_H

... the removal of the copyright line.

Jan



[PATCH v3 07/34] xen/asm-generic: introdure nospec.h

2023-12-22 Thread Oleksii Kurochko
The  header is similar between Arm, PPC, and RISC-V,
so it has been moved to asm-generic.

Signed-off-by: Oleksii Kurochko 
---
Changes in V3:
 - new patch.
---
 xen/arch/arm/include/asm/Makefile |  1 +
 xen/arch/ppc/include/asm/Makefile |  1 +
 xen/arch/ppc/include/asm/nospec.h | 15 ---
 xen/arch/riscv/include/asm/Makefile   |  1 +
 .../include/asm => include/asm-generic}/nospec.h  | 10 +-
 5 files changed, 8 insertions(+), 20 deletions(-)
 delete mode 100644 xen/arch/ppc/include/asm/nospec.h
 rename xen/{arch/arm/include/asm => include/asm-generic}/nospec.h (54%)

diff --git a/xen/arch/arm/include/asm/Makefile 
b/xen/arch/arm/include/asm/Makefile
index c3f4291ee2..dfb4e9e45c 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -3,6 +3,7 @@ generic-y += altp2m.h
 generic-y += device.h
 generic-y += hardirq.h
 generic-y += iocap.h
+generic-y += nospec.h
 generic-y += numa.h
 generic-y += paging.h
 generic-y += percpu.h
diff --git a/xen/arch/ppc/include/asm/Makefile 
b/xen/arch/ppc/include/asm/Makefile
index adb752b804..0e96ad54c3 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -5,6 +5,7 @@ generic-y += div64.h
 generic-y += hardirq.h
 generic-y += hypercall.h
 generic-y += iocap.h
+generic-y += nospec.h
 generic-y += numa.h
 generic-y += paging.h
 generic-y += percpu.h
diff --git a/xen/arch/ppc/include/asm/nospec.h 
b/xen/arch/ppc/include/asm/nospec.h
deleted file mode 100644
index b97322e48d..00
--- a/xen/arch/ppc/include/asm/nospec.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/* From arch/arm/include/asm/nospec.h. */
-#ifndef __ASM_PPC_NOSPEC_H__
-#define __ASM_PPC_NOSPEC_H__
-
-static inline bool evaluate_nospec(bool condition)
-{
-return condition;
-}
-
-static inline void block_speculation(void)
-{
-}
-
-#endif /* __ASM_PPC_NOSPEC_H__ */
diff --git a/xen/arch/riscv/include/asm/Makefile 
b/xen/arch/riscv/include/asm/Makefile
index adb752b804..0e96ad54c3 100644
--- a/xen/arch/riscv/include/asm/Makefile
+++ b/xen/arch/riscv/include/asm/Makefile
@@ -5,6 +5,7 @@ generic-y += div64.h
 generic-y += hardirq.h
 generic-y += hypercall.h
 generic-y += iocap.h
+generic-y += nospec.h
 generic-y += numa.h
 generic-y += paging.h
 generic-y += percpu.h
diff --git a/xen/arch/arm/include/asm/nospec.h 
b/xen/include/asm-generic/nospec.h
similarity index 54%
rename from xen/arch/arm/include/asm/nospec.h
rename to xen/include/asm-generic/nospec.h
index 51c7aea4f4..5ded9746f3 100644
--- a/xen/arch/arm/include/asm/nospec.h
+++ b/xen/include/asm-generic/nospec.h
@@ -1,8 +1,8 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _ASM_GENERIC_NOSPEC_H
+#define _ASM_GENERIC_NOSPEC_H
 
-#ifndef _ASM_ARM_NOSPEC_H
-#define _ASM_ARM_NOSPEC_H
+#include 
 
 static inline bool evaluate_nospec(bool condition)
 {
@@ -13,7 +13,7 @@ static inline void block_speculation(void)
 {
 }
 
-#endif /* _ASM_ARM_NOSPEC_H */
+#endif /* _ASM_GENERIC_NOSPEC_H */
 
 /*
  * Local variables:
-- 
2.43.0