From: Richard Hirst <rhirst@linuxcare.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: David Huggins-Daines <dhd@linuxcare.com>,
parisc-linux@thepuffingroup.com
Subject: Re: [parisc-linux] 2.4.0-test6 lack of speed
Date: Wed, 30 Aug 2000 11:15:23 +0100 [thread overview]
Message-ID: <20000830111523.F877@linuxcare.com> (raw)
In-Reply-To: <20000829172308.A1032@vodka.thepuffingroup.com>; from matthew@wil.cx on Tue, Aug 29, 2000 at 05:23:08PM -0400
On Tue, Aug 29, 2000 at 05:23:08PM -0400, Matthew Wilcox wrote:
> My attempt at fixing this in a sane manner led me to create:
>
> #define user_fdc(addr) asm volatile("fdc 0(%%sr3,%0)" : : "r" (addr))
> (...)
>
> and
>
> #define kernel_fdc(addr) asm volatile("fdc 0(%%sr0,%0)" : : "r" (addr))
> (...)
>
> however, the resulting kernel wouldn't boot. So let's take this a
I tried something similar, with the same result.
What do you make of arch/parisc/lib/usercopy.c
unsigned long
__generic_copy_to_user(void *to, const void *from, unsigned long n)
{
if (access_ok(VERIFY_WRITE, to, n)) {
__flush_dcache_range((unsigned long)from, n);
lcopy_to_user(to,from,n);
__flush_dcache_range((unsigned long)to, n);
}
return 0;
}
Typically 'from' would be a kernel virtual address, and 'to' would
be a user virtual address, yes? So, that is expecting __flush_dcache_range()
to know which space register to use. But then sometimes these functions
for accessing user space are redirected at kernel space by set_fs().
In that case both addresses are kernel virtual addresses.
lcopy_to_user() claims to modify %sr1 to get the right space in %sr1,
based on a flag in the task struct.
See copy_strings_kernel() in fs/exec.c for an example of where
copy_from_user( is used to copy from kernel space.
Richard
next prev parent reply other threads:[~2000-08-30 10:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-08-22 14:38 [parisc-linux] 2.4.0-test6 lack of speed Richard Hirst
2000-08-22 14:52 ` Richard Hirst
2000-08-22 15:50 ` Richard Hirst
2000-08-22 16:05 ` David Huggins-Daines
2000-08-23 16:23 ` Richard Hirst
2000-08-23 16:38 ` Paul Bame
2000-08-24 13:46 ` Richard Hirst
2000-08-29 21:23 ` Matthew Wilcox
2000-08-30 0:17 ` Matthew Wilcox
2000-08-30 8:15 ` Richard Hirst
2000-08-30 12:41 ` Richard Hirst
2000-08-30 10:15 ` Richard Hirst [this message]
2000-08-30 13:18 ` Matthew Wilcox
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=20000830111523.F877@linuxcare.com \
--to=rhirst@linuxcare.com \
--cc=dhd@linuxcare.com \
--cc=matthew@wil.cx \
--cc=parisc-linux@thepuffingroup.com \
/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