diff mbox series

[v5,2/3] hw/i386: Use edk2_add_host_crypto_policy()

Message ID 20190620122132.10075-3-philmd@redhat.com
State New
Headers show
Series fw_cfg: Add edk2_add_host_crypto_policy() | expand

Commit Message

Philippe Mathieu-Daudé June 20, 2019, 12:21 p.m. UTC
Enable the EDK2 Crypto Policy features on the PC machine.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/i386/pc.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Laszlo Ersek June 24, 2019, 3 p.m. UTC | #1
On 06/20/19 14:21, Philippe Mathieu-Daudé wrote:
> Enable the EDK2 Crypto Policy features on the PC machine.
> 
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/i386/pc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 2c5446b095..fe99ebfe3d 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -39,6 +39,7 @@
>  #include "hw/nvram/fw_cfg.h"
>  #include "hw/timer/hpet.h"
>  #include "hw/firmware/smbios.h"
> +#include "hw/firmware/uefi_edk2.h"
>  #include "hw/loader.h"
>  #include "elf.h"
>  #include "multiboot.h"
> @@ -1049,6 +1050,11 @@ static FWCfgState *bochs_bios_init(AddressSpace *as, PCMachineState *pcms)
>      return fw_cfg;
>  }
>  
> +static void pc_uefi_setup(PCMachineState *pcms)
> +{
> +    edk2_add_host_crypto_policy(pcms->fw_cfg);
> +}
> +
>  static long get_file_size(FILE *f)
>  {
>      long where, size;
> @@ -1653,6 +1659,7 @@ void pc_machine_done(Notifier *notifier, void *data)
>      if (pcms->fw_cfg) {
>          pc_build_smbios(pcms);
>          pc_build_feature_control_file(pcms);
> +        pc_uefi_setup(pcms);
>          /* update FW_CFG_NB_CPUS to account for -device added CPUs */
>          fw_cfg_modify_i16(pcms->fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus);
>      }
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
diff mbox series

Patch

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 2c5446b095..fe99ebfe3d 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -39,6 +39,7 @@ 
 #include "hw/nvram/fw_cfg.h"
 #include "hw/timer/hpet.h"
 #include "hw/firmware/smbios.h"
+#include "hw/firmware/uefi_edk2.h"
 #include "hw/loader.h"
 #include "elf.h"
 #include "multiboot.h"
@@ -1049,6 +1050,11 @@  static FWCfgState *bochs_bios_init(AddressSpace *as, PCMachineState *pcms)
     return fw_cfg;
 }
 
+static void pc_uefi_setup(PCMachineState *pcms)
+{
+    edk2_add_host_crypto_policy(pcms->fw_cfg);
+}
+
 static long get_file_size(FILE *f)
 {
     long where, size;
@@ -1653,6 +1659,7 @@  void pc_machine_done(Notifier *notifier, void *data)
     if (pcms->fw_cfg) {
         pc_build_smbios(pcms);
         pc_build_feature_control_file(pcms);
+        pc_uefi_setup(pcms);
         /* update FW_CFG_NB_CPUS to account for -device added CPUs */
         fw_cfg_modify_i16(pcms->fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus);
     }