Commit 84d77496 authored by Will Deacon's avatar Will Deacon
Browse files

arm64: Allow random seed to be specified for KASLR



Fully fledged bootloaders should really be populating this from within
the guest using virtio-rng, but having a way to specify it on the cmdline
is useful for developers or users without a bootloader.
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 93dd1288
......@@ -5,7 +5,10 @@
OPT_BOOLEAN('\0', "aarch32", &(cfg)->aarch32_guest, \
"Run AArch32 guest"), \
OPT_BOOLEAN('\0', "pmu", &(cfg)->has_pmuv3, \
"Create PMUv3 device"),
"Create PMUv3 device"), \
OPT_U64('\0', "kaslr-seed", &(cfg)->kaslr_seed, \
"Specify random seed for Kernel Address Space " \
"Layout Randomization (KASLR)"),
#include "arm-common/kvm-config-arch.h"
......
......@@ -142,6 +142,7 @@ static int setup_fdt(struct kvm *kvm)
_FDT(fdt_begin_node(fdt, "chosen"));
_FDT(fdt_property_cell(fdt, "linux,pci-probe-only", 1));
_FDT(fdt_property_string(fdt, "bootargs", kvm->cfg.real_cmdline));
_FDT(fdt_property_u64(fdt, "kaslr-seed", kvm->cfg.arch.kaslr_seed));
/* Initrd */
if (kvm->arch.initrd_size != 0) {
......
......@@ -9,6 +9,7 @@ struct kvm_config_arch {
bool virtio_trans_pci;
bool aarch32_guest;
bool has_pmuv3;
u64 kaslr_seed;
enum irqchip_type irqchip;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment