Re: [ 022/108] scsi: Silence unnecessary warnings about ioctl to partition

2012-07-23 Thread Paolo Bonzini
warnings from lots of commands, including some proprietary userspace applications, I don't think disallowing the ioctls for processes with CAP_SYS_RAWIO will happen in the near future if ever. So lets just stop warning for processes with CAP_SYS_RAWIO for which ioctl is allowed. CC: Paolo Bonzini

Re: [PATCH v2] scsi: virtio-scsi: Fix address translation failure of HighMem pages used by sg list

2012-07-25 Thread Paolo Bonzini
Il 25/07/2012 14:13, Wang Sen ha scritto: When using the commands below to write some data to a virtio-scsi LUN of the QEMU guest(32-bit) with 1G physical memory(qemu -m 1024), the qemu will crash. # sudo mkfs.ext4 /dev/sdb (/dev/sdb is the virtio-scsi LUN.) # sudo mount

Re: [PATCH v2] scsi: virtio-scsi: Fix address translation failure of HighMem pages used by sg list

2012-07-25 Thread Paolo Bonzini
Il 25/07/2012 14:47, Boaz Harrosh ha scritto: NACK-by: Boaz Harrosh Apart from the HighMem pages problem, where in previous sg_set_buf() code was the marker copied? It was not because it is not needed because the allocation of sg took care of that. For example in 64bit the is no bugs,

[PATCH 1/2] virtio-scsi: fix LUNs greater than 255

2012-07-26 Thread Paolo Bonzini
with the flat format. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index c7030fb..8b6b927 100644 --- a/drivers

