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

Re: [PATCH v4 2/4] xen: Add files needed for minimal ppc64le build


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 19 Jun 2023 10:01:40 +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=LnosluTA5cRZYQhlL4XcCeJvic8miCTBSyAP5luvsFM=; b=FPERfVCRkVUSUFVWfFiWxbjfCIX5ckCaionQCZPAncMNOty4Nf7YpUAZAw2RovHtFtMuz8uX1/q3U1e9SFvUJlyNh7ilPoiFLpGEVYR3iZwUb1VsMW/bCtQF8NmMaUSFumab70t2uGdabZ/BdbX/N47uKaFXYQAepgnjs2lE9+T/Pd0a3nluNIQO3vrsBrbNXbHF9vbuOo0TnhMoK95pgNRp1tryonsl3iaf6XCPeADz6ugfopzxm7PA4tuZALNjytk55f9bHKXZyohAP4jlgOwpcBF2DDqQIzc8iBAkMLzOjIzjL9X+j+sqXJLaxthT0WiHnzqsrtkoz2X8irB6xw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B4grtX007nCFEciGawSWslryoNdyoeNwwf8ISqmbaonU7MrsanI4psUFSW+p64jQ8yQGc+W8wXzX6L0/N3NpsUJzVzSEXyO4Qbdl/lmV26FWlq40dhCiEdSLfi8lTXOi+drxDZ8HwFCwLtiR1CK0i1mzuuf6OKPZnlIux10o917NH0B5jW47jf3sHuO0fYtNMXe8ovCwrLYtaufNQykLp8tb2cMnyVSqAfDLMEyeDYffKu1DrfNmBmmChaBTRQ7ZqWFkugATRb/ZwUXAod11HfdUvt1pW0SVqyDAavrfwGJc66aM2OSaN+pm458hZ0OVzI5C4DzwzK/OG2Q7hOrSOQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: tpearson@xxxxxxxxxxxxxxxxxxxxx, George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 19 Jun 2023 08:02:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.06.2023 22:39, Julien Grall wrote:
> On 16/06/2023 21:24, Andrew Cooper wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/ppc/ppc64/head.S
>>> @@ -0,0 +1,27 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>>> +
>>> +.section .text.header, "ax", %progbits
>>> +
>>> +ENTRY(start)
>>> +    /*
>>> +     * Depending on how we were booted, the CPU could be running in either
>>> +     * Little Endian or Big Endian mode. The following trampoline from 
>>> Linux
>>> +     * cleverly uses an instruction that encodes to a NOP if the CPU's
>>> +     * endianness matches the assumption of the assembler (LE, in our case)
>>> +     * or a branch to code that performs the endian switch in the other 
>>> case.
>>> +     */
>>> +    tdi 0, 0, 0x48    /* Reverse endian of b . + 8          */
>>> +    b . + 44          /* Skip trampoline if endian is good  */
>>> +    .long 0xa600607d  /* mfmsr r11                          */
>>> +    .long 0x01006b69  /* xori r11,r11,1                     */
>>> +    .long 0x00004039  /* li r10,0                           */
>>> +    .long 0x6401417d  /* mtmsrd r10,1                       */
>>> +    .long 0x05009f42  /* bcl 20,31,$+4                      */
>>> +    .long 0xa602487d  /* mflr r10                           */
>>> +    .long 0x14004a39  /* addi r10,r10,20                    */
>>> +    .long 0xa6035a7d  /* mtsrr0 r10                         */
>>> +    .long 0xa6037b7d  /* mtsrr1 r11                         */
>>> +    .long 0x2400004c  /* rfid                               */
>>> +
>>> +    /* Now that the endianness is confirmed, continue */
>>> +1:  b 1b
>>
>> .size start, . - start
>> .type start, %function
> 
> Shouldn't we introduce ENDPROC()/END() to avoid open-coding these two 
> lines everywhere?

A proposal for this is pending, see "x86: annotate entry points with
type and size". That proposal extends to asking whether to use this
scheme uniformly, not just for x86.

Jan



 


Rackspace

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