Skip to content
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

Tuned arguments of QEMU to fit for acrn-unit-test #8

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

ysun
Copy link

@ysun ysun commented Jun 21, 2019

Added memory size (1G) and smp supported (4 cores).
Specified the CPU model and some flags, which is supported by ACRN.
Refined Makefile to run unit-test by command 'unit':
'make unit file=xxx'
'xxx' stands for case name, no extension followed.

Signed-off-by: Yi Sun [email protected]

fyin1 and others added 22 commits October 30, 2018 09:35
We do know what kind of guest we want to build. So add the files
generated during running cmd configure. Then we could just do
make to build unit-test.

Signed-off-by: Yin Fengwei <[email protected]>
We don't have fwcfg to pass info from DM to guest. So we hardcode
the guest cpu number. And 1 is used because the SMP support in
unit-test is blocked by one issue in ACRN.

Signed-off-by: Yin Fengwei <[email protected]>
The test guest needs DM to prepare the mem_* in multiboot info.
So we should set the flag in multiboot header to request DM to
prepare these info.

Signed-off-by: Yin Fengwei <[email protected]>
Signed-off-by: Jason Chen CJ <[email protected]>
Current unit-test cases are guest based. Move them to guest directory.
So we could test the smp related operations.

Signed-off-by: Yin Fengwei <[email protected]>
There is no guarantee on the exact values in the selectors of data segments,
including DS, ES, FS, GS and SS, at the time an OS is invoked, according to
Section 3.2, Multiboot Specification 0.6.96. Not re-initializing the selectors
can lead to segmentation faults the first time a reload of segment base address
is needed.

Signed-off-by: Junjie Mao <[email protected]>
The initialization of .bss is available only when the test is loaded by an ELF
loader, which is not the case when it is started directly by a
multiboot-compliant bootloader.

This patch explicitly clears .bss, except the stack which is already in use when
initializing .bss.

Signed-off-by: Junjie Mao <[email protected]>
fix bug because of cstart.S not init esp.

Signed-off-by: Huihuang Shi <[email protected]>
initialize ds/es/fs/gs/ss in cstart.S
Raw binaries can be used as a multiboot module passed to ACRN hypervisor by the
physical bootloader. This allows the hypervisor to load a unit test without
additional logic for loading ELF files.

v1 -> v2:
* Do not rely on the code starting at exact 4M. Instead prepending zeros at the
  beginning of the image to locate the code right at the position decided at
  link-time. Due to the impreciseness of stext, the starting address of .text
  section is used as the beginning of the image.

Signed-off-by: Junjie Mao <[email protected]>
When stitching multiple tests into a single executable, names of the test files
will be used in function identifiers which cannot contain any dash.

Signed-off-by: Junjie Mao <[email protected]>
Having each test as a separate binary can easily lead to the explosion of file
numbers, considering the number of cases that will be written for thorough
testing. This also leads to difficulties for running multiple tests in a
partition-mode configuration where guest binaries are always loaded by the
physical bootloader.

This patch introduces a 2-phase link approach to allow the tests to be linked in
either one-per-test or all-in-one. The trick behind the scene is that sources of
each test are first compiled and linked before the following object-level
modifications are conducted.

    1. All symbols are converted local, except the function main().
    2. The symbol main() is duplicated to main_<test>() which has global
       linkage.
    3. The symbol main() is converted weak global.

The edited object files are named following the convention
<test>_prelink.o. Each of them can be compiled with the other libraries to
generate an executable ELF, as is done previously, or linked together to
generate one stitched executable that contains all tests indexed by the
generated case_table.c.

Signed-off-by: Junjie Mao <[email protected]>
Compilers like gcc may place information like compiler versions, build IDs,
etc. into dedicate sections called .comment or .note. These sections may be
placed even before the entry point if the linker script does not specify how
these sections shall be handled. This can be problematic as it is assumed that
the beginning of the image is a 12-byte multiboot header, followed by the entry
point of the image. It has also been met that ignoring these sections in the
linker script leads to a very small bss_start (mostly <1K), which leads the test
program to crash when it tries to initialize its .bss section.

Discard these sections as these sections contain compiler/linker-specific
information which is mostyl useless at runtime.

Signed-off-by: Junjie Mao <[email protected]>
fix AP load tss error upon AP receiving second IPI&SIPI message
Enable loading stitched tests in partition mode
Added memory size (1G) and smp supported (4 cores).
Specified the CPU model and some flags, which is supported by ACRN.
Refined Makefile to run unit-test by command 'unit':
    'make unit file=xxx'
    'xxx' stands for case name, no extension followed.

Signed-off-by: Yi Sun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants