All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <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,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH][for-4.19 v5 2/8] x86: add deviation for asm-only functions
Date: Tue, 31 Oct 2023 09:18:31 +0100	[thread overview]
Message-ID: <68ae1905f2fd345ea0923b31a3065d79@bugseng.com> (raw)
In-Reply-To: <a91fbdc6-1307-dfce-4e5e-351138c49dc6@suse.com>

On 2023-10-31 08:50, Jan Beulich wrote:
> On 31.10.2023 00:02, Stefano Stabellini wrote:
>> On Mon, 30 Oct 2023, Jan Beulich wrote:
>>> On 30.10.2023 10:11, Nicola Vetrini wrote:
>>>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>>>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>>>> @@ -163,6 +163,15 @@ Therefore the absence of prior declarations is 
>>>> safe."
>>>>  -config=MC3R1.R8.4,reports+={safe, 
>>>> "first_area(any_loc(file(gcov)))"}
>>>>  -doc_end
>>>> 
>>>> +-doc_begin="Recognize the occurrence of current_stack_pointer as a 
>>>> declaration."
>>>> +-file_tag+={asm_defns, "^xen/arch/x86/include/asm/asm_defns\\.h$"}
>>>> +-config=MC3R1.R8.4,declarations+={safe, 
>>>> "loc(file(asm_defns))&&^current_stack_pointer$"}
>>>> +-doc_end
>>>> +
>>>> +-doc_begin="asmlinkage is a marker to indicate that the function is 
>>>> only used from asm modules."
>>>> +-config=MC3R1.R8.4,declarations+={safe,"loc(text(^.*asmlinkage.*$, 
>>>> -1..0))"}
>>>> +-doc_end
>>> 
>>> In the longer run asmlinkage will want using for functions used 
>>> either way
>>> between C and assembly (i.e. C->asm calls as well as asm->C ones). 
>>> I'd like
>>> to ask that the text please allow for that (e.g. s/from/to interface 
>>> with/).
>>> 

Will do

>>>> --- a/xen/arch/x86/hvm/svm/intr.c
>>>> +++ b/xen/arch/x86/hvm/svm/intr.c
>>>> @@ -123,7 +123,7 @@ static void svm_enable_intr_window(struct vcpu 
>>>> *v, struct hvm_intack intack)
>>>>          vmcb, general1_intercepts | GENERAL1_INTERCEPT_VINTR);
>>>>  }
>>>> 
>>>> -void svm_intr_assist(void)
>>>> +asmlinkage void svm_intr_assist(void)
>>> 
>>> Nit (here and below): Attributes, unless impossible for some specific
>>> reason, should always go between type and identifier. Not all our 
>>> code
>>> is conforming to that, but I think a majority is, and hence you 
>>> should
>>> be able to find ample examples (taking e.g. __init).
>> 
>> Hi Jan, in general I agree with this principle but I noticed that this
>> is not the way Linux uses asmlinkage, a couple of examples:
>> 
>> asmlinkage void do_page_fault(struct pt_regs *regs);
>> asmlinkage const sys_call_ptr_t sys_call_table[];
>> 
>> Should we go our way or follow Linux on this in terms of code style?
> 
> Linux isn't very consistent in attribute placement anyway, and doing it
> "randomly" relies on the compiler guys never going to tighten what
> attributes mean dependent on their placement (iirc gcc doc has text to
> the effect of this possibly changing at any time). Aiui part of the
> reason why parsing is more relaxed than it should be is that certain
> attributes cannot be placed unambiguously at their nominally dedicated
> place.
> 
> So my personal view on your question is that we should go our more
> consistent way.
> 
> Jan

Ok.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


  reply	other threads:[~2023-10-31  8:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30  9:11 [XEN PATCH][for-4.19 v5 0/8] Fix or deviate various instances of missing declarations Nicola Vetrini
2023-10-30  9:11 ` [XEN PATCH][for-4.19 v5 1/8] xen: modify or add declarations for variables where needed Nicola Vetrini
2023-10-30  9:11 ` [XEN PATCH][for-4.19 v5 2/8] x86: add deviation for asm-only functions Nicola Vetrini
2023-10-30 11:29   ` Julien Grall
2023-10-30 22:54     ` Stefano Stabellini
2023-10-31  8:15       ` Nicola Vetrini
2023-10-30 15:12   ` Jan Beulich
2023-10-30 23:02     ` Stefano Stabellini
2023-10-31  7:50       ` Jan Beulich
2023-10-31  8:18         ` Nicola Vetrini [this message]
2023-10-31  8:22     ` Nicola Vetrini
2023-10-31  8:26       ` Jan Beulich
2023-10-31 22:56         ` Stefano Stabellini
2023-10-30 22:55   ` Stefano Stabellini
2023-10-30  9:11 ` [XEN PATCH][for-4.19 v5 3/8] x86: add asmlinkage macro to variables only used in asm code Nicola Vetrini
2023-10-30  9:11 ` [XEN PATCH][for-4.19 v5 4/8] x86/grant: switch included header to make declarations visible Nicola Vetrini
2023-10-30  9:11 ` [XEN PATCH][for-4.19 v5 5/8] x86/vm_event: add missing include for hvm_vm_event_do_resume Nicola Vetrini
2023-10-30  9:11 ` [XEN PATCH][for-4.19 v5 6/8] xen/console: remove stub definition in consoled.h Nicola Vetrini
2023-10-30  9:11 ` [XEN PATCH][for-4.19 v5 7/8] x86/mem_access: make function static Nicola Vetrini
2023-10-30  9:11 ` [XEN PATCH][for-4.19 v5 8/8] docs/misra: exclude three more files 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=68ae1905f2fd345ea0923b31a3065d79@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=cardoe@cardoe.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=simone.ballarin@bugseng.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.