Skip to content
  1. Oct 31, 2021
    • Zixuan Wang's avatar
      x86 UEFI: Boot from UEFI · ad5fb883
      Zixuan Wang authored
      This commit provides initial support for x86 test cases to boot from
      UEFI:
      
         1. UEFI compiler flags are added to Makefile
         2. A new TARGET_EFI macro is added to turn on/off UEFI startup code
         3. Previous Multiboot setup code is refactored and updated for
            supporting UEFI, including the following changes:
            1. x86/efi/crt0-efi-x86_64.S: provides entry point and jumps to
               setup code in lib/efi.c.
            2. lib/efi.c: performs UEFI setup, calls arch-related setup
               functions, then jumps to test case main() function
            3. lib/x86/setup.c: provides arch-related setup under UEFI
      
      To build test cases for UEFI, please first install the GNU-EFI library.
      Check x86/efi/README.md for more details.
      
      This commit is tested by a simple test calling report() and
      report_summayr(). This commit does not include such a test to avoid
      unnecessary files added into git history. To build and run this test in
      UEFI (assuming file name is x86/dummy.c):
      
         ./configure --target-efi
         make x86/dummy.efi
         ./x86/efi/run ./x86/dummy.efi
      
      To use the default Multiboot instead of UEFI:
      
         ./configure
         make x86/dummy.flat
         ./x86/run ./x86/dummy.flat
      
      Some x86 test cases require additional fixes to work in UEFI, e.g.,
      converting to position independent code (PIC), setting up page tables,
      etc. This commit does not provide these fixes, so compiling and running
      UEFI test cases other than x86/dummy.c may trigger compiler errors or
      QEMU crashes. These test cases will be fixed by the follow-up commits in
      this series.
      
      The following code is ported from github.com/rhdrjones/kvm-unit-tests
         - ./configure: 'target-efi'-related code
      
      See original code:
         - Repo: https://github.com/rhdrjones/kvm-unit-tests
      
      
         - Branch: target-efi
      
      Co-developed-by: default avatarVarad Gautam <varad.gautam@suse.com>
      Signed-off-by: default avatarVarad Gautam <varad.gautam@suse.com>
      Signed-off-by: default avatarZixuan Wang <zixuanwang@google.com>
      Message-Id: <20211004204931.1537823-6-zxwang42@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ad5fb883
    • Zixuan Wang's avatar
      x86 UEFI: Copy code from GNU-EFI · 8715af84
      Zixuan Wang authored
      To build x86 test cases with UEFI, we need to borrow some source
      code from GNU-EFI, which includes the initialization code and linker
      scripts. This commit only copies the source code, without any
      modification. These source code files are not used by KVM-Unit-Tests
      in this commit.
      
      The following source code is copied from GNU-EFI:
         1. x86/efi/elf_x86_64_efi.lds
         2. x86/efi/reloc_x86_64.c
         3. x86/efi/crt0-efi-x86_64.S
      
      We put these EFI-related files under a new dir `x86/efi` because:
         1. EFI-related code is easy to find
         2. EFI-related code is separated from the original code in `x86/`
         3. EFI-related code can still reuse the Makefile and test case code
            in its parent dir `x86/`
      
      GNU-EFI repo and version:
         GIT URL: https://git.code.sf.net/p/gnu-efi/code
         Commit ID: 4fe83e102674
         Website: https://sourceforge.net/p/gnu-efi/code/ci/4fe83e/tree/
      
      
      
      Co-developed-by: default avatarVarad Gautam <varad.gautam@suse.com>
      Signed-off-by: default avatarVarad Gautam <varad.gautam@suse.com>
      Signed-off-by: default avatarZixuan Wang <zixuanwang@google.com>
      Message-Id: <20211004204931.1537823-5-zxwang42@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8715af84
    • Varad Gautam's avatar
      x86 UEFI: Implement UEFI function calls · 0eaa5176
      Varad Gautam authored
      
      
      This commit implements helper functions that call UEFI services and
      assist the boot up process.
      
      Signed-off-by: default avatarVarad Gautam <varad.gautam@suse.com>
      Reviewed-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
      Message-Id: <20211004204931.1537823-4-zxwang42@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0eaa5176
    • Varad Gautam's avatar
      x86 UEFI: Copy code from Linux · c3770197
      Varad Gautam authored
      
      
      Copy UEFI-related definitions from Linux, so the follow-up commits can
      develop UEFI function calls based on these definitions, without relying
      on GNU-EFI library.
      
      Signed-off-by: default avatarVarad Gautam <varad.gautam@suse.com>
      Message-Id: <20211004204931.1537823-3-zxwang42@gmail.com>
      Signed-off-by: default avatarZixuan Wang <zxwang42@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c3770197
  2. Oct 21, 2021
  3. Oct 20, 2021
  4. Oct 18, 2021
  5. Oct 13, 2021
  6. Oct 12, 2021
    • Andrew Jones's avatar
      arm64: gic-v3: Avoid NULL dereferences · b4667f4c
      Andrew Jones authored
      
      
      LPI allocation requires that the redistributors are configured first.
      It's unlikely that offline cpus have had their redistributors
      configured, so filter them out right away. Also, assert on any cpu,
      not just the calling cpu, in gicv3_lpi_alloc_tables() when we detect
      a unit test failed to follow instructions. Improve the assert with a
      hint message while we're at it.
      
      Cc: Eric Auger <eric.auger@redhat.com>
      Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
      Message-Id: <20211011160420.26785-1-drjones@redhat.com>
      Signed-off-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
      b4667f4c
  7. Oct 11, 2021
Loading