Re: [PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-09 Thread Paolo Bonzini
tgt-tgt_lock while invoking the calls to virtio_ring.c:virtqueue_add_buf() and friends. This bug was originally introduced in v3.5-rc7 code with: commit 2bd37f0fde99cbf8b78fb55f1128e8c3a63cf1da Author: Paolo Bonzini pbonz...@redhat.com Date: Wed Jun 13 16:56:34 2012 +0200 [SCSI

Re: [PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-09 Thread Paolo Bonzini
Il 09/11/2012 20:31, Nicholas A. Bellinger ha scritto: That's done on purpose. After you do virtqueue_add_buf, you don't need the sg list anymore, nor the lock that protects it. The cover letter is at https://lkml.org/lkml/2012/6/13/295 and had this text: This series reorganizes the

Re: [PATCH 90/91] block: fail SCSI passthrough ioctls on partition devices

2012-02-05 Thread Paolo Bonzini
On 02/05/2012 11:11 PM, Willy Tarreau wrote: Signed-off-by: Ben Hutchingsb...@decadent.org.uk Signed-off-by: Greg Kroah-Hartmangre...@linuxfoundation.org [wt: no scsi_cmd_blk_ioctl in 2.6.27, change callers instead. cciss is OK, ub,virtio_blk,ide-floppy,sd need fixing, cdromst can be ignored ]

Re: [PATCH 90/91] block: fail SCSI passthrough ioctls on partition devices

2012-02-07 Thread Paolo Bonzini
On 02/05/2012 11:53 PM, Willy Tarreau wrote: Thanks for this report, I missed this patch. I thought the reason for the lack of scsi_cmd_blk_ioctl() it was one of the differences between 2.6.27 and 2.6.32, so I have adapted the callers I identified to perform the same test as what's in

[PATCH] block: avoid false positive warnings on ioctl to partition

2012-02-13 Thread Paolo Bonzini
: Jens Axboe ax...@kernel.dk Cc: Linus Torvalds torva...@linux-foundation.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Note: I will take care of the stable backport as soon as this patch or something similar hits Linus's tree. block/scsi_ioctl.c | 43

Re: [PATCH v2] block: avoid false positive warnings on ioctl to partition

2012-02-27 Thread Paolo Bonzini
Ping. On 02/17/2012 08:38 AM, Paolo Bonzini wrote: After a month of reports, the warnings from non-whitelisted ioctls to a partitions can be classified in three groups. BLKFLSBUF and BLKROSET are always sent to devices. Not having them in the whitelist did not cause any visible harm

Re: [PATCH v2] block: avoid false positive warnings on ioctl to partition

2012-02-29 Thread Paolo Bonzini
Il 29/02/2012 01:14, Linus Torvalds ha scritto: So I'm still not convinced this is safe, and feel a bit worried about us possibly silently missing some things. That default: return -ENOIOCTLCMD; is what worries me. Blocking the ones we *know* about and understand I'm perfectly

Re: [PATCH v2] block: avoid false positive warnings on ioctl to partition

2012-02-29 Thread Paolo Bonzini
Il 29/02/2012 20:56, Ray Lee ha scritto: On Wed, Feb 29, 2012 at 12:13 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 29/02/2012 01:14, Linus Torvalds ha scritto: So I'm still not convinced this is safe, and feel a bit worried about us possibly silently missing some things. That default

Re: [PATCH v2] block: avoid false positive warnings on ioctl to partition

2012-03-06 Thread Paolo Bonzini
Il 29/02/2012 01:14, Linus Torvalds ha scritto: So I'm still not convinced this is safe, and feel a bit worried about us possibly silently missing some things. That default: return -ENOIOCTLCMD; is what worries me. Blocking the ones we *know* about and understand I'm perfectly

Re: [PATCH] virtio-scsi: Fix virtqueue affinity setup

2013-08-01 Thread Paolo Bonzini
vscsi-num_queues counts the number of request virtqueue which does not include the control and event virtqueue. It is wrong to subtract VIRTIO_SCSI_VQ_BASE from vscsi-num_queues. Reviewed-by: Paolo Bonzini pbonz...@redhat.com This patch fixes the following panic. (qemu) device_del scsi0

[PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-08-30 Thread Paolo Bonzini
is readonly, and later check it when updating the accessed and dirty bits. Cc: stable@vger.kernel.org Cc: g...@redhat.com Cc: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- CCing to stable@ since the regression was introduced

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Paolo Bonzini
Il 02/09/2013 12:07, Gleb Natapov ha scritto: On Mon, Sep 02, 2013 at 06:00:39PM +0800, Xiao Guangrong wrote: On 09/02/2013 05:25 PM, Gleb Natapov wrote: On Mon, Sep 02, 2013 at 05:20:15PM +0800, Xiao Guangrong wrote: On 08/30/2013 08:41 PM, Paolo Bonzini wrote: Page tables in a read-only

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Paolo Bonzini
Il 02/09/2013 12:11, Gleb Natapov ha scritto: Got it, thanks for your explanation. BTW, if you and Paolo are busy on other things, i am happy to fix these issues. :) I am busy with reviews mostly :). If you are not to busy with lockless write protection then fine with me. Lest wait

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Paolo Bonzini
Il 02/09/2013 11:25, Gleb Natapov ha scritto: On Mon, Sep 02, 2013 at 05:20:15PM +0800, Xiao Guangrong wrote: On 08/30/2013 08:41 PM, Paolo Bonzini wrote: Page tables in a read-only memory slot will currently cause a triple fault because the page walker uses gfn_to_hva and it fails

Re: [PATCH] KVM: VMX: mark unusable segment as nonpresent

2013-07-02 Thread Paolo Bonzini
Il 28/06/2013 12:17, Gleb Natapov ha scritto: Some userspaces do not preserve unusable property. Since usable segment has to be present according to VMX spec we can use present property to amend userspace bug by making unusable segment always nonpresent. vmx_segment_access_rights() already

Re: [Ksummit-2013-discuss] [ATTEND] How to act on LKML

2013-07-18 Thread Paolo Bonzini
Il 16/07/2013 20:27, James Bottomley ha scritto: I'm perfectly happy to run linux-scsi along reasonable standards of civility and try to keep the debates technical, but that's far easier to do on a low traffic list; obviously, I realise that style of argument doesn't suit everyone, so it's not

Re: [PATCH] KVM: VMX: fix halt emulation while emulating invalid guest sate

2013-05-08 Thread Paolo Bonzini
; + ret = kvm_emulate_halt(vcpu); + goto out; + } + if (signal_pending(current)) goto out; if (need_resched()) -- Gleb. Reviewed-by: Paolo Bonzini pbonz...@redhat.com

[PATCH] KVM: Emulate multibyte NOP

2013-05-30 Thread Paolo Bonzini
This is encountered when booting RHEL5.9 64-bit. There is another bug after this one that is not a simple emulation failure, but this one lets the boot proceed a bit. Cc: stable@vger.kernel.org # 3.9 Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/emulate.c | 4 +++- 1 file

[PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-05-30 Thread Paolo Bonzini
The x86-64 extended low-byte registers were fetched correctly from reg, but not from mod/rm. This fixes another bug in the boot of RHEL5.9 64-bit, but it is still not enough. Cc: gnata...@redhat.com Cc: k...@vger.kernel.org Cc: stable@vger.kernel.org # 3.9 Signed-off-by: Paolo Bonzini pbonz

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Paolo Bonzini
Il 02/06/2013 20:12, Gleb Natapov ha scritto: On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: The x86-64 extended low-byte registers were fetched correctly from reg, but not from mod/rm. This fixes another bug in the boot of RHEL5.9 64-bit, but it is still not enough. Did I

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Paolo Bonzini
Il 03/06/2013 10:04, Gleb Natapov ha scritto: On Mon, Jun 03, 2013 at 08:27:57AM +0200, Paolo Bonzini wrote: Il 02/06/2013 20:12, Gleb Natapov ha scritto: On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: The x86-64 extended low-byte registers were fetched correctly from reg

[PATCH 1/3] virtio-scsi: initialize scatterlist structure

2012-10-02 Thread Paolo Bonzini
From: Richard W.M. Jones rjo...@redhat.com The sg struct is used without being initialized, which breaks when CONFIG_DEBUG_SG is enabled. Cc: stable@vger.kernel.org Signed-off-by: Richard W.M. Jones rjo...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi

[PATCH for 3.6 1/3] virtio-scsi: fix copying of sg_list in the presence of of HighMem pages

2012-08-29 Thread Paolo Bonzini
() is copied too when the last entry of the source sg_list is copied to the the last entry in destination list. Cc: Stable kernel stable@vger.kernel.org # 3.4: 4fe74b1: [SCSI] virtio-scsi: SCSI driver Signed-off-by: Wang Sen senw...@linux.vnet.ibm.com Signed-off-by: Paolo Bonzini pbonz

[PATCH for 3.6 3/3] virtio-scsi: fix LUNs greater than 255

2012-08-29 Thread Paolo Bonzini
with the flat format. Cc: Stable kernel stable@vger.kernel.org # 3.4: 4fe74b1: [SCSI] virtio-scsi: SCSI driver Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers

[PATCH] KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table

2014-07-30 Thread Paolo Bonzini
...@redhat.com Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- virt/kvm/ioapic.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 2458a1dc2ba9..e8ce34c9db32 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm

Re: [PATCH] KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table

2014-08-06 Thread Paolo Bonzini
Il 06/08/2014 16:03, Zhang, Yang Z ha scritto: Paolo Bonzini wrote on 2014-07-31: Probably, the guest is masking the interrupt in the redirection table in the interrupt routine, i.e. while the interrupt is set in a LAPIC's ISR. The simplest fix is to ignore the masking state, we would rather

Re: [PATCH] KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table

2014-08-07 Thread Paolo Bonzini
Il 07/08/2014 03:31, Zhang, Yang Z ha scritto: Let me give an example to see whether my concern is a real problem: Guest allocates a vector and set it in IOAPIC entry to deliver interrupt. Later it masks the IOAPIC entry(means stop the corresponding device) and assign this vector to a MSI

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Paolo Bonzini
Il 14/08/2014 09:01, Xiao Guangrong ha scritto: - update_memslots(slots, new, kvm-memslots-generation); + /* ensure generation number is always increased. */ + slots-generation = old_memslots-generation; + update_memslots(slots, new); rcu_assign_pointer(kvm-memslots,

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 18:35, Xiao Guangrong ha scritto: Hi Paolo, Thank you to review the patch! On Aug 18, 2014, at 9:57 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 14/08/2014 09:01, Xiao Guangrong ha scritto: - update_memslots(slots, new, kvm-memslots-generation); + /* ensure

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 23:15, David Matlack ha scritto: I just realized how simple Paolo's idea is. I think it can be a one line patch (without comments): [...] update_memslots(slots, new, kvm-memslots-generation); rcu_assign_pointer(kvm-memslots, slots);

Re: [PATCH 2/2] kvm: x86: fix stale mmio cache bug

2014-08-18 Thread Paolo Bonzini
Il 14/08/2014 09:01, Xiao Guangrong ha scritto: * Clear the mmio cache info for the given gva, - * specially, if gva is ~0ul, we clear all mmio cache info. + * specially, if gva is ~MMIO_GVA_ANY, we clear all mmio cache info. Extra ~. */ +#define MMIO_GVA_ANY ~((gva_t)0) + Better:

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-19 Thread Paolo Bonzini
Il 19/08/2014 05:50, Xiao Guangrong ha scritto: Note in the step *, my approach detects the invalid generation-number which will invalidate the mmio spte properly . You are right, in fact my mail included another part: Another alternative could be to use the low bit to mark an in-progress

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-19 Thread Paolo Bonzini
Il 19/08/2014 10:50, Xiao Guangrong ha scritto: Okay, what confused me it that it seems that the single line patch is ok to you. :) No, it was late and I was confused. :) Now, do we really need to care the case 2? like David said: Sorry I didn't explain myself very well: Since we can get a

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-20 Thread Paolo Bonzini
Il 20/08/2014 03:03, David Matlack ha scritto: On Tue, Aug 19, 2014 at 5:29 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 05:03 PM, Paolo Bonzini wrote: Il 19/08/2014 10:50, Xiao Guangrong ha scritto: Okay, what confused me it that it seems that the single line

Re: [PATCH] KVM: x86: fix TSC matching

2014-08-26 Thread Paolo Bonzini
Il 26/08/2014 11:08, Pekka Enberg ha scritto: On Sun, Aug 17, 2014 at 11:54 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 15/08/2014 18:54, Marcelo Tosatti ha scritto: Ping on integration. It's been in kvm/next for a while, and is now in Linus's tree: Does this make sense for -stable

Re: [GIT PULL 2/2] KVM: s390/mm: try a cow on read only pages for key ops

2014-08-27 Thread Paolo Bonzini
Il 27/08/2014 09:13, Christian Borntraeger ha scritto: On 27/08/14 05:06, Ben Hutchings wrote: On Mon, 2014-08-25 at 15:10 +0200, Christian Borntraeger wrote: The PFMF instruction handler blindly wrote the storage key even if the page was mapped R/O in the host. Lets try a COW before

Re: [PATCH 2/2] kvm: x86: fix stale mmio cache bug

2014-08-29 Thread Paolo Bonzini
Il 28/08/2014 23:10, David Matlack ha scritto: Paolo, It seems like this patch ([PATCH 2/2] kvm: x86: fix stale mmio cache) is ready to go. Is there anything blocking it from being merged? (It should be fine to merge this on its own, independent of the fix discussed in [PATCH 1/2] KVM: fix

[PATCH 3/3] kvm: x86: fix stale mmio cache bug

2014-08-29 Thread Paolo Bonzini
the mmio cache. [ xiaoguangrong: adjust the code to make it simpler for stable-tree fix. ] Cc: stable@vger.kernel.org Signed-off-by: David Matlack dmatl...@google.com Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/include/asm

[PATCH 1/3] KVM: do not bias the generation number in kvm_current_mmio_generation

2014-08-29 Thread Paolo Bonzini
The next patch will give a meaning (a la seqcount) to the low bit of the generation number. Ensure that it matches between kvm-memslots-generation and kvm_current_mmio_generation(). Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/mmu.c | 7

[PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-08-29 Thread Paolo Bonzini
...@linux.vnet.ibm.com Signed-off-by: David Matlack dmatl...@google.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Documentation/virtual/kvm/mmu.txt | 14 ++ arch/x86/kvm/mmu.c| 20 virt/kvm/kvm_main.c | 23

Re: [PATCH] virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze

2013-10-28 Thread Paolo Bonzini
; + + err = register_hotcpu_notifier(vscsi-nb); + if (err) + vdev-config-del_vqs(vdev); - return virtscsi_init(vdev, vscsi); + return err; } #endif Reviewed-by: Paolo Bonzini pbonz...@redhat.com Cc: stable@vger.kernel.org -- To unsubscribe from this list

[PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Paolo Bonzini
Yet another instruction that we fail to emulate, this time found in Windows 2008R2 32-bit. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Testcase on its way. BTW, lahf/sahf is another candidate for #UD emulation. arch/x86/kvm/emulate.c | 14

Re: [PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 15:21, Gleb Natapov ha scritto: On Thu, Oct 31, 2013 at 11:29:42AM +0100, Paolo Bonzini wrote: Yet another instruction that we fail to emulate, this time found in Windows 2008R2 32-bit. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com

Re: [PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 15:34, Gleb Natapov ha scritto: I haven't checked AMD doc, but if it is documented that lahf/sahf #UDs at 64 bit we should emulate it correctly. It says The LAHF instruction can only be executed in 64-bit mode if supported by the processor implementation. Check the status of ECX

[PATCH] KVM: x86: fix emulation of movzbl %bpl, %eax

2013-10-31 Thread Paolo Bonzini
-by: Michele Baldessari mich...@redhat.com Cc: stable@vger.kernel.org Cc: Gleb Natapov g...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/emulate.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

Re: [PATCH] KVM: SVM: fix NMI window after iret

2014-02-18 Thread Paolo Bonzini
Il 17/01/2014 20:52, Radim Krčmář ha scritto: We should open NMI window right after an iret, but SVM exits before it. We wanted to single step using the trap flag and then open it. (or we could emulate the iret instead) We don't do it since commit 3842d135ff2 (likely), because the iret exit

[PATCH] kvm, vmx: Really fix lazy FPU on nested guest

2014-02-27 Thread Paolo Bonzini
Bader stefan.ba...@canonical.com Tested-by: Kashyap Chamarty kcham...@redhat.com Tested-by: Anthoine Bourgeois bourge...@bertin.fr Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] kvm: x86: fix apic_base enable check

2014-03-03 Thread Paolo Bonzini
, in the condition instead. Fixes: e66d2ae7c67bd Signed-off-by: Andrew Jones drjo...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com (cherry picked from commit 0dce7cd67fd9055c4a2ff278f8af1431e646d346) --- arch/x86/kvm/lapic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] kvm: x86: fix apic_base enable check

2014-03-04 Thread Paolo Bonzini
Il 04/03/2014 01:43, Greg KH ha scritto: On Mon, Mar 03, 2014 at 05:43:01PM +0100, Paolo Bonzini wrote: From: Andrew Jones drjo...@redhat.com For 3.8.13.w, 3.10, 3.11.10.w, 3.12, 3.13. How? It showed up in 3.13 in Linus's tree, so it can't go there. It's also already in 3.10 and odds

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-12 Thread Paolo Bonzini
Il 12/03/2014 11:40, Radim Krčmář ha scritto: 2014-03-11 22:05-0300, Marcelo Tosatti: On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window where we do not

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-14 Thread Paolo Bonzini
Il 13/03/2014 18:08, Radim Krčmář ha scritto: I agree that old code is wrong and the patch looks correct, but I only see how the bug may cause pending IRR to not be delivered in time, not how interrupt can disrupt a higher priority task. Right. Also, on SMP guests the effect would likely

[PATCH] KVM: x86: Fix potential divide by 0 in lapic (CVE-2013-6367)

2013-12-12 Thread Paolo Bonzini
that if the lapic_timer.period is 0, then the division does not occur. Reported-by: Andrew Honig aho...@google.com Cc: stable@vger.kernel.org Signed-off-by: Andrew Honig aho...@google.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/lapic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH] KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368)

2013-12-12 Thread Paolo Bonzini
-by: Andrew Honig aho...@google.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/lapic.c | 27 +++ arch/x86/kvm/lapic.h | 4 ++-- arch/x86/kvm/x86.c | 40 +--- 3 files changed, 18 insertions(+), 53 deletions(-) diff --git

[PATCH] KVM: Improve create VCPU parameter

2013-12-12 Thread Paolo Bonzini
that the vcpu_id provided is less than 255. The api documentation already specifies that the vcpu_id must be less than max_vcpus, but this is currently not checked. Reported-by: Andrew Honig aho...@google.com Cc: stable@vger.kernel.org Signed-off-by: Andrew Honig aho...@google.com Signed-off-by: Paolo

[PATCH] KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376)

