From: Philipp Rumpf <prumpf@parcelfarce.linux.theplanet.co.uk>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to transfer memory from PCI memory directly to user space safely and portable?
Date: Mon, 27 Nov 2000 19:29:19 +0000 [thread overview]
Message-ID: <20001127192919.X2272@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <00112614213105.05228@paganini> <20001126151120.V2272@parcelfarce.linux.theplanet.co.uk> <8vu9ji$r2a$1@cesium.transmeta.com>
In-Reply-To: <8vu9ji$r2a$1@cesium.transmeta.com>; from hpa@zytor.com on Mon, Nov 27, 2000 at 10:36:34AM -0800
On Mon, Nov 27, 2000 at 10:36:34AM -0800, H. Peter Anvin wrote:
> Followup to: <20001126151120.V2272@parcelfarce.linux.theplanet.co.uk>
> By author: Philipp Rumpf <prumpf@parcelfarce.linux.theplanet.co.uk>
> In newsgroup: linux.dev.kernel
> >
> > I hope count isn't provided by userspace here ?
> >
> > > 1. What happens if the user space memory is swapped to disk? Will
> > > verify_area() make sure that the memory is in physical RAM when it returns,
> > > or will it return -EFAULT, or will something even worse happen?
> >
> > On i386, you'll sleep implicitly waiting for the page fault to be handled; in
> > the generic case, anything could happen.
> >
>
> That doesn't sound right. I would expect it to wait for the page to
> be brought in on any and all architectures, otherwise it seems rather
> impossible to write portable Linux kernel code.
The code in question was
memcpy_fromio(user_space_dst, iobase, count);
Assuming user_space_dst is a userspace pointer, what I said is true; on some
architectures we will be dereferencing random pointers in kernel space, and
we won't get -EFAULT right on any architecture.
Or did I miss something ?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-11-27 19:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-26 13:21 How to transfer memory from PCI memory directly to user space safely and portable? Anders Torger
2000-11-26 15:11 ` Philipp Rumpf
2000-11-26 15:36 ` Anders Torger
2000-11-27 18:36 ` H. Peter Anvin
2000-11-27 19:29 ` Philipp Rumpf [this message]
2000-11-27 19:30 ` H. Peter Anvin
2000-11-27 13:51 ` Richard B. Johnson
-- strict thread matches above, loose matches on Subject: below --
2000-11-27 13:27 aprasad
2000-11-26 13:54 ` Anders Torger
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=20001127192919.X2272@parcelfarce.linux.theplanet.co.uk \
--to=prumpf@parcelfarce.linux.theplanet.co.uk \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.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.