[PATCH] VT-d: Support multiple device assignment to one guest

2008-09-27 Thread Han, Weidong
From f2f722515135d95016f2d2ab55cc2aaf23d2fd80 Mon Sep 17 00:00:00 2001 From: Weidong Han [EMAIL PROTECTED] Date: Sat, 27 Sep 2008 14:28:07 +0800 Subject: [PATCH] Support multiple device assignment to one guest Current VT-d patches in kvm only support one device assignment to one guest due to

RE: Status of pci passthrough work?

2008-09-27 Thread Han, Weidong
Hi Thomas, the patches of passthrough/VT-d on kvm.git are already checked in. With Amit's userspace patches, you can assign device to guest. You can have a try. Randy (Weidong) Thomas Fjellstrom wrote: I'm very interested in being able to pass a few devices through to kvm guests. I'm

Re: Status of pci passthrough work?

2008-09-27 Thread Thomas Fjellstrom
On Saturday 27 September 2008, Han, Weidong wrote: Hi Thomas, the patches of passthrough/VT-d on kvm.git are already checked in. With Amit's userspace patches, you can assign device to guest. You can have a try. Does that mean I need VT-d support in hardware? All I have to test with right

RE: Status of pci passthrough work?

2008-09-27 Thread Han, Weidong
Thomas Fjellstrom wrote: On Saturday 27 September 2008, Han, Weidong wrote: Hi Thomas, the patches of passthrough/VT-d on kvm.git are already checked in. With Amit's userspace patches, you can assign device to guest. You can have a try. Does that mean I need VT-d support in hardware? All

Re: Status of pci passthrough work?

2008-09-27 Thread Thomas Fjellstrom
On Saturday 27 September 2008, Han, Weidong wrote: Thomas Fjellstrom wrote: On Saturday 27 September 2008, Han, Weidong wrote: Hi Thomas, the patches of passthrough/VT-d on kvm.git are already checked in. With Amit's userspace patches, you can assign device to guest. You can have a

[PATCH 0/6 v3] PCI: Linux kernel SR-IOV support

2008-09-27 Thread Zhao, Yu
Greetings, Following patches are intended to support SR-IOV capability in the Linux kernel. With these patches, people can turn a PCI device with the capability into multiple ones from software perspective, which can benefit KVM and achieve other purposes such as QoS, security, etc. [PATCH

[PATCH 1/6 v3] PCI: export some functions and macros

2008-09-27 Thread Zhao, Yu
Export some functions and move some macros from c file to header file. Cc: Jesse Barnes [EMAIL PROTECTED] Cc: Randy Dunlap [EMAIL PROTECTED] Cc: Grant Grundler [EMAIL PROTECTED] Cc: Alex Chiang [EMAIL PROTECTED] Cc: Matthew Wilcox [EMAIL PROTECTED] Cc: Roland Dreier [EMAIL PROTECTED] Cc: Greg KH

[PATCH 4/6 v3] PCI: support SR-IOV capability

2008-09-27 Thread Zhao, Yu
Add Single Root I/O Virtualization (SR-IOV) support. Cc: Jesse Barnes [EMAIL PROTECTED] Cc: Randy Dunlap [EMAIL PROTECTED] Cc: Grant Grundler [EMAIL PROTECTED] Cc: Alex Chiang [EMAIL PROTECTED] Cc: Matthew Wilcox [EMAIL PROTECTED] Cc: Roland Dreier [EMAIL PROTECTED] Cc: Greg KH [EMAIL PROTECTED]

Re: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Yang, Sheng
On Wednesday 24 September 2008 16:38:35 Avi Kivity wrote: Yang, Sheng wrote: - Shared Interrupt support I still don't know who would do this. It's very important for VT-d real usable. If nobody interested in it, I would pick it up, but after Oct. 6 (after National Holiday in

Re: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Avi Kivity
Yang, Sheng wrote: After check host shared interrupts situation, I got a question here: If I understand correctly, current solution don't block host shared irq, just come with the performance pentry. The penalty come with host disabled irq line for a period. We have to wait guest to write

Re: [PATCH] VT-d: Fix iommu map page for mmio pages

2008-09-27 Thread Avi Kivity
Muli Ben-Yehuda wrote: MMIO isn't just a register window. It may be an on-device buffer. Unlikely, but ok. It's unlikely in the same ways graphics cards are unlikely :) With a multi-card setup, perhaps it is even reasonable for one card to dma to another. I strongly

Re: KVM: MMU: fix largepage shadow accounting with oos

2008-09-27 Thread Avi Kivity
Marcelo Tosatti wrote: There's no need to increase the largepage shadow count when syncing since there's no count decrement on unsync, only on destruction. Applied, thanks. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- To

Re: [patch] stop passing in global variable as argument to cmos_init()

2008-09-27 Thread Avi Kivity
Jes Sorensen wrote: Hi, Looking through the ia64 code I came across this little gem. At some point someone added a new argument to hw/pc.c:cmos_init() named 'smp_cpus', and then passed in the global variable 'smp_cpus' as the argument. This propagated through to the ia64 code as well. I

Re: [patch] reindent ia64 code to match qemu code style

2008-09-27 Thread Avi Kivity
Jes Sorensen wrote: Hi, Xiantao and I have agreed to reformat the ia64 related code so it better matches the QEMU formatting style. This patch has zero code change, it is solely reformatting. It goes on top of the cmos_init() tidyup patch I sent out earlier today. Applied, thanks. I got a

Re: [PATCH 10/11] VMX: work around lacking VNMI support

2008-09-27 Thread Avi Kivity
Jan Kiszka wrote: As a workaround (or safety bag), is it imaginable to delay or deny VCPU snapshots at not yet fully restorable points (like GUEST_INTERRUPTIBILITY_INFO != 0)? Or stick-your-head-into-the-sand for now? Head in sand. The points where we have interrupt shadows should be

Re: [PATCH 4/9] Implement GIF, clgi and stgi v3

2008-09-27 Thread Avi Kivity
Joerg Roedel wrote: I had another possible idea for performance improvement here. Since we only inject normal interrupts and exceptions (and not NMI and such) we can patch clgi to cli and stgi to sti to save these two intercepts in the guests vmrun path. Any objections/problems with this?

Re: [PATCH 4/9] Implement GIF, clgi and stgi v3

2008-09-27 Thread Avi Kivity
Alexander Graf wrote: Hmm yes, this is a problem. So this optimization will not work. We need other ways to optimize :) Well it would work for the KVM-in-KVM case, where we know that VMRUN is always triggered with IF=1 and V_INTR=1. The only case that hack fails is when we have IF=0 and

