<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/arch, branch v5.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-09-14T23:07:40Z</updated>
<entry>
<title>Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm</title>
<updated>2019-09-14T23:07:40Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-09-14T23:07:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1609d7604b847a9820e63393d1a3b6cac7286d40'/>
<id>urn:sha1:1609d7604b847a9820e63393d1a3b6cac7286d40</id>
<content type='text'>
Pull kvm fixes from Paolo Bonzini:
 "The main change here is a revert of reverts. We recently simplified
  some code that was thought unnecessary; however, since then KVM has
  grown quite a few cond_resched()s and for that reason the simplified
  code is prone to livelocks---one CPUs tries to empty a list of guest
  page tables while the others keep adding to them. This adds back the
  generation-based zapping of guest page tables, which was not
  unnecessary after all.

  On top of this, there is a fix for a kernel memory leak and a couple
  of s390 fixlets as well"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: x86/mmu: Reintroduce fast invalidate/zap for flushing memslot
  KVM: x86: work around leak of uninitialized stack contents
  KVM: nVMX: handle page fault in vmread
  KVM: s390: Do not leak kernel stack data in the KVM_S390_INTERRUPT ioctl
  KVM: s390: kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset()
</content>
</entry>
<entry>
<title>Merge tag 'riscv/for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux</title>
<updated>2019-09-14T22:58:02Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-09-14T22:58:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b03c036e6f96340dd311817c7b964dad183c4141'/>
<id>urn:sha1:b03c036e6f96340dd311817c7b964dad183c4141</id>
<content type='text'>
Pull RISC-V fix from Paul Walmsley:
 "Last week, Palmer and I learned that there was an error in the RISC-V
  kernel image header format that could make it less compatible with the
  ARM64 kernel image header format. I had missed this error during my
  original reviews of the patch.

  The kernel image header format is an interface that impacts
  bootloaders, QEMU, and other user tools. Those packages must be
  updated to align with whatever is merged in the kernel. We would like
  to avoid proliferating these image formats by keeping the RISC-V
  header as close as possible to the existing ARM64 header. Since the
  arch/riscv patch that adds support for the image header was merged
  with our v5.3-rc1 pull request as commit 0f327f2aaad6a ("RISC-V: Add
  an Image header that boot loader can parse."), we think it wise to try
  to fix this error before v5.3 is released.

  The fix itself should be backwards-compatible with any project that
  has already merged support for premature versions of this interface.
  It primarily involves ensuring that the RISC-V image header has
  something useful in the same field as the ARM64 image header"

* tag 'riscv/for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: modify the Image header to improve compatibility with the ARM64 header
</content>
</entry>
<entry>
<title>Merge tag 'kvm-s390-master-5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master</title>
<updated>2019-09-14T07:25:30Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2019-09-14T07:25:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a9c20bb0206ae9384bd470a6832dd8913730add9'/>
<id>urn:sha1:a9c20bb0206ae9384bd470a6832dd8913730add9</id>
<content type='text'>
KVM: s390: Fixes for 5.3

- prevent a user triggerable oops in the migration code
- do not leak kernel stack content
</content>
</entry>
<entry>
<title>KVM: x86/mmu: Reintroduce fast invalidate/zap for flushing memslot</title>
<updated>2019-09-14T07:25:11Z</updated>
<author>
<name>Sean Christopherson</name>
<email>sean.j.christopherson@intel.com</email>
</author>
<published>2019-09-13T02:46:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=002c5f73c508f7df5681bda339831c27f3c1aef4'/>
<id>urn:sha1:002c5f73c508f7df5681bda339831c27f3c1aef4</id>
<content type='text'>
James Harvey reported a livelock that was introduced by commit
d012a06ab1d23 ("Revert "KVM: x86/mmu: Zap only the relevant pages when
removing a memslot"").

The livelock occurs because kvm_mmu_zap_all() as it exists today will
voluntarily reschedule and drop KVM's mmu_lock, which allows other vCPUs
to add shadow pages.  With enough vCPUs, kvm_mmu_zap_all() can get stuck
in an infinite loop as it can never zap all pages before observing lock
contention or the need to reschedule.  The equivalent of kvm_mmu_zap_all()
that was in use at the time of the reverted commit (4e103134b8623, "KVM:
x86/mmu: Zap only the relevant pages when removing a memslot") employed
a fast invalidate mechanism and was not susceptible to the above livelock.

There are three ways to fix the livelock:

- Reverting the revert (commit d012a06ab1d23) is not a viable option as
  the revert is needed to fix a regression that occurs when the guest has
  one or more assigned devices.  It's unlikely we'll root cause the device
  assignment regression soon enough to fix the regression timely.

- Remove the conditional reschedule from kvm_mmu_zap_all().  However, although
  removing the reschedule would be a smaller code change, it's less safe
  in the sense that the resulting kvm_mmu_zap_all() hasn't been used in
  the wild for flushing memslots since the fast invalidate mechanism was
  introduced by commit 6ca18b6950f8d ("KVM: x86: use the fast way to
  invalidate all pages"), back in 2013.

- Reintroduce the fast invalidate mechanism and use it when zapping shadow
  pages in response to a memslot being deleted/moved, which is what this
  patch does.

For all intents and purposes, this is a revert of commit ea145aacf4ae8
("Revert "KVM: MMU: fast invalidate all pages"") and a partial revert of
commit 7390de1e99a70 ("Revert "KVM: x86: use the fast way to invalidate
all pages""), i.e. restores the behavior of commit 5304b8d37c2a5 ("KVM:
MMU: fast invalidate all pages") and commit 6ca18b6950f8d ("KVM: x86:
use the fast way to invalidate all pages") respectively.

Fixes: d012a06ab1d23 ("Revert "KVM: x86/mmu: Zap only the relevant pages when removing a memslot"")
Reported-by: James Harvey &lt;jamespharvey20@gmail.com&gt;
Cc: Alex Willamson &lt;alex.williamson@redhat.com&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson &lt;sean.j.christopherson@intel.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: x86: work around leak of uninitialized stack contents</title>
<updated>2019-09-14T07:25:11Z</updated>
<author>
<name>Fuqian Huang</name>
<email>huangfq.daxian@gmail.com</email>
</author>
<published>2019-09-12T04:18:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=541ab2aeb28251bf7135c7961f3a6080eebcc705'/>
<id>urn:sha1:541ab2aeb28251bf7135c7961f3a6080eebcc705</id>
<content type='text'>
Emulation of VMPTRST can incorrectly inject a page fault
when passed an operand that points to an MMIO address.
The page fault will use uninitialized kernel stack memory
as the CR2 and error code.

The right behavior would be to abort the VM with a KVM_EXIT_INTERNAL_ERROR
exit to userspace; however, it is not an easy fix, so for now just ensure
that the error code and CR2 are zero.

Signed-off-by: Fuqian Huang &lt;huangfq.daxian@gmail.com&gt;
Cc: stable@vger.kernel.org
[add comment]
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: nVMX: handle page fault in vmread</title>
<updated>2019-09-14T07:25:02Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2019-09-13T22:26:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f7eea636c3d505fe6f1d1066234f1aaf7171b681'/>
<id>urn:sha1:f7eea636c3d505fe6f1d1066234f1aaf7171b681</id>
<content type='text'>
The implementation of vmread to memory is still incomplete, as it
lacks the ability to do vmread to I/O memory just like vmptrst.

Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>riscv: modify the Image header to improve compatibility with the ARM64 header</title>
<updated>2019-09-14T02:03:52Z</updated>
<author>
<name>Paul Walmsley</name>
<email>paul.walmsley@sifive.com</email>
</author>
<published>2019-09-14T01:35:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=474efecb65dceb15f793b6e2f2b226e952f0f8e9'/>
<id>urn:sha1:474efecb65dceb15f793b6e2f2b226e952f0f8e9</id>
<content type='text'>
Part of the intention during the definition of the RISC-V kernel image
header was to lay the groundwork for a future merge with the ARM64
image header.  One error during my original review was not noticing
that the RISC-V header's "magic" field was at a different size and
position than the ARM64's "magic" field.  If the existing ARM64 Image
header parsing code were to attempt to parse an existing RISC-V kernel
image header format, it would see a magic number 0.  This is
undesirable, since it's our intention to align as closely as possible
with the ARM64 header format.  Another problem was that the original
"res3" field was not being initialized correctly to zero.

Address these issues by creating a 32-bit "magic2" field in the RISC-V
header which matches the ARM64 "magic" field.  RISC-V binaries will
store "RSC\x05" in this field.  The intention is that the use of the
existing 64-bit "magic" field in the RISC-V header will be deprecated
over time.  Increment the minor version number of the file format to
indicate this change, and update the documentation accordingly.  Fix
the assembler directives in head.S to ensure that reserved fields are
properly zero-initialized.

Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;
Reported-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
Reviewed-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
Cc: Atish Patra &lt;atish.patra@wdc.com&gt;
Cc: Karsten Merker &lt;merker@debian.org&gt;
Link: https://lore.kernel.org/linux-riscv/194c2f10c9806720623430dbf0cc59a965e50448.camel@wdc.com/T/#u
Link: https://lore.kernel.org/linux-riscv/mhng-755b14c4-8f35-4079-a7ff-e421fd1b02bc@palmer-si-x1e/T/#t</content>
</entry>
<entry>
<title>Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2019-09-12T13:47:35Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-09-12T13:47:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=95217783b7f6f331e7a6675e0a31fb9a5a1b9a36'/>
<id>urn:sha1:95217783b7f6f331e7a6675e0a31fb9a5a1b9a36</id>
<content type='text'>
Pull x86 fixes from Ingo Molnar:
 "A KVM guest fix, and a kdump kernel relocation errors fix"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/timer: Force PIT initialization when !X86_FEATURE_ARAT
  x86/purgatory: Change compiler flags from -mcmodel=kernel to -mcmodel=large to fix kexec relocation errors
</content>
</entry>
<entry>
<title>KVM: s390: Do not leak kernel stack data in the KVM_S390_INTERRUPT ioctl</title>
<updated>2019-09-12T12:12:21Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2019-09-12T11:54:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=53936b5bf35e140ae27e4bbf0447a61063f400da'/>
<id>urn:sha1:53936b5bf35e140ae27e4bbf0447a61063f400da</id>
<content type='text'>
When the userspace program runs the KVM_S390_INTERRUPT ioctl to inject
an interrupt, we convert them from the legacy struct kvm_s390_interrupt
to the new struct kvm_s390_irq via the s390int_to_s390irq() function.
However, this function does not take care of all types of interrupts
that we can inject into the guest later (see do_inject_vcpu()). Since we
do not clear out the s390irq values before calling s390int_to_s390irq(),
there is a chance that we copy random data from the kernel stack which
could be leaked to the userspace later.

Specifically, the problem exists with the KVM_S390_INT_PFAULT_INIT
interrupt: s390int_to_s390irq() does not handle it, and the function
__inject_pfault_init() later copies irq-&gt;u.ext which contains the
random kernel stack data. This data can then be leaked either to
the guest memory in __deliver_pfault_init(), or the userspace might
retrieve it directly with the KVM_S390_GET_IRQ_STATE ioctl.

Fix it by handling that interrupt type in s390int_to_s390irq(), too,
and by making sure that the s390irq struct is properly pre-initialized.
And while we're at it, make sure that s390int_to_s390irq() now
directly returns -EINVAL for unknown interrupt types, so that we
immediately get a proper error code in case we add more interrupt
types to do_inject_vcpu() without updating s390int_to_s390irq()
sometime in the future.

Cc: stable@vger.kernel.org
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Reviewed-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Reviewed-by: Janosch Frank &lt;frankja@linux.ibm.com&gt;
Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Link: https://lore.kernel.org/kvm/20190912115438.25761-1-thuth@redhat.com
Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>KVM: s390: kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset()</title>
<updated>2019-09-12T11:09:17Z</updated>
<author>
<name>Igor Mammedov</name>
<email>imammedo@redhat.com</email>
</author>
<published>2019-09-11T07:52:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13a17cc0526f08d1df9507f7484176371cd263a0'/>
<id>urn:sha1:13a17cc0526f08d1df9507f7484176371cd263a0</id>
<content type='text'>
If userspace doesn't set KVM_MEM_LOG_DIRTY_PAGES on memslot before calling
kvm_s390_vm_start_migration(), kernel will oops with:

  Unable to handle kernel pointer dereference in virtual kernel address space
  Failing address: 0000000000000000 TEID: 0000000000000483
  Fault in home space mode while using kernel ASCE.
  AS:0000000002a2000b R2:00000001bff8c00b R3:00000001bff88007 S:00000001bff91000 P:000000000000003d
  Oops: 0004 ilc:2 [#1] SMP
  ...
  Call Trace:
  ([&lt;001fffff804ec552&gt;] kvm_s390_vm_set_attr+0x347a/0x3828 [kvm])
   [&lt;001fffff804ecfc0&gt;] kvm_arch_vm_ioctl+0x6c0/0x1998 [kvm]
   [&lt;001fffff804b67e4&gt;] kvm_vm_ioctl+0x51c/0x11a8 [kvm]
   [&lt;00000000008ba572&gt;] do_vfs_ioctl+0x1d2/0xe58
   [&lt;00000000008bb284&gt;] ksys_ioctl+0x8c/0xb8
   [&lt;00000000008bb2e2&gt;] sys_ioctl+0x32/0x40
   [&lt;000000000175552c&gt;] system_call+0x2b8/0x2d8
  INFO: lockdep is turned off.
  Last Breaking-Event-Address:
   [&lt;0000000000dbaf60&gt;] __memset+0xc/0xa0

due to ms-&gt;dirty_bitmap being NULL, which might crash the host.

Make sure that ms-&gt;dirty_bitmap is set before using it or
return -EINVAL otherwise.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: afdad61615cc ("KVM: s390: Fix storage attributes migration with memory slots")
Signed-off-by: Igor Mammedov &lt;imammedo@redhat.com&gt;
Link: https://lore.kernel.org/kvm/20190911075218.29153-1-imammedo@redhat.com/
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Reviewed-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Reviewed-by: Claudio Imbrenda &lt;imbrenda@linux.ibm.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Reviewed-by: Janosch Frank &lt;frankja@linux.ibm.com&gt;
Signed-off-by: Janosch Frank &lt;frankja@linux.ibm.com&gt;
Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
</content>
</entry>
</feed>
