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

Re: [PATCH v2 1/3] xen/ppc: Set up a basic C environment


  • To: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 23 Jun 2023 08:34: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=6EdVSHky/o+iTh9FJ0jzTnOzH+1V/kyuI4qmjY0voV0=; b=QjWCD1LXvOH65/lgkMIA0naVDT9DfutbWXOk/StNH5+eY31pH6yxFaS2t1tTN+T2H8HsYHI8sux/Op5TBPHT1W8zen40lsygIIRRbA1ZOXZsIoO5TXnSfBVulN+BUuQ/sCrnCoTIXXV9Aqw8f9qCfbCx1wVclPw8SJIyo5itW5fKBlwJyd5nco1juY+PpkbYnOJhFs6kHZqZkr6Eg6vF2UOKGVp+SRyPOH7mlcODhzpOgRMQIVOqgce3IxDcik9TGRvuGGxjrus6l98CC4InuWtCvfI1cB0T9sPteD1UARa8tthDG1RZRjTxYPiUT/lU2MnrcKlEym23ZRaCGDcsPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TSgO1QrWR/Jka0HAoXd8dVzwUppxfLpa47gt/RCH4t4tuagyefFIbKbgMdZm4FOdx9stsepwIbCk+wcA/gM7I4se7i0MPbA+mHhVwAMlqvRBBb+1BZigO/ZMiWrgXmI4vJ1UCoJyoSRRI3Hq5NIz2bTX9arjS6h9l9unpCYypJKXPjpEC8vw+J0XsZm+zBCfSdQdEmmCN98RdKCzSj3l15acjgvGjP398H4gYbJ9R+RoqMuvQbHHmNGdu2RsDL5IhQJKx0uluRqsn7ooSvR2TMvRFJmk6dYH/kUXKmDH0UvWSRuMYQS+4T6cbKf9tdw6nWHC67uwY2YRziPmWYNOAw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 23 Jun 2023 06:34:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.06.2023 03:26, Shawn Anastasio wrote:
> On 6/22/23 5:49 PM, Andrew Cooper wrote:
>> On 22/06/2023 9:57 pm, Shawn Anastasio wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/ppc/setup.c
>>> @@ -0,0 +1,13 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>>> +#include <xen/init.h>
>>> +
>>> +void __init noreturn start_xen(unsigned long r3, unsigned long r4,
>>> +                               unsigned long r5, unsigned long r6,
>>> +                               unsigned long r7)
>>> +{
>>> +    for ( ;; )
>>> +        /* Set current hardware thread to very low priority */
>>> +        asm volatile("or %r31, %r31, %r31");
>>
>> Is there something magic about the OR instruction, or something magic
>> about %r31?
> 
> Using the OR instruction with all three operands equal is of course a
> no-op, but when using certain registers it can have a separate magic
> side effect.
> 
> `or r31,31,31` is one such form that sets the Program Priority Register
> to "very low" priority. Of course here where we don't have SMP going
> there's not much point in using this over the standard side effect-less
> no-op (`or r0,r0,r0` or just `nop`).
> 
> For a table of these magic OR forms, you can see page 836 of the Power
> ISA 3.0B:
> https://wiki.raptorcs.com/w/images/c/cb/PowerISA_public.v3.0B.pdf

I have 3.1 to hand, and it looks like they were dropped from there?
Otherwise I was meaning to say that it's a shame gas doesn't support
these.

Anyway - I think you want to put this behind a macro named after the
pseudo.

Finally, as a nit: Style above is lacking several blanks. One
between the two semicolons, and a total of three in the asm().

Jan



 


Rackspace

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