[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 02/14] hw/i386/vmport: Set EAX to -1 on failed and unsupported co
From: |
Liran Alon |
Subject: |
[PATCH 02/14] hw/i386/vmport: Set EAX to -1 on failed and unsupported commands |
Date: |
Tue, 10 Mar 2020 01:53:59 +0200 |
This is used as a signal for VMware Tools to know if a command it
attempted to invoke, failed or is unsupported. As a result, VMware Tools
will either report failure to user or fallback to another backdoor command
in attempt to perform some operation.
A few examples:
* open-vm-tools TimeSyncReadHost() function fallbacks to
CMD_GETTIMEFULL command when CMD_GETTIMEFULL_WITH_LAG
fails/unsupported.
* open-vm-tools Hostinfo_NestingSupported() function verifies
EAX != -1 to check for success.
* open-vm-tools Hostinfo_VCPUInfoBackdoor() functions checks
if reserved-bit is set to indicate command is unimplemented.
Reviewed-by: Nikita Leshenko <address@hidden>
Signed-off-by: Liran Alon <address@hidden>
---
hw/i386/vmport.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
index 9319720e8204..a78e20040a79 100644
--- a/hw/i386/vmport.c
+++ b/hw/i386/vmport.c
@@ -72,6 +72,7 @@ static uint64_t vmport_ioport_read(void *opaque, hwaddr addr,
eax = env->regs[R_EAX];
if (eax != VMPORT_MAGIC) {
+ eax = UINT32_MAX;
goto out;
}
@@ -79,6 +80,7 @@ static uint64_t vmport_ioport_read(void *opaque, hwaddr addr,
trace_vmport_command(command);
if (command >= VMPORT_ENTRIES || !s->func[command]) {
qemu_log_mask(LOG_UNIMP, "vmport: unknown command %x\n", command);
+ eax = UINT32_MAX;
goto out;
}
--
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 <=
- [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, 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
- 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