Gerd Hoffmann wrote: > Well, after reading the code a bit more it seems the intention is to > call the function in a row with others, have stuff queued up (in case > lazy_mode == PARAVIRT_LAZY_CPU is set) and update everything in one go > then. I don't think that makes sense for that function as it isn't > performance-critical. It is called on boot and cpu bringup (well, not > yet) only, right? > Yes, that's right. While its not performance critical in itself, the idea was that if it were in a stream of other deferred cpu-state updates, then it should happen in the appropriate order. But in practice this is mainly to make a context switch a single hypercall, so the most important ones are stack-switch followed by 3x update_descriptor (for TLS). > We have a simliar issue for xen_write_gdt_entry() btw, it calls > mc_flush() which doesn't work too. I've fixed it that way: > > @@ -761,7 +762,13 @@ static asmlinkage void __init xen_start_ > /* set up PDA descriptor */ > pack_descriptor(&low, &high, (unsigned)&boot_pda, > sizeof(boot_pda)-1, > 0x80 | DESCTYPE_S | 0x02, 0); > +#if 0 > xen_write_gdt_entry(cpu_gdt_table, GDT_ENTRY_PDA, low, high); > +#else > + if (HYPERVISOR_update_descriptor(virt_to_machine(cpu_gdt_table + > GDT_ENTRY_PDA).maddr, > + (u64)high << 32 | low)) > + BUG(); > +#endif > > /* set up %gs and init Xen parts of the PDA */ > asm volatile("mov %0, %%gs" : : "r" (__KERNEL_PDA) : "memory"); > > [ gna, thunderbird isn't great for sending patches inline, you should > get the idea though ... ] > Yeah, that's ugly, but I guess it will do for now. (You can inline patches without damage in thunderbird if you paste them as "preformat") J