mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
65b9fc442c
Protected VMs (PVM) are KVM VMs, where KVM can't access the VM's state like guest memory and guest registers anymore. Instead the PVMs are mostly managed by a new entity called Ultravisor (UV), which provides an API, so KVM and the PV can request management actions. PVMs are encrypted at rest and protected from hypervisor access while running. They switch from a normal operation into protected mode, so we can still use the standard boot process to load an encrypted image and then move it into protected mode. This commit adds the tool 'genprotimg'. It takes a kernel, key files, optionally an initrd, optionally a file with the kernel command line, and it generates a single, loadable image file. The image consists of a concatenation of a plain text boot loader, the encrypted components for kernel, initrd, and cmdline, and the integrity-protected PV header, containing metadata necessary for running the guest in PV mode. It's possible to use this image file as a kernel for zipl or for a direct kernel boot using QEMU. Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> Acked-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
43 lines
1.3 KiB
C
43 lines
1.3 KiB
C
/*
|
|
* PV components related definitions and functions
|
|
*
|
|
* Copyright IBM Corp. 2020
|
|
*
|
|
* s390-tools is free software; you can redistribute it and/or modify
|
|
* it under the terms of the MIT license. See LICENSE for details.
|
|
*/
|
|
|
|
#ifndef PV_COMPS_H
|
|
#define PV_COMPS_H
|
|
|
|
#include <glib.h>
|
|
#include <openssl/evp.h>
|
|
#include <stdint.h>
|
|
|
|
#include "boot/s390.h"
|
|
#include "boot/stage3b.h"
|
|
#include "utils/buffer.h"
|
|
|
|
#include "pv_comp.h"
|
|
|
|
typedef struct _pv_img_comps PvImgComps;
|
|
|
|
PvImgComps *pv_img_comps_new(const EVP_MD *ald_md, const EVP_MD *pld_md,
|
|
const EVP_MD *tld_md, GError **err);
|
|
guint pv_img_comps_length(const PvImgComps *comps);
|
|
GSList *pv_img_comps_get_comps(const PvImgComps *comps);
|
|
struct stage3b_args *pv_img_comps_get_stage3b_args(const PvImgComps *comps,
|
|
struct psw_t *psw);
|
|
gint pv_img_comps_add_component(PvImgComps *comps, PvComponent **comp,
|
|
GError **err);
|
|
PvComponent *pv_img_comps_get_nth_comp(PvImgComps *comps, guint n);
|
|
gint pv_img_comps_set_offset(PvImgComps *comps, gsize offset, GError **err);
|
|
gint pv_img_comps_finalize(PvImgComps *comps, Buffer **pld_digest,
|
|
Buffer **ald_digest, Buffer **tld_digest,
|
|
uint64_t *nep, GError **err);
|
|
void pv_img_comps_free(PvImgComps *comps);
|
|
|
|
WRAPPED_G_DEFINE_AUTOPTR_CLEANUP_FUNC(PvImgComps, pv_img_comps_free)
|
|
|
|
#endif
|