[PATCH v1 4/8] xen/riscv: introduce function for physical offset calculation

2023-06-06 Thread Oleksii Kurochko
The function was introduced to not calculate and save physical offset before MMU is enabled because access to start() is PC-relative and in case of linker_addr != load_addr it will result in incorrect value in phys_offset. Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/mm.h | 2

[PATCH v1 1/8] xen/riscv: make sure that identity mapping isn't bigger then page size

2023-06-06 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/xen.lds.S | 9 + 1 file changed, 9 insertions(+) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 878130f313..74afbaab9b 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -20,6 +20,7

[PATCH v1 3/8] xen/riscv: introduce reset_stack() function

2023-06-06 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/riscv64/head.S | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index 8887f0cbd4..6fb7dd80fd 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv

[PATCH v1 2/8] xen/riscv: add .sbss section to .bss

2023-06-06 Thread Oleksii Kurochko
Sometimes variables are located in .sbss section but it won't be mapped after MMU will be enabled. To avoid MMU failures .sbss should be mapped Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/xen.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/riscv

[PATCH v1 0/8] xen/riscv: introduce identity mapping

2023-06-06 Thread Oleksii Kurochko
. * Added __ASSEMBLY__ guards. * move extern of cpu0_boot_stack to a header. The reason for this patch series can be found here: https://lore.kernel.org/xen-devel/4e336121-fc0c-b007-bf7b-430352563...@citrix.com/ Oleksii Kurochko (8): xen/riscv: make sure that identity mapping isn't bigger then page

[PATCH v1 5/8] xen/riscv: introduce identity mapping

2023-06-06 Thread Oleksii Kurochko
The way how switch to virtual address was implemented in the commit e66003e7be ("xen/riscv: introduce setup_initial_pages") wasn't safe enough so identity mapping was introduced and used. Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages") Signed-off-by: Oleksii Kur

[PATCH v6 6/6] xen/riscv: test basic handling stuff

2023-05-29 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V6: - Nothing changed --- Changes in V5: - Nothing changed --- Changes in V4: - Add Acked-by: Alistair Francis --- Changes in V3: - Nothing changed --- Changes in V2: - Nothing changed --- xen/arch/riscv

[PATCH v6 4/6] xen/riscv: introduce trap_init()

2023-05-29 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- Changes in V6: - trap_init() is now called after enabling the MMU. - Add additional explanatory comments. --- Changes in V5: - Nothing changed --- Changes in V4: - Nothing changed --- Changes in V3: - Nothing changed

[PATCH v6 1/6] xen/riscv: introduce temporary printk stuff

2023-05-29 Thread Oleksii Kurochko
The patch introdcuces printk related stuff which should be deleted after Xen common code will be available. Signed-off-by: Oleksii Kurochko --- Changes in V6: - the patch was introduced in the current patch series (V6) --- xen/arch/riscv/early_printk.c | 168

[PATCH v6 5/6] xen/riscv: introduce an implementation of macros from

2023-05-29 Thread Oleksii Kurochko
nformation. Signed-off-by: Oleksii Kurochko --- Changes in V6: - Avoid LINK_TO_LOAD() as bug.h functionality expected to be used after MMU is enabled. - Change early_printk() to printk() --- Changes in V5: - Remove "#include " from as there is no any need in it anymo

[PATCH v6 2/6] xen/riscv: introduce dummy

2023-05-29 Thread Oleksii Kurochko
will be used in the patch "xen/riscv: introduce decode_cause() stuff" and requires Signed-off-by: Oleksii Kurochko --- Changes in V6: - Nothing changed. Only rebase. --- Changes in V5: * the patch was introduced in the current patch series (V5) --- xen/arch/riscv/include/asm/

[PATCH v6 0/6] [PATCH v5 0/7] RISCV basic exception handling implementation

2023-05-29 Thread Oleksii Kurochko
mpty headers: and as they are needed to include which provides ARRAY_SIZE and other macros. - Code style fixes. --- Oleksii Kurochko (6): xen/riscv: introduce temporary printk stuff xen/riscv: introduce dummy xen/riscv: introduce decode_cause() stuff xen/riscv: introduce trap_init()

[PATCH v6 3/6] xen/riscv: introduce decode_cause() stuff

2023-05-29 Thread Oleksii Kurochko
The patch introduces stuff needed to decode a reason of an exception. Signed-off-by: Oleksii Kurochko --- Changes in V6: - Remove usage of LINK_TO_LOAD() due to the MMU being enabled first. - Change early_printk() to printk() --- Changes in V5: - Remove from riscv/traps/c as nothing would

[PATCH v9 0/5] enable MMU for RISC-V

