@@ -369,7 +369,7 @@ func Cmdline(cfg Config) (string, []string, error) {
369369 args = appendArgsIfNoConflict (args , "-cpu" , cpu )
370370 switch * y .Arch {
371371 case limayaml .X8664 :
372- if strings .HasPrefix (cpu , "qemu64" ) {
372+ if strings .HasPrefix (cpu , "qemu64" ) && runtime . GOOS != "windows" {
373373 // use q35 machine with vmware io port disabled.
374374 args = appendArgsIfNoConflict (args , "-machine" , "q35,vmport=off" )
375375 // use tcg accelerator with multi threading with 512MB translation block size
@@ -379,6 +379,9 @@ func Cmdline(cfg Config) (string, []string, error) {
379379 args = appendArgsIfNoConflict (args , "-accel" , "tcg,thread=multi,tb-size=512" )
380380 // This will disable CPU S3 state.
381381 args = append (args , "-global" , "ICH9-LPC.disable_s3=1" )
382+ } else if runtime .GOOS == "windows" && accel == "whpx" {
383+ // whpx: injection failed, MSI (0, 0) delivery: 0, dest_mode: 0, trigger mode: 0, vector: 0
384+ args = appendArgsIfNoConflict (args , "-machine" , "q35,accel=" + accel + ",kernel-irqchip=off" )
382385 } else {
383386 args = appendArgsIfNoConflict (args , "-machine" , "q35,accel=" + accel )
384387 }
@@ -608,7 +611,7 @@ func getAccel(arch limayaml.Arch) string {
608611 case "netbsd" :
609612 return "nvmm"
610613 case "windows" :
611- return "whpx" // untested
614+ return "whpx"
612615 }
613616 }
614617 return "tcg"
0 commit comments