Re: svs_pmap_sync() svs_pdir_switch() overhead

Mouse <[email protected]>
Newsgroups gmane.os.netbsd.ports.x86-64
Message-ID <[email protected]>
>> In the [XXX] window, the PTEs could be used by userland.  If you
>> copied them using memcpy(), some parts of the bytes could contain
>> stale values.
> You mean if memcpy() was moving single bytes at a time?  That won't
> happen, see:

> https://nxr.netbsd.org/xref/src/common/lib/libc/arch/x86_64/string/bcopy.S

Even if it won't happen now, that's no guarantee it won't happen in the
future.  It is no part of memcpy()'s contract that it will or won't
copy data in any particular order or fashion.  Indeed, some compilers
inline memcpy under some circumstances, especially when called with a
compile-time constant for the size, and if that happens the library
implementation is completely irrelevant.

I think it would be way too brittle to count on memcpy to copy things
the way you want.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.