diff mbox series

[v1,02/29] xen/asm-generic: introduce stub header paging.h

Message ID 5def596788d602b9b34302630c91644952c7115d.1694702259.git.oleksii.kurochko@gmail.com (mailing list archive)
State New, archived
Headers show
Series Introduce stub headers necessary for full Xen build | expand

Commit Message

Oleksii K. Sept. 14, 2023, 2:56 p.m. UTC
The patch introduces stub header needed for full Xen build.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/include/asm-generic/paging.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 xen/include/asm-generic/paging.h

Comments

Jan Beulich Oct. 19, 2023, 9:05 a.m. UTC | #1
On 14.09.2023 16:56, Oleksii Kurochko wrote:
> The patch introduces stub header needed for full Xen build.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  xen/include/asm-generic/paging.h | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>  create mode 100644 xen/include/asm-generic/paging.h
> 
> diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-generic/paging.h
> new file mode 100644
> index 0000000000..2aab63b536
> --- /dev/null
> +++ b/xen/include/asm-generic/paging.h
> @@ -0,0 +1,17 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __ASM_GENERIC_PAGING_H__
> +#define __ASM_GENERIC_PAGING_H__
> +
> +#define paging_mode_translate(d)	(1)
> +#define paging_mode_external(d)		(1)
> +
> +#endif /* __ASM_GENERIC_PAGING_H__ */

Looks okay, but wants accompanying by dropping (i.e. effectively moving)
Arm's respective header. The description than also wants adjusting (it
wasn't quite suitable anyway, as there's missing context).

Jan
Julien Grall Oct. 19, 2023, 10:35 a.m. UTC | #2
Hi,

On 19/10/2023 10:05, Jan Beulich wrote:
> On 14.09.2023 16:56, Oleksii Kurochko wrote:
>> The patch introduces stub header needed for full Xen build.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> ---
>>   xen/include/asm-generic/paging.h | 17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>   create mode 100644 xen/include/asm-generic/paging.h
>>
>> diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-generic/paging.h
>> new file mode 100644
>> index 0000000000..2aab63b536
>> --- /dev/null
>> +++ b/xen/include/asm-generic/paging.h
>> @@ -0,0 +1,17 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +#ifndef __ASM_GENERIC_PAGING_H__
>> +#define __ASM_GENERIC_PAGING_H__
>> +
>> +#define paging_mode_translate(d)	(1)
>> +#define paging_mode_external(d)		(1)
This is more a question for Jan, in the past I recall you asked the 
macor to evaluate the argument. Shouldn't we do the same here?

Also, I think we want to take the opportunity to convert to true. 
Lastly, this seems to be using hard tab rather than soft tab. In Xen we 
use the latter (unless this is a file imported from Linux).

>> +
>> +#endif /* __ASM_GENERIC_PAGING_H__ */
> 
> Looks okay, but wants accompanying by dropping (i.e. effectively moving)
> Arm's respective header.

FWIW, I would be ok if the change is separate. I can help to write it also.

> The description than also wants adjusting (it
> wasn't quite suitable anyway, as there's missing context).

Cheers,
Jan Beulich Oct. 19, 2023, 10:49 a.m. UTC | #3
On 19.10.2023 12:35, Julien Grall wrote:
> Hi,
> 
> On 19/10/2023 10:05, Jan Beulich wrote:
>> On 14.09.2023 16:56, Oleksii Kurochko wrote:
>>> The patch introduces stub header needed for full Xen build.
>>>
>>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>> ---
>>>   xen/include/asm-generic/paging.h | 17 +++++++++++++++++
>>>   1 file changed, 17 insertions(+)
>>>   create mode 100644 xen/include/asm-generic/paging.h
>>>
>>> diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-generic/paging.h
>>> new file mode 100644
>>> index 0000000000..2aab63b536
>>> --- /dev/null
>>> +++ b/xen/include/asm-generic/paging.h
>>> @@ -0,0 +1,17 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +#ifndef __ASM_GENERIC_PAGING_H__
>>> +#define __ASM_GENERIC_PAGING_H__
>>> +
>>> +#define paging_mode_translate(d)	(1)
>>> +#define paging_mode_external(d)		(1)
> This is more a question for Jan, in the past I recall you asked the 
> macor to evaluate the argument. Shouldn't we do the same here?

