[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property
From: |
Michael S. Tsirkin |
Subject: |
Re: [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property |
Date: |
Tue, 10 Mar 2020 05:32:29 -0400 |
On Tue, Mar 10, 2020 at 01:54:01AM +0200, Liran Alon wrote:
> Instead of hard-coding the VMX version, make it a VMPORT object property.
> This would allow user to control it's value via "-global
> vmport.vmx-version=X".
>
> Reviewed-by: Nikita Leshenko <address@hidden>
> Signed-off-by: Liran Alon <address@hidden>
More detail on why this is useful?
> ---
> hw/i386/vmport.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
> index 7c21e56081b0..a2c8ff4b59cf 100644
> --- a/hw/i386/vmport.c
> +++ b/hw/i386/vmport.c
> @@ -44,6 +44,8 @@ typedef struct VMPortState {
> MemoryRegion io;
> VMPortReadFunc *func[VMPORT_ENTRIES];
> void *opaque[VMPORT_ENTRIES];
> +
> + uint32_t vmx_version;
> } VMPortState;
>
> static VMPortState *port_state;
> @@ -112,7 +114,7 @@ static uint32_t vmport_cmd_get_version(void *opaque,
> uint32_t addr)
> X86CPU *cpu = X86_CPU(current_cpu);
>
> cpu->env.regs[R_EBX] = VMPORT_MAGIC;
> - return 6;
> + return port_state->vmx_version;
> }
>
> static uint32_t vmport_cmd_ram_size(void *opaque, uint32_t addr)
> @@ -169,6 +171,8 @@ static void vmport_realizefn(DeviceState *dev, Error
> **errp)
> }
>
> static Property vmport_properties[] = {
> + /* Default value taken from open-vm-tools code VERSION_MAGIC definition
> */
> + DEFINE_PROP_UINT32("vmx-version", VMPortState, vmx_version, 6),
> DEFINE_PROP_END_OF_LIST(),
> };
>
> --
> 2.20.1
- [PATCH 00/14]: hw/i386/vmport: Bug fixes and improvements, Liran Alon, 2020/03/09
- [PATCH 02/14] hw/i386/vmport: Set EAX to -1 on failed and unsupported commands, Liran Alon, 2020/03/09
- [PATCH 01/14] hw/i386/vmport: Propagate IOPort read to vCPU EAX register, Liran Alon, 2020/03/09
- [PATCH 03/14] hw/i386/vmport: Add device properties, Liran Alon, 2020/03/09
- [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property, Liran Alon, 2020/03/09
- Re: [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property,
Michael S. Tsirkin <=
- Re: [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property, Liran Alon, 2020/03/10
- Re: [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property, Michael S. Tsirkin, 2020/03/10
- Re: [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property, Liran Alon, 2020/03/10
- Re: [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property, Michael S. Tsirkin, 2020/03/10
- Re: [PATCH 04/14] hw/i386/vmport: Introduce vmx-version property, Liran Alon, 2020/03/10
[PATCH 05/14] hw/i386/vmport: Report VMX type in CMD_GETVERSION, Liran Alon, 2020/03/09