2013-12-12 Thread Paolo Bonzini
. The problem is that KVM supports only one cluster with ID 0 in clustered mode, but the code that has the bug does not take this into account. Reported-by: Lars Bull larsb...@google.com Cc: stable@vger.kernel.org Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com

Re: [PATCH] KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376)

2013-12-13 Thread Paolo Bonzini
Il 13/12/2013 17:07, Radim Krčmář ha scritto: This bug can only be hit when the destination cpu is 256, so the request itself is buggy -- we don't support that many in kvm and it would crash when initializing the vcpus if we did. = It looks like we should just ignore the ipi,

[PATCH backport hints for 3.10] KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368)

2013-12-16 Thread Paolo Bonzini
kvm_lapic_set_vapic_addr in older kernels. I will review the backports as they are posted to LKML (if I am CCed...). Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/lapic.c | 38 +- arch/x86/kvm/lapic.h | 4 ++-- arch/x86/kvm/x86.c | 33

Re: [PATCH backport hints for 3.10] KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368)

2013-12-16 Thread Paolo Bonzini
Il 16/12/2013 16:24, Greg KH ha scritto: On Mon, Dec 16, 2013 at 12:38:17PM +0100, Paolo Bonzini wrote: The KVM patch fix vapic memory corruption applies to most kernels that have KVM, but the fix does not apply on many older branches. The APIs it uses are available in 3.1, but until 3.9

