[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 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 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 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 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 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 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 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 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 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 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 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 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 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 v1 2/4] xen/arm: switch ARM to use generic implementation of bug.h

2023-02-03 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- xen/arch/arm/Kconfig | 1 + xen/arch/arm/include/asm/bug.h | 86 xen/arch/arm/include/asm/div64.h | 2 +- xen/arch/arm/traps.c | 79 - xen/arch/arm/vgic/vgic-v2.c

[PATCH v1 1/4] xen: introduce CONFIG_GENERIC_BUG_FRAME

2023-02-03 Thread Oleksii Kurochko
header * generic implementation of do_bug_frame() * new config CONFIG_GENERIC_BUG_FRAME Signed-off-by: Oleksii Kurochko --- xen/common/Kconfig| 6 ++ xen/common/Makefile | 1 + xen/common/bug.c | 88 + xen/include/xen/bug.h | 127

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

2023-02-03 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- xen/arch/x86/acpi/cpufreq/cpufreq.c | 2 +- xen/arch/x86/include/asm/asm_defns.h | 2 +- xen/arch/x86/include/asm/bug.h | 32 ++-- 3 files changed, 4 insertions(+), 32 deletions(-) diff --git a/xen/arch/x86/acpi/cpufreq

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

2023-02-03 Thread Oleksii Kurochko
only common parts was removed from . RISC-V will be switched to use and in the future, it will use common the version of do_bug_frame() when xen/common will work for RISC-V. Oleksii Kurochko (4): xen: introduce CONFIG_GENERIC_BUG_FRAME xen/arm: switch ARM to use generic implementation

[PATCH v1 4/4] xen: change to

2023-02-03 Thread Oleksii Kurochko
Since the generic version of bug.h stuff was introduced it is necessary to rename all uses of to Signed-off-by: Oleksii Kurochko --- xen/drivers/cpufreq/cpufreq.c | 2 +- xen/include/xen/lib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/cpufreq

[PATCH v10 2/2] automation: add RISC-V smoke test

2023-02-07 Thread Oleksii Kurochko
Add check if there is a message 'Hello from C env' presents in log file to be sure that stack is set and C part of early printk is working. Signed-off-by: Oleksii Kurochko Acked-by: Stefano Stabellini Reviewed-by: Alistair Francis --- Changes in V10: - Nothing changed --- Changes in V9

[PATCH v10 0/2] Basic early_printk and smoke test implementation

2023-02-07 Thread Oleksii Kurochko
5: - Nothing changed --- Changes in V4: - Nothing changed --- Changes in V3: - Nothing changed - All mentioned comments by Stefano in Xen mailing list will be fixed as a separate patch out of this patch series. --- Oleksii Kurochko (2): xen/riscv: introduce early_printk basic stuff automa

[PATCH v10 1/2] xen/riscv: introduce early_printk basic stuff

2023-02-07 Thread Oleksii Kurochko
ow so there is no vscnprintf. This commit adds early printk implementation built on the putc SBI call. As sbi_console_putchar() is already being planned for deprecation it is used temporarily now and will be removed or reworked after real uart will be ready. Signed-off-by: Bobby Eshleman Signed-off-by: Ol

[PATCH v3 01/14] xen/riscv: change ISA to r64G

2023-02-07 Thread Oleksii Kurochko
-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- Changes in V3: - Change the name of config RISCV_ISA_RV64IMA to RISCV_ISA_RV64G as instructions from Zicsr and Zifencei extensions aren't part of I extension any more. --- Changes in V2: - Nothing changed --- xen/arch/riscv

[PATCH v9 2/2] automation: add RISC-V smoke test

2023-02-07 Thread Oleksii Kurochko
Add check if there is a message 'Hello from C env' presents in log file to be sure that stack is set and C part of early printk is working. Signed-off-by: Oleksii Kurochko Acked-by: Stefano Stabellini Reviewed-by: Alistair Francis --- Changes in V9: - Nothing changed --- Changes in V8: - Set

[PATCH v9 0/2] Basic early_printk and smoke test implementation

2023-02-07 Thread Oleksii Kurochko
All mentioned comments by Stefano in Xen mailing list will be fixed as a separate patch out of this patch series. --- Oleksii Kurochko (2): xen/riscv: introduce early_printk basic stuff automation: add RISC-V smoke test automation/gitlab-ci/test.yaml| 20 ++ automa

[PATCH v9 1/2] xen/riscv: introduce early_printk basic stuff

2023-02-07 Thread Oleksii Kurochko
ow so there is no vscnprintf. This commit adds early printk implementation built on the putc SBI call. As sbi_console_putchar() is already being planned for deprecation it is used temporarily now and will be removed or reworked after real uart will be ready. Signed-off-by: Bobby Eshleman Signed-off-by: Ol

[PATCH v3 07/14] xen/riscv: introduce exception context

