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

Re: [PATCH v4] xen: introduce CONFIG_HAS_SHARED_INFO for archs without a shared page





On 6/30/26 5:02 PM, Oleksii Kurochko wrote:


@@ -55,6 +59,7 @@ struct evtchn_expand_array;
  int evtchn_fifo_init_control(struct evtchn_init_control *init_control);   int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
  void evtchn_fifo_destroy(struct domain *d);
+void evtchn_fifo_init_ops(struct domain *d);
  #else
  static inline int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
  {
@@ -68,6 +73,7 @@ static inline void evtchn_fifo_destroy(struct domain *d)
  {
      return;
  }
+static inline void evtchn_fifo_init_ops(struct domain *d) {}
  #endif /* CONFIG_EVTCHN_FIFO */

Unlike these two. Which raise a different question though: What will be the
behavior when EVTCHN_FIFO=n and HAS_SHARED_INFO=n? Taking
evtchn_alloc_unbound() as example, afaict evtchn_port_init() will stumble
over a NULL pointer. Looks like for that (and only that) case we still need
your earlier dummy fallback.

I will introduce dummy fallback (I will shrunk some stubs in final version):

+#ifndef CONFIG_HAS_SHARED_INFO
+static void cf_check evtchn_none_set_pending(
+    struct vcpu *v, struct evtchn *evtchn) {}
+static void cf_check evtchn_none_clear_pending(
+    struct domain *d, struct evtchn *evtchn) {}
+static void cf_check evtchn_none_unmask(
+    struct domain *d, struct evtchn *evtchn) {}
+static bool cf_check evtchn_none_is_pending(
+    const struct domain *d, const struct evtchn *evtchn) { return false; }
+static bool cf_check evtchn_none_is_masked(
+    const struct domain *d, const struct evtchn *evtchn) { return true; }
+static void cf_check evtchn_none_print_state(
+    struct domain *d, const struct evtchn *evtchn) {}
+
+static const struct evtchn_port_ops evtchn_port_ops_none = {
+    .set_pending   = evtchn_none_set_pending,
+    .clear_pending = evtchn_none_clear_pending,
+    .unmask        = evtchn_none_unmask,
+    .is_pending    = evtchn_none_is_pending,
+    .is_masked     = evtchn_none_is_masked,
+    .print_state   = evtchn_none_print_state,
+};
+
+static void evtchn_none_init(struct domain *d)
+{
+    d->evtchn_port_ops = &evtchn_port_ops_none;
+}
+#endif

I will shrink it to::

#ifndef CONFIG_HAS_SHARED_INFO
/*
 * Placeholder ops for domains with neither a shared_info page nor (yet)
 * a FIFO control block.  None of these are ever reachable in practice;
 * they only exist to keep d->evtchn_port_ops non-NULL.
 */
static void cf_check evtchn_none_set_pending(
    struct vcpu *v, struct evtchn *evtchn) {}

static void cf_check evtchn_none_noop(
    struct domain *d, struct evtchn *evtchn) {}

static bool cf_check evtchn_none_false(
    const struct domain *d, const struct evtchn *evtchn) { return false; }

static void cf_check evtchn_none_print_state(
    struct domain *d, const struct evtchn *evtchn) {}

static const struct evtchn_port_ops evtchn_port_ops_none = {
    .set_pending   = evtchn_none_set_pending,
    .clear_pending = evtchn_none_noop,
    .unmask        = evtchn_none_noop,
    .is_pending    = evtchn_none_false,
    .is_masked     = evtchn_none_false,
    .print_state   = evtchn_none_print_state,
};

void evtchn_none_init(struct domain *d)
{
    d->evtchn_port_ops = &evtchn_port_ops_none;
}
#endif /* CONFIG_HAS_SHARED_INFO */

~ Oleksii




 


Rackspace

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