[PATCH v2] KVM: mmu: allow page tables to be in read-only slots

2013-09-05 Thread Paolo Bonzini
, as explained by comments in the code. Cc: stable@vger.kernel.org Cc: k...@vger.kernel.org Cc: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Cc: Gleb Natapov g...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/paging_tmpl.h | 20 +++- include/linux

Re: [PATCH v2] KVM: mmu: allow page tables to be in read-only slots

2013-09-09 Thread Paolo Bonzini
Il 08/09/2013 11:04, Gleb Natapov ha scritto: On Thu, Sep 05, 2013 at 02:21:53PM +0200, Paolo Bonzini wrote: Page tables in a read-only memory slot will currently cause a triple fault when running with shadow paging, because the page walker uses gfn_to_hva and it fails on such a slot

[PATCH 2/3] KVM: protect kvm_usage_count with its own spinlock

2013-09-16 Thread Paolo Bonzini
The VM list need not be protected by a raw spinlock. Separate the two so that kvm_lock can be made non-raw. Cc: stable@vger.kernel.org Cc: k...@vger.kernel.org Cc: g...@redhat.com Cc: jan.kis...@siemens.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Documentation/virtual/kvm

[PATCH 1/3] KVM: cleanup (physical) CPU hotplug

2013-09-16 Thread Paolo Bonzini
Remove the useless argument, and do not do anything if there are no VMs running at the time of the hotplug. Cc: stable@vger.kernel.org Cc: k...@vger.kernel.org Cc: g...@redhat.com Cc: jan.kis...@siemens.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- virt/kvm/kvm_main.c | 14

