mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* flush_page_to_ram() question in kernel/ptrace.c
@ 2001-03-08 20:00 Manfred Spraul
  2001-03-08 21:08 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Manfred Spraul @ 2001-03-08 20:00 UTC (permalink / raw)
  To: linux-kernel

>From linux/kernel/ptrace.c, access_one_page():

>        flush_cache_page(vma, addr);
> 
>         if (write) {
>                 maddr = kmap(page);
>                 memcpy(maddr + (addr & ~PAGE_MASK), buf, len);
>                 flush_page_to_ram(page);
>                 flush_icache_page(vma, page);
>                 kunmap(page);
>         } else {
>                 maddr = kmap(page);
>                 memcpy(buf, maddr + (addr & ~PAGE_MASK), len);
>                 flush_page_to_ram(page);
                  ^^^^^^^^^^^^^^^^^^^^^^
>                 kunmap(page);
>         }

Is this flush required?

The memcpy read from the mapping, it didn't write.

--
	Manfred

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: flush_page_to_ram() question in kernel/ptrace.c
  2001-03-08 20:00 flush_page_to_ram() question in kernel/ptrace.c Manfred Spraul
@ 2001-03-08 21:08 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2001-03-08 21:08 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: linux-kernel


Manfred Spraul writes:
 > >                 memcpy(buf, maddr + (addr & ~PAGE_MASK), len);
 > >                 flush_page_to_ram(page);
 >                   ^^^^^^^^^^^^^^^^^^^^^^
 > Is this flush required?
 > 
 > The memcpy read from the mapping, it didn't write.

You have to kick it out of the cache so that future reads on the
kernel side don't get stale data with caching setups that allow
illegal aliases to form.

Later,
David S. Miller
davem@redhat.com








^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-08 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-08 20:00 flush_page_to_ram() question in kernel/ptrace.c Manfred Spraul
2001-03-08 21:08 ` David S. Miller

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®