Re: [PATCH] kvm: x86: Save/restore error_code

2010-12-10 Thread Jason Wang
Juan Quintela writes: Jason Wang jasow...@redhat.com wrote: Juan Quintela writes: Jason Wang jasow...@redhat.com wrote: The saving and restoring of error_code seems lost and convert the error_code to uint32_t. Signed-off-by: Jason Wang jasow...@redhat.com

[PATCH 1/3] Clean up cpu_inject_x86_mce().

2010-12-10 Thread Jin Dongming
Hi, all I am sorry for replying late. I modified the patches as the comments of huang-san and Marcelo-san and resend them. Thanks. Best Regards, Jin Dongming --- Clean up cpu_inject_x86_mce() for later patch. Signed-off-by: Jin Dongming

[PATCH 2/3] Add broadcast option for mce command.

2010-12-10 Thread Jin Dongming
When the following test case is injected with mce command, maybe user could not get the expected result. DATA command cpu bank status mcg_status addr misc (qemu) mce 1 10xbd00 0x050x1234 0x8c Expected Result

[PATCH 3/3] Add function for checking mca broadcast of CPU.

2010-12-10 Thread Jin Dongming
Add function for checking whether current CPU support mca broadcast. Signed-off-by: Jin Dongming jin.dongm...@np.css.fujitsu.com --- target-i386/cpu.h|1 + target-i386/helper.c | 33 + target-i386/kvm.c|6 +- 3 files changed, 35

[PATCH 1/3] kvm, x86: introduce kvm_mce_in_progress

2010-12-10 Thread Jin Dongming
Share same error handing, and rename this function after MCIP (Machine Check In Progress) flag. Signed-off-by: Hidetoshi Seto seto.hideto...@jp.fujitsu.com Signed-off-by: Jin Dongming jin.dongm...@np.css.fujitsu.com --- target-i386/kvm.c | 15 +-- 1 files changed, 5 insertions(+),

[PATCH 2/3] kvm, x86: kvm_mce_inj_* subroutins for templated error injections

2010-12-10 Thread Jin Dongming
Refactor codes for maintainability. Signed-off-by: Hidetoshi Seto seto.hideto...@jp.fujitsu.com Signed-off-by: Jin Dongming jin.dongm...@np.css.fujitsu.com --- target-i386/kvm.c | 111 ++--- 1 files changed, 71 insertions(+), 40 deletions(-) diff

[PATCH 3/3] kvm, x86: introduce kvm_inject_x86_mce_on

