All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Fix BTT data corruptions after crash
@ 2016-02-11 21:24 ` Toshi Kani
  0 siblings, 0 replies; 12+ messages in thread
From: Toshi Kani @ 2016-02-11 21:24 UTC (permalink / raw)
  To: tglx, mingo, hpa, bp, dan.j.williams
  Cc: ross.zwisler, vishal.l.verma, micah.parrish, brian.boylston, x86,
	linux-nvdimm, linux-kernel

Data corruption issues were observed in tests which initiated a system
crash/reset while accessing BTT devices.  This problem is reproducible.

The BTT driver calls pmem_rw_bytes() to update data in pmem devices.
This interface calls __copy_user_nocache(), which uses non-temporal
stores so that the stores to pmem are persistent.

__copy_user_nocache() uses non-temporal stores when a request size is
8 bytes or larger (and is aligned by 8 bytes).  The BTT driver updates
the BTT map table, which entry size is 4 bytes.  Therefore, updates to
the map table entries remain cached, and are not written to pmem after
a crash.  Since the BTT driver makes previous blocks free and uses them
for subsequent writes, the map table ends up pointing to blocks allocated
for other LBAs after a crash.

Patch 1 cleans up __copy_user_nocache() before making changes.
Patch 2 makes __copy_user_nocache() handle 4-byte nocache copy.

---
v3:
 - Add a cleanup patch to rename numeric labels to descriptively named
   labels with .L. (Ingo Molnar, Borislav Petkov)
v2:
 - Add comments (Ingo Molnar).
---
Toshi Kani (2):
 1/2 x86/lib/copy_user_64.S: cleanup __copy_user_nocache()
 2/2 x86/lib/copy_user_64.S: Handle 4-byte nocache copy

---
 arch/x86/lib/copy_user_64.S | 142 +++++++++++++++++++++++++++++++-------------
 1 file changed, 101 insertions(+), 41 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-02-17 15:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-11 21:24 [PATCH v3 0/2] Fix BTT data corruptions after crash Toshi Kani
2016-02-11 21:24 ` Toshi Kani
2016-02-11 21:24 ` [PATCH v3 1/2] x86/lib/copy_user_64.S: cleanup __copy_user_nocache() Toshi Kani
2016-02-11 21:24   ` Toshi Kani
2016-02-17  8:02   ` Ingo Molnar
2016-02-17  8:02     ` Ingo Molnar
2016-02-17 15:52     ` Toshi Kani
2016-02-17 15:52       ` Toshi Kani
2016-02-17 12:13   ` [tip:x86/urgent] x86/uaccess/64: Make the __copy_user_nocache() assembly code more readable tip-bot for Toshi Kani
2016-02-11 21:24 ` [PATCH v3 2/2] x86/lib/copy_user_64.S: Handle 4-byte nocache copy Toshi Kani
2016-02-11 21:24   ` Toshi Kani
2016-02-17 12:14   ` [tip:x86/urgent] x86/uaccess/64: Handle the caching of 4-byte nocache copies properly in __copy_user_nocache () tip-bot for Toshi Kani

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.