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

Re: [PATCH v2 3/6] xen/riscv: introduce function for physical offset calculation


  • To: Oleksii <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 7 Jul 2023 11:35:25 +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=7oaUgK4GUfbYgKkoMx0K06KlPIwsg+CPjsQWPNp5oZs=; b=gVNUwE486qmQchZF1vZCBalekvq/DL2lM92hGuRUnLIAej9suPygKpLaNFsepyq328HW9jQF2N4qcOzc5tvPI2IVINi4wAtTLxtMZSkMaOfQcejDuEkOMJn2Zmi4yY+QiMbfvSO7AOdQz5v6j3RGugR5NlUX6CVo816HQes0mTpsZ7X5hDbBT4VCrQ1qnszIwzzZCrd5fiR6eSEh2QmvhvyjnV68ZbVjzi+63IRBPd/4ARCnbu1uQUHgkiV/dkCmnitwQXy7MvIeVSoFyVbGKkFdhHuBUq2+44ofLymEDIYGbnadIh9jN85VmThMvHfaTyuIGROQ3MoBvZZWvNLMWQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U2NUg5NX4S57MYok1RuHEjQY6Z6+FVPcVIMKEeg4X6Hir+kboJtSGoinmg7bs1aCJfEgZ2q69rBxkVbVxRGWrwm6ser1GiViGyfcbWT4Www399sKu7iBOj4f3Qw3Wt1UFnO/+ePpEgKVu9sjmeXlcZMj3GtkxWtTjVgi+4EVX8rKLEL+teTdfdabmC/PEGrLVOORdjH1feE+gj16+Eh9m9489WLjE9+xN5VAAEBd4ExtOSPldpz7KWA4Cd64uiOtKDoIDDXI7jVQ8oFb2M2p40Sv0PMbfkCRxswX25UItK0LyXrK2dh98209bVP4Ju5u/VuWYVZAxNaW1oazdyN+xw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 07 Jul 2023 09:35:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.07.2023 11:12, Oleksii wrote:
> On Thu, 2023-07-06 at 13:18 +0200, Jan Beulich wrote:
>> On 19.06.2023 15:34, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/riscv64/head.S
>>> +++ b/xen/arch/riscv/riscv64/head.S
>>> @@ -29,6 +29,8 @@ ENTRY(start)
>>>  
>>>          jal     reset_stack
>>>  
>>> +        jal     calc_phys_offset
>>> +
>>>          tail    start_xen
>>>  
>>>          .section .text, "ax", %progbits
>>
>> Since you call a C function, the code to save/restore a0/a1 needs to
>> move here (from patch 4).
> Thanks. It makes sense.
> It would be better to move save/restore a0/a1 ( from patch 4 )code
> here.
> 
> The only one reason I didn't do that before that calc_phys_offset
> doesn't touch that and it is guaranteed that it will not ( as it
> doesn't have arguments )

How does a function not having parameters guarantee that registers
used for parameter passing aren't touched? Inside a function, the
compiler is free to use argument-passing registers just like other
temporary ones; their values don't need preserving, from all I know
(otherwise the RISC-V ABI would be different to all other ABIs I
know of).

Jan



 


Rackspace

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