-
Notifications
You must be signed in to change notification settings - Fork 14
v2: XTF on arm #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
orzelmichal
wants to merge
12
commits into
andyhhp:master
Choose a base branch
from
orzelmichal:for-master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently XTF build system is strictly made up for x86.
Modify the build system so that it will be easier
to add other architectures to XTF in the future.
This is done by generalizing the common makefiles to be
architecture independent and creating architecture
specific makefiles.
ARCH variable behaviour:
By default ARCH is set to the host architecture where make is executed,
provided that it is supported by XTF.
In order to perform cross compilation, ARCH needs to be set to the target
architecture (when invoking make) e.g. ARCH=x86, together with specifying
cross compiler prefix e.g. CROSS_COMPILE=x86_64-linux-gnu-.
Introduce new variable called BASE_ARCH that contains the name
of the architecture devoided of information about bitness.
It may be that BASE_ARCH == ARCH for some architectures.
For example:
ARCH=x86, BASE_ARCH=x86
ARCH=arm{64,32}, BASE_ARCH=arm
ARCH=riscv{64,32}, BASE_ARCH=riscv
Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Add initial support to XTF for arm64/arm32 without modifying existing XTF architecture. Some of the files are just dummy files waiting to be properly implemented step by step later on. The purpose of this change is to add the initial code and minimal set of files to support XTF on arm without modifying the existing XTF design. This creates a base for further implementation. Based-on-the-work-from: Julien Grall <julien@xen.org> Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Add BSS zeroing into arm64 startup code head.S and implement a function clean_and_invalidate_dcache. Image protocol states that the state of the cache for BSS region is not known as BSS is not part of the loaded image. This is why it is required to invalidate the cache before and after zeroing BSS. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Add support for arm64/arm32 in the build system, modify the common headers to be aware of the new architectures and update the documentation. Architecture can be set using: ARCH=arm64 or ARCH=arm32. Currently only one test: tests/example is supported allowing the startup code head.S to be executed ending up in an infinite loop. Debug messages are printed using hypercall console_io. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Each architecture needs to define its own hypercall handling interface. The hypercall handler should be named as follows: hypercall_<hypercall_name> e.g. hypercall_console_io The reason for that is to have a standard way of calling hypercalls in the common code. Modify the common <xtf/hypercall.h> header to be architecture independent and move x86 handlers to architecture specific code. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Add the hypercall wrappers for arm64 and arm32 from Linux. The hypercalls are defined in the assembly files hypercall.S and they are specific to arm64/arm32. The prototypes and higher level wrappers are defined in arch/arm/include/arch/hypercall.h as they are common to both arm64 and arm32. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Improve the startup code for arm64 and implement the proper traps handling for arm. At this point it would be possible to jump to the C world. However MMU and PV console support shall be done first. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Add the following to the startup code head.S: -setup boot page tables -setup identity mapping -enable MMU MMU configuration: -granularity: 4KB -VA width: 39bit -VA start: 0xffffff8000000000 -3 levels of lookup: L1->L2->2M blocks, L2->L3->4KB pages(fixmap) -1GB identity mapping removed before jumping into C Modify the arm64 environment from 64le to mmu64le to reflect that it has MMU enabled. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Add macros to convert between frame numbers and address formats. Add functions to store page table entry and setup fixmap. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Now, when everything is ready, get rid of infinite loop from the startup code and jump to C world. Because there is no PV console support added yet, use hypercall_console_io to print messages using printk so that we can see the results from running the hello-world test. Result: (d1) - XTF booting - (d1) - Setup CPU - (d1) - Setup page tables - (d1) - Enable MMU - (d1) - Zero BSS - (d1) - Setup stack - (d1) - Jump to C world- (d1) --- Xen Test Framework --- (d1) Environment: ARM64 LE MMU (d1) Hello World (d1) Test result: SUCCESS Signed-off-by: Michal Orzel <michal.orzel@arm.com>
... together with public header features.h storing feature flags reported by XENVER_get_features. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
... so that we can connect to a guest console using xl console. PV console should not be used when XTF is running as dom0. For that purpose, implement a function is_initdomain that uses hypercall xen_version to get Xen features and checks if bit XENFEAT_dom0 is set. Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch series adds arm support into XTF and creates a base for further implementation.
Support for arm64 mostly includes:
Support for arm32 allows to run only a startup code.
This series was tested using qemu-system-aarch64 and FVP_Base_RevC-2xAEMvA with
XTF running as dom0 or domU.
Previous discussion on v1 can be found here:
#4
Major changes since v1:
Please review, comment, ask questions.