[PATCH] target/i386: sgx: mark device not user creatable

Paolo Bonzini posted 1 patch 2 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211109175021.17813-1-pbonzini@redhat.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
hw/i386/sgx-epc.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] target/i386: sgx: mark device not user creatable
Posted by Paolo Bonzini 2 years, 6 months ago
The device is created by the machine based on the sgx-epc property.
It should not be created by users.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/sgx-epc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c
index 55e2217eae..e508827e78 100644
--- a/hw/i386/sgx-epc.c
+++ b/hw/i386/sgx-epc.c
@@ -154,6 +154,7 @@ static void sgx_epc_class_init(ObjectClass *oc, void *data)
     dc->realize = sgx_epc_realize;
     dc->unrealize = sgx_epc_unrealize;
     dc->desc = "SGX EPC section";
+    dc->user_creatable = false;
     device_class_set_props(dc, sgx_epc_properties);
 
     mdc->get_addr = sgx_epc_md_get_addr;
-- 
2.33.1


Re: [PATCH] target/i386: sgx: mark device not user creatable
Posted by Thomas Huth 2 years, 6 months ago
On 09/11/2021 18.50, Paolo Bonzini wrote:
> The device is created by the machine based on the sgx-epc property.
> It should not be created by users.
> 
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   hw/i386/sgx-epc.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c
> index 55e2217eae..e508827e78 100644
> --- a/hw/i386/sgx-epc.c
> +++ b/hw/i386/sgx-epc.c
> @@ -154,6 +154,7 @@ static void sgx_epc_class_init(ObjectClass *oc, void *data)
>       dc->realize = sgx_epc_realize;
>       dc->unrealize = sgx_epc_unrealize;
>       dc->desc = "SGX EPC section";
> +    dc->user_creatable = false;
>       device_class_set_props(dc, sgx_epc_properties);
>   
>       mdc->get_addr = sgx_epc_md_get_addr;
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>


Re: [PATCH] target/i386: sgx: mark device not user creatable
Posted by Philippe Mathieu-Daudé 2 years, 6 months ago
On 11/9/21 18:50, Paolo Bonzini wrote:
> The device is created by the machine based on the sgx-epc property.
> It should not be created by users.
> 
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/i386/sgx-epc.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>