Commit Graph

25 Commits

Author SHA1 Message Date
Sergio Lopez 4a7e7781ef qboot: Update to fix issue when mem > 3328 MiB
Update binary to a version that fixes the issue when mem > 3328
MiB (wrapping around the MMIO hole), matching "bc48d49" from
https://github.com/slp/qboot-krunfw

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-24 17:56:00 +02:00
Sergio Lopez ce57807c81 patches/0006: Allow booting SEV-ES APs without GHCB (HACK)
Allow booting APs with SEV-ES enabled, by setting the trampoline at a
well-known location, and moving sev_es_trampoline_start to the
beginning of realmode's .text.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-24 17:54:02 +02:00
Sergio Lopez e948a139c6 qboot: Update to binary with SEV-ES support
Update binary to a version with SEV-ES support, matching "5ec4468"
from https://github.com/slp/qboot-krunfw

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-20 16:24:29 +02:00
Sergio Lopez 4eb65a7e5a patches/0005: virtio: Force the use of the DMA API (HACK)
For running under SEV, we need to instruct virtio-mmio to use bounce
buffers through the DMA API, but there's currently no way of
signalling this using the device properties.

Force the use of the DMA API until there's a proper way to do this.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-10 13:08:19 +02:00
Sergio Lopez df8d4ff3ed SEV: bundle qboot and initrd into the library
Bundle qboot (used as FW by libkrun-SEV) and initrd into the
library. To simplify the build process, we import then as binary blobs
into the project. Their source code can be found at the following
repositories:

- https://github.com/slp/qboot-krunfw

- https://github.com/slp/initrd-krunfw

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-09 17:45:08 +02:00
Sergio Lopez 23a950f218 SEV: update x86_64 config to support SEV guest
Update the config so the kernel can boot as an SEV guest.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-09 17:35:56 +02:00
Sergio Lopez 0ea4706588
Merge pull request #5 from dfaggioli/main
patches/0004 x86/entry: build thunk_$(BITS) only if CONFIG_PREEMPTION=y
2021-02-27 22:41:07 +01:00
Dario Faggioli 2515a76362 patches/0004 x86/entry: build thunk_$(BITS) only if CONFIG_PREEMPTION=y
Import patch https://lore.kernel.org/patchwork/patch/1369985/ for
fixing the build with newer binutils (was failing with 2.36-1.1.x86_64
on openSUSE Tumbleweed).

Addresses Issue #4.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
2021-02-27 11:26:11 +00:00
Sergio Lopez 9a5fa03b6b README.md: Add instructions for building under macOS
Add instructions for building under macOS using the
"build_on_krunvm.sh" script.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-02-04 11:13:59 +01:00
Sergio Lopez 4ae59bb6b0 Update kernel config file for x86_64
Update kernel config file for x86_64 so oldconfig runs without asking
questions.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-01-28 06:26:27 +01:00
Sergio Lopez b332645018 Makefile: Use a different LIBDIR for each platform
Use "lib64" as LIBDIR for Fedora, and "lib" for macOS.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-01-27 17:25:14 +01:00
Sergio Lopez 3159f7a0c6 Makefile: Support different library names
Support both Linux (.so) and Darwin (.dylib) library names.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-01-27 14:21:21 +01:00
Sergio Lopez 291307000c
Merge pull request #2 from slp/aarch64
Add support for AArch64
2021-01-27 14:05:51 +01:00
Sergio Lopez c5bc63db97 Enable security keys in the kernel
Enable security keys in the kernel, as it's required by crun.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-01-27 12:18:45 +01:00
Sergio Lopez 6b79b8ff6c Add a script for building in krunvm
Add a script for building the kernel inside a VM managed by
krunvm. This is specially useful for building the kernel on macOS.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-01-27 09:40:34 +01:00
Sergio Lopez 97dfec94a9 Add support for AArch64
Add support for generating a kernel for AArch64.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-01-27 09:38:27 +01:00
Sergio Lopez 2d6ee629d7 Update to Linux 5.10.10 and latest TSI
Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-01-27 09:32:40 +01:00
Sergio Lopez 6139eda34c patches/0009: krunfw: Allow RST if sk_shutdown == SHUTDOWN_MASK
Even if sk_shutdown == SHUTDOWN_MASK, allow processing of OP_RST
packets. This prevents RST storms caused by dangling sockets.

Also, rename previous patch files to homogenize them.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-11-11 07:12:39 +01:00
Sergio Lopez c35a55883b patches/0008: krun: Initialize addr_vsock in libkip_listen
Otherwise vsock_addr_cast() may fail.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-10-27 11:39:10 +01:00
Sergio Lopez 9f852c8f50 patches/0007: krun: Ignore run_cmd on orderly reboot
We don't really support restarting the conventional way, so ignore
"run_cmd" so we can fall back to an emergency sync and reboot.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-10-02 15:38:37 +02:00
Sergio Lopez 1d32840662 patches/0006: krun: setsockopt: lie about having set the option
Eventually we should inform the VMM so it can set the option on the
external context socket.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-10-02 15:37:50 +02:00
Sergio Lopez cf8933e0b0 patches/0005: krun: Don't re-wrap socket on listen()
If the socket already has another wrapped socket, don't create a new
one.

This fixes a bug where would break s2vi when userspace calls to listen()
on an already listening socket to change its attributes.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-10-02 15:36:27 +02:00
Sergio Lopez 79076794a6 v2b: Rename symbols and add versioning
Rename symbols to include the krunfw prefix, and add the
"krunfw_get_version" function to keep track of API versions.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-09-04 14:43:56 +02:00
Sergio Lopez dd29104a2b README.md: Update libkrun references to new location
Update libkrun URL to references point to its new home at the
"containers" GitHub organization.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-08-18 09:54:25 +02:00
Sergio Lopez 443c03426a initial commit 2020-08-13 18:47:26 +02:00