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

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


  • To: Oleksii <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 23 Feb 2023 14:25:32 +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=KeCDSOHsY27B4uBG9IQJ1YATBHPkM0LrgQthGtNA4Bs=; b=OIHkx07Z1/ErW7AwqcbWrJqZsERjNpgfEpf528zZvu38s4Yfiv7qFjI+P9c0Dy0c9PBgw0Zv9rUlLbLGqVmaFe2PV6RYoVcN1C8EI3V8suzNP2M9Gjr1PdewllDiDQzISWo/QZQoI54is2Jm7PMS57/LQGPl9GCJ+rN9EuoR8pY+Fd5jOBB3D5Ogrm+V5irtxCAvxIBGYv4bmgDTvM5+JPSg6vPpuTsGxCX4VwhVfRdfOcnX4dEUm5y4TlXA7Cm8yHA4vvRZ+dDI4wB0aWQ0sHUOejlvEcLmxmsXJiewuIYlN+QLtFsq845SwCj8byvrJA6G8DDepMpuT9pVFPnhhQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YgD2YXWoZ7faIVZIgu0cJlcvaDsMGy6HSdj+F9ARlSoK0bv88Ygh4apzDbiORfu8Lss3IIj2L71KdKeH6oiBXjkAEyNXzfiUYJMvP/XgzgGnB3epznOdzXEzsqZvfhM6h1aIlJ8+hM75ep7tzg+qkv+qqHuIrrtDCJQ4wfsmKk1ZLSoN66UwcYcY2n4EKx1Oq0NrHteWuEGoF8XaS5tiNfSRHrQ9j1Skm7kJCpDzMF1s6U54aL2thiD3yXkSRi8saWo8XvoE6gYqCp/83E9mjZEM5tdvTAoaARDu6PQkpFZv/xNaNG9+4WOhrrcAU4e/+nSyL6bIoUwOFp/rHSNb3w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Thu, 23 Feb 2023 13:25:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.02.2023 14:16, Oleksii wrote:
>>
>>> +        void (*fn)(const struct cpu_user_regs *) = (void *)regs-
>>>> BUG_FN_REG;
>>
>> ... this, wouldn't it be better (and independent of the specific
>> arch) if
>> you checked for BUG_FN_REG being defined?
>>
>> Another (#ifdef-free) variant would be to have bug_ptr() take a 2nd
>> argument
>> and then uniformly use ...
>>
>>> +#else
>>> +        void (*fn)(const struct cpu_user_regs *) = bug_ptr(bug);
>>
>> ... this, slightly altered to
>>
>>         void (*fn)(const struct cpu_user_regs *) = bug_ptr(bug,
>> regs);
> I think that I will go with BUG_FN_REG instead of changing bug_ptr()'s
> arguments as bug_ptr() is used below to get file name so it won't be
> clear what bug_ptr() should return either an address of file name or
> regs->BUG_FN_REG.

Oh, indeed - I'm sorry that I didn't pay attention to ...

>>> +#endif
>>> +
>>> +        fn(regs);
>>> +        return 0;
>>> +    }
>>> +
>>> +    /* WARN, BUG or ASSERT: decode the filename pointer and line
>>> number. */
>>> +    filename = bug_ptr(bug);
>>> +    if ( !is_kernel(filename) && !is_patch(filename) )

... this 2nd use.

Jan



 


Rackspace

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