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

Re: [PATCH 8/9] xen/ppc: Add stub function and symbol definitions


  • To: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 28 Aug 2023 08:26:20 +0200
  • 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=P8UOidGIClrirOOYsmFd5eNCoEX1xONL/rumc0CnnaQ=; b=WsyAzYL9hi2K3wF+oOo4OOnPeifnmidIpCdWl8q0wnH2Ez5duYp0teHDwCwp2XgfnphMv6VFI3oDCeVOqxxf9Y8EVjOKZOy+g2rAbKxHQRWeSdGTEbK9eUoFqO7iOQF4QWfTTFgBGyFm1k9HOGV5w3r1WDOnq6zWiaX6eHHgdQq0iLavAy9D3jkVTfGuBSlyJG1tMOWOUq802ygcPRPVGJ4zKWFay34ja3QOVK56llHYsskIOY788iz+/X1/hSovlisaVzyT5GimsOT5VvpDkvBQBXXpcLIyvse4DOiLH5WB0kL/MSS9jSbKDdmOSRF5J2iaK3I1L5GV/zkztd08zQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WJ/cJAeSqc0m2e2bOV+AVcxxVmsutllKlVdHdUZClD38BKEyZeqoVl0MZy77Oa8+wlIxeBi0VHVqdv3eKbiUSAipSYnbXfB4ZhLMOb6BN0m51qMKy3v4Mm/Z1GaDGarg3KctpA7G2TQI8TARLYaj/UY53TNMbdzr9ybCtCQm1LgXWUf33fcScaTCilX+PM/uMBG8XeJ4yL0643yI2Og9BEyhWI3kk4Stwq9J5PqBVDOoP9z4mQpBOMO79AjVCepC5KsEg4T45nHtYjbWJik31FHq2D/KhWLfYJxXq0cOpn8DEdeTm39incXH2OXcu/k3ShpwnZjF910jyQEh+8vKHQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 28 Aug 2023 06:26:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.08.2023 19:26, Shawn Anastasio wrote:
> On 8/25/23 4:10 AM, Jan Beulich wrote:
>> On 23.08.2023 20:39, Shawn Anastasio wrote:
>>> On 8/8/23 5:27 AM, Jan Beulich wrote:
>>>> On 03.08.2023 01:03, Shawn Anastasio wrote:
>>>>> --- /dev/null
>>>>> +++ b/xen/arch/ppc/stubs.c
>>>>> @@ -0,0 +1,351 @@
>>>>> [...]
>>>>> +static void ack_none(struct irq_desc *irq)
>>>>> +{
>>>>> +    BUG();
>>>>> +}
>>>>> +
>>>>> +static void end_none(struct irq_desc *irq)
>>>>> +{
>>>>> +    BUG();
>>>>> +}
>>>>> +
>>>>> +hw_irq_controller no_irq_type = {
>>>>> +    .typename = "none",
>>>>> +    .startup = irq_startup_none,
>>>>> +    .shutdown = irq_shutdown_none,
>>>>> +    .enable = irq_enable_none,
>>>>> +    .disable = irq_disable_none,
>>>>> +    .ack = ack_none,
>>>>> +    .end = end_none
>>>>> +};
>>>>
>>>> I would recommend to avoid filling pointers (and hence having private
>>>> hook functions) where it's not clear whether they'll be required. "end",
>>>> for example, is an optional hook on x86. Iirc common code doesn't use
>>>> any of the hooks.
>>>
>>> Alright, I'll drop the `end_none` stub and leave the .end pointer as
>>> NULL.
>>
>> Yet my comment was about all the (presently dead) hook functions.
> 
> Sorry, I misunderstood. To clarify, by "hook functions" you're referring
> to all of the function pointer fields of hw_irq_controller? Are all
> users of this struct going to properly check for NULL before trying to
> call these function pointers?

If I'm not mistaken, all uses of these hooks are in arch-specific code
(we don't have a proper common layer, unlike Linux). Hence what checks
there are going to be is all up to you. But as long as none of the fields
are used, supplying (stub) hooks is pointless in the first place. IOW you
can leave the pointers at NULL now and still use them later without
checks, so long as at _that_ time you populate them (and then not just
pointing to stub functions).

My main point here is: This introduction of temporary stubs would better
be as little overhead and as little code churn as possible - minimum
number of new symbols/functions/objects, just enough for things to build.

Jan



 


Rackspace

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