All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Richard Palethorpe <rpalethorpe@suse.com>
Cc: x86@kernel.org, Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	rpalethorpe@richiejp.com,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	ltp@lists.linux.it
Subject: Re: [PATCH] x86/entry/ia32: Ensure s32 is sign extended to s64
Date: Mon, 27 Sep 2021 20:51:11 +0200	[thread overview]
Message-ID: <875yuletsw.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20210927161955.28494-1-rpalethorpe@suse.com> (Richard Palethorpe's message of "Mon, 27 Sep 2021 17:19:55 +0100")

* Richard Palethorpe:

> +#define __SC_COMPAT_CAST(t, a)						\
> +	(__typeof(__builtin_choose_expr(__TYPE_IS_L(t), 0, 0U)))	\
> +	(unsigned int)a

So this casts to int (triggering sign extension) if the type on the
64-bit kernel side is long?  But not in other cases (unsigned long,
pointer)?  Just double-checking.

Thanks,
Florian


WARNING: multiple messages have this Message-ID (diff)
From: Florian Weimer <fweimer@redhat.com>
To: Richard Palethorpe <rpalethorpe@suse.com>
Cc: linux-s390@vger.kernel.org, rpalethorpe@richiejp.com,
	Arnd Bergmann <arnd@arndb.de>, Vasily Gorbik <gor@linux.ibm.com>,
	linux-api@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] x86/entry/ia32: Ensure s32 is sign extended to s64
Date: Mon, 27 Sep 2021 20:51:11 +0200	[thread overview]
Message-ID: <875yuletsw.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20210927161955.28494-1-rpalethorpe@suse.com> (Richard Palethorpe's message of "Mon, 27 Sep 2021 17:19:55 +0100")

* Richard Palethorpe:

> +#define __SC_COMPAT_CAST(t, a)						\
> +	(__typeof(__builtin_choose_expr(__TYPE_IS_L(t), 0, 0U)))	\
> +	(unsigned int)a

So this casts to int (triggering sign extension) if the type on the
64-bit kernel side is long?  But not in other cases (unsigned long,
pointer)?  Just double-checking.

Thanks,
Florian


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

  parent reply	other threads:[~2021-09-27 18:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 16:19 [PATCH] x86/entry/ia32: Ensure s32 is sign extended to s64 Richard Palethorpe
2021-09-27 16:19 ` [LTP] " Richard Palethorpe via ltp
2021-09-27 18:22 ` Arnd Bergmann
2021-09-27 18:22   ` [LTP] " Arnd Bergmann
2021-09-28  9:02   ` Richard Palethorpe
2021-09-28  9:02     ` [LTP] " Richard Palethorpe
2021-09-27 18:51 ` Florian Weimer [this message]
2021-09-27 18:51   ` Florian Weimer
2021-09-27 19:01   ` Arnd Bergmann
2021-09-27 19:01     ` [LTP] " Arnd Bergmann

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=875yuletsw.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=arnd@arndb.de \
    --cc=borntraeger@de.ibm.com \
    --cc=bp@alien8.de \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=ltp@lists.linux.it \
    --cc=mingo@redhat.com \
    --cc=rpalethorpe@richiejp.com \
    --cc=rpalethorpe@suse.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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.