From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Julien Grall <julien@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>,
sstabellini@kernel.org, michal.orzel@amd.com,
xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
consulting@bugseng.com, andrew.cooper3@citrix.com,
roger.pau@citrix.com, bertrand.marquis@arm.com,
George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v3] xen: replace occurrences of SAF-1-safe with asmlinkage attribute
Date: Thu, 23 Nov 2023 11:40:15 +0100 [thread overview]
Message-ID: <1b48ead895d32fbb06a2ce67e1450f6b@bugseng.com> (raw)
In-Reply-To: <1f5d5e07-1b34-4e4d-8904-e5463a2db919@xen.org>
On 2023-11-23 11:26, Julien Grall wrote:
> Hi Nicola,
>
> On 23/11/2023 09:25, Nicola Vetrini wrote:
>> On 2023-11-23 09:57, Jan Beulich wrote:
>>> On 16.11.2023 10:08, Nicola Vetrini wrote:
>>>> The comment-based justifications for MISRA C:2012 Rule 8.4 are
>>>> replaced
>>>> by the asmlinkage pseudo-attribute, for the sake of uniformity.
>>>>
>>>> Add missing 'xen/compiler.h' #include-s where needed.
>>>>
>>>> The text in docs/misra/deviations.rst and docs/misra/safe.json
>>>> is modified to reflect this change.
>>>>
>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>> ---
>>>> This patch should be applied after patch 2 of this series.
>>>> The request made by Julien to update the wording is
>>>> contained in the present patch.
>>>
>>> Along with this request he supplied you with an ack. Did you drop
>>> that
>>> for a particular reason, or did you simply forget to record it here?
>>>
>>
>> I forgot and added it in a reply.
>>
>>>> --- a/xen/arch/x86/boot/reloc.c
>>>> +++ b/xen/arch/x86/boot/reloc.c
>>>> @@ -28,6 +28,7 @@ asm (
>>>>
>>>> #include "defs.h"
>>>>
>>>> +#include <xen/compiler.h>
>>>> #include <xen/kconfig.h>
>>>> #include <xen/multiboot.h>
>>>> #include <xen/multiboot2.h>
>>>> @@ -348,9 +349,8 @@ static multiboot_info_t *mbi2_reloc(uint32_t
>>>> mbi_in, uint32_t video_out)
>>>> return mbi_out;
>>>> }
>>>>
>>>> -/* SAF-1-safe */
>>>> -void *__stdcall reloc(uint32_t magic, uint32_t in, uint32_t
>>>> trampoline,
>>>> - uint32_t video_info)
>>>> +void *asmlinkage __stdcall reloc(uint32_t magic, uint32_t in,
>>>> + uint32_t trampoline, uint32_t
>>>> video_info)
>>>> {
>>>
>>> One purpose of asmlinkage is to possibly alter the default C calling
>>> convention
>>> to some more easy to use in assembly code. At least over a period of
>>> time Linux
>>> for example used that on ix86. If we decided to do something like
>>> this, there
>>> would be a collision with __stdcall. Hence I'm not convinced we can
>>> put
>>> asmlinkage here. At which point the complete removal of SAF-1-safe
>>> also would
>>> need dropping.
>>>
>>
>> Ok, so we can keep SAF-1 here and below and leave the wording in
>> deviations.rst and safe.sjon as is.
>
> I guess you mean without this patch applied and not including my
> proposed rewording (i.e. to deprecated SAF-1)?
>
> If so, then we are back to the initial concern I raised. We would have
> two ways to address the deviation. From a user perspective, it would be
> unclear which one should be used.
>
The wording that is now on staging (committed by Stefano).
- Functions and variables used only by asm modules are marked with
the `asmlinkage` macro. Existing code may use a SAF-1-safe
textual deviation (see safe.json), but new code should not use
it.
I guess special cases can be dealt with as they arise. That may or may
not be mentioned in the deviation.
> In particular, I would rather favor asmlinkage whenever it is possible
> and only use SAF-1 when it is not possible to use it (like here).
>
> Another possibility would be to deviate __stdcall like we do for
> asmlinkage (I will let Jan confirm if this is desirable). With this
> approach, there is less ambiguity when to use either of them.
>
> Cheers,
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2023-11-23 10:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 9:08 [XEN PATCH v3] xen: replace occurrences of SAF-1-safe with asmlinkage attribute Nicola Vetrini
2023-11-16 9:15 ` Nicola Vetrini
2023-11-17 19:15 ` Julien Grall
2023-11-18 2:47 ` Stefano Stabellini
2023-11-20 10:22 ` Julien Grall
2023-11-20 8:39 ` Nicola Vetrini
2023-11-20 8:46 ` Jan Beulich
2023-11-20 10:27 ` Julien Grall
2023-11-21 8:16 ` Nicola Vetrini
2023-11-21 9:16 ` Jan Beulich
2023-11-21 9:46 ` Nicola Vetrini
2023-11-21 10:18 ` Jan Beulich
2023-11-21 10:31 ` Nicola Vetrini
2023-11-23 8:57 ` Jan Beulich
2023-11-23 9:25 ` Nicola Vetrini
2023-11-23 10:26 ` Julien Grall
2023-11-23 10:31 ` Jan Beulich
2023-11-23 10:40 ` Nicola Vetrini [this message]
2023-11-23 10:43 ` Julien Grall
2023-11-23 11:30 ` Nicola Vetrini
2023-11-23 11:36 ` Jan Beulich
2023-11-23 11:39 ` Nicola Vetrini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1b48ead895d32fbb06a2ce67e1450f6b@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=ayan.kumar.halder@amd.com \
--cc=bertrand.marquis@arm.com \
--cc=consulting@bugseng.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.