Re: [PATCH 7/9] Add VMRUN handler v3

2008-09-27 Thread Avi Kivity
Alexander Graf wrote: Is copying one page really that expensive? Is there any accelerated function available for that that copies it with SSE or so? :-) 'rep movs' is supposed to be accelerated, doing cacheline-by-cacheline copies (at least on Intel). In any case the kernel memcpy()

Re: [PATCH 7/9] Add VMRUN handler v3

2008-09-27 Thread Avi Kivity
[EMAIL PROTECTED] wrote: Copying data in memory is always expensive because the accesses may miss in the caches and data must be fetched from memory. As far as I know this can be around 150 cycles per cache line. When the copy is sequential, the processor will prefetch the data ahead of

Re: [PATCH 1/6 v3] PCI: export some functions and macros

2008-09-27 Thread Matthew Wilcox
On Sat, Sep 27, 2008 at 04:27:44PM +0800, Zhao, Yu wrote: Export some functions and move some macros from c file to header file. That's absolutely not everything this patch does. You need to split this into smaller pieces and explain what you're doing and why for each of them. diff --git

Re: [PATCH 4/4] kvm: bios: switch MTRRs to cover only the PCI range and default to WB

2008-09-27 Thread Avi Kivity
Yang, Sheng wrote: I think we should do a little more than just write msr to update mtrr. Intel SDM 10.11.8 MTRR consideration in MP Systems define the procedure to modify MTRR msr in MP. Especially, step 4 enter no-fill cache mode(set CR0.CD bit and clean NW bit), step 12 re-enabled the

Re: Status of pci passthrough work?

2008-09-27 Thread Jan C. Bernauer
Hi, I have about the same problem, so excuse me for hijacking this thread. My hardware consists of a 780g/SB700 Mainboard and a 4850e AMD CPU, and I'm interested in forwarding a DVB-C tuner card to the guest. Maybe some NICs later. I tried and 'sort of' got it working with Amit's kernel and

Re: [PATCH 4/4] kvm: bios: switch MTRRs to cover only the PCI range and default to WB

