linux/arch
Paolo Bonzini 2a31b9db15 kvm: introduce manual dirty log reprotect
There are two problems with KVM_GET_DIRTY_LOG.  First, and less important,
it can take kvm->mmu_lock for an extended period of time.  Second, its user
can actually see many false positives in some cases.  The latter is due
to a benign race like this:

  1. KVM_GET_DIRTY_LOG returns a set of dirty pages and write protects
     them.
  2. The guest modifies the pages, causing them to be marked ditry.
  3. Userspace actually copies the pages.
  4. KVM_GET_DIRTY_LOG returns those pages as dirty again, even though
     they were not written to since (3).

This is especially a problem for large guests, where the time between
(1) and (3) can be substantial.  This patch introduces a new
capability which, when enabled, makes KVM_GET_DIRTY_LOG not
write-protect the pages it returns.  Instead, userspace has to
explicitly clear the dirty log bits just before using the content
of the page.  The new KVM_CLEAR_DIRTY_LOG ioctl can also operate on a
64-page granularity rather than requiring to sync a full memslot;
this way, the mmu_lock is taken for small amounts of time, and
only a small amount of time will pass between write protection
of pages and the sending of their content.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-12-14 12:34:19 +01:00
..
alpha TTY/Serial fixes for 4.20-rc2 2018-11-10 13:32:14 -06:00
arc ARC: io.h: Implement reads{x}()/writes{x}() 2018-11-30 11:26:29 -08:00
arm Merge branch 'spectre' of git://git.armlinux.org.uk/~rmk/linux-arm 2018-12-06 16:45:36 -08:00
arm64 A few clk driver fixes this time: 2018-12-08 11:33:26 -08:00
c6x c6x changes for 4.20 2018-10-31 15:39:25 -07:00
csky csky: bugfix tlb_get_pgd error. 2018-12-03 10:49:11 +08:00
h8300 mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
hexagon mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
ia64 ia64: export node_distance function 2018-11-26 18:30:40 -08:00
m68k s390 updates for 4.20-rc2 2018-11-09 06:30:44 -06:00
microblaze microblaze: function_graph: Simplify with function_graph_enter() 2018-11-27 20:30:18 -05:00
mips kvm: introduce manual dirty log reprotect 2018-12-14 12:34:19 +01:00
nds32 nds32: function_graph: Simplify with function_graph_enter() 2018-11-27 20:30:43 -05:00
nios2 mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
openrisc mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
parisc Merge branch 'parisc-4.20-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2018-12-04 09:10:39 -08:00
powerpc kvm: make KVM_CAP_ENABLE_CAP_VM architecture agnostic 2018-12-14 12:34:18 +01:00
riscv While rewriting the function graph tracer, I discovered a design flaw that 2018-11-30 09:32:34 -08:00
s390 kvm: make KVM_CAP_ENABLE_CAP_VM architecture agnostic 2018-12-14 12:34:18 +01:00
sh sh/function_graph: Simplify with function_graph_enter() 2018-11-27 20:31:39 -05:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2018-12-03 09:35:27 -08:00
um for-linus-20181109 2018-11-09 16:31:51 -06:00
unicore32 memblock: stop using implicit alignment to SMP_CACHE_BYTES 2018-10-31 08:54:16 -07:00
x86 kvm: introduce manual dirty log reprotect 2018-12-14 12:34:19 +01:00
xtensa xtensa: fix coprocessor part of ptrace_{get,set}xregs 2018-11-26 18:37:51 -08:00
.gitignore
Kconfig New gcc plugin: stackleak 2018-11-01 11:46:27 -07:00