Skip to contentSkip to conversation

x86: Avoid tripping watchdog when constructing dom0

PATCH New Ross Lagerwall 1 participant 1 message Jun 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86: Avoid tripping watchdog when constructing dom0

Constructing dom0 may take a few seconds, particularly if the slow VESA graphics terminal is used. Process pending softirqs a few times to avoid tripping a watchdog with a short timeout.

---

Changes in v2: Process pending softirqs inside ELF code.

 xen/arch/x86/domain_build.c        | 4 ++++
 xen/common/libelf/libelf-dominfo.c | 8 ++++++++
 2 files changed, 12 insertions(+)
xen/arch/x86/domain_build.c +4 -0
index 03e4bfe..d76707f 100644
@@ -930,6 +930,8 @@ int __init construct_dom0(
     BUG_ON(d->vcpu[0] == NULL);
     BUG_ON(v->is_initialised);
 
+    process_pending_softirqs();
+
     printk("*** LOADING DOMAIN 0 ***\n");
 
     d->max_pages = ~0U;
@@ -1167,6 +1169,8 @@ int __init construct_dom0(
            _p(v_start), _p(v_end));
     printk(" ENTRY ADDRESS: %p\n", _p(parms.virt_entry));
 
+    process_pending_softirqs();
+
     mpt_alloc = (vpt_start - v_start) + pfn_to_paddr(alloc_spfn);
     if ( vinitrd_start )
         mpt_alloc -= PAGE_ALIGN(initrd_len);
xen/common/libelf/libelf-dominfo.c +8 -0
index 6120dd4..4882c52 100644
@@ -16,6 +16,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#ifdef __XEN__
+#include <xen/softirq.h>
+#endif
+
 #include "libelf-private.h"
 
 /* ------------------------------------------------------------------------ */
@@ -235,6 +239,10 @@ static unsigned elf_xen_parse_notes(struct elf_binary *elf,
           ELF_HANDLE_PTRVAL(note) < parms->elf_note_end;
           note = elf_note_next(elf, note) )
     {
+#ifdef __XEN__
+        process_pending_softirqs();
+#endif
+
         if ( *total_note_count >= ELF_MAX_TOTAL_NOTE_COUNT )
         {
             elf_mark_broken(elf, "too many ELF notes");
Signature · 1 line
2.1.0