Ben, On 01/08/2018 12:35 AM, Ben Hutchings wrote: > I have a backport of KPTI/KAISER to 3.16, based on Hugh Dickins's work > for 3.18, some upstream changes between 3.16 and 3.18, and other > patches that went into 4.4.75. > > I sent this out for review on the stable list after quite minimal > testing, but have done more since then. On bare metal (Sandy Bridge, > with pcid but not invpcid) it crashes at boot. In fact it > reboots without any panic message, suggesting a triple fault, as soon > as I apply the patch that turns on CR4.PCIDE, i.e. without KPTI itself. I've seen this as well with my 3.13 tree. As soon as PCID is set on the first (non-boot) CPU, the kernel reboots. Note that it seems to work fine with maxcpus=1. I've checked the other versions, your 3.2 doesn't have this issue and Hugh's 3.18 doesn't have it either. After some bisecting, I found that the problem was introduced in 3.15 by: cda846f101fb ('x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline') and then later fixed again in 4.0 by: 375074cc736a ('x86: Clean up cr4 manipulation') I've backported 375074cc736a to 3.13 which seems to fix this particular issue but I'm still seeing userspace segfaults. FWIW: My tree: https://code.launchpad.net/~juergh/+git/linux-pti pti/3.13 is my 3.13 tree, pti/3.2.97-bwh and pti/3.16.52-bwh are yours and pti/3.18.72 is Hugh's. ...Juerg > Using the 'nopcid' kernel parameter gets it to boot but it's somewhat > unstable even after that - once I start another kernel build I see > programs segfaulting. So I'm guessing I've screwed up some of the TLB > stuff. > > I'm going to continue investigating this myself before making a > release, but would really appreciate any time people can spare to > review this patch series. > > (I haven't found any such regression in 3.2.98.) > > Ben. >
Attachment:
signature.asc
Description: OpenPGP digital signature