From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH tbt_cases] umip_basic_test.c: update umip basic test for new kernel v5.4
Date: Thu, 3 Oct 2019 14:14:02 +0200 [thread overview]
Message-ID: <20191003121402.GD1858@rei> (raw)
In-Reply-To: <20190927031930.27425-1-pengfei.xu@intel.com>
Hi!
> + /* after linux kernel v5.4 mainline, 64bit SGDT SIDT SMSW will return
> + dummy value and not trigger SIGSEGV due to kernel code change */
> + #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0)
This is obviously wrong, the version you get here is the version from
kernel headers that does not correspond to the kernel you are running
on at all.
We do have tst_kvercmp() function in LTP that uses parses uname() output
and returns if you are running on kernel newer/same/older as the version
passed to that function. Use that one instead.
> + tst_res(TINFO, "Linux kernel version is after than v5.4");
> + if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV) {
> + tst_res(TFAIL, "Got SIGSEGV\n\n");
> + return;
> + }
> + tst_res(TPASS, "Didn't receive SIGSEGV, child exited with %s\n\n",
> + tst_strstatus(status));
> + return;
^
Wrong indentation.
> + #else
> + tst_res(TINFO, "Linux kernel version is before than v5.4");
> + #endif
> + }
> +
> if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV) {
> - tst_res(TPASS, "Got SIGSEGV");
> + tst_res(TPASS, "Got SIGSEGV\n\n");
> return;
> }
> - tst_res(TFAIL, "Didn't receive SIGSEGV, child exited with %s",
> + tst_res(TFAIL, "Didn't receive SIGSEGV, child exited with %s\n\n",
> tst_strstatus(status));
Can you please avoid polluting output with useless newlines as well?
> }
>
> --
> 2.14.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2019-10-03 12:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 3:19 [LTP] [PATCH tbt_cases] umip_basic_test.c: update umip basic test for new kernel v5.4 Pengfei Xu
2019-10-03 12:14 ` Cyril Hrubis [this message]
2019-10-03 15:43 ` Pengfei Xu
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=20191003121402.GD1858@rei \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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