2010-12-10 Thread Jin Dongming
Pass a table instead of multiple args. Note: kvm_inject_x86_mce(env, bank, status, mcg_status, addr, misc, abort_on_error); is equal to: struct kvm_x86_mce mce = { .bank = bank, .status = status, .mcg_status = mcg_status, .addr =

Re: [PATCH] intel-iommu: Fix use after release during device attach

2010-12-10 Thread Jan Kiszka
Am 14.11.2010 10:18, Jan Kiszka wrote: Am 02.11.2010 08:31, Sheng Yang wrote: On Tuesday 02 November 2010 15:05:51 Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Obtail the new pgd pointer before releasing the page containing this value. Signed-off-by: Jan Kiszka

Re: [RFC PATCH 2/3] sched: add yield_to function

2010-12-10 Thread Srivatsa Vaddagiri
On Thu, Dec 09, 2010 at 11:34:46PM -0500, Rik van Riel wrote: On 12/03/2010 09:06 AM, Srivatsa Vaddagiri wrote: On Fri, Dec 03, 2010 at 03:03:30PM +0100, Peter Zijlstra wrote: No, because they do receive service (they spend some time spinning before being interrupted), so the respective

Re: [PATCH V2] qemu,kvm: Enable user space NMI injection for kvm guest

2010-12-10 Thread Jan Kiszka
Am 10.12.2010 08:42, Lai Jiangshan wrote: Make use of the new KVM_NMI IOCTL to send NMIs into the KVM guest if the user space raised them. (example: qemu monitor's nmi command) Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/configure b/configure index 2917874..f6f9362

[RFC PATCH V2 0/5] macvtap TX zero copy between guest and host kernel

2010-12-10 Thread Shirley Ma
This patchset add supports for TX zero-copy between guest and host kernel through vhost. It significantly reduces CPU utilization on the local host on which the guest is located (It reduced 30-50% CPU usage for vhost thread for single stream test). The patchset is based on previous submission and

[RFC PATCH V2 1/5] Add a new sock flag for zero-copy

2010-12-10 Thread Shirley Ma
Signed-off-by: Shirley Ma x...@us.ibm.com include/net/sock.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/net/sock.h b/include/net/sock.h index a6338d0..ff34ea7 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -543,6 +543,7 @@ enum sock_flags {

[RFC PATCH V2 2/5] Add a new device flag for zero copy

2010-12-10 Thread Shirley Ma
Signed-off-by: Shirley Ma x...@us.ibm.com --- include/linux/netdevice.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d8fd2c2..7207665 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h

[RFC PATCH V2 3/5] Add userspace buffers callback in skb_share_info

2010-12-10 Thread Shirley Ma
Signed-off-by: Shirley Ma x...@us.ibm.com --- include/linux/skbuff.h | 13 + net/core/skbuff.c | 13 - 2 files changed, 25 insertions(+), 1 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index e6ba898..938a7cb 100644 ---

[RFC PATCH V2 4/5] Add vhost zero copy callback to release guest kernel buffers

2010-12-10 Thread Shirley Ma
This patch uses msg_control to pass vhost callback to macvtap (any better idea to pass this in a simple way?). vhost doesn't notify guest to release buffers until the underlying lower device DMA has done for these buffers. This vq can not be reset if any outstanding reference. Signed-off-by:

[RFC PATCH V2 5/5] Add TX zero copy in macvtap

2010-12-10 Thread Shirley Ma
Only when buffer size is greater than GOODCOPY_LEN (128), macvtap enables zero-copy. Signed-off-by: Shirley Ma x...@us.ibm.com --- drivers/net/macvtap.c | 128 - 1 files changed, 116 insertions(+), 12 deletions(-) diff --git

Re: [RFC PATCH V2 0/5] macvtap TX zero copy between guest and host kernel

2010-12-10 Thread Shirley Ma
This patch has built and tested against most recent linus git tree. But I haven't done checkpatch yet. I would like to know whether this approach is acceptable or not first. Thanks Shirley -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [RFC PATCH V2 5/5] Add TX zero copy in macvtap

2010-12-10 Thread Eric Dumazet
Le vendredi 10 décembre 2010 à 02:13 -0800, Shirley Ma a écrit : + while (len) { + f = skb_shinfo(skb)-frags[i]; + f-page = page[i]; + f-page_offset = base ~PAGE_MASK; + f-size = min_t(int, len,

Re: [PATCH v2 2/2] qemu,qmp: convert do_inject_nmi() to QObject, QError

2010-12-10 Thread Markus Armbruster
Lai Jiangshan la...@cn.fujitsu.com writes: Convert do_inject_nmi() to QObject, QError, we need to use it(via libvirt). changed from v1 Add document. Add error handling when the cpu index is invalid. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/hmp-commands.hx

Re: [PATCH v2 1/2] QError: new QERR_INVALID_CPU_INDEX

2010-12-10 Thread Luiz Capitulino
On Fri, 10 Dec 2010 14:36:01 +0800 Lai Jiangshan la...@cn.fujitsu.com wrote: Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com As Markus said, we report this as an invalid parameter in do_cpu(), we can do the same for inject-nmi. --- diff --git a/qerror.c b/qerror.c index

Re: [PATCH v2 2/2] qemu,qmp: convert do_inject_nmi() to QObject, QError

2010-12-10 Thread Luiz Capitulino
On Fri, 10 Dec 2010 14:36:08 +0800 Lai Jiangshan la...@cn.fujitsu.com wrote: +SQMP +inject_nmi +-- + +Inject an NMI on the given CPU (x86 only). + +Arguments: + +- cpu_index: the index of the CPU to be injected NMI (json-int) + +Example: + +- { execute: inject_nmi, arguments:

Re: [PATCH 09/28] nVMX: Add VMCS fields to the vmcs12

2010-12-10 Thread Nadav Har'El
On Thu, Dec 09, 2010, Avi Kivity wrote about Re: [PATCH 09/28] nVMX: Add VMCS fields to the vmcs12: And please address all my earlier comments, there's no point in me reviewing the same thing again and again. Hi, Agreed. Like I said previously, I am keeping a detailed list of things you

[PATCH 5/5] kvm/svm: copy instruction bytes from VMCB

2010-12-10 Thread Andre Przywara
In case of a nested page fault or an intercepted #PF newer SVM implementations provide a copy of the faulting instruction bytes in the VMCB. Use these bytes to feed the instruction emulator and avoid the costly guest instruction fetch in this case. Signed-off-by: Andre Przywara

[PATCH -v2 0/5] kvm/svm: implement new DecodeAssist features

2010-12-10 Thread Andre Przywara
Hi, version 2 of the DecodeAssist patches. Changes over version 1: - goes on top of the CR8 handling fix I sent out earlier this week (required for proper handling of CR8 exceptions) - handles exception cases properly (for mov cr and mov dr) - uses X86_FEATURE_ names instead of SVM_FEATURE

[PATCH 1/5] kvm/svm: add new SVM feature bit names

2010-12-10 Thread Andre Przywara
the recent APM Vol.2 and the recent AMD CPUID specification describe new CPUID features bits for SVM. Name them here for later usage. Signed-off-by: Andre Przywara andre.przyw...@amd.com --- arch/x86/kvm/svm.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git

[PATCH 3/5] kvm/svm: enhance mov DR intercept handler

2010-12-10 Thread Andre Przywara
Newer SVM implementations provide the GPR number in the VMCB, so that the emulation path is no longer necesarry to handle debug register access intercepts. Implement the handling in svm.c and use it when the info is provided. Signed-off-by: Andre Przywara andre.przyw...@amd.com ---

[PATCH 4/5] kvm/svm: implement enhanced INVLPG intercept

2010-12-10 Thread Andre Przywara
When the DecodeAssist feature is available, the linear address is provided in the VMCB on INVLPG intercepts. Use it directly to avoid any decoding and emulation. This is only useful for shadow paging, though. Signed-off-by: Andre Przywara andre.przyw...@amd.com --- arch/x86/kvm/svm.c |7

[PATCH 2/5] kvm/svm: enhance MOV CR intercept handler

2010-12-10 Thread Andre Przywara
Newer SVM implementations provide the GPR number in the VMCB, so that the emulation path is no longer necesarry to handle CR register access intercepts. Implement the handling in svm.c and use it when the info is provided. Signed-off-by: Andre Przywara andre.przyw...@amd.com ---

[PATCH 0/3] Provide unmapped page cache control (v2)

2010-12-10 Thread Balbir Singh
The following series implements page cache control, this is a split out version of patch 1 of version 3 of the page cache optimization patches posted earlier at Previous posting https://lkml.org/lkml/2010/11/30/79 The previous revision received lot of comments, I've tried to address as many of

[PATCH 1/3] Move zone_reclaim() outside of CONFIG_NUMA (v2)

2010-12-10 Thread Balbir Singh
Changelog v2 Moved sysctl for min_unmapped_ratio as well This patch moves zone_reclaim and associated helpers outside CONFIG_NUMA. This infrastructure is reused in the patches for page cache control that follow. Signed-off-by: Balbir Singh bal...@linux.vnet.ibm.com --- include/linux/mmzone.h |

[PATCH 2/3] Refactor zone_reclaim (v2)

2010-12-10 Thread Balbir Singh
Move reusable functionality outside of zone_reclaim. Make zone_reclaim_unmapped_pages modular Signed-off-by: Balbir Singh bal...@linux.vnet.ibm.com --- mm/vmscan.c | 35 +++ 1 files changed, 23 insertions(+), 12 deletions(-) diff --git a/mm/vmscan.c

[PATCH 3/3] Provide control over unmapped pages (v2)

2010-12-10 Thread Balbir Singh
Changelog v2 1. Use a config option to enable the code (Andrew Morton) 2. Explain the magic tunables in the code or at-least attempt to explain them (General comment) 3. Hint uses of the boot parameter with unlikely (Andrew Morton) 4. Use better names (balanced is not a good naming convention)

Re: [RFC PATCH 0/3] directed yield for Pause Loop Exiting

2010-12-10 Thread Rik van Riel
On 12/10/2010 12:03 AM, Balbir Singh wrote: This is a good problem statement, there are other things to consider as well 1. If a hard limit feature is enabled underneath, donating the timeslice would probably not make too much sense in that case The idea is to get the VCPU that is holding

Re: [RFC PATCH 2/3] sched: add yield_to function

2010-12-10 Thread Rik van Riel
On 12/10/2010 03:39 AM, Srivatsa Vaddagiri wrote: On Thu, Dec 09, 2010 at 11:34:46PM -0500, Rik van Riel wrote: On 12/03/2010 09:06 AM, Srivatsa Vaddagiri wrote: On Fri, Dec 03, 2010 at 03:03:30PM +0100, Peter Zijlstra wrote: No, because they do receive service (they spend some time spinning

Re: [RFC PATCH V2 5/5] Add TX zero copy in macvtap

2010-12-10 Thread Shirley Ma
On Fri, 2010-12-10 at 11:27 +0100, Eric Dumazet wrote: You could make one atomic_add() outside of the loop, and factorize many things... atomic_add(len, skb-sk-sk_wmem_alloc); skb-data_len += len; skb-len += len; skb-truesize += len; while (len) { ... } Yep, thanks, will

Re: [RFC PATCH V2 5/5] Add TX zero copy in macvtap

2010-12-10 Thread Shirley Ma
On Fri, 2010-12-10 at 08:25 -0800, Shirley Ma wrote: On Fri, 2010-12-10 at 11:27 +0100, Eric Dumazet wrote: You could make one atomic_add() outside of the loop, and factorize many things... atomic_add(len, skb-sk-sk_wmem_alloc); skb-data_len += len; skb-len += len; skb-truesize

Re: [RFC PATCH V2 5/5] Add TX zero copy in macvtap

2010-12-10 Thread Eric Dumazet
Le vendredi 10 décembre 2010 à 08:25 -0800, Shirley Ma a écrit : On Fri, 2010-12-10 at 11:27 +0100, Eric Dumazet wrote: You could make one atomic_add() outside of the loop, and factorize many things... atomic_add(len, skb-sk-sk_wmem_alloc); skb-data_len += len; skb-len += len;

Re: linux-next: Tree for November 22 (kvm)

2010-12-10 Thread Randy Dunlap
(primary cpu clock)); #endif kvm_guest_cpu_init(); native_smp_prepare_boot_cpu(); } Can we get this fix merged, please? Build error is still happening in linux-next 20101210. --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** -- To unsubscribe from

Re: [PATCH] intel-iommu: Fix use after release during device attach

2010-12-10 Thread Chris Wright
* Jan Kiszka (jan.kis...@siemens.com) wrote: --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -3627,9 +3627,9 @@ static int intel_iommu_attach_device(struct iommu_domain *domain, pte = dmar_domain-pgd; if (dma_pte_present(pte)) { -

Re: [PATCH v16 02/17]Add a new struct for device to manipulate external buffer.

2010-12-10 Thread David Miller
From: xiaohui@intel.com Date: Wed, 1 Dec 2010 16:08:13 +0800 From: Xin Xiaohui xiaohui@intel.com Add a structure in structure net_device, the new field is named as mp_port. It's for mediate passthru (zero-copy). It contains the capability for the net device driver,

Re: [PATCH v16 03/17] Add a ndo_mp_port_prep pointer to net_device_ops.

2010-12-10 Thread David Miller
From: xiaohui@intel.com Date: Wed, 1 Dec 2010 16:08:14 +0800 +#if defined(CONFIG_MEDIATE_PASSTHRU) || defined(CONFIG_MEDIATE_PASSTHRU_MODULE) + int (*ndo_mp_port_prep)(struct net_device *dev, + struct mp_port *port);

Re: [RFC PATCH 3/3] kvm: use yield_to instead of sleep in kvm_vcpu_on_spin

2010-12-10 Thread Avi Kivity
On 12/09/2010 07:07 PM, Rik van Riel wrote: Right. May be clearer by using a for () loop instead of the goto. And open coding kvm_for_each_vcpu ? Somehow I suspect that won't add to clarity... No, I meant having a for (pass = 0; pass 2; ++pass) and nesting kvm_for_each_vcpu() in it. --

Re: [RFC PATCH 0/3] directed yield for Pause Loop Exiting

2010-12-10 Thread Avi Kivity
On 12/10/2010 07:03 AM, Balbir Singh wrote: Scheduler people, please flame me with anything I may have done wrong, so I can do it right for a next version :) This is a good problem statement, there are other things to consider as well 1. If a hard limit feature is enabled underneath,