[PATCH 3/3] KVM: Convert kvm_lock back to non-raw spinlock

2013-09-16 Thread Paolo Bonzini
-off-by: Paolo Bonzini pbonz...@redhat.com --- Documentation/virtual/kvm/locking.txt | 2 +- arch/x86/kvm/mmu.c| 4 ++-- arch/x86/kvm/x86.c| 8 include/linux/kvm_host.h | 2 +- virt/kvm/kvm_main.c | 18

Re: [PATCH 1/3] KVM: cleanup (physical) CPU hotplug

2013-09-17 Thread Paolo Bonzini
Il 17/09/2013 09:57, Jan Kiszka ha scritto: Remove the useless argument, and do not do anything if there are no VMs running at the time of the hotplug. kvm_cpu_hotplug already filters !kvm_usage_count. If we need the check to be under kvm_lock, drop that line as well. If that is not required

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-10-14 Thread Paolo Bonzini
Il 01/09/2013 11:17, Gleb Natapov ha scritto: This makes me think are there other places where gfn_to_hva() was used, but gfn_to_hva_prot() should have been? - kvm_host_page_size() looks incorrect. We never use huge page to map read only memory slots currently. - kvm_handle_bad_page()

Re: [PATCH] virtio-scsi: Skip setting affinity on uninitialized vq

