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

Re: [Minios-devel] [UNIKRAFT PATCH v4 4/9] plat/linuxu: Add linuxu (x86_64) interrupts support



Hi Sharan,

On 08/28/2018 01:14 PM, Sharan Santhanam wrote:
It would wise to use unsigned integers while performing the left shift.
(1UL << (((sig) - 1) % (8 * sizeof(unsigned long))). Please refer to [1], it gives us some guideline on the safe practices with bit operations
+#define sig_word_mask(sig) \
+    (1 << (((sig) - 1) % (8 * sizeof(unsigned long))))

OK.

We are using this list without initializing the list.
+UK_SLIST_HEAD(irq_handler_head, struct irq_handler);
+static struct irq_handler_head irq_handlers[IRQS_NUM];

Actually, it's initialized via a memset:

+int ukplat_irq_init(struct uk_alloc *a)
+{
+    UK_ASSERT(!irq_enabled);
+    UK_ASSERT(!allocator);
+
+    allocator = a;
+
+    /* Clear list head */
+    memset(irq_handlers, 0, sizeof(irq_handlers));
+
+    k_sigemptyset(&handled_signals_set);
+
+    return 0;
+}

Though I agree it's probably nicer to do a for loop over 0..IRQS_NUM and call UK_SLIST_INIT(&irq_handlers[i]), which produces the same result, but feels a bit more clear and stable.

Cheers,
Florian

--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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