Re: new text patching for review




Ewwwwwwwwwww.... you plan to run this in SMP ? So you actually go byte
by byte changing pieces of instructions non atomically and doing
non-Intel's errata friendly XMC. You are really looking for trouble
there :) Two distinct errors can occur:

In this case it is ok because this only happens when transitioning
from 1 CPU to 2 CPUs or vice versa and in both cases the other CPUs
are essentially stopped.

All the other manipulations currently are single byte.

I suppose for your immediate value patches something stronger is needed,
but we can worry about that post .23.

What I don't like about this particular implementation is that it does
not support "poking" more than 1 byte. In order to support this, you
would have to deal with the case where the address range spans over more
than one page.

I considered it, but the function would have been at least twice as big
to handle all the corner cases. And for the current callers it's all fine.

Also, doing the copy in the same interface seems a bit awkward.

Splitting it would also seem quite awkward.


I would much prefer something like:

void *map_shadow_write(void *addr, size_t len);
(returns a pointer to the shadow writable pages, at the same page offset
as "addr")

int unmap_shadow_write(void *shadow_addr, size_t len);
(unmap the shadow pages)

Then, the in-kernel user is free to modify their pages as they like.
Since we cannot foresee each modification pattern, I think that leaving
this kind of flexibility is useful.

You could as well call vmap directly then; it's not that much
more complicated. I don't really see much value in complicating
it right now.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • SMP Timekeeping regression in 2.6.16-rc5 (and 2.6.16-rc4)
    ... Just built and installed a 2.6.16-rc5 kernel on my Powermac G4 Dual ... Essentially the two CPUs have ... # Loadable module support ...
    (Linux-Kernel)
  • Re: NUMA API
    ... I am aware of the code in libnuma by ak but this code ... numa_all_nodes could maybe in future change with node hotplug support, ... NUMA is only about "what CPUs ... but not "sticky memory" effects. ...
    (Linux-Kernel)
  • [SUMMARY] OT: High End Servers comparison
    ... (typical database and banking benchmarks are transactions per second.) ... We just did a comparison of some Sun and IBM servers for a new project. ... Type and number of disks supported: ... IBM, for example, will ship you a system with some CPUs ...
    (SunManagers)
  • Re: Best way to process data, async IO and completion ports
    ... A thread pool is an efficient mechanism for dispatching work to worker ... A good rule of thumb is to try to keep all CPUs busy by ... Microsoft Online Community Support ... initial response from the community or a Microsoft Support Engineer ...
    (microsoft.public.win32.programmer.kernel)
  • [PATCH] x86: remove NexGen support
    ... It is claimed that NexGen CPUs were never shipped: ... the code intended to support NexGen thereby being ... * but fortunately the switch to using exceptions got rid of all that. ...
    (Linux-Kernel)