From: Martin Doucha <mdoucha@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it, Nicolai Stange <nstange@suse.de>
Subject: Re: [LTP] [PATCH 4/7] KVM: Add async communication helper functions
Date: Thu, 18 May 2023 10:36:44 +0200 [thread overview]
Message-ID: <18915cfd-8866-a01f-8562-1c6023a8e47f@suse.cz> (raw)
In-Reply-To: <20230517224746.GC8914@pevik>
On 18. 05. 23 0:47, Petr Vorel wrote:
> Hi Martin,
>
> Acked-by: Petr Vorel <pvorel@suse.cz>
>
>> /*
>> * Result value indicating end of test. If the test program exits using
>> * the HLT instruction with any valid result value other than KVM_TEXIT or
>> diff --git a/testcases/kernel/kvm/include/kvm_guest.h b/testcases/kernel/kvm/include/kvm_guest.h
>> index ec13c5845..96f246155 100644
>> --- a/testcases/kernel/kvm/include/kvm_guest.h
>> +++ b/testcases/kernel/kvm/include/kvm_guest.h
>> @@ -64,6 +64,20 @@ void tst_brk_(const char *file, const int lineno, int result,
>> const char *message) __attribute__((noreturn));
>> #define tst_brk(result, msg) tst_brk_(__FILE__, __LINE__, (result), (msg))
>
> BTW (unrelated to this commit, as it was not added to this commit) tst_brk()
> definition from include/tst_test.h contains also
> TST_BRK_SUPPORTS_ONLY_TCONF_TBROK().
>
> And tst_res() has also TST_RES_SUPPORTS_TCONF_TFAIL_TINFO_TPASS_TWARN().
The support macros are not needed, the controller program always handles
TBROK using tst_brk() even if the guest incorrectly called tst_res(TBROK).
> We could rename tst_res_flags.h to tst_res.h and add there tst_brk() and
> tst_res() definitions and tst_brk_() and tst_res_() signatures.
I don't think that's a good idea. The guest library currently does not
support variadic parameters for tst_res() and tst_brk() so the function
signatures are slightly different.
>> diff --git a/testcases/kernel/kvm/lib_guest.c b/testcases/kernel/kvm/lib_guest.c
>> index d3b2ac3d5..f3e21d3d6 100644
>> --- a/testcases/kernel/kvm/lib_guest.c
>> +++ b/testcases/kernel/kvm/lib_guest.c
>> @@ -155,6 +155,22 @@ void tst_brk_(const char *file, const int lineno, int result,
>> kvm_exit();
>> }
>
>> +void tst_signal_host(void *data)
>> +{
>> + test_result->file_addr = (uintptr_t)data;
>> + test_result->result = KVM_TSYNC;
>> +}
>> +
>> +void tst_wait_host(void *data)
>> +{
>> + volatile int32_t *vres = &test_result->result;
>> +
>> + tst_signal_host(data);
>> +
>> + while (*vres != KVM_TNONE)
>> + ;
> Interesting there is no any usleep().
usleep() does not exist in the guest library. And even if it did,
yielding the CPU to the host would prevent kvm_svm03 from ever
reproducing the CLGI bug.
--
Martin Doucha mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-05-18 8:37 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 15:36 [LTP] [PATCH 0/7] Two AMD SVM vulnerability tests Martin Doucha
2023-05-17 15:36 ` [LTP] [PATCH 1/7] KVM: Add VMSAVE/VMLOAD intercept constants Martin Doucha
2023-05-17 22:08 ` Petr Vorel
2023-05-18 8:27 ` Martin Doucha
2023-05-18 9:49 ` Petr Vorel
2023-05-17 15:36 ` [LTP] [PATCH 2/7] Add test for CVE 2021-3656 Martin Doucha
2023-05-17 22:32 ` Petr Vorel
2023-05-18 8:29 ` Martin Doucha
2023-05-18 9:56 ` Petr Vorel
2023-05-17 15:36 ` [LTP] [PATCH 3/7] lib: Add safe functions for pthread_kill() and mutexes Martin Doucha
2023-05-17 23:07 ` Petr Vorel
2023-05-23 12:02 ` Cyril Hrubis
2023-05-17 15:36 ` [LTP] [PATCH 4/7] KVM: Add async communication helper functions Martin Doucha
2023-05-17 22:47 ` Petr Vorel
2023-05-18 8:36 ` Martin Doucha [this message]
2023-05-18 9:55 ` Petr Vorel
2023-05-23 12:13 ` Cyril Hrubis
2023-05-23 12:18 ` Martin Doucha
2023-05-17 15:36 ` [LTP] [PATCH 5/7] KVM: Allow expected KVM_RUN errors in tst_kvm_run_instance() Martin Doucha
2023-05-18 10:03 ` Petr Vorel
2023-05-23 12:22 ` Cyril Hrubis
2023-05-17 15:36 ` [LTP] [PATCH 6/7] KVM: Add STGI/CLGI intercept constants Martin Doucha
2023-05-17 23:20 ` Petr Vorel
2023-05-18 8:38 ` Martin Doucha
2023-05-18 9:53 ` Petr Vorel
2023-05-17 15:36 ` [LTP] [PATCH 7/7] Add KVM test for CPU lockup through malicous SVM guest Martin Doucha
2023-05-18 10:08 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18915cfd-8866-a01f-8562-1c6023a8e47f@suse.cz \
--to=mdoucha@suse.cz \
--cc=ltp@lists.linux.it \
--cc=nstange@suse.de \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).