Re: [PATCH v2 32/32] hw/display: mark most display adapters as insecure

[email protected]
Newsgroups gmane.comp.emulators.qemu
Message-ID <178708450916.1320462.1427984683087351414.b4-review@b4>
> Most of thte display adapters are emulating old hardware which is not
> relevant to virtualization use cases.
> 
> The exceptions that should be considered secure are Cirrus (PCI, not
> ISA), Bochs, QXL, RAMFB, VGA (PCI, MMIO, not ISA) and VMWare VGA.
> 
> The Cirrus PCI decision is borderline. It has been heavily used with
> virtualization in the past, but these days VGA / RAMFB are strongly
> recommended instead. Due to its historical usage though, we can
> consider the code fairly mature, even if no longer hugely relevant
> to virtualization use cases.
> 
> Signed-off-by: Daniel P. Berrangé <[email protected]>
> Message-ID: <[email protected]>
>
> diff --git a/hw/display/artist.c b/hw/display/artist.c
> index 3c884c92437c..caab4d1d4c52 100644
> --- a/hw/display/artist.c
> +++ b/hw/display/artist.c
> @@ -1504,6 +1504,7 @@ static const TypeInfo artist_info = {
>      .instance_size = sizeof(ARTISTState),
>      .instance_init = artist_initfn,
>      .class_init    = artist_class_init,
> +    .secure        = false,
>  };
>  
>  static void artist_register_types(void)
> diff --git a/hw/display/ati.c b/hw/display/ati.c
> index f7c0006a879d..6e332e02d2fb 100644
> --- a/hw/display/ati.c
> +++ b/hw/display/ati.c
> @@ -1080,6 +1080,7 @@ static const TypeInfo ati_vga_info = {
>      .instance_size = sizeof(ATIVGAState),
>      .class_init = ati_vga_class_init,
>      .instance_init = ati_vga_init,
> +    .secure = false,
>      .interfaces = (const InterfaceInfo[]) {
>            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>            { },
> diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c
> index 1bb2ee45a015..bb6c986fb86f 100644
> --- a/hw/display/bcm2835_fb.c
> +++ b/hw/display/bcm2835_fb.c
> @@ -459,6 +459,7 @@ static const TypeInfo bcm2835_fb_info = {
>      .instance_size = sizeof(BCM2835FBState),
>      .class_init    = bcm2835_fb_class_init,
>      .instance_init = bcm2835_fb_init,
> +    .secure        = false,
>  };
>  
>  static void bcm2835_fb_register_types(void)
> diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
> index ad2821c97458..0495d900f6d2 100644
> --- a/hw/display/bochs-display.c
> +++ b/hw/display/bochs-display.c
> @@ -374,6 +374,7 @@ static const TypeInfo bochs_display_type_info = {
>      .instance_size  = sizeof(BochsDisplayState),
>      .instance_init  = bochs_display_init,
>      .class_init     = bochs_display_class_init,
> +    .secure         = true,
>      .interfaces     = (const InterfaceInfo[]) {
>          { INTERFACE_PCIE_DEVICE },
>          { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> diff --git a/hw/display/cg3.c b/hw/display/cg3.c
> index daeef1521745..f437921a7e70 100644
> --- a/hw/display/cg3.c
> +++ b/hw/display/cg3.c
> @@ -384,6 +384,7 @@ static const TypeInfo cg3_info = {
>      .instance_size = sizeof(CG3State),
>      .instance_init = cg3_initfn,
>      .class_init    = cg3_class_init,
> +    .secure        = false,
>  };
>  
>  static void cg3_register_types(void)
> diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> index ef08694626d6..d9403ccb57e7 100644
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -3013,6 +3013,7 @@ static const TypeInfo cirrus_vga_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCICirrusVGAState),
>      .class_init    = cirrus_vga_class_init,
> +    .secure        = true,
>      .interfaces = (const InterfaceInfo[]) {
>          { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>          { },
> diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c
> index 4b55c48eff85..7b38e6c33a3c 100644
> --- a/hw/display/cirrus_vga_isa.c
> +++ b/hw/display/cirrus_vga_isa.c
> @@ -91,6 +91,7 @@ static const TypeInfo isa_cirrus_vga_info = {
>      .parent        = TYPE_ISA_DEVICE,
>      .instance_size = sizeof(ISACirrusVGAState),
>      .class_init = isa_cirrus_vga_class_init,
> +    .secure        = false,
>  };
>  
>  static void cirrus_vga_isa_register_types(void)
> diff --git a/hw/display/dm163.c b/hw/display/dm163.c
> index f8340d8275e9..f0437867753e 100644
> --- a/hw/display/dm163.c
> +++ b/hw/display/dm163.c
> @@ -343,6 +343,7 @@ static const TypeInfo dm163_types[] = {
>          .parent = TYPE_DEVICE,
>          .instance_size = sizeof(DM163State),
>          .class_init = dm163_class_init

missing trailing coma

> +        .secure = false,
>      }
>  };
>  
> diff --git a/hw/display/dpcd.c b/hw/display/dpcd.c
> index a157dc64e761..733f6433759b 100644
> --- a/hw/display/dpcd.c
> +++ b/hw/display/dpcd.c
> @@ -155,6 +155,7 @@ static const TypeInfo dpcd_info = {
>      .instance_size = sizeof(DPCDState),
>      .class_init    = dpcd_class_init,
>      .instance_init = dpcd_init,
> +    .secure        = false,
>  };
>  
>  static void dpcd_register_types(void)
> diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
> index c61e0280a7cd..85e32e8700d0 100644
> --- a/hw/display/exynos4210_fimd.c
> +++ b/hw/display/exynos4210_fimd.c
> @@ -1974,6 +1974,7 @@ static const TypeInfo exynos4210_fimd_info = {
>      .instance_size = sizeof(Exynos4210fimdState),
>      .instance_init = exynos4210_fimd_init,
>      .class_init = exynos4210_fimd_class_init,
> +    .secure = false,
>  };
>  
>  static void exynos4210_fimd_register_types(void)
> diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c
> index a6ddc21d3e4a..c23d5846843e 100644
> --- a/hw/display/g364fb.c
> +++ b/hw/display/g364fb.c
> @@ -543,6 +543,7 @@ static const TypeInfo g364fb_sysbus_info = {
>      .parent        = TYPE_SYS_BUS_DEVICE,
>      .instance_size = sizeof(G364SysBusState),
>      .class_init    = g364fb_sysbus_class_init,
> +    .secure        = false,
>  };
>  
>  static void g364fb_register_types(void)
> diff --git a/hw/display/i2c-ddc.c b/hw/display/i2c-ddc.c
> index 2adfc1a1472f..525479aa49a2 100644
> --- a/hw/display/i2c-ddc.c
> +++ b/hw/display/i2c-ddc.c
> @@ -117,7 +117,8 @@ static const TypeInfo i2c_ddc_info = {
>      .parent = TYPE_I2C_SLAVE,
>      .instance_size = sizeof(I2CDDCState),
>      .instance_init = i2c_ddc_init,
> -    .class_init = i2c_ddc_class_init
> +    .class_init = i2c_ddc_class_init,
> +    .secure = false,
>  };
>  
>  static void ddc_register_devices(void)
> diff --git a/hw/display/jazz_led.c b/hw/display/jazz_led.c
> index 90e82b58be29..946f78306e2f 100644
> --- a/hw/display/jazz_led.c
> +++ b/hw/display/jazz_led.c
> @@ -310,6 +310,7 @@ static const TypeInfo jazz_led_info = {
>      .instance_size = sizeof(LedState),
>      .instance_init = jazz_led_init,
>      .class_init    = jazz_led_class_init,
> +    .secure        = false,
>  };
>  
>  static void jazz_led_register(void)
> diff --git a/hw/display/macfb.c b/hw/display/macfb.c
> index 574d667173ca..b80ce26d9b90 100644
> --- a/hw/display/macfb.c
> +++ b/hw/display/macfb.c
> @@ -825,6 +825,7 @@ static const TypeInfo macfb_sysbus_info = {
>      .parent        = TYPE_SYS_BUS_DEVICE,
>      .instance_size = sizeof(MacfbSysBusState),
>      .class_init    = macfb_sysbus_class_init,
> +    .secure        = false,
>  };
>  
>  static const TypeInfo macfb_nubus_info = {
> @@ -833,6 +834,7 @@ static const TypeInfo macfb_nubus_info = {
>      .instance_size = sizeof(MacfbNubusState),
>      .class_init    = macfb_nubus_class_init,
>      .class_size    = sizeof(MacfbNubusDeviceClass),
> +    .secure        = false,
>  };
>  
>  static void macfb_register_types(void)
> diff --git a/hw/display/next-fb.c b/hw/display/next-fb.c
> index ec81b766a7e4..9ddbd13ba325 100644
> --- a/hw/display/next-fb.c
> +++ b/hw/display/next-fb.c
> @@ -134,6 +134,7 @@ static const TypeInfo nextfb_info = {
>      .parent        = TYPE_SYS_BUS_DEVICE,
>      .instance_size = sizeof(NeXTFbState),
>      .class_init    = nextfb_class_init,
> +    .secure        = false,
>  };
>  
>  static void nextfb_register_types(void)
> diff --git a/hw/display/pl110.c b/hw/display/pl110.c
> index 09c3c59e0ed6..ce33d4c68cca 100644
> --- a/hw/display/pl110.c
> +++ b/hw/display/pl110.c
> @@ -596,18 +596,21 @@ static const TypeInfo pl110_info = {
>      .instance_size = sizeof(PL110State),
>      .instance_init = pl110_init,
>      .class_init    = pl110_class_init,
> +    .secure        = false,
>  };
>  
>  static const TypeInfo pl110_versatile_info = {
>      .name          = "pl110_versatile",
>      .parent        = TYPE_PL110,
>      .instance_init = pl110_versatile_init,
> +    .secure        = false,
>  };
>  
>  static const TypeInfo pl111_info = {
>      .name          = "pl111",
>      .parent        = TYPE_PL110,
>      .instance_init = pl111_init,
> +    .secure        = false,
>  };
>  
>  static void pl110_register_types(void)
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index 18f482ca7f7b..8f876c872ad8 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -2516,7 +2516,9 @@ static const TypeInfo qxl_pci_type_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIQXLDevice),
>      .abstract = true,
> +    .secure = true,
>      .class_init = qxl_pci_class_init,
> +    .secure        = true,


.secure is set twice here

-- 
Marc-André Lureau <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.