mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
spapr: Generate random HASHPKEYR for spapr machines
The hypervisor is expected to create a value for the HASHPKEY SPR for each partition. Currently it uses zero for all partitions, use a random number instead, which in theory might make kernel ROP protection more secure. Signed-of-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20241219034035.1826173-4-npiggin@gmail.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
This commit is contained in:
parent
b4aa82dc3a
commit
d91b101da1
3 changed files with 6 additions and 0 deletions
|
@ -273,6 +273,8 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
|
|||
env->spr_cb[SPR_PIR].default_value = cs->cpu_index;
|
||||
env->spr_cb[SPR_TIR].default_value = thread_index;
|
||||
|
||||
env->spr_cb[SPR_HASHPKEYR].default_value = spapr->hashpkey_val;
|
||||
|
||||
cpu_ppc_set_1lpar(cpu);
|
||||
|
||||
/* Set time-base frequency to 512 MHz. vhyp must be set first. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue