Saanjh Sengupta <saanjhsengu...@outlook.com> writes: > Hi, > > I am writing to seek assistance with an issue I am experiencing while using > the stoptrigger.c plugin in QEMU emulation. I am > currently utilising the latest QEMU version, 9.2.92, and attempting to > emulate the Debian 11 as the operating system. > > The command I am using to emulate QEMU is as follows: > ./build/qemu-system-x86_64 -m 2048M -smp 2 -boot c -nographic -serial > mon:stdio -nic > tap,ifname=tap0,script=no,downscript=no -hda debian11.qcow2 -icount shift=0 > -plugin . > /build/contrib/plugins/libstoptrigger.so,icount=9000000000 -d plugin -qmp > tcp:localhost:4444,server,wait=off > > However, when I attempt to use the -icount shift=0 option, the plugin fails > with the error "Basic icount read". I have > attached a screenshot of the error for your reference.
icount and libstoptrigger are independent of each other. You do not need to enable icount to use libstoptrigger. > > error.png > > > When I remove the -plugin argument from the command the OS boots up > perfectly, as expected. Command utilised in that > context was somewhat like ./build/qemu-system-x86_64 -m 2048M -smp 2 -boot c > -nographic -serial mon:stdio -nic > tap,ifname=tap0,script=no,downscript=no -hda debian11.qcow2 -icount shift=0 > -qmp > tcp:localhost:4444,server,wait=off > > I would greatly appreciate it if you could provide guidance on resolving this > issue. Specifically, I would like to know the cause > of the error and any potential solutions or workarounds that could be > implemented to successfully use the stoptrigger.c > plugin with the -icount shift=0 option. It's likely the instrumentation libstoptrigger does has changed the size of some of the translation blocks leading to the error being triggered. To know exactly what is going wrong we would need to see a backtrace of the failure. The case: if (!cpu->neg.can_do_io) { error_report("Bad icount read"); exit(1); } is basically saying you are trying to read icount at a point its not a known precise value. Any attempt to do a device access should trigger a TB recompile so the device access is on the last translated instruction of the block. However if a TCG helper queries time and its not the last instruction in a block that would trigger it. > > Regards > > Saanjh Sengupta -- Alex Bennée Virtualisation Tech Lead @ Linaro