Would certainly be desirable, and iirc actually needed for one of the
Misra rules.

> Also, I think we want to take the opportunity to convert to true. 
> Lastly, this seems to be using hard tab rather than soft tab. In Xen we 
> use the latter (unless this is a file imported from Linux).

Oh, didn't even notice those; thanks for spotting. If we're at cosmetics,
the parentheses also aren't needed here in the expansions of the macros.

Jan
Oleksii K. Oct. 23, 2023, 9:35 a.m. UTC | #4
Hi, 
On Thu, 2023-10-19 at 11:35 +0100, Julien Grall wrote:
> Hi,
> 
> On 19/10/2023 10:05, Jan Beulich wrote:
> > On 14.09.2023 16:56, Oleksii Kurochko wrote:
> > > The patch introduces stub header needed for full Xen build.
> > > 
> > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > > ---
> > >   xen/include/asm-generic/paging.h | 17 +++++++++++++++++
> > >   1 file changed, 17 insertions(+)
> > >   create mode 100644 xen/include/asm-generic/paging.h
> > > 
> > > diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-
> > > generic/paging.h
> > > new file mode 100644
> > > index 0000000000..2aab63b536
> > > --- /dev/null
> > > +++ b/xen/include/asm-generic/paging.h
> > > @@ -0,0 +1,17 @@
> > > +/* SPDX-License-Identifier: GPL-2.0-only */
> > > +#ifndef __ASM_GENERIC_PAGING_H__
> > > +#define __ASM_GENERIC_PAGING_H__
> > > +
> > > +#define paging_mode_translate(d)       (1)
> > > +#define paging_mode_external(d)                (1)
> This is more a question for Jan, in the past I recall you asked the 
> macor to evaluate the argument. Shouldn't we do the same here?
Could you please share a link?
I am not sure that I am in the context.

> 
> Also, I think we want to take the opportunity to convert to true. 
Sure, we can. I'll change definition to true.

> Lastly, this seems to be using hard tab rather than soft tab. In Xen
> we 
> use the latter (unless this is a file imported from Linux).
Thanks. I'll update tab.

> 
> > > +
> > > +#endif /* __ASM_GENERIC_PAGING_H__ */
> > 
> > Looks okay, but wants accompanying by dropping (i.e. effectively
> > moving)
> > Arm's respective header.
> 
> FWIW, I would be ok if the change is separate. I can help to write it
> also.
I would be glad if you could help.

> 
> > The description than also wants adjusting (it
> > wasn't quite suitable anyway, as there's missing context).
> 
> 
~ Oleksii
Oleksii K. Oct. 23, 2023, 9:40 a.m. UTC | #5
On Thu, 2023-10-19 at 11:05 +0200, Jan Beulich wrote:
> On 14.09.2023 16:56, Oleksii Kurochko wrote:
> > The patch introduces stub header needed for full Xen build.
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> >  xen/include/asm-generic/paging.h | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> >  create mode 100644 xen/include/asm-generic/paging.h
> > 
> > diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-
> > generic/paging.h
> > new file mode 100644
> > index 0000000000..2aab63b536
> > --- /dev/null
> > +++ b/xen/include/asm-generic/paging.h
> > @@ -0,0 +1,17 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef __ASM_GENERIC_PAGING_H__
> > +#define __ASM_GENERIC_PAGING_H__
> > +
> > +#define paging_mode_translate(d)       (1)
> > +#define paging_mode_external(d)                (1)
> > +
> > +#endif /* __ASM_GENERIC_PAGING_H__ */
> 
> Looks okay, but wants accompanying by dropping (i.e. effectively
> moving)
> Arm's respective header. The description than also wants adjusting
> (it
> wasn't quite suitable anyway, as there's missing context).
If I understand you correctly, I'll re-use ARM's header, but I am not
sure I know how the description should be changed except that it can be
more specific regarding which one header is introduced.