2023-02-07 Thread Oleksii Kurochko
eded for current status of the RISC-V port - register_t renamed to unsigned long - rename wait_for_interrupt to wfi Signed-off-by: Bobby Eshleman Signed-off-by: Oleksii Kurochko --- Changes in V3: - update code style for die() function --- Changes in V2: - All the changes were a

[PATCH v3 10/14] xen/riscv: mask all interrupts

2023-02-07 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- Changes in V3: - Nothing changed --- Changes in V2: - Add Reviewed-by to the commit message --- xen/arch/riscv/riscv64/head.S | 5 + 1 file changed, 5 insertions(+) diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch

[PATCH v3 03/14] xen/riscv: add

2023-02-07 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V3: - Add Acked-by: Alistair Francis --- Changes in V2: - Take the latest version of riscv_encoding.h from OpenSBI. - Update riscv_encoding.h with Xen related changes mentioned in the commit message. - Update comm

[PATCH v3 00/14] RISCV basic exception handling implementation

2023-02-07 Thread Oleksii Kurochko
pdate correspondingly the patches in the patch series. - Refactor bug.h, remove bug_instr_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 macro

[PATCH v3 12/14] xen/riscv: introduce an implementation of macros from

2023-02-07 Thread Oleksii Kurochko
The patch introduces macros: BUG(), WARN(), run_in_exception(), assert_failed. The implementation uses "ebreak" instruction in combination with diffrent bug frame tables (for each type) which contains useful information. Signed-off-by: Oleksii Kurochko --- Changes in V3: - Rebase

[PATCH v3 08/14] xen/riscv: introduce exception handlers implementation

2023-02-07 Thread Oleksii Kurochko
The patch introduces an implementation of basic exception handlers: - to save/restore context - to handle an exception itself. The handler calls wait_for_interrupt now, nothing more. Signed-off-by: Oleksii Kurochko --- Changes in V3: - Nothing changed --- Changes in V2: - Refactor entry.S

[PATCH v3 11/14] xen/riscv: introduce trap_init()

2023-02-07 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- Changes in V3: - Nothing changed --- Changes in V2: - Rename setup_trap_handler() to trap_init(). - Add Reviewed-by to the commit message. --- xen/arch/riscv/include/asm/traps.h | 1 + xen/arch/riscv/setup.c | 4

[PATCH v3 09/14] xen/riscv: introduce decode_cause() stuff

2023-02-07 Thread Oleksii Kurochko
The patch introduces stuff needed to decode a reason of an exception. Signed-off-by: Oleksii Kurochko --- Changes in V3: - Nothing changed --- Changes in V2: - Make decode_trap_cause() more optimization friendly. - Merge the pathc which introduces do_unexpected_trap() to the current one

[PATCH v3 14/14] automation: modify RISC-V smoke test

2023-02-07 Thread Oleksii Kurochko
The patch modifies the grep pattern to reflect the usage of WARN. Signed-off-by: Oleksii Kurochko --- Changes in V3: - Update commit message --- Changes in V2: - Leave only the latest "grep ..." --- automation/scripts/qemu-smoke-riscv64.sh | 2 +- 1 file changed, 1 insertion(+),

[PATCH v3 13/14] xen/riscv: test basic handling stuff

2023-02-07 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V3: - Nothing changed --- Changes in V2: - Nothing changed --- xen/arch/riscv/setup.c | 16 1 file changed, 16 insertions(+) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index d502cf06b0..8d070244fd 100644

[PATCH v3 02/14] xen/riscv: add header

2023-02-07 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V3: - Nothing changed --- Changes in V2: - Nothing changed --- xen/arch/riscv/include/asm/asm.h | 54 1 file changed, 54 insertions(+) create mode 100644 xen/arch/riscv/include/asm/asm.h diff --git a/xen/arch

[PATCH v3 04/14] xen/riscv: add header

2023-02-07 Thread Oleksii Kurochko
The following changes were made in comparison with from Linux: * remove all defines as they are defined in riscv_encoding.h * leave only csr_* macros Origin: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ d2d11f342b17 Signed-off-by: Oleksii Kurochko --- Changes in V3

[PATCH v3 06/14] xen/riscv: introduce empty

2023-02-07 Thread Oleksii Kurochko
To include is required Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V3: - Add Acked-by: Alistair Francis --- Changes in V2: - is a new empty header which is required to include --- xen/arch/riscv/include/asm/cache.h | 6 ++ 1 file changed, 6

[PATCH v3 05/14] xen/riscv: introduce empty

2023-02-07 Thread Oleksii Kurochko
To include is required Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V3: - Add Acked-by: Alistair Francis --- Changes in V2: - is a new empty header which is required to include --- xen/arch/riscv/include/asm/string.h | 6 ++ 1 file changed, 6

