Re: [PATCH] x86-64: espfix for 64-bit mode *PROTOTYPE*

From: Boris Ostrovsky
Date: Wed Apr 23 2014 - 10:25:59 EST


On 04/22/2014 09:42 PM, H. Peter Anvin wrote:
On 04/22/2014 06:23 PM, Andrew Lutomirski wrote:
What's the to_dmesg thing for?

It's for debugging... the espfix page tables generate so many duplicate
entries that trying to output it via a seqfile runs out of memory. I
suspect we need to do something like skip the espfix range or some other
hack.

It looks sane, although I haven't checked the detailed register manipulation.

Users of big systems may complain when every single CPU lines up for
that mutex. Maybe no one cares.
Right now the whole smpboot sequence is fully serialized... that needs
to be fixed.

Konrad - I really could use some help figuring out what needs to be done
for this not to break Xen.

This does break Xen PV:

[ 3.683735] ------------[ cut here ]------------
[ 3.683807] WARNING: CPU: 0 PID: 0 at arch/x86/xen/multicalls.c:129 xen_mc_flush+0x1c8/0x1d0()
[ 3.683903] Modules linked in:
[ 3.684006] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.15.0-rc2 #2

[ 3.684176] 0000000000000009 ffffffff81c01de0 ffffffff816cfb15 0000000000000000
[ 3.684416] ffffffff81c01e18 ffffffff81084abd 0000000000000000 0000000000000001
[ 3.684654] 0000000000000000 ffff88023da0b180 0000000000000010 ffffffff81c01e28
[ 3.684893] Call Trace:
[ 3.684962] [<ffffffff816cfb15>] dump_stack+0x45/0x56
[ 3.685032] [<ffffffff81084abd>] warn_slowpath_common+0x7d/0xa0
[ 3.685102] [<ffffffff81084b9a>] warn_slowpath_null+0x1a/0x20
[ 3.685171] [<ffffffff810050a8>] xen_mc_flush+0x1c8/0x1d0
[ 3.685240] [<ffffffff81008155>] xen_set_pgd+0x1f5/0x220
[ 3.685310] [<ffffffff8101975a>] init_espfix_this_cpu+0x36a/0x380
[ 3.685379] [<ffffffff813cb559>] ? acpi_tb_initialize_facs+0x31/0x33
[ 3.685450] [<ffffffff81d27ec6>] start_kernel+0x37f/0x411
[ 3.685517] [<ffffffff81d27950>] ? repair_env_string+0x5c/0x5c
[ 3.685586] [<ffffffff81d27606>] x86_64_start_reservations+0x2a/0x2c
[ 3.685654] [<ffffffff81d2a6df>] xen_start_kernel+0x594/0x5a0
[ 3.685728] ---[ end trace a2cf2d7b2ecab826 ]---

But then I think we may want to rearrange preempt_enable/disable in xen_set_pgd().

-boris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/