2023-05-25 Thread Oleksii Kurochko
automation: update RISC-V smoke test" from the patch series as it was introduced simplified approach for RISC-V smoke test by Andrew Cooper * Add patch [[xen/riscv: remove dummy_bss variable] as there is no any sense in dummy_bss variable after introduction of inittial page t

[PATCH v9 3/5] xen/riscv: align __bss_start

2023-05-25 Thread Oleksii Kurochko
.bss section") Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V9: * Nothing changed. Only rebase. --- Changes in V8: * Remove ". = ALIGN(PAGE_SIZE);" before "*(.bss.page_aligned)" in vmlinux.lds.S file as any contribution to .bss.page_aligned have

[PATCH v9 4/5] xen/riscv: setup initial pagetables

2023-05-25 Thread Oleksii Kurochko
The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko --- Changes in V9: - Nothing changed. Only rebase --- Changes in V8: - Nothing changed. Only rebase --- Changes in V7: - Nothing

[PATCH v9 5/5] xen/riscv: remove dummy_bss variable

2023-05-25 Thread Oleksii Kurochko
After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V9: - Nothing changed. Only rebase --- Changes in V8: - Nothing changed. Only rebase --- Changes in V7: - Nothing

[PATCH v9 2/5] xen/riscv: introduce setup_initial_pages

2023-05-25 Thread Oleksii Kurochko
ons for specific section ( such as .text, .rodata, etc ) otherwise RW permission will be set by default. * Add function to check that requested SATP_MODE is supported Origin: g...@github.com:xvisor/xvisor.git 9be2fdd7 Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V9: - Add &

[PATCH v9 1/5] xen/riscv: add VM space layout

2023-05-25 Thread Oleksii Kurochko
Also it was added explanation about ignoring of top VA bits Signed-off-by: Oleksii Kurochko --- Changes in V9: - Update comment for VM layout description. --- Changes in V8: - Add "#ifdef RV_STAGE1_MODE == SATP_MODE_SV39" instead of "#ifdef SV39" in the comment to V

[PATCH v8 3/5] xen/riscv: align __bss_start

2023-05-22 Thread Oleksii Kurochko
.bss section") Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V8: * Remove ". = ALIGN(PAGE_SIZE);" before "*(.bss.page_aligned)" in vmlinux.lds.S file as any contribution to .bss.page_aligned have to specify proper alignment themselves. * Add

[PATCH v8 1/5] xen/riscv: add VM space layout

2023-05-22 Thread Oleksii Kurochko
Also it was added explanation about ignoring of top VA bits Signed-off-by: Oleksii Kurochko --- Changes in V8: - Add "#ifdef RV_STAGE1_MODE == SATP_MODE_SV39" instead of "#ifdef SV39" in the comment to VM layout description. - Update the upper bound of direct m

[PATCH v8 0/5] enable MMU for RISC-V