~ Oleksii
Jan Beulich Oct. 23, 2023, 10:15 a.m. UTC | #6
On 23.10.2023 11:35, Oleksii wrote:
> On Thu, 2023-10-19 at 11:35 +0100, Julien Grall wrote:
>> On 19/10/2023 10:05, Jan Beulich wrote:
>>> On 14.09.2023 16:56, Oleksii Kurochko wrote:
>>>> The patch introduces stub header needed for full Xen build.
>>>>
>>>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>>> ---
>>>>   xen/include/asm-generic/paging.h | 17 +++++++++++++++++
>>>>   1 file changed, 17 insertions(+)
>>>>   create mode 100644 xen/include/asm-generic/paging.h
>>>>
>>>> diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-
>>>> generic/paging.h
>>>> new file mode 100644
>>>> index 0000000000..2aab63b536
>>>> --- /dev/null
>>>> +++ b/xen/include/asm-generic/paging.h
>>>> @@ -0,0 +1,17 @@
>>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>>> +#ifndef __ASM_GENERIC_PAGING_H__
>>>> +#define __ASM_GENERIC_PAGING_H__
>>>> +
>>>> +#define paging_mode_translate(d)       (1)
>>>> +#define paging_mode_external(d)                (1)
>> This is more a question for Jan, in the past I recall you asked the 
>> macor to evaluate the argument. Shouldn't we do the same here?
> Could you please share a link?
> I am not sure that I am in the context.

There's no particular link to be provided, I think. It is simply good
practice to make sure macros evaluate each of the parameters exactly
once. This is simply to avoid surprises at use sites, where function-
like macro invocations - as that terminology says - look like
function invocations, where every argument expression is also
evaluated exactly once (and in unspecified order).

Jan
Jan Beulich Oct. 23, 2023, 10:29 a.m. UTC | #7
On 23.10.2023 11:40, Oleksii wrote:
> On Thu, 2023-10-19 at 11:05 +0200, Jan Beulich wrote:
>> On 14.09.2023 16:56, Oleksii Kurochko wrote:
>>> The patch introduces stub header needed for full Xen build.
>>>
>>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>> ---
>>>  xen/include/asm-generic/paging.h | 17 +++++++++++++++++
>>>  1 file changed, 17 insertions(+)
>>>  create mode 100644 xen/include/asm-generic/paging.h
>>>
>>> diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-
>>> generic/paging.h
>>> new file mode 100644
>>> index 0000000000..2aab63b536
>>> --- /dev/null
>>> +++ b/xen/include/asm-generic/paging.h
>>> @@ -0,0 +1,17 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +#ifndef __ASM_GENERIC_PAGING_H__
>>> +#define __ASM_GENERIC_PAGING_H__
>>> +
>>> +#define paging_mode_translate(d)       (1)
>>> +#define paging_mode_external(d)                (1)
>>> +
>>> +#endif /* __ASM_GENERIC_PAGING_H__ */
>>
>> Looks okay, but wants accompanying by dropping (i.e. effectively
>> moving)
>> Arm's respective header. The description than also wants adjusting
>> (it
>> wasn't quite suitable anyway, as there's missing context).
> If I understand you correctly, I'll re-use ARM's header, but I am not
> sure I know how the description should be changed except that it can be
> more specific regarding which one header is introduced.

Well, first of all context is missing in "full Xen build" - PPC has recently
reached that point already, and both Arm and x86 have been fully building
for quite some time. And then, as said elsewhere, imo headers needed solely
for building (but being otherwise non-functional) shouldn't be introduced.
At which point it may make sense to give a pointer as to where the
definitions are needed, and clarify why what is introduced is sufficient /
appropriate as fallback for a certain "common" default case of operation.

Jan
diff mbox series

Patch

diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-generic/paging.h
new file mode 100644
index 0000000000..2aab63b536
--- /dev/null
+++ b/xen/include/asm-generic/paging.h
@@ -0,0 +1,17 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_PAGING_H__
+#define __ASM_GENERIC_PAGING_H__
+
+#define paging_mode_translate(d)	(1)
+#define paging_mode_external(d)		(1)
+
+#endif /* __ASM_GENERIC_PAGING_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */