[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH][for-4.19 v5 2/8] x86: add deviation for asm-only functions


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 31 Oct 2023 09:26:59 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hrga80tquEQ+dISSCnrS4LHWXksW7tVYEjiF4NNaW4U=; b=cFxHIF4NTuZ4uwTBvEVtNPL3vdm7Otfhb+e6+nWLgm+CVMynNhqID4Qdi8etNyjQn2rqq4eXi9leUvYDdOYbrvXvBbuQBhr8op4ZhCgqx3QEZ4QzLBy2TW5JWqOpFAzb6T9p5buHR/wvb63GBsq6dxnw2CtUjOKVhWC/K2o5vJyRXJ8pdD6Q0Mw40pwt2lSqMFZGxPX2Gp5Ys1GRFzzKhO1VJJxB/UiwVpHFhG2qakmf7ngeeJIMI+e5AqH26IeviUZIszu7lAD3HIaz3WD/OJnWZ0Zv98FTxekV5sEOCO4Q1kprFrrx9vl9z4WHevcgQ+yGUOwZipWnUjhvAB9QdA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XKBAYJLpn8wgESexsayI5JCgHsbPqCep3pYX0DX1eV/GLRujJFEujFTyxmr+uayMvS7l6KhlQkXPDz2uNDcnoK1uyKUrxSRVyVox01drtYdleQXAe6dYU0/3GNoNkYha4ot+ReAXbgVOblXdbZJuZw1L6yxJ5JCCSpXyizG8edWFuXrkc2l1rfMSE+BXScHvxiUanPeJOy8lz6Wnl8E5Nd9ThqNz6ILr1ah/hbhhDSvX7LQlVP7mxbd1xgyuKGEsyWsoWM3TPni5JFdAHpgjhdcQ/z0lncyh4dZTlaWTbbEm9KOBXMfuv0wGDKQKsdeYafotdMi9aGRB9hfC/8gHmA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, Simone Ballarin <simone.ballarin@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 31 Oct 2023 08:27:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.10.2023 09:22, Nicola Vetrini wrote:
> On 2023-10-30 16:12, 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/).
>>
>>> --- 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).
>>
>>> --- a/xen/include/xen/compiler.h
>>> +++ b/xen/include/xen/compiler.h
>>> @@ -159,6 +159,9 @@
>>>  # define ASM_FLAG_OUT(yes, no) no
>>>  #endif
>>>
>>> +/* Mark a function or variable as used only from asm */
>>> +#define asmlinkage
>>
>> I appreciate this being an immediately "natural" place, but considering
>> what we know from Linux I think we ought to allow for arch overrides 
>> here
>> right away. For that I'm afraid compiler.h isn't best; it may still be
>> okay as long as at least an #ifndef is put around it. Imo, however, 
>> this
>> ought to go into xen/linkage.h, as is being introduced by "common:
>> assembly entry point type/size annotations". It's somewhat a shame that
>> this and the rest of that series has missed 4.18 ...
> 
> An #ifndef around what, exactly?

The #define. That way at least an arch's config.h can override it.

> Anyway, making (part of) this series 
> wait for approval
> until the other has been accepted into 4.19 (for which I have no 
> specific timeframe)
> does not seem that desirable to me.

It's not ideal, but you or anyone else are free to help that other work
make progress.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.