Cc'ing Justin Maybe we should add a MAINTAINERS section for the WHPX files.
On 7/12/19 3:26 PM, Stefan Weil wrote: > Signed-off-by: Stefan Weil <s...@weilnetz.de> > --- > target/i386/whpx-all.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c > index 31d47320e4..ed95105eae 100644 > --- a/target/i386/whpx-all.c > +++ b/target/i386/whpx-all.c > @@ -1396,7 +1396,7 @@ static int whpx_accel_init(MachineState *ms) > } > > memset(&prop, 0, sizeof(WHV_PARTITION_PROPERTY)); > - prop.ProcessorCount = smp_cpus; > + prop.ProcessorCount = ms->smp.cpus; I tried to understand how the Windows Hypervisor would answer to an invalid or zeroed property, but I can't find doc for WHvPartitionPropertyCodeProcessorCount. There is a funny comment in VirtualBox although: /** * @todo Someone at Microsoft please explain another weird API: * - Why this API doesn't take the WHV_PARTITION_PROPERTY_CODE value as an * argument rather than as part of the struct. That is so weird if you've * used any other NT or windows API, including WHvGetCapability(). * - Why use PVOID when WHV_PARTITION_PROPERTY is what's expected. We * technically only need 9 bytes for setting/getting * WHVPartitionPropertyCodeProcessorClFlushSize, but the API insists on 16. */ https://www.virtualbox.org/svn/vbox/trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp > hr = whp_dispatch.WHvSetPartitionProperty( > whpx->partition, > WHvPartitionPropertyCodeProcessorCount, > @@ -1405,7 +1405,7 @@ static int whpx_accel_init(MachineState *ms) > > if (FAILED(hr)) { > error_report("WHPX: Failed to set partition core count to %d," > - " hr=%08lx", smp_cores, hr); > + " hr=%08lx", ms->smp.cores, hr); > ret = -EINVAL; > goto error; > } >