[PATCH] ns1650: refactor interrupt handling in ns16550_uart_dt_init()

2023-07-13 Thread Oleksii Kurochko
ev, 0); if ( ! res ) return -EINVAL; uart->irq = res; If 'res' equals to -1 then polling mode should be used instead of return -EINVAL. Signed-off-by: Oleksii Kurochko --- xen/drivers/char/ns16550.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --g

[PATCH v2] ns16550: add support for polling mode when device tree is used

2023-07-18 Thread Oleksii Kurochko
://github.com/torvalds/linux/blob/master/arch/powerpc/boot/dts/ebony.dts#L197 Signed-off-by: Oleksii Kurochko --- xen/drivers/char/ns16550.c | 51 -- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char

[PATCH v3 1/3] xen/riscv: add SPDX tag to config.h

2023-07-17 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V3: - new patch --- xen/arch/riscv/include/asm/config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h index 38862df0b8..fa90ae0898 100644 --- a/xen/arch/riscv

[PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-17 Thread Oleksii Kurochko
les. Since it is not easy to keep track where the identity map was mapped, so we will look for the top-most entry exclusive to the identity map and remove it. Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages") Signed-off-by: Oleksii Kurochko Suggested-by: Andrew Coope

[PATCH v3 0/3] xen/riscv: introduce identity mapping

2023-07-17 Thread Oleksii Kurochko
_init. - Update SPDX tags. - Add Review-By/Suggested-By for some patches. - code style fixes. Oleksii Kurochko (3): xen/riscv: add SPDX tag to config.h xen/riscv: introduce function for physical offset calculation xen/riscv: introduce identity mapping xen/arch/riscv/include/asm/config.h | 2 +

[PATCH v3 2/3] xen/riscv: introduce function for physical offset calculation

2023-07-17 Thread Oleksii Kurochko
The function was introduced to 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 --- Changes in V3: - save/restore of a0/a1

[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 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 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 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 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 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 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 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 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 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 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 v1 6/8] xen/riscv: add SPDX tags

2023-06-06 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/config.h | 2 ++ xen/arch/riscv/include/asm/current.h | 2 ++ xen/arch/riscv/include/asm/early_printk.h | 2 ++ xen/arch/riscv/include/asm/mm.h | 2 ++ xen/arch/riscv/include/asm/page-bits.h| 2 ++ xen/arch

[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 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 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 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 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 7/8] xen/riscv: add __ASSEMBLY__ guards

2023-06-06 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/page.h | 4 1 file changed, 4 insertions(+) diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h index 8e8ec9ee36..1c6add70a5 100644 --- a/xen/arch/riscv/include/asm/page.h +++ b/xen/arch/riscv

[PATCH v1 8/8] xen/riscv: move extern of cpu0_boot_stack to header

2023-06-06 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/mm.h | 2 ++ xen/arch/riscv/mm.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h index 3b04131628..fc3afa5521 100644 --- a/xen/arch

[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 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 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 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 v6 0/2] xen/riscv: introduce identity mapping

2023-08-01 Thread Oleksii Kurochko
- use phys_offset variable instead of doing calcultations to get phys offset in head.S file. ( it can be easily done as entire Xen is 1:1 mapped now ) - declare enable_muu() as __init. - Update SPDX tags. - Add Review-By/Suggested-By for some patches. - code style fixes. Oleksii Kuroch

[PATCH v6 2/2] xen/riscv: introduce identity mapping

2023-08-01 Thread Oleksii Kurochko
addresses, identity mapping is removed from page-tables in the following way: search for top-most page table entry and remove it. Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages") Signed-off-by: Oleksii Kurochko Suggested-by: Andrew Cooper --- Changes in V6: - t2 regist

[PATCH v6 1/2] xen/riscv: introduce function for physical offset calculation

2023-08-01 Thread Oleksii Kurochko
The function was introduced to 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 --- Changes in V6: - After 9380f06fe8(&quo

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

2023-08-03 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 V7: - only rebase was done. --- Changes in V6: - the patch was introduced in the current patch series (V6) --- xen/arch/riscv

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

2023-08-03 Thread Oleksii Kurochko
will be used in the patch "xen/riscv: introduce decode_cause() stuff" and requires Signed-off-by: Oleksii Kurochko --- Changes in V7: - Nothing changed. Only rebase. --- Changes in V6: - Nothing changed. Only rebase. --- Changes in V5: * the patch was introduced in the current pa

[PATCH v7 0/6] RISCV basic exception handling implementation

2023-08-03 Thread Oleksii Kurochko
() to trap_init() and update correspondingly the patches in the patch series. - Refactor bug.h, remove bug_instr_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 ARR

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

2023-08-03 Thread Oleksii Kurochko
The patch introduces stuff needed to decode a reason of an exception. Signed-off-by: Oleksii Kurochko --- Changes in V7: - Nothing changed. Only rebase. --- Changes in V6: - Remove usage of LINK_TO_LOAD() due to the MMU being enabled first. - Change early_printk() to printk() --- Changes

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

2023-08-03 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V6: - Nothing changed. Only rebase. --- Changes in V6: - Nothing changed --- Changes in V5: - Nothing changed --- Changes in V4: - Add Acked-by: Alistair Francis --- Changes in V3: - Nothing changed --- Changes

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

2023-08-03 Thread Oleksii Kurochko
nformation. Signed-off-by: Oleksii Kurochko --- Changes in V7: - move to this patch the definition of cast_to_bug_frame() from the previous patch. - update the comment in bug.h. - update the comment above do_bug_frame(). - fix code style. - add comment to read_instr func. - add space for

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

2023-08-03 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- Changes in V7: - #define cast_to_bug_frame(addr) ((const struct bug_frame *)(addr)). - remove unnecessary comments in trap_init() function. --- Changes in V6: - trap_init() is now called after enabling the MMU. - Add

[PATCH v4 2/2] xen/riscv: introduce identity mapping

2023-07-24 Thread Oleksii Kurochko
age-tables in the following way: recursively visit all ptes related to identity mapping and remove them. Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages") Signed-off-by: Oleksii Kurochko Suggested-by: Andrew Cooper --- Changes in V4: - remove definition of ARRAY_SIZE and ROUNDU

[PATCH v4 0/2] xen/riscv: introduce identity mapping

2023-07-24 Thread Oleksii Kurochko
doing calcultations to get phys offset in head.S file. ( it can be easily done as entire Xen is 1:1 mapped now ) - declare enable_muu() as __init. - Update SPDX tags. - Add Review-By/Suggested-By for some patches. - code style fixes. Oleksii Kurochko (2): xen/riscv: introduce fun

[PATCH v4 1/2] xen/riscv: introduce function for physical offset calculation

2023-07-24 Thread Oleksii Kurochko
The function was introduced to 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 --- Changes in V4: - update the comment

[PATCH v5 2/2] xen/riscv: introduce identity mapping

2023-07-27 Thread Oleksii Kurochko
addresses, identity mapping is removed from page-tables in the following way: search for top-most page table entry and remove it. Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages") Signed-off-by: Oleksii Kurochko Suggested-by: Andrew Cooper --- Changes in V5: - update

[PATCH v5 1/2] xen/riscv: introduce function for physical offset calculation

2023-07-27 Thread Oleksii Kurochko
The function was introduced to 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 --- Changes in V5: - update prototype

[PATCH v5 0/2] xen/riscv: introduce identity mapping

2023-07-27 Thread Oleksii Kurochko
d now ) - declare enable_muu() as __init. - Update SPDX tags. - Add Review-By/Suggested-By for some patches. - code style fixes. Oleksii Kurochko (2): xen/riscv: introduce function for physical offset calculation xen/riscv: introduce identity mapping xen/arch/riscv/include/asm/config.h | 2 +

[PATCH v4 1/1] ns16550: add support for polling mode when device tree is used

2023-07-27 Thread Oleksii Kurochko
s in Linux kernel ), so the check of the return value of platform_get_irq() was updated in case of when device tree is used for UART initialization. For example: https://github.com/torvalds/linux/blob/master/arch/powerpc/boot/dts/ebony.dts#L197 Signed-off-by: Oleksii Kurochko --- Changes in V4:

