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

Re: [PATCH v1 1/4] xen: introduce CONFIG_GENERIC_BUG_FRAME


  • To: Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 13 Feb 2023 13:33:39 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=fU3C5XFJST73ONsVDOydkoum9yzfaDwok36FqCyALos=; b=Xp92Zs2tuEsZfYpO6joqOrNMmU5eCYtcUp/iTa5sTbX1enZAuiRp6eswVuNsN53CYJDhcQOrkvlVHMfvcce3LtJbPyIPBs2cUW32hm9ZTDJcYXNojwkKRKyYKwMRdXC2utzCZoMHr+bVb1rpmBs53wa0Bt4ul/pVQjNrAzGSVAovLI3F1KfKUWjXC9anJd7gqUy00GTWuBauXnwG0YSyC8ywbtgTaarxPWzQvAxbLvOFW3tBbe6JCXfdntVbA2jbCidcGcANsHIsHlfFGph+X4r6JkJAbEj8nC5QQFvVt0bJcy7vOiXcRquC5RHExHH5dZA6z1FYne7T2B8VuxZy6w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gQeOVUHMnvzR8gIWY+fgsXIztf+G1a21NpMO9rV8tawdNcbR6qpQoToTiQaa0nvfC+q5ATVJVQ2S5HKQf8HvgLKhwBYtenu/rs5/8MaUBIysNz/NquPRhwTMiDAw1qXadVG06QxnJW3Q2AYr8g2QuN+qYhLZG7PnH6sogtoqIoY49y0PtrwpF/pYFxcf9cDmw1I6he6x+ma+1yre6Ym+AZ2nonwya/hFHWbIydCtVvvunxs/UCTrB1Zn+pkoILJ05s9DdtugpxxWJX1dgK+Wv/QNv6Seh+yyftt44Nh45dgm1/SQ0ib42IN/jC1vYGbeOkEi7JILFgtFJLmzzky4Ag==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 13 Feb 2023 13:34:19 +0000
  • Ironport-data: A9a23:gXG3A6zzFRqDQPXZBqF6t+fexyrEfRIJ4+MujC+fZmUNrF6WrkUCy mMZD2mGPPmOY2akeNxyPoXgphlX6pbSzIIwGQpp/yAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw//F+UwHUMja4mtC5QRkPKsT5jcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KXlM9 aMyOAk8VxvAqs3o4LWEcPBLmP12eaEHPKtH0p1h5RfwKK9+BLzmHeDN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjiVlVQpuFTuGIO9ltiibMNZhEuH4 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuqCdhIRebhp5aGhnWv6E4fVzdOfmCJsMeJsRSeXtMEM 2E9r39GQa8asRbDosPGdx+lpH+Ju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en-devel.lists.xenproject.org>

On 13/02/2023 1:19 pm, Julien Grall wrote:
>
>
> On 13/02/2023 12:24, Jan Beulich wrote:
>> On 03.02.2023 18:05, Oleksii Kurochko wrote:
>>> --- a/xen/common/Kconfig
>>> +++ b/xen/common/Kconfig
>>> @@ -92,6 +92,12 @@ config STATIC_MEMORY
>>>           If unsure, say N.
>>>   +config GENERIC_DO_BUG_FRAME
>>> +    bool
>>> +    help
>>> +      Generic do_bug_frame() function is needed to handle the type
>>> of bug
>>> +      frame and print an information about it.
>>
>> Generally help text for prompt-less functions is not very useful.
>> Assuming
>> it is put here to inform people actually reading the source file, I'm
>> okay
>> for it to be left here, but please at least drop the stray "an". I also
>> think this may want moving up in the file, e.g. ahead of all the HAS_*
>> controls (which, as you will notice, all have no help text either). Plus
>> finally how about shorter and more applicable GENERIC_BUG_FRAME - after
>> all what becomes generic is more than just do_bug_frame()?
>>
>>> --- /dev/null
>>> +++ b/xen/common/bug.c
>>> @@ -0,0 +1,88 @@
>>> +#include <xen/bug.h>
>>> +#include <xen/errno.h>
>>> +#include <xen/types.h>
>>> +#include <xen/kernel.h>
>>
>> Please order headers alphabetically unless there's anything preventing
>> that from being done.
>>
>>> +#include <xen/string.h>
>>> +#include <xen/virtual_region.h>
>>> +
>>> +#include <asm/processor.h>
>>> +
>>> +int do_bug_frame(const struct cpu_user_regs *regs, vaddr_t pc)
>>
>> I know Arm is using vaddr_t and RISC-V now also has it, but in UNIX-like
>> environments that's redundant with "unsigned long", and it's also
>> redundant with C99's uintptr_t. Hence when seeing the type I always
>> wonder whether it's really a host virtual address which is meant (and
>> not perhaps a guest one, which in principle could differ from the host
>> one for certain guest types). In any event the existence of this type
>> should imo not be a prereq to using this generic piece of infrastructure
>
> C spec aside, the use "unsigned long" is quite overloaded within Xen.
> Although, this has improved since we introduced mfn_t/gfn_t.
>
> In the future, I could imagine us to also introduce typesafe for
> vaddr_t, reducing further the risk to mix different meaning of
> unsigned long.
>
> Therefore, I think the introduction of vaddr_t should be a prereq for
> using the generic piece of infrastructure.

I'm with Jan on this.  vaddr_t is pure obfuscation, and you can do what
you like with it in ARM, but you will find very firm objection to it
finding its way into common or x86 code.

virtual addresses are spelt 'unsigned long'.

~Andrew



 


Rackspace

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