2014-04-11 Thread Paolo Bonzini
. Not a problem though; the queues are few and this is not a hot path anyway. Acked-by: Paolo Bonzini pbonz...@redhat.com Paolo -- To unsubscribe from this list: send the line unsubscribe stable in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [PATCH] virtio-scsi: Skip setting affinity on uninitialized vq

2014-04-11 Thread Paolo Bonzini
Il 11/04/2014 03:23, Fam Zheng ha scritto: virtscsi_init calls virtscsi_remove_vqs on err, even before initializing the vqs. The latter calls virtscsi_set_affinity, so let's check the pointer there before setting affinity on it. This fixes a panic when setting device's num_queues=2 on RHEL 6.5:

[PATCH v2 4/6] scsi_error: fix invalid setting of host byte

2014-06-04 Thread Paolo Bonzini
comments. - Paolo] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: fix all occurrences [Bart] drivers/scsi/scsi_error.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index f17aa7aa7879

[PATCH v2 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
or oopses. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d66c4ee2c774..fda9fb35 100644

[PATCH v3 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
or oopses. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d66c4ee2c774..fda9fb35 100644

[PATCH v3 4/6] scsi_error: fix invalid setting of host byte

2014-06-04 Thread Paolo Bonzini
comments. - Paolo] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: fix all occurrences [Bart] except one v2-v3: really fix all occurrences [Bart] drivers/scsi/scsi_error.c | 6 +++--- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi

Re: [PATCH v3 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
Il 04/06/2014 19:29, Venkatesh Srinivas ha scritto: Do you really want to poll the request VQs for completions if the TMF was rejected? I wasn't sure, but bugs in this path are hard enough that I preferred the safer patch. TMF ABORT may return FUNCTION REJECTED if the command to abort

Re: [PATCH 1/1] nbd: fsync and kill block device on shutdown

2014-04-27 Thread Paolo Bonzini
Il 23/04/2014 05:42, Qiang Huang ha scritto: From: Paolo Bonzini pbonz...@redhat.com commit 3a2d63f87989e01437ba994df5f297528c353d7d upstream. There are two problems with shutdown in the NBD driver. 1: Receiving the NBD_DISCONNECT ioctl does not sync the filesystem. This patch adds

[PATCH] KVM: x86: remove WARN_ON from get_kernel_ns()

2014-05-13 Thread Paolo Bonzini
-by: Marcelo Tosatti mtosa...@redhat.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/x86.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 41693787cd66..757d40871b30 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1123,7

[PATCH] KVM: lapic: sync highest ISR to hardware apic on EOI

2014-05-23 Thread Paolo Bonzini
@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/lapic.c | 62 ++--- 1 files changed, 43 insertions(+), 19 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 9736529..0069118 100644 --- a/arch/x86

Re: [PATCH] KVM: lapic: sync highest ISR to hardware apic on EOI

2014-05-26 Thread Paolo Bonzini
Il 26/05/2014 05:44, Zhang, Yang Z ha scritto: Paolo Bonzini wrote on 2014-05-23: When Hyper-V enlightenments are in effect, Windows prefers to issue an Hyper-V MSR write to issue an EOI rather than an x2apic MSR write. The Hyper-V MSR write is not handled by the processor, and besides being

Re: [PATCH] KVM: lapic: sync highest ISR to hardware apic on EOI

2014-05-26 Thread Paolo Bonzini
Il 26/05/2014 16:28, Michael S. Tsirkin ha scritto: static inline void apic_clear_isr(int vec, struct kvm_lapic *apic) { - if (__apic_test_and_clear_vector(vec, apic-regs + APIC_ISR)) + struct kvm_vcpu *vcpu; + if (!__apic_test_and_clear_vector(vec, apic-regs + APIC_ISR)) +

Re: [PATCH] KVM: lapic: sync highest ISR to hardware apic on EOI

2014-05-28 Thread Paolo Bonzini
Il 28/05/2014 18:57, Marcelo Tosatti ha scritto: On Fri, May 23, 2014 at 04:51:53PM +0200, Paolo Bonzini wrote: When Hyper-V enlightenments are in effect, Windows prefers to issue an Hyper-V MSR write to issue an EOI rather than an x2apic MSR write. The Hyper-V MSR write is not handled

[PATCH 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-03 Thread Paolo Bonzini
or oopses. Cc: stable@vger.kernel.org Cc: Ulrich Obergfell uober...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index

[PATCH 4/6] scsi_error: fix invalid setting of host byte

2014-06-03 Thread Paolo Bonzini
will corrupt the result field and initiate an unwanted command retry. Fix this by using set_host_byte instead, following the model of commit 2082ebc45af9c9c648383b8cde0dc1948eadbf31. Cc: stable@vger.kernel.org Signed-off-by: Ulrich Obergfell uober...@redhat.com Signed-off-by: Paolo Bonzini pbonz

[PATCH 3/6] virtio-scsi: avoid cancelling uninitialized work items

2014-06-03 Thread Paolo Bonzini
Calling the workqueue interface on uninitialized work items isn't a good idea even if they're zeroed. It's not failing catastrophically only through happy accidents, and a debug kernel rightfully complains. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers

[PATCH 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-03 Thread Paolo Bonzini
or oopses. Cc: stable@vger.kernel.org Cc: Ulrich Obergfell uober...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index

[PATCH 4/6] scsi_error: fix invalid setting of host byte

2014-06-03 Thread Paolo Bonzini
will corrupt the result field and initiate an unwanted command retry. Fix this by using set_host_byte instead, following the model of commit 2082ebc45af9c9c648383b8cde0dc1948eadbf31. Cc: stable@vger.kernel.org Signed-off-by: Ulrich Obergfell uober...@redhat.com Signed-off-by: Paolo Bonzini pbonz

[PATCH 3/6] virtio-scsi: avoid cancelling uninitialized work items

2014-06-03 Thread Paolo Bonzini
Calling the workqueue interface on uninitialized work items isn't a good idea even if they're zeroed. It's not failing catastrophically only through happy accidents, and a debug kernel rightfully complains. Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers

Re: [PATCH][stable-3.4] KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368)

2014-01-14 Thread Paolo Bonzini
: Accelerated apic support') Reported-by: Andrew Honig aho...@google.com Signed-off-by: Andrew Honig aho...@google.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com [ lizf: backported to 3.4: based on Paolo's backport hints for 3.10 ] Signed-off-by: Li Zefan lize...@huawei.com Reviewed

[PATCH 2/2] x86, kvm: correctly access the KVM_CPUID_FEATURES leaf at 0x40000101

2014-01-27 Thread Paolo Bonzini
kvm_cpuid_base(). This also requires making the function non-inline, since kvm_cpuid_base() is static. Fixes: 1085ba7f552d84aa8ac0ae903fa8d0cc2ff9f79d Cc: stable@vger.kernel.org Cc: mtosa...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/include/asm/kvm_para.h | 11

[PATCH 1/2] x86, kvm: cache the base of the KVM cpuid leaves

2014-01-27 Thread Paolo Bonzini
It is unnecessary to go through hypervisor_cpuid_base every time a leaf is found (which will be every time a feature is requested after the next patch). Fixes: 1085ba7f552d84aa8ac0ae903fa8d0cc2ff9f79d Cc: stable@vger.kernel.org Cc: mtosa...@redhat.com Signed-off-by: Paolo Bonzini pbonz

Re: [patch] KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio()

2014-01-30 Thread Paolo Bonzini
Il 29/01/2014 14:16, Dan Carpenter ha scritto: If kvm_io_bus_register_dev() fails then it returns success but it should return an error code. I also did a little cleanup like removing an impossible NULL test. Fixes: 2b3c246a682c ('KVM: Make coalesced mmio use a device per zone') Signed-off-by:

[PATCH 2/3] nbd: fsync and kill block device on shutdown

2013-02-12 Thread Paolo Bonzini
: # file -s /dev/sda /dev/sda: x86 boot sector; etc. Cc: stable@vger.kernel.org Cc: nbd-gene...@lists.sf.net Cc: Paul Clements paul.cleme...@steeleye.com Cc: Andrew Morton a...@linux-foundation.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/block/nbd.c | 10 ++ 1 files

Re: [PATCH 2/3] nbd: fsync and kill block device on shutdown

2013-02-13 Thread Paolo Bonzini
Il 12/02/2013 22:41, Andrew Morton ha scritto: There are two problems with shutdown in the NBD driver. The first is that receiving the NBD_DISCONNECT ioctl does not sync the filesystem; this is useful because BLKFLSBUF is restricted to processes that have CAP_SYS_ADMIN, and the NBD client

Re: [ 68/89] xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end

2013-02-13 Thread Paolo Bonzini
Il 01/02/2013 14:08, Greg Kroah-Hartman ha scritto: 3.7-stable review patch. If anyone has any objections, please let me know. -- From: Dave Chinner dchin...@redhat.com commit eb178619f930fa2ba2348de332a1ff1c66a31424 upstream. When _xfs_buf_find is passed an out of

Re: [patch NOT added to the 3.12 stable tree] kvm: fix wrong address when writing Hyper-V tsc page

2014-07-17 Thread Paolo Bonzini
not be able to get a correct clocksource (QueryPerformanceCounter will always return 0) which causes serious chaos. Signed-off-by: Xiaoming Gao newton...@tencnet.com Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion

Re: [PATCH 2/3] kvm: fix potentially corrupt mmio cache

2014-09-02 Thread Paolo Bonzini
Il 02/09/2014 18:44, David Matlack ha scritto: -#define MMIO_GEN_SHIFT 19 -#define MMIO_GEN_LOW_SHIFT 9 -#define MMIO_GEN_LOW_MASK ((1 MMIO_GEN_LOW_SHIFT) - 1) +#define MMIO_GEN_SHIFT 20 +#define MMIO_GEN_LOW_SHIFT

[PATCH 09/14] KVM: x86: Decoding guest instructions which cross page boundary may fail

2014-10-24 Thread Paolo Bonzini
. Cc: stable@vger.kernel.org Fixes: 5cfc7e0f5e5e1adf998df94f8e36edaf5d30d38e Signed-off-by: Nadav Amit na...@cs.technion.ac.il Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/emulate.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c

[PATCH 12/14] KVM: x86: PREFETCH and HINT_NOP should have SrcMem flag

2014-10-24 Thread Paolo Bonzini
. Adding SrcMem|NoAccess for prefetch and hint-nop and SrcMem for clflush. This fixes CVE-2014-8480. Fixes: 41061cdb98a0bec464278b4db8e894a3121671f5 Cc: stable@vger.kernel.org Signed-off-by: Nadav Amit na...@cs.technion.ac.il Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/emulate.c

[PATCH 10/14] KVM: emulate: avoid accessing NULL ctxt-memopp

2014-10-24 Thread Paolo Bonzini
: 41061cdb98a0bec464278b4db8e894a3121671f5 Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 02c8ea804aaf..eb3b1c46f995 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c

  1   2   >