Messages in this thread | | | Date | Thu, 21 Apr 2022 10:50:44 +0200 | From | David Hildenbrand <> | Subject | Re: [PATCH 1/1] x86/mm: Forbid the zero page once it has uncorrectable errors |
| |
On 21.04.22 09:53, Zhuo, Qiuxu wrote: >> From: Hansen, Dave <dave.hansen@intel.com> >> ... >> Subject: Re: [PATCH 1/1] x86/mm: Forbid the zero page once it has >> uncorrectable errors >> ... >> There are lots of pages which are entirely fatal if they have uncorrectable errors. >> On my laptop, if there were an error, there is a 0.00000596% chance it will be in >> the zero page. >> >> Why is this worth special casing this one page? > > Hi Dave, > > Yes, this is a rare problem. Just feel that the fix is simple, so post it here to see whether you'll consider it 😊.
Just some background information.
mm_forbids_zeropage() exists for the sole purpose of s390x/kvm not being able to use the shared zeropage for a KVM guest because the storage keys associated with the shared zeropage could result in trouble. So s390x/kvm has to make sure that no shared zeropage is mapped into the process.
See fa41ba0d08de ("s390/mm: avoid empty zero pages for KVM guests to avoid postcopy hangs") for details.
@Christian
a) with keyless guests we could actually use the shared zeropage because the guest cannot possibly enable storage keys, correct?
b) Why is there no mm_forbids_zeropage() check in mfill_zeropage_pte()? Maybe I'm missing something, but looks like we can still place the shared zeropage into a KVM guest via uffd.
In general, there are more place that will use the shared zeropage, most notably, fs/dax.c will place the shared zeropage for holes and would still use it on x86-64. IIRC, s390x doesn't use it.
/proc/vmcore will map the zeropage to user space for areas that are not RAM, so you could still stumble over it there and trigger a MCE.
Last but not least, the huge shared zeropage would suffer from similar problems.
Also, I wonder if the generic code change in mm/memory-failure.c is correct as it touches common code and you only mess with the x86 zeropage. But I did not look into the details.
So the code here at least isn't complete. So I'm not convinced this change is worth it.
-- Thanks,
David / dhildenb
| |