[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 04/12] livepatch: Implement pre-|post- apply|revert hooks

On 9/17/19 10:12 AM, Wieczorkiewicz, Pawel wrote:
diff --git a/xen/include/xen/livepatch_payload.h 
index 99613af2db..cd20944cc4 100644
--- a/xen/include/xen/livepatch_payload.h
+++ b/xen/include/xen/livepatch_payload.h
@@ -21,6 +21,16 @@ typedef struct payload livepatch_payload_t;
  typedef void livepatch_loadcall_t(void);
  typedef void livepatch_unloadcall_t(void);
  +typedef int livepatch_precall_t(livepatch_payload_t *arg);
+typedef void livepatch_postcall_t(livepatch_payload_t *arg);
+struct livepatch_hooks {
+    struct {
+        livepatch_precall_t *const *pre;
+        livepatch_postcall_t *const *post;

Wouldn't it be simpler to drop a level of indirection here?

I think it would complicate things, because the handling of original hooks 
(load, unload)
has been implemented as a pointer to an array of pointers (because of the 
multiple hooks requirement).

I did not want to introduce a distinction between pointers to multiple hooks 
and single hooks for simplicity
(all the hooks are arrays of pointers, even if there is only a single hook).

I believe that makes the whole code a bit more consistent and potentially 

OK, fair enough.

Ross Lagerwall

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.