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

Re: [PATCH 2/5] xen/ppc: Switch to medium PIC code model


  • To: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 1 Aug 2023 08:05:14 +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=AhPl0SC7stn5KY8OCYXi8U52DpOh3sVv03quWlKBUJo=; b=IpuYTLiXv4m4hQvk9VeYpeem7Duo/9uLbSTBHXTdNVtkk9wbIv1rQsdkjOfo7HSDkhHFBQCC16us+r8Ki6AahDx4vnrkQIvUK2r75Zbk+YZhNpx2+dM7U43vfV8zhliTjQ9jqI0HisiRNtSi6TM+AIJtnSj3KuCDxR0oDUtaVheGT01VJwcadXEyeLzuHHf8sF2qwS4dBrTiZKGCSkKxL0hwZPv9wKCjGDYcH/z2potYJoAu3qNTpRtSqXvbixz3vp5xCRh5x/oQ0pf/9DuB/DxqtT7jab7INuJFWwVAZ2qGzhIdqXavR9KL3PH4DS0O/N0ulZ3/gE+ciINDUwcd3Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=md+UJ0ui4xmgE5wH7Cot6YDK40K77/akSoOAW/VQPIYpexG+wPHUlBIVSfGM2IxayzDgDrgLIcHScbf3nVfXqUqImenSb4DpbApg6sajbSRwiHziEZQiTSI0Mbd0J8DwETF+W8GuGtQvuIvAnRv7F2DGHKpk3Wgn7uLu40sshN0di/BP8iJ8MN3RE8u5A3kzxWoXinqX2Oot3lsuKd6Pu0Y4rdDbMgHe9nvdjtoAfKTiNiphY1oc0vkJUZHJMqMN++oLQ2SJg8A8cdqcPh6Y3Q4Yw1HbjP/hBiLe0BdBBL3AdkO7G8ar7DoCI49ykCsKAonPnsGWMG3AoCuR40ZbGQ==
  • 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: Tue, 01 Aug 2023 06:05:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.07.2023 21:09, Shawn Anastasio wrote:
> On 7/31/23 10:58 AM, Jan Beulich wrote:
>> On 28.07.2023 23:35, Shawn Anastasio wrote:
>>> --- a/xen/arch/ppc/ppc64/head.S
>>> +++ b/xen/arch/ppc/ppc64/head.S
>>> @@ -1,9 +1,11 @@
>>>  /* SPDX-License-Identifier: GPL-2.0-or-later */
>>>  
>>>  #include <asm/asm-defns.h>
>>> +#include <asm/asm-offsets.h>
>>>  
>>>      .section .text.header, "ax", %progbits
>>>  
>>> +
>>>  ENTRY(start)
>>
>> Nit: Stray change?
>>
>>> @@ -11,16 +13,19 @@ ENTRY(start)
>>>      FIXUP_ENDIAN
>>>  
>>>      /* set up the TOC pointer */
>>> -    LOAD_IMM32(%r2, .TOC.)
>>> +    bcl        20, 31, .+4
>>
>> Could you use a label name instead of .+4? Aiui you really mean
>>
>>> +1:  mflr    %r12
>>
>> ... "1f" there?
> 
> Yes, good point. I'll point out that this form of the `bcl` instruction
> is specifically defined in the ISA specification as the recommended
> way to obtain the address of the next instruction, and hardware
> implementations presumably optimize it. Using a label instead of +4
> would of course be fine as long as the label immediately follows the
> bcl, but if the label was elsewhere then the optimization that the ISA
> allows for this specific instruction might not be hit. Just something
> that should be kept in mind in case this code is ever refactored.

Hmm, not really. If there was refactoring, the calculations using 1b
would also need adjusting. That's why it's relevant that all "sides"
agree on using one and the same label. (A similar "optimization"
exists in x86 as well, just fyi, so we have precedent of that.)

> I'll change it to 1f in v2.

Thanks.

Jan



 


Rackspace

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