[PATCH v3] ns16550: add support for polling mode when device tree is used

2023-07-24 Thread Oleksii Kurochko
( according to dts files in Linux kernel ), so the check of the return value of platform_get_irq() was updated in case of when device tree is used for UART initialization. For example: https://github.com/torvalds/linux/blob/master/arch/powerpc/boot/dts/ebony.dts#L197 Signed-off-by: Oleksii Kurochko

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

2023-08-11 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 V8: - only rebase was done. --- Changes in V7: - only rebase was done. --- Changes in V6: - the patch was introduced in the current patch

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

2023-08-11 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V8: - Nothing changed. Only rebase. --- Changes in V6: - Nothing changed. Only rebase. --- Changes in V6: - Nothing changed --- Changes in V5: - Nothing changed --- Changes in V4: - Add Acked-by: Alistair Francis

[PATCH v8 0/6] RISCV basic exception handling implementation

2023-08-11 Thread Oleksii Kurochko
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 xen/riscv: introduce decode_cause() stuff xen/riscv: introduce trap_init() xen/ri

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

2023-08-11 Thread Oleksii Kurochko
The patch introduces stuff needed to decode a reason of an exception. Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- Changes in V8: - fix typo in return string from decode_reserved_interrupt_cause - add Acked-by: Alistair Francis --- Changes in V7: - Nothing changed. Only

<    1   2   3   4   5   6   7   8   >