From: Logan Gunthorpe <logang@deltatee.com>
To: "Jann Horn" <jannh@google.com>,
"Mukesh Ojha" <mojha@codeaurora.org>,
"Horia Geantă" <horia.geanta@nxp.com>
Cc: Muli Ben-Yehuda <mulix@mulix.org>, Jon Mason <jdmason@kudzu.us>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
the arch/x86 maintainers <x86@kernel.org>,
iommu@lists.linux-foundation.org,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/calgary: fix bitcast type warnings
Date: Fri, 29 Mar 2019 15:32:07 -0600 [thread overview]
Message-ID: <3275e86a-5b12-29ff-9b1f-d8eba099ae98@deltatee.com> (raw)
In-Reply-To: <CAG48ez13xg1oUiO_pyDHVbJkWRQdW4CoX7uGzoujyf4L6VB-dw@mail.gmail.com>
On 2019-03-29 3:19 p.m., Jann Horn wrote:
>>> Can the existing api's not be used here like iowrite64be/ioread64be/ or
>>> similar variant in "include/asm-generic/io.h"
>>
>> Oooh! I didn't realize that those exist. I'll change that and send a v2.
Yes, they are very new! It took me a while to get those patches in as it
is a bit more complicated than it seems.
> Actually, that doesn't work at the moment on x86-64:
>
> include/asm-generic/io.h only defines these things if
> CONFIG_GENERIC_IOMAP isn't defined; and X86 unconditionally defines
> it. With CONFIG_GENERIC_IOMAP set, these functions are provided by
> include/asm-generic/iomap.h.
For CONFIG_GENERIC_IOMAP, lib/iomap.c provides _lo_hi and _hi_lo
implementations seeing the pio regions must be emulated with 32bit
operations and we have to define the order.
> The definitions for these are in lib/iomap.c, except that there are no
> definitions for ioread64be() and iowrite64be(); if you try to use
> them, you get linker errors.
Some platforms implement these but most do not. If I recall correctly
only powerpc does.
If you want to use 64 bit operations in a portable fashion, you should
include "linux/io-64-nonatomic-hi-lo.h" or
"linux/io-64-nonatomic-lo-hi.h", depending on weather you want the lower
bits or the higher bits to be written or read first in cases where an
atomic operation is not available.
Logan
next prev parent reply other threads:[~2019-03-29 21:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 22:59 Jann Horn
2019-03-29 8:18 ` Mukesh Ojha
2019-03-29 16:48 ` Jann Horn
2019-03-29 21:19 ` Jann Horn
2019-03-29 21:25 ` Jann Horn
2019-03-29 21:32 ` Logan Gunthorpe [this message]
2019-03-29 21:40 ` Jann Horn
2019-03-29 21:43 ` Logan Gunthorpe
2019-03-29 21:45 ` Jann Horn
2019-03-30 10:24 ` Mukesh Ojha
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=3275e86a-5b12-29ff-9b1f-d8eba099ae98@deltatee.com \
--to=logang@deltatee.com \
--cc=bp@alien8.de \
--cc=horia.geanta@nxp.com \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jannh@google.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mojha@codeaurora.org \
--cc=mulix@mulix.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®