On 20/11/2019 13:47, Greg Kurz wrote: > On Wed, 20 Nov 2019 12:28:19 +0100 > Laurent Vivier <lviv...@redhat.com> wrote: > >> On 20/11/2019 10:00, Laurent Vivier wrote: >>> On 20/11/2019 05:36, David Gibson wrote: >>>> On Tue, Nov 19, 2019 at 04:45:26PM +0100, Greg Kurz wrote: >>>>> On Tue, 19 Nov 2019 15:06:51 +0100 >>>>> Laurent Vivier <lviv...@redhat.com> wrote: >>>>> >>>>>> On 19/11/2019 02:00, David Gibson wrote: >>>>>>> On Fri, Nov 08, 2019 at 05:47:59PM +0100, Greg Kurz wrote: >>>>>>>> On Fri, 8 Nov 2019 16:40:35 +0100 >>>>>>>> Laurent Vivier <lviv...@redhat.com> wrote: >>>>>>>> >>>>>>>>> Commit 29cb4187497d sets by default the VSMT to smp_threads, >>>>>>>>> but older kernels (< 4.13) don't support that. >>>>>>>>> >>>>>>>>> We can reasonably restore previous behavior with this kernel >>>>>>>>> to allow to run QEMU as before. >>>>>>>>> >>>>>>>>> If VSMT is not supported, VSMT will be set to MAX(8, smp_threads) >>>>>>>>> as it is done for previous machine types (< pseries-4.2) >>>>>>>>> >>>>>>>> >>>>>>>> It is usually _bad_ to base the machine behavior on host capabilities. >>>>>>>> What happens if we migrate between an older kernel and a recent one ? >>>>>>> >>>>>>> Right. We're really trying to remove instaces of such behaviour. I'd >>>>>>> prefer to completely revert Greg's original patch than to re-introduce >>>>>>> host configuration dependency into the guest configuration.. >>>>>>> >>>>>>>> I understand this is to fix tests/migration-test on older kernels. >>>>>>>> Couldn't this be achieved with migration-test doing some introspection >>>>>>>> and maybe pass vsmt=8 on the QEMU command line ? >>>>>>> >>>>>>> ..adjusting the test case like this might be a better idea, though. >>>>>>> >>>>>>> What's the test setup where we're using the old kernel? I really only >>>>>>> applied the original patch on the guess that we didn't really care >>>>>>> about kernels that old. The fact you've hit this in practice makes me >>>>>>> doubt that assumption. >>>>>>> >>>>>> >>>>>> The way to fix the tests is to add "-smp threads=8" on the command line >>>>>> (for all tests, so basically in qtest_init_without_qmp_handshake(), and >>>>>> it will impact all the machine types), and we have to check if it is >>>>> >>>>> Ohhh... it isn't possible to initialize Qtest with machine specific >>>>> properties ? That's a bit unfortunate :-\ >>>> >>>> Uhh... I don't see why we can't. Couldn't we just put either -machine >>>> vsmt=8 or -smp 8 into the cmd_src / cmd_dst printfs() in the >>>> strcmp(arch, "ppc64") case? >>> >>> Yes, but we need to do that to all other tests that fail. test-migration >>> is not the only one impacted by the problem (we have also pxe-test), so >>> it's why I thought to fix the problem in a generic place. >>> >>> But it seems there are only this couple of tests that are impacted so I >>> can modify both instead. I think only tests that really start CPU have >>> the problem. >>> >>> I'm going to send a patch to fix that. >> >> And again, it's a little bit more complicated than expected: setting >> vsmt to 8 works only with kvm_hv, but breaks in case of TCG or kvm_pr. >> So the test must check what is in use... >> > > AFAICT, migration-test explicitly skip tests if kvm_hv isn't present. > > /* > * On ppc64, the test only works with kvm-hv, but not with kvm-pr and TCG > * is touchy due to race conditions on dirty bits (especially on PPC for > * some reason) > */ > if (g_str_equal(qtest_get_arch(), "ppc64") && > access("/sys/module/kvm_hv", F_OK)) { > g_test_message("Skipping test: kvm_hv not available"); > return g_test_run(); > } > > and I don't see any error in pxe-test if I force tcg and vsmt=8. > > What error do you see with your testing ?
In fact, you're right, it works with vsmt=8 and it's better. Laurent