[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 04/33] i386: Add 'sgx-epc' device to expose EPC sections t
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 04/33] i386: Add 'sgx-epc' device to expose EPC sections to guest |
Date: |
Tue, 14 Sep 2021 08:36:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 7/19/21 1:21 PM, Yang Zhong wrote:
> From: Sean Christopherson <sean.j.christopherson@intel.com>
>
> SGX EPC is enumerated through CPUID, i.e. EPC "devices" need to be
> realized prior to realizing the vCPUs themselves, which occurs long
> before generic devices are parsed and realized. Because of this,
> do not allow 'sgx-epc' devices to be instantiated after vCPUS have
> been created.
>
> The 'sgx-epc' device is essentially a placholder at this time, it will
> be fully implemented in a future patch along with a dedicated command
> to create 'sgx-epc' devices.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
> hw/i386/meson.build | 1 +
> hw/i386/sgx-epc.c | 161 ++++++++++++++++++++++++++++++++++++++
> include/hw/i386/sgx-epc.h | 44 +++++++++++
> 3 files changed, 206 insertions(+)
> create mode 100644 hw/i386/sgx-epc.c
> create mode 100644 include/hw/i386/sgx-epc.h
>
> diff --git a/hw/i386/meson.build b/hw/i386/meson.build
> index 80dad29f2b..27476b36bb 100644
> --- a/hw/i386/meson.build
> +++ b/hw/i386/meson.build
> @@ -5,6 +5,7 @@ i386_ss.add(files(
> 'e820_memory_layout.c',
> 'multiboot.c',
> 'x86.c',
> + 'sgx-epc.c',
> ))
>
> i386_ss.add(when: 'CONFIG_X86_IOMMU', if_true: files('x86-iommu.c'),
> diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c
> new file mode 100644
> index 0000000000..aa487dea79
> --- /dev/null
> +++ b/hw/i386/sgx-epc.c
> @@ -0,0 +1,161 @@
> +/*
> + * SGX EPC device
> + *
> + * Copyright (C) 2019 Intel Corporation
> + *
> + * Authors:
> + * Sean Christopherson <sean.j.christopherson@intel.com>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#include "qemu/osdep.h"
> +#include "hw/i386/pc.h"
> +#include "hw/i386/sgx-epc.h"
> +#include "hw/mem/memory-device.h"
> +#include "hw/qdev-properties.h"
> +#include "monitor/qdev.h"
Is that include used?
> +#include "qapi/error.h"
> +#include "qapi/visitor.h"
> +#include "qemu/config-file.h"
Ditto.
> +#include "qemu/error-report.h"
Ditto.
> +#include "qemu/option.h"
Ditto.
> +#include "qemu/units.h"
Ditto.
> +#include "target/i386/cpu.h"
> +#include "exec/address-spaces.h"
- Re: [PATCH v4 04/33] i386: Add 'sgx-epc' device to expose EPC sections to guest,
Philippe Mathieu-Daudé <=