All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 2/3] testcase: make use of .supported_archs
Date: Mon, 8 Nov 2021 13:41:36 +0100	[thread overview]
Message-ID: <YYkbAEITAiGbdTTk@yuki> (raw)
In-Reply-To: <20211108021450.1460819-2-liwang@redhat.com>

Hi!
>  	asm volatile (
>  		"add $0x400, %%esp\n\t"
>  		"int $0x80\n\t"
> @@ -114,15 +112,14 @@ static void run(void)
>  
>  static struct tst_test test = {
>  	.test_all = run,
> +	.supported_archs = (const char *const []) {
> +		"i386",
> +		"ppc",
> +		NULL
> +	},
>  	.tags = (const struct tst_tag[]) {
>  		{"linux-git", "cf01fb9985e8"},
>  		{"CVE", "CVE-2017-7616"},
>  		{}
>  	}
>  };
> -
> -#else /* #if defined(__x86_64__) || defined(__powerpc__) */
> -
> -TST_TEST_TCONF("not i386 or powerpc");
> -
> -#endif /* #else #if defined(__x86_64__) || defined(__powerpc__) */

Accordingly to this table:

https://wiki.debian.org/ArchitectureSpecificsMemo

__powerpc__ matches both 32bit and 64bit variants.

I guess that we would have to change the checks in the library as:

#ifdef __powerpc__
# ifdef __powerpc64__ || __ppc64__
.arch = "ppc64",
.type = TST_PPC64,
# else
.arch = "ppc",
.type = "TST_PPC"
# endif
#endif

Also I guess that gcc does not define __x86__ for historical reasons and
__i386__ really means __x86__, but I haven't checked that one.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2021-11-08 12:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08  2:14 [LTP] [PATCH v3 1/3] lib: adding .supported_archs field in tst_test structure Li Wang
2021-11-08  2:14 ` [LTP] [PATCH v3 2/3] testcase: make use of .supported_archs Li Wang
2021-11-08 12:41   ` Cyril Hrubis [this message]
2021-11-09  6:52     ` Li Wang
2021-11-08  2:14 ` [LTP] [PATCH v3 3/3] max_map_count: replace ifdefs by tst_arch Li Wang
2021-11-08 12:44   ` Cyril Hrubis
2021-11-09  9:35     ` Li Wang
2021-11-09 10:47       ` Cyril Hrubis
2021-11-09 11:41         ` Li Wang
2021-11-08 12:34 ` [LTP] [PATCH v3 1/3] lib: adding .supported_archs field in tst_test structure Cyril Hrubis
2021-11-09  7:52   ` Li Wang

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=YYkbAEITAiGbdTTk@yuki \
    --to=chrubis@suse.cz \
    --cc=liwang@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.