2008-09-27 Thread Zwane Mwaikambo
On Sat, 27 Sep 2008, Avi Kivity wrote: Yang, Sheng wrote: I think we should do a little more than just write msr to update mtrr. Intel SDM 10.11.8 MTRR consideration in MP Systems define the procedure to modify MTRR msr in MP. Especially, step 4 enter no-fill cache mode(set CR0.CD bit

Re: Status of pci passthrough work?

2008-09-27 Thread Thomas Fjellstrom
On Saturday 27 September 2008, Jan C. Bernauer wrote: Hi, I have about the same problem, so excuse me for hijacking this thread. My hardware consists of a 780g/SB700 Mainboard and a 4850e AMD CPU, and I'm interested in forwarding a DVB-C tuner card to the guest. Maybe some NICs later. I

Re: Status of pci passthrough work?

2008-09-27 Thread Jan C. Bernauer
Thomas Fjellstrom wrote: How did you manage to pull together those patches? They all seem so old, and won't likely apply cleanly to git head :( Which patches do you mean? The patches for kvm? There is a nice repository managed by Amit Shah: Linux source:

Re: Status of pci passthrough work?

2008-09-27 Thread Thomas Fjellstrom
On Saturday 27 September 2008, Jan C. Bernauer wrote: Thomas Fjellstrom wrote: So I've checked out both of those trees and used head, and kvm-userspace is erroring out: gcc -I. -I.. -I/root/kvm-amit-userspace/qemu/target-i386 -I/root/kvm-amit- userspace/qemu -MMD -MT qemu-kvm-x86.o -MP

Re: Status of pci passthrough work?

2008-09-27 Thread Jan C. Bernauer
Thomas Fjellstrom wrote: that leaves me with: /root/kvm-amit-userspace/qemu/../libkvm/libkvm.h:28: warning: âstruct kvm_msr_entryâ declared inside parameter list

Re: Status of pci passthrough work?

2008-09-27 Thread Thomas Fjellstrom
On Saturday 27 September 2008, Jan C. Bernauer wrote: Thomas Fjellstrom wrote: that leaves me with: /root/kvm-amit-userspace/qemu/../libkvm/libkvm.h:28: warning: âstruct kvm_msr_entryâ declared inside parameter list /root/kvm-amit-userspace/qemu/../libkvm/libkvm.h:28: warning: its scope

RE: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Tian, Kevin
From:Avi Kivity Sent: 2008年9月27日 17:50 Yang, Sheng wrote: After check host shared interrupts situation, I got a question here: If I understand correctly, current solution don't block host shared irq, just come with the performance pentry. The penalty come with host disabled irq line for a

Re: [PATCH 4/4] kvm: bios: switch MTRRs to cover only the PCI range and default to WB

2008-09-27 Thread Sheng Yang
On Saturday 27 September 2008 21:55:33 Zwane Mwaikambo wrote: On Sat, 27 Sep 2008, Avi Kivity wrote: Yang, Sheng wrote: I think we should do a little more than just write msr to update mtrr. Intel SDM 10.11.8 MTRR consideration in MP Systems define the procedure to modify MTRR msr

RE: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Dong, Eddie
Tian, Kevin wrote: From:Avi Kivity Sent: 2008年9月27日 17:50 Yang, Sheng wrote: After check host shared interrupts situation, I got a question here: If I understand correctly, current solution don't block host shared irq, just come with the performance pentry. The penalty come with host

RE: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Dong, Eddie
I don't see how this relates to shared guest interrupts. Whatever you have on the host side, you still need to support shared guest interrupts. The only way to avoid the issue is by using MSI for the guest, and even then we still have to support interrupt sharing since not all guests have

RE: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Tian, Kevin
From: Dong, Eddie Sent: 2008年9月28日 10:04 Tian, Kevin wrote: From:Avi Kivity Sent: 2008年9月27日 17:50 Yang, Sheng wrote: After check host shared interrupts situation, I got a question here: If I understand correctly, current solution don't block host shared irq, just come with the

Re: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Avi Kivity
Tian, Kevin wrote: If the guest fails to disable interrupts on a device that shares an interrupt line with the host, the host will experience an interrupt flood. Eventually the host will disable the host device as well. This issue also exists on host side, that one misbehaved driver

Re: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Avi Kivity
Dong, Eddie wrote: I don't see how this relates to shared guest interrupts. Whatever you have on the host side, you still need to support shared guest interrupts. The only way to avoid the issue is by using MSI for the guest, and even then we still have to support interrupt sharing since not

Re: Status of pci passthrough work?

2008-09-27 Thread Avi Kivity
Jan C. Bernauer wrote: Hi, I have about the same problem, so excuse me for hijacking this thread. My hardware consists of a 780g/SB700 Mainboard and a 4850e AMD CPU, and I'm interested in forwarding a DVB-C tuner card to the guest. Maybe some NICs later. I tried and 'sort of' got it working

RE: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Tian, Kevin
From: Avi Kivity [mailto:[EMAIL PROTECTED] Sent: 2008年9月28日 12:23 There is no issue on the host, since all drivers operate on the same trust level. A misbehaving driver on the host will take down the entire system even without shared interrupts, by corrupting memory, not releasing a lock, etc.

Re: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Avi Kivity
Tian, Kevin wrote: No. Maybe the Neocleus polarity trick (which also reduces performance). To my knowledge, Neocleus polarity trick can't solve this isolation issue, which just provides one effecient way to track assertion/deassertion transition on the irq line. For example, reverse

Re: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Yang, Sheng
On Sunday 28 September 2008 13:04:06 Avi Kivity wrote: Tian, Kevin wrote: No. Maybe the Neocleus polarity trick (which also reduces performance). To my knowledge, Neocleus polarity trick can't solve this isolation issue, which just provides one effecient way to track

RE: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Dong, Eddie
Avi Kivity wrote: Dong, Eddie wrote: I don't see how this relates to shared guest interrupts. Whatever you have on the host side, you still need to support shared guest interrupts. The only way to avoid the issue is by using MSI for the guest, and even then we still have to support

Re: Remaining passthrough/VT-d tasks list

2008-09-27 Thread Yang, Sheng
On Sunday 28 September 2008 13:04:06 Avi Kivity wrote: Tian, Kevin wrote: No. Maybe the Neocleus polarity trick (which also reduces performance). To my knowledge, Neocleus polarity trick can't solve this isolation issue, which just provides one effecient way to track