2023-05-22 Thread Oleksii Kurochko
such section in xen.lds.S * Update the argument of pte_is_valid() to "const pte_t *p" * Remove patch "[PATCH v1 3/3] automation: update RISC-V smoke test" from the patch series as it was introduced simplified approach for RISC-V smoke test by Andrew Cooper * Add patch [

[PATCH v8 2/5] xen/riscv: introduce setup_initial_pages

2023-05-22 Thread Oleksii Kurochko
ons for specific section ( such as .text, .rodata, etc ) otherwise RW permission will be set by default. * Add function to check that requested SATP_MODE is supported Origin: g...@github.com:xvisor/xvisor.git 9be2fdd7 Signed-off-by: Oleksii Kurochko --- Changes in V8: - Add parentheses for

[PATCH v8 5/5] xen/riscv: remove dummy_bss variable

2023-05-22 Thread Oleksii Kurochko
After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V8: - Nothing changed. Only rebase --- Changes in V7: - Nothing changed. Only rebase --- Changes in V6: - Nothing

[PATCH v8 4/5] xen/riscv: setup initial pagetables

2023-05-22 Thread Oleksii Kurochko
The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko --- Changes in V8: - Nothing changed. Only rebase --- Changes in V7: - Nothing changed. Only rebase --- Changes in V6: - Nothing

[PATCH v7 0/5] enable MMU for RISC-V

2023-05-11 Thread Oleksii Kurochko
oke test by Andrew Cooper * Add patch [[xen/riscv: remove dummy_bss variable] as there is no any sense in dummy_bss variable after introduction of inittial page tables. --- Oleksii Kurochko (5): xen/riscv: add VM space layout xen/riscv: introduce setup_initial_pages xen/riscv: align __bss_sta

[PATCH v7 4/5] xen/riscv: setup initial pagetables

2023-05-11 Thread Oleksii Kurochko
The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko --- Changes in V7: - Nothing changed. Only rebase --- Changes in V6: - Nothing changed. Only rebase --- Changes in V5: - Nothing

[PATCH v7 3/5] xen/riscv: align __bss_start

2023-05-11 Thread Oleksii Kurochko
bss clear cycle requires proper alignment of __bss_start. Signed-off-by: Oleksii Kurochko --- Changes in V7: * the patch was introduced in the current patch series. --- xen/arch/riscv/xen.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv

[PATCH v7 2/5] xen/riscv: introduce setup_initial_pages

2023-05-11 Thread Oleksii Kurochko
ons for specific section ( such as .text, .rodata, etc ) otherwise RW permission will be set by default. * Add function to check that requested SATP_MODE is supported Origin: g...@github.com:xvisor/xvisor.git 9be2fdd7 Signed-off-by: Oleksii Kurochko --- Changes in V7: - define CONFIG_PAGING_LEV

[PATCH v7 1/5] xen/riscv: add VM space layout

2023-05-11 Thread Oleksii Kurochko
Also it was added explanation about ignoring of top VA bits Signed-off-by: Oleksii Kurochko --- Changes in V7: - Fix range of frametable range in RV64 layout. - Add ifdef SV39 to the RV64 layout comment to make it explicit that description if for SV39 mode. - Add missed row in the RV64

[PATCH v7 5/5] xen/riscv: remove dummy_bss variable

2023-05-11 Thread Oleksii Kurochko
After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V6: - Nothing changed. Only rebase --- Changes in V5: - Nothing changed. Only rebase --- Changes in V4: - Nothing

[PATCH v6 4/4] xen/riscv: remove dummy_bss variable

2023-05-03 Thread Oleksii Kurochko
After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V6: - Nothing changed. Only rebase --- Changes in V5: - Nothing changed. Only rebase --- Changes in V4: - Nothing

[PATCH v6 2/4] xen/riscv: introduce setup_initial_pages

2023-05-03 Thread Oleksii Kurochko
ons for specific section ( such as .text, .rodata, etc ) otherwise RW permission will be set by default. * Add function to check that requested SATP_MODE is supported Origin: g...@github.com:xvisor/xvisor.git 9be2fdd7 Signed-off-by: Oleksii Kurochko --- Changes in V6: - move PAGE_SHIFT, PADDR_BITS t

[PATCH v6 0/4] enable MMU for RISC-V

2023-05-03 Thread Oleksii Kurochko
patch series as it was introduced simplified approach for RISC-V smoke test by Andrew Cooper * Add patch [[xen/riscv: remove dummy_bss variable] as there is no any sense in dummy_bss variable after introduction of inittial page tables. --- Oleksii Kurochko (4): xen/riscv: add VM sp

[PATCH v6 1/4] xen/riscv: add VM space layout

2023-05-03 Thread Oleksii Kurochko
Also it was added explanation about ignoring of top VA bits Signed-off-by: Oleksii Kurochko --- Changes in V6: - update comment above the RISCV-64 layout table - add Slot column to the table with RISCV-64 Layout - update RV-64 layout table. --- Changes in V5: * the patch was introduced

[PATCH v6 3/4] xen/riscv: setup initial pagetables

2023-05-03 Thread Oleksii Kurochko
The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko --- Changes in V6: - Nothing changed. Only rebase --- Changes in V5: - Nothing changed. Only rebase --- Changes in V4: - Nothing

[PATCH v5 2/4] xen/riscv: introduce setup_initial_pages

2023-04-19 Thread Oleksii Kurochko
ons for specific section ( such as .text, .rodata, etc ) otherwise RW permission will be set by default. * Add function to check that requested SATP_MODE is supported Origin: g...@github.com:xvisor/xvisor.git 9be2fdd7 Signed-off-by: Oleksii Kurochko --- Changes in V5: * Indent fields of pte_t

[PATCH v5 3/4] xen/riscv: setup initial pagetables

2023-04-19 Thread Oleksii Kurochko
The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko --- Changes in V5: - Nothing changed. Only rebase --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: - update

[PATCH v5 4/4] xen/riscv: remove dummy_bss variable

2023-04-19 Thread Oleksii Kurochko
After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V5: - Nothing changed. Only rebase --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: * patch

[PATCH v5 0/4] enable MMU for RISC-V

2023-04-19 Thread Oleksii Kurochko
duced simplified approach for RISC-V smoke test by Andrew Cooper * Add patch [[xen/riscv: remove dummy_bss variable] as there is no any sense in dummy_bss variable after introduction of inittial page tables. --- Oleksii Kurochko (4): xen/riscv: add VM space layout xen/riscv: introd

[PATCH v5 1/4] xen/riscv: add VM space layout

2023-04-19 Thread Oleksii Kurochko
Also it was added explanation about ignoring of top VA bits Signed-off-by: Oleksii Kurochko --- Changes in V5: * the patch was introduced in the current patch series. --- xen/arch/riscv/include/asm/config.h | 31 + 1 file changed, 31 insertions(+) diff --git a/xen

[PATCH v4 0/3] enable MMU for RISC-V

2023-04-07 Thread Oleksii Kurochko
dd patch [[xen/riscv: remove dummy_bss variable] as there is no any sense in dummy_bss variable after introduction of inittial page tables. --- Oleksii Kurochko (3): xen/riscv: introduce setup_initial_pages xen/riscv: setup initial pagetables xen/riscv: remove dummy_bss variable xen/arch/

[PATCH v4 3/3] xen/riscv: remove dummy_bss variable

2023-04-07 Thread Oleksii Kurochko
After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: * patch was introduced in the current one patch series (v3

[PATCH v4 1/3] xen/riscv: introduce setup_initial_pages

2023-04-07 Thread Oleksii Kurochko
ons for specific section ( such as .text, .rodata, etc ) otherwise RW permission will be set by default. * Add function to check that requested SATP_MODE is supported Origin: g...@github.com:xvisor/xvisor.git 9be2fdd7 Signed-off-by: Oleksii Kurochko --- Changes in V4: * use GB() macros instead of def

[PATCH v4 2/3] xen/riscv: setup initial pagetables

2023-04-07 Thread Oleksii Kurochko
The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: - update the commit message that MMU is also enabled here - remove

[PATCH v9 1/5] xen: introduce CONFIG_GENERIC_BUG_FRAME

2023-03-29 Thread Oleksii Kurochko
of do_bug_frame * new config CONFIG_GENERIC_BUG_FRAME Signed-off-by: Oleksii Kurochko --- Changes in V9: * rename BUILD_BUG_ON_LINE_WIDTH to BUG_CHECK_LINE_WIDTH * Remove from as the patch were merged to staging which move all things used in from to more proper headers. * add

[PATCH v9 5/5] xen/x86: switch x86 to use generic implemetation of bug.h

2023-03-29 Thread Oleksii Kurochko
void *' Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V9: * update the commit message * add additional explanation to header --- Changes in V8: * move from to to fix compilation issue. The following compilation issue occurs: In file included from ./arch

[PATCH v9 3/5] xen: change to

2023-03-29 Thread Oleksii Kurochko
e used in <*/cpufreq.c> In the following two patches x86 and ARM archictectures will be switched fully: [1] xen/arm: switch ARM to use generic implementation of bug.h [2] xen/x86: switch x86 to use generic implemetation of bug.h Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich

[PATCH v9 4/5] xen/arm: switch ARM to use generic implementation of bug.h

2023-03-29 Thread Oleksii Kurochko
implementation of bug.h macros to generic one Signed-off-by: Oleksii Kurochko --- Changes in V9: * add additional explanation to header --- Changes in V8: * Nothing changed. --- Changes in V7: * Rebase the patch. --- Changes in V6: * Update the "changes in v5" * Rebase on top of the patch [xen:

[PATCH v9 2/5] xen/arm: remove unused defines in

2023-03-29 Thread Oleksii Kurochko
The following defines BUG_DISP_WIDTH, BUG_LINE_LO_WIDTH, BUG_LINE_HI_WIDTH aren't used in ARM so could be purged as unused. Requested-by: Jan Beulich Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V9: * Nothing changed --- Changes in V8: * Update the commit message

[PATCH v9 0/5] introduce generic implementation of macros from bug.h

2023-03-29 Thread Oleksii Kurochko
. * Rework do_invalid_op() in x86 ( re-use handle_bug_frame() and find_bug_frame() ) --- Oleksii Kurochko (5): xen: introduce CONFIG_GENERIC_BUG_FRAME xen/arm: remove unused defines in xen: change to xen/arm: switch ARM to use generic implementation of bug.h xen/x86: switch x86 to use

[PATCH v3 1/3] xen/riscv: introduce setup_initial_pages

2023-03-27 Thread Oleksii Kurochko
ons for specific section ( such as .text, .rodata, etc ) otherwise RW permission will be set by default. Origin: g...@github.com:xvisor/xvisor.git 9be2fdd7 Signed-off-by: Oleksii Kurochko --- Changes in V3: - update definition of pte_t structure to have a proper size of pte_t in case of RV32. -

[PATCH v3 2/3] xen/riscv: setup initial pagetables

2023-03-27 Thread Oleksii Kurochko
The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko --- Changes in V3: - update the commit message that MMU is also enabled here - remove early_printk("All set up\n") as it

[PATCH v3 0/3] enable MMU for RISC-V

2023-03-27 Thread Oleksii Kurochko
pproach for RISC-V smoke test by Andrew Cooper * Add patch [[xen/riscv: remove dummy_bss variable] as there is no any sense in dummy_bss variable after introduction of inittial page tables. --- Oleksii Kurochko (3): xen/riscv: introduce setup_initial_pages xen/riscv: setup initial paget

[PATCH v3 3/3] xen/riscv: remove dummy_bss variable

2023-03-27 Thread Oleksii Kurochko
After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V3: * patch was introduced in the current one patch series (v3). --- Changes in V2: * patch was introduced

[PATCH v2 2/3] xen/riscv: setup initial pagetables

2023-03-16 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V2: * Update the commit message --- xen/arch/riscv/setup.c | 5 + 1 file changed, 5 insertions(+) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index b56c69a3dc..a3481973ff 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch

[PATCH v2 3/3] xen/riscv: remove dummy_bss variable

2023-03-16 Thread Oleksii Kurochko
After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V2: * patch was introduced in the current one patch series (v2). --- xen/arch/riscv/setup.c | 8 1 file changed

[PATCH v2 1/3] xen/riscv: introduce setup_initial_pages

2023-03-16 Thread Oleksii Kurochko
ial_pagetables() as there is no such section in xen.lds.S * Update the argument of pte_is_valid() to "const pte_t *p" Origin: https://gitlab.com/xen-on-risc-v/xen/-/tree/riscv-rebase 4af165b468af Signed-off-by: Oleksii Kurochko --- Changes in V2: * update the commit message: * Remove {ZEROETH,FIRS

[PATCH v2 0/3] enable MMU for RISC-V

2023-03-16 Thread Oleksii Kurochko
e_t *p" * Remove patch "[PATCH v1 3/3] automation: update RISC-V smoke test" from the patch series as it was introduced simplified approach for RISC-V smoke test by Andrew Cooper * Add patch [[xen/riscv: remove dummy_bss variable] as there is no any sense in dummy_b

[PATCH v5 7/7] xen/riscv: test basic handling stuff

2023-03-16 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V5: - Nothing changed --- Changes in V4: - Add Acked-by: Alistair Francis --- Changes in V3: - Nothing changed --- Changes in V2: - Nothing changed --- xen/arch/riscv/setup.c | 17 + 1 file

[PATCH v5 6/7] xen/riscv: introduce an implementation of macros from

2023-03-16 Thread Oleksii Kurochko
nformation. Signed-off-by: Oleksii Kurochko --- Changes in V5: - Remove "#include " from as there is no any need in it anymore - Update macros GET_INSN_LENGTH: remove UL and 'unsigned int len;' from it - Remove " include " from risc/setup.c. it is not needed in the cu

[PATCH v5 0/7] RISCV basic exception handling implementation

2023-03-16 Thread Oleksii Kurochko
r_t type from it. - Refactor decode_trap_cause() function to be more optimization-friendly. - Add two new empty headers: and as they are needed to include which provides ARRAY_SIZE and other macros. - Code style fixes. --- Oleksii Kurochko (7): xen/riscv: introduce boot informa

[PATCH v5 5/7] xen/riscv: introduce trap_init()

2023-03-16 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- Changes in V5: - Nothing changed --- Changes in V4: - Nothing changed --- Changes in V3: - Nothing changed --- Changes in V2: - Rename setup_trap_handler() to trap_init(). - Add Reviewed-by to the commit message

[PATCH v5 4/7] xen/riscv: introduce decode_cause() stuff

2023-03-16 Thread Oleksii Kurochko
The patch introduces stuff needed to decode a reason of an exception. Signed-off-by: Oleksii Kurochko --- Changes in V5: - Remove from riscv/traps/c as nothing would require inclusion. - decode_reserved_interrupt_cause(), decode_interrupt_cause(), decode_cause, do_unexpected_trap

[PATCH v5 3/7] xen/riscv: introduce dummy

2023-03-16 Thread Oleksii Kurochko
will be used in the patch "xen/riscv: introduce decode_cause() stuff" and requires Signed-off-by: Oleksii Kurochko --- Changes in V5: * the patch was introduced in the current patch series (V5) --- xen/arch/riscv/include/asm/bug.h | 10 ++ 1 file changed, 10 insertions(

[PATCH v5 2/7] xen/riscv: initialize boot_info structure

2023-03-16 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V5: * the patch was introduced in the current patch series (V5) --- xen/arch/riscv/setup.c | 12 1 file changed, 12 insertions(+) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 0908bdb9f9..36556eb779 100644

[PATCH v5 1/7] xen/riscv: introduce boot information structure

2023-03-16 Thread Oleksii Kurochko
The structure holds information about: 1. linker start/end address 2. load start/end address Also the patch introduces offsets for boot information structure members to access them in assembly code. Signed-off-by: Oleksii Kurochko --- Changes in V5: * the patch was introduced in the current

[PATCH v2 0/2] deal with GOT stuff for RISC-V

2023-03-16 Thread Oleksii Kurochko
[xen/riscv: add EMBEDDED_EXTRA_CFLAGS to CFLAGS]. * In addition to the patch [1] was created another patch [xen/riscv: add explicit check that .got{.plt} is empty] to be sure that .got{.plt} sections weren't produced. --- Oleksii Kurochko (2): xen/riscv: add EMBEDDED_EXTRA_CFLAGS to CFLAGS

[PATCH v2 2/2] xen/riscv: add explicit check that .got{.plt} is empty

2023-03-16 Thread Oleksii Kurochko
early failure. Signed-off-by: Oleksii Kurochko --- Changes in V2: * the patch was introduced in patch series v2. --- xen/arch/riscv/xen.lds.S | 13 + 1 file changed, 13 insertions(+) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index ca57cce75c..f299ea8422 100644

[PATCH v2 1/2] xen/riscv: add EMBEDDED_EXTRA_CFLAGS to CFLAGS

2023-03-16 Thread Oleksii Kurochko
used. Signed-off-by: Oleksii Kurochko --- Changes in V2: * instead of changing 'la' to 'lla' to keep cpu0_boot_stack PC-relative it was updated CFLAGS with EMBEDDED_EXTRA_CFLAGS which contains -fno-PIE thereby 'la' will be transformed to 'auipc/addi' without GOT usage. * update

[PATCH v8 5/5] xen/x86: switch x86 to use generic implemetation of bug.h

2023-03-15 Thread Oleksii Kurochko
void *' * add '#include ' Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V8: * move from to to fix compilation issue. The following compilation issue occurs: In file included from ./arch/x86/include/asm/smp.h:10, from ./include/xen/smp.h:4

[PATCH v8 4/5] xen/arm: switch ARM to use generic implementation of bug.h

2023-03-15 Thread Oleksii Kurochko
implementation of bug.h macros to generic one Signed-off-by: Oleksii Kurochko --- Changes in V8: * Nothing changed. --- Changes in V7: * Rebase the patch. --- Changes in V6: * Update the "changes in v5" * Rebase on top of the patch [xen: introduce CONFIG_GENERIC_BUG_FRAME] as there were min

[PATCH v8 3/5] xen: change to

2023-03-15 Thread Oleksii Kurochko
e used in <*/cpufreq.c> In the following two patches x86 and ARM archictectures will be switched fully: [1] xen/arm: switch ARM to use generic implementation of bug.h [2] xen/x86: switch x86 to use generic implemetation of bug.h Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich

[PATCH v8 1/5] xen: introduce CONFIG_GENERIC_BUG_FRAME

2023-03-15 Thread Oleksii Kurochko
of do_bug_frame * new config CONFIG_GENERIC_BUG_FRAME Signed-off-by: Oleksii Kurochko --- Changes in V8: * move BUILD_BUG_ON_LINE_WIDTH(line) to "ifndef BUG_FRAME_STRUCT" and add #elif for "ifndef BUG_FRAME_STRUCT" to define stub for BUILD_BUG_ON_LINE_WIDTH. * mo

[PATCH v8 0/5] introduce generic implementation of macros from bug.h

2023-03-15 Thread Oleksii Kurochko
related to bug frame structure more generic. * Rename bug_file() in ARM implementation to bug_ptr() as generic do_bug_frame() uses bug_ptr(). * Introduce BUG_INSTR and MODIFIER to make _ASM_BUGFRAME_TEXT reusable between x86 and RISC-V. * Rework do_invalid_op() in x86 ( re-use handle_bug_fr

[PATCH v8 2/5] xen/arm: remove unused defines in

2023-03-15 Thread Oleksii Kurochko
The following defines BUG_DISP_WIDTH, BUG_LINE_LO_WIDTH, BUG_LINE_HI_WIDTH aren't used in ARM so could be purged as unused. Requested-by: Jan Beulich Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V8: * Update the commit message with Requested-by and Reviewed

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

2023-03-14 Thread Oleksii Kurochko
of _GLOBAL_OFFSET_TABLE_ where all addresses will be without counting that it might happen that linker address != load address. To be sure that SP is loaded always PC-relative address 'la' should be changed to 'lla', which always transforms to 'auipc/addi'. Signed-off-by: Oleksii Kurochko --- xen/arch

[PATCH v7 1/5] xen: introduce CONFIG_GENERIC_BUG_FRAME

2023-03-09 Thread Oleksii Kurochko
of do_bug_frame * new config CONFIG_GENERIC_BUG_FRAME Signed-off-by: Oleksii Kurochko --- Changes in V7: * fix code style. * Remove '#include ' from bug.c. it should be a part of . * move BUILD_BUG_ON_LINE_WIDTH to '#ifndef BUG_FRAME_STRUCT' and define dummy BUILD_BUG_ON_LINE_WIDTH when

[PATCH v7 3/5] xen: change to

2023-03-09 Thread Oleksii Kurochko
6 and ARM archictectures will be switched fully: [1] xen/arm: switch ARM to use generic implementation of bug.h [2] xen/x86: switch x86 to use generic implemetation of bug.h Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V7: * Remove #undef {BUG_DISP_WIDTH, BUG_LINE_LO_WIDTH, BUG_LI

[PATCH v7 4/5] xen/arm: switch ARM to use generic implementation of bug.h

2023-03-09 Thread Oleksii Kurochko
implementation of bug.h macros to generic one Signed-off-by: Oleksii Kurochko --- Changes in V7: * Rebase the patch. --- Changes in V6: * Update the "changes in v5" * Rebase on top of the patch [xen: introduce CONFIG_GENERIC_BUG_FRAME] as there were minor changes. --- Changes in V5: * co

[PATCH v7 5/5] xen/x86: switch x86 to use generic implemetation of bug.h

2023-03-09 Thread Oleksii Kurochko
void *' * add '#include ' Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V7: * update the commit message * make eip 'const void *' * change [eip = (unsigned char *)eip + sizeof(bug_insn);] to [eip += sizeof(bug_insn);] * add '#include ' to * add Reviewed-by: Jan

[PATCH v7 0/5] introduce generic implementation of macros from bug.h

2023-03-09 Thread Oleksii Kurochko
C-V. * Rework do_invalid_op() in x86 ( re-use handle_bug_frame() and find_bug_frame() ) --- Oleksii Kurochko (5): xen: introduce CONFIG_GENERIC_BUG_FRAME xen/arm: remove unused defines in xen: change to xen/arm: switch ARM to use generic implementation of bug.h xen/x86: switch x86 to us

[PATCH v7 2/5] xen/arm: remove unused defines in

2023-03-09 Thread Oleksii Kurochko
The following defines BUG_DISP_WIDTH, BUG_LINE_LO_WIDTH, BUG_LINE_HI_WIDTH aren't used in ARM so could be purged as unused. Signed-off-by: Oleksii Kurochko --- xen/arch/arm/include/asm/bug.h | 4 1 file changed, 4 deletions(-) diff --git a/xen/arch/arm/include/asm/bug.h b/xen/arch/arm

[PATCH v6 4/4] xen/x86: switch x86 to use generic implemetation of bug.h

2023-03-07 Thread Oleksii Kurochko
*' Signed-off-by: Oleksii Kurochko --- Changes in V6: * update the commit message * update the type of eip to 'void *' in do_invalid_op() * fix the logic of do_invalid_op() * move macros BUG_DEBUGGER_TRAP_FATAL under #ifndef __ASSEMBLY__ as it is not necessary to be in assembly code

[PATCH v6 1/4] xen: introduce CONFIG_GENERIC_BUG_FRAME

2023-03-07 Thread Oleksii Kurochko
of do_bug_frame * new config CONFIG_GENERIC_BUG_FRAME Signed-off-by: Oleksii Kurochko --- Changes in V6: * fix code style. * change -EINVAL to -ENOENT in case when bug_frame wasn't found in generic do_bug_frame() * change all 'return id' to 'break' inside switch/case of generic do_bug_frame

[PATCH v6 3/4] xen/arm: switch ARM to use generic implementation of bug.h

2023-03-07 Thread Oleksii Kurochko
implementation of bug.h macros to generic one Signed-off-by: Oleksii Kurochko --- Changes in V6: * Update the "changes in v5" * Rebase on top of the patch [xen: introduce CONFIG_GENERIC_BUG_FRAME] as there were minor changes. --- Changes in V5: * common/bug.c changes were removed af

[PATCH v6 2/4] xen: change to

2023-03-07 Thread Oleksii Kurochko
neric implemetation of bug.h Signed-off-by: Oleksii Kurochko --- Changes in V6: - change the inclusion order of . - add #undef of BUG_DISP_WIDTH, BUG_LINE_LO_WIDTH for ARM & x86 as they were introduced unconditionally in . - update the commit message --- C

[PATCH v6 0/4] [PATCH v5 0/4] introduce generic implementation of macros from bug.h

2023-03-07 Thread Oleksii Kurochko
G_INSTR and MODIFIER to make _ASM_BUGFRAME_TEXT reusable between x86 and RISC-V. * Rework do_invalid_op() in x86 ( re-use handle_bug_frame() and find_bug_frame() ) --- Oleksii Kurochko (4): xen: introduce CONFIG_GENERIC_BUG_FRAME xen: change to xen/arm: switch ARM to use generic imple

[PATCH v5 3/4] xen/arm: switch ARM to use generic implementation of bug.h

2023-03-03 Thread Oleksii Kurochko
implementation of bug.h macros to generic one Signed-off-by: Oleksii Kurochko --- Changes in V5: * Nothing changed --- Changes in V4: * Switch ARM implementation to generic one * Remove BUG_FN_REG from arm{16,32}/bug.h as it isn't needed after switch to generic implementation * Update commit message

[PATCH v5 1/4] xen: introduce CONFIG_GENERIC_BUG_FRAME

2023-03-03 Thread Oleksii Kurochko
of do_bug_frame * new config CONFIG_GENERIC_BUG_FRAME Signed-off-by: Oleksii Kurochko --- Changes in V5: * Remove "#ifdef BUG_FN_REG..." from generic do_bug_frame() as ARM will use generic implementation fully. --- Changes in V4: * common/bug.c: - Use BUG_DEBUGGER_

[PATCH v5 4/4] xen/x86: switch x86 to use generic implemetation of bug.h

2023-03-03 Thread Oleksii Kurochko
-by: Oleksii Kurochko --- Changes in V5: * Nothing changed --- Changes in V4: * Back comment /* !__ASSEMBLY__ */ for #else case in * Remove changes related to x86/.../asm/debuger.h as do_bug_frame() prototype was updated and cpu_user_regs isn't const any more. --- Changes in V3: * As prototype

[PATCH v5 2/4] xen: change to

2023-03-03 Thread Oleksii Kurochko
redundant redeclaration of ... In the following two patches x86 and ARM archictectures will be switched fully: * xen/arm: switch ARM to use generic implementation of bug.h * xen/x86: switch x86 to use generic implemetation of bug.h Signed-off-by: Oleksii Kurochko --- Changes in V5: - Nothing c

[PATCH v5 0/4] introduce generic implementation of macros from bug.h

2023-03-03 Thread Oleksii Kurochko
tructure more generic. * Rename bug_file() in ARM implementation to bug_ptr() as generic do_bug_frame() uses bug_ptr(). * Introduce BUG_INSTR and MODIFIER to make _ASM_BUGFRAME_TEXT reusable between x86 and RISC-V. * Rework do_invalid_op() in x86 ( re-use handle_bug_frame() and find_bug_f

[PATCH v3 3/3] xen/riscv: initialize .bss section

2023-03-03 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/riscv64/head.S | 9 + xen/arch/riscv/setup.c| 8 2 files changed, 17 insertions(+) diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index adf5d6c74a..8887f0cbd4 100644 --- a/xen/arch/riscv

[PATCH v3 2/3] xen/riscv: read/save hart_id and dtb_base passed by bootloader

2023-03-03 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes since v2: * Add the comment for start() function with the explanation what and how OpenSBI pass to start() function. * Clean up start() code related to read hart_id & dtb_base. --- Changes since v1: * read/save/pass of hart_id and dtb_

[PATCH v3 0/3] Do basic initialization things

2023-03-03 Thread Oleksii Kurochko
dtb_base --- Oleksii Kurochko (3): xen/riscv: disable fpu xen/riscv: read/save hart_id and dtb_base passed by bootloader xen/riscv: initialize .bss section xen/arch/riscv/riscv64/head.S | 21 + xen/arch/riscv/setup.c| 11 ++- 2 files changed, 31 insertions(+), 1

[PATCH v3 1/3] xen/riscv: disable fpu

2023-03-03 Thread Oleksii Kurochko
Disable FPU to detect illegal usage of floating point in kernel space. Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/riscv64/head.S | 7 +++ 1 file changed, 7 insertions(+) diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index ffd95f9f89..52fa41c778 100644

[PATCH v2 0/3] Do basic initialization things

2023-03-02 Thread Oleksii Kurochko
and dtb_base passed by a bootloader were moved to head.S. Also, it was updated start_xen() arguments to recieve hard_id & dtb_base --- Oleksii Kurochko (3): xen/riscv: read/save hart_id and dtb_base passed by bootloader xen/riscv: initialize .bss section xen/riscv: disable fpu xen/arch/r

[PATCH v2 1/3] xen/riscv: read/save hart_id and dtb_base passed by bootloader

2023-03-02 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes since v1: * read/save/pass of hart_id and dtb_base passed by a bootloader were moved to head.S. * Update start_xen() to recieve hard_id & dtb_base --- xen/arch/riscv/riscv64/head.S | 24 xen/arch/riscv/set

[PATCH v2 3/3] xen/riscv: disable fpu

2023-03-02 Thread Oleksii Kurochko
Disable FPU to detect illegal usage of floating point in kernel space. Signed-off-by: Oleksii Kurochko --- Changes since v1: * Rebase on top of two previous patches. --- xen/arch/riscv/setup.c | 8 1 file changed, 8 insertions(+) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv

<    1   2   3   4   5   6   7   8   >