Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-16 Thread Jan Beulich
On 16.03.2023 10:52, Oleksii wrote: >>> >>> Could you please explain what is x86 section asserts? >> >> If you look at the bottom of x86's xen.lds.S you'll find a number of >> assertions, among them one towards .got being empty. Some of the >> sections checked there may indeed not be applicable on

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-16 Thread Oleksii
> > > > Could you please explain what is x86 section asserts? > > If you look at the bottom of x86's xen.lds.S you'll find a number of > assertions, among them one towards .got being empty. Some of the > sections checked there may indeed not be applicable on arbitrary > architectures, but I think

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-16 Thread Oleksii
On Thu, 2023-03-16 at 09:45 +0100, Jan Beulich wrote: > On 16.03.2023 08:42, Oleksii wrote: > > On Wed, 2023-03-15 at 21:12 +, Andrew Cooper wrote: > > > On 15/03/2023 7:59 am, Jan Beulich wrote: > > > > On 14.03.2023 21:16, Oleksii wrote: > > > > > I checked in Linux binary how 'la' instructio

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-16 Thread Jan Beulich
On 16.03.2023 08:42, Oleksii wrote: > On Wed, 2023-03-15 at 21:12 +, Andrew Cooper wrote: >> On 15/03/2023 7:59 am, Jan Beulich wrote: >>> On 14.03.2023 21:16, Oleksii wrote: I checked in Linux binary how 'la' instruction is transformed, and it looks like it is translated as I ex

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-16 Thread Jan Beulich
On 15.03.2023 19:25, Oleksii wrote: > On Wed, 2023-03-15 at 08:35 +0100, Jan Beulich wrote: >> On 14.03.2023 21:16, Oleksii wrote: >>> On Tue, 2023-03-14 at 17:09 +, Andrew Cooper wrote: On 14/03/2023 4:00 pm, Oleksii Kurochko wrote: > The patch is needed to keep all addresses PC-relat

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-16 Thread Jan Beulich
On 15.03.2023 19:33, Oleksii wrote: > On Wed, 2023-03-15 at 08:35 +0100, Jan Beulich wrote: >> On 14.03.2023 21:16, Oleksii wrote: >>> On Tue, 2023-03-14 at 17:09 +, Andrew Cooper wrote: On 14/03/2023 4:00 pm, Oleksii Kurochko wrote: > The patch is needed to keep all addresses PC-relat

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-16 Thread Jan Beulich
On 15.03.2023 19:23, Oleksii wrote: > On Wed, 2023-03-15 at 08:59 +0100, Jan Beulich wrote: >> On 14.03.2023 21:16, Oleksii wrote: >>> I checked in Linux binary how 'la' instruction is transformed, and >>> it >>> looks like it is translated as I expect to auipc/addi pair: >>> ffe01066: 0002

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-16 Thread Oleksii
On Wed, 2023-03-15 at 21:12 +, Andrew Cooper wrote: > On 15/03/2023 7:59 am, Jan Beulich wrote: > > On 14.03.2023 21:16, Oleksii wrote: > > > I checked in Linux binary how 'la' instruction is transformed, > > > and it > > > looks like it is translated as I expect to auipc/addi pair: > > > f

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-15 Thread Andrew Cooper
On 15/03/2023 7:59 am, Jan Beulich wrote: > On 14.03.2023 21:16, Oleksii wrote: >> I checked in Linux binary how 'la' instruction is transformed, and it >> looks like it is translated as I expect to auipc/addi pair: >> ffe01066: 00027517 auipc a0,0x27 >> ffe0106a: f9a50513 addi a0,a

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-15 Thread Oleksii
On Wed, 2023-03-15 at 08:35 +0100, Jan Beulich wrote: > On 14.03.2023 21:16, Oleksii wrote: > > On Tue, 2023-03-14 at 17:09 +, Andrew Cooper wrote: > > > On 14/03/2023 4:00 pm, Oleksii Kurochko wrote: > > > > The patch is needed to keep all addresses PC-relative. > > > > > > > > Pseudoinstruct

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-15 Thread Oleksii
On Wed, 2023-03-15 at 08:35 +0100, Jan Beulich wrote: > On 14.03.2023 21:16, Oleksii wrote: > > On Tue, 2023-03-14 at 17:09 +, Andrew Cooper wrote: > > > On 14/03/2023 4:00 pm, Oleksii Kurochko wrote: > > > > The patch is needed to keep all addresses PC-relative. > > > > > > > > Pseudoinstruct

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-15 Thread Oleksii
On Wed, 2023-03-15 at 08:59 +0100, Jan Beulich wrote: > On 14.03.2023 21:16, Oleksii wrote: > > I checked in Linux binary how 'la' instruction is transformed, and > > it > > looks like it is translated as I expect to auipc/addi pair: > > ffe01066: 00027517 auipc a0,0x27 > > ffe0106a

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-15 Thread Jan Beulich
On 14.03.2023 21:16, Oleksii wrote: > I checked in Linux binary how 'la' instruction is transformed, and it > looks like it is translated as I expect to auipc/addi pair: > ffe01066: 00027517 auipc a0,0x27 > ffe0106a: f9a50513 addi a0,a0,-102 # ffe28000 > > > I checked comp

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-15 Thread Jan Beulich
On 14.03.2023 21:16, Oleksii wrote: > On Tue, 2023-03-14 at 17:09 +, Andrew Cooper wrote: >> On 14/03/2023 4:00 pm, Oleksii Kurochko wrote: >>> The patch is needed to keep all addresses PC-relative. >>> >>> Pseudoinstruction 'la' can be transformed to 'auipc/addi' or >>> 'auipc/l{w|d}'. It depe

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-14 Thread Oleksii
On Tue, 2023-03-14 at 17:09 +, Andrew Cooper wrote: > On 14/03/2023 4:00 pm, Oleksii Kurochko wrote: > > The patch is needed to keep all addresses PC-relative. > > > > Pseudoinstruction 'la' can be transformed to 'auipc/addi' or > > 'auipc/l{w|d}'. It depends on the .option directive: nopic an

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-14 Thread Andrew Cooper
On 14/03/2023 4:00 pm, Oleksii Kurochko wrote: > The patch is needed to keep all addresses PC-relative. > > Pseudoinstruction 'la' can be transformed to 'auipc/addi' or > 'auipc/l{w|d}'. It depends on the .option directive: nopic and pic. > > Right now, 'la' transforms to 'auipc/l{w|d}', which in c

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-14 Thread Bobby Eshleman
On Tue, Mar 14, 2023 at 06:00:41PM +0200, Oleksii Kurochko wrote: > The patch is needed to keep all addresses PC-relative. > > Pseudoinstruction 'la' can be transformed to 'auipc/addi' or > 'auipc/l{w|d}'. It depends on the .option directive: nopic and pic. > > Right now, 'la' transforms to 'auip

Re: [PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-14 Thread Jan Beulich
On 14.03.2023 17:00, Oleksii Kurochko wrote: > The patch is needed to keep all addresses PC-relative. > > Pseudoinstruction 'la' can be transformed to 'auipc/addi' or > 'auipc/l{w|d}'. It depends on the .option directive: nopic and pic. > > Right now, 'la' transforms to 'auipc/l{w|d}', I'm afrai

[PATCH v1] xen/riscv: make calculation of stack address PC-relative

2023-03-14 Thread Oleksii Kurochko
The patch is needed to keep all addresses PC-relative. Pseudoinstruction 'la' can be transformed to 'auipc/addi' or 'auipc/l{w|d}'. It depends on the .option directive: nopic and pic. Right now, 'la' transforms to 'auipc/l{w|d}', which in case of cpu0_boot_stack[] will lead to the usage of _GLOBA