Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread David Evensky
I don't know if there is a PCI card that only provides a region of memory. I'm not really trying to provide emulation for a known piece of hardware, so I picked values that weren't being used since there didn't appear to be an 'unknown'. I'll ask around. \dae On Thu, Aug 25, 2011 at 08:41:43AM

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Pekka Enberg
On Thu, Aug 25, 2011 at 1:25 AM, David Evensky even...@sandia.gov wrote: +       if (*next == '\0') +               p = next; +       else +               p = next + 1; +       /* parse out size */ +       base = 10; +       if (strcasestr(p, 0x)) +               base = 16; +       size =

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread David Evensky
On Thu, Aug 25, 2011 at 09:02:56AM +0300, Pekka Enberg wrote: On Thu, Aug 25, 2011 at 1:25 AM, David Evensky even...@sandia.gov wrote: + ? ? ? if (*next == '\0') + ? ? ? ? ? ? ? p = next; + ? ? ? else + ? ? ? ? ? ? ? p = next + 1; + ? ? ? /* parse out size */ + ? ? ? base = 10; + ?

Re: [Qemu-devel] [RFC PATCH v5 0/4] Separate thread for VM migration

2011-08-25 Thread Umesh Deshpande
Jitterd Test I ran jitterd in a migrating VM of size 8GB with and w/o the patch series. ./jitterd -f -m 1 -p 100 -r 40 That is to report the jitter of greater than 400ms during the interval of 40 seconds. Jitter in ms. with the migration thread. RunTotal (Peak) 1No chatter 2

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Asias He
On Thu, Aug 25, 2011 at 1:54 PM, Pekka Enberg penb...@kernel.org wrote: On 8/25/11 8:34 AM, Asias He wrote: Hi, David On Thu, Aug 25, 2011 at 6:25 AM, David Evensky even...@sandia.gov wrote: This patch adds a PCI device that provides PCI device memory to the guest. This memory in the

KSM Unstable tree question

2011-08-25 Thread Prateek Sharma
Hello everyone . I've been trying to understand how KSM works (i want to make some modifications / implement some optimizations) . One thing that struck me odd was the high number of calls to remove_rmap_item_from_tree . Particularly, this instance in cmp_and_merge_page : /*

Re: [Qemu-devel] [RFC PATCH v5 0/4] Separate thread for VM migration

2011-08-25 Thread Avi Kivity
On 08/25/2011 09:29 AM, Umesh Deshpande wrote: Jitterd Test I ran jitterd in a migrating VM of size 8GB with and w/o the patch series. ./jitterd -f -m 1 -p 100 -r 40 That is to report the jitter of greater than 400ms during the interval of 40 seconds. Jitter in ms. with the migration

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Pekka Enberg
On 8/25/11 9:30 AM, Asias He wrote: On Thu, Aug 25, 2011 at 1:54 PM, Pekka Enbergpenb...@kernel.org wrote: On 8/25/11 8:34 AM, Asias He wrote: Hi, David On Thu, Aug 25, 2011 at 6:25 AM, David Evenskyeven...@sandia.gov wrote: This patch adds a PCI device that provides PCI device memory to

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Asias He
On Thu, Aug 25, 2011 at 3:02 PM, Pekka Enberg penb...@kernel.org wrote: On 8/25/11 9:30 AM, Asias He wrote: On Thu, Aug 25, 2011 at 1:54 PM, Pekka Enbergpenb...@kernel.org  wrote: On 8/25/11 8:34 AM, Asias He wrote: Hi, David On Thu, Aug 25, 2011 at 6:25 AM, David

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Pekka Enberg
On 8/25/11 10:20 AM, Asias He wrote: On Thu, Aug 25, 2011 at 3:02 PM, Pekka Enbergpenb...@kernel.org wrote: On 8/25/11 9:30 AM, Asias He wrote: On Thu, Aug 25, 2011 at 1:54 PM, Pekka Enbergpenb...@kernel.orgwrote: On 8/25/11 8:34 AM, Asias He wrote: Hi, David On Thu, Aug 25, 2011 at

Re: [Qemu-devel] Guest kernel device compatability auto-detection

2011-08-25 Thread Richard W.M. Jones
On Thu, Aug 25, 2011 at 08:33:04AM +0300, Avi Kivity wrote: On 08/25/2011 08:21 AM, Sasha Levin wrote: Hi, Currently when we run the guest we treat it as a black box, we're not quite sure what it's going to start and whether it supports the same features we expect it to support when running

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Xiao Guangrong
On 08/25/2011 10:04 AM, Marcelo Tosatti wrote: Yes, in this case, the sp is not zapped, but it is hardly to know the gfn is not used as gpte just depends on writing, for example, the guest can change the mapping address or the status bit, and so on...The sp can be zapped if the guest write it

Re: [Qemu-devel] Guest kernel device compatability auto-detection

2011-08-25 Thread Sasha Levin
On Thu, 2011-08-25 at 08:32 +0100, Richard W.M. Jones wrote: On Thu, Aug 25, 2011 at 08:33:04AM +0300, Avi Kivity wrote: On 08/25/2011 08:21 AM, Sasha Levin wrote: Hi, Currently when we run the guest we treat it as a black box, we're not quite sure what it's going to start and whether

Re: [Qemu-devel] Guest kernel device compatability auto-detection

2011-08-25 Thread Richard W.M. Jones
On Thu, Aug 25, 2011 at 10:40:34AM +0300, Sasha Levin wrote: From what I gathered libguestfs only provides access to the guests' image. Correct. Which part is doing the IKCONFIG or System.map probing? Or is it done in a different way? You'll have to see what Matt's doing in the virt-v2v

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Xiao Guangrong
On 08/24/2011 03:09 AM, Marcelo Tosatti wrote: On Wed, Aug 24, 2011 at 12:32:32AM +0800, Xiao Guangrong wrote: On 08/23/2011 08:38 PM, Marcelo Tosatti wrote: And, i think there are not problems since: if the spte without accssed bit is written frequently, it means the guest page table is

Re: [Qemu-devel] Guest kernel device compatability auto-detection

2011-08-25 Thread Richard W.M. Jones
On Thu, Aug 25, 2011 at 08:48:25AM +0100, Richard W.M. Jones wrote: On Thu, Aug 25, 2011 at 10:40:34AM +0300, Sasha Levin wrote: From what I gathered libguestfs only provides access to the guests' image. Correct. Which part is doing the IKCONFIG or System.map probing? Or is it done in

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Stefan Hajnoczi
On Thu, Aug 25, 2011 at 6:06 AM, Pekka Enberg penb...@kernel.org wrote: On Wed, 2011-08-24 at 21:49 -0700, David Evensky wrote: On Wed, Aug 24, 2011 at 10:27:18PM -0500, Alexander Graf wrote: On 24.08.2011, at 17:25, David Evensky wrote: This patch adds a PCI device that provides

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Pekka Enberg
Hi Stefan, On Thu, Aug 25, 2011 at 1:31 PM, Stefan Hajnoczi stefa...@gmail.com wrote: It's obviously not competing. One thing you might want to consider is making the guest interface compatible with ivshmem. Is there any reason we shouldn't do that? I don't consider that a requirement, just

Re: kvm PCI assignment VFIO ramblings

2011-08-25 Thread Roedel, Joerg
Hi Alex, On Wed, Aug 24, 2011 at 05:13:49PM -0400, Alex Williamson wrote: Is this roughly what you're thinking of for the iommu_group component? Adding a dev_to_group iommu ops callback let's us consolidate the sysfs support in the iommu base. Would AMD-Vi do something similar (or exactly

Re: [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority functions.

2011-08-25 Thread Stefan Hajnoczi
On Mon, Jul 4, 2011 at 11:00 PM, Raghavendra D Prabhu raghu.prabh...@gmail.com wrote: The gnutls_*_set_priority family of functions has been marked deprecated in 2.12.x. These functions have been superceded by gnutls_priority_set_direct(). Signed-off-by: Raghavendra D Prabhu

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Stefan Hajnoczi
On Thu, Aug 25, 2011 at 11:37 AM, Pekka Enberg penb...@kernel.org wrote: Hi Stefan, On Thu, Aug 25, 2011 at 1:31 PM, Stefan Hajnoczi stefa...@gmail.com wrote: It's obviously not competing. One thing you might want to consider is making the guest interface compatible with ivshmem. Is there any

Re: kvm PCI assignment VFIO ramblings

2011-08-25 Thread Roedel, Joerg
On Wed, Aug 24, 2011 at 10:56:13AM -0400, Alex Williamson wrote: On Wed, 2011-08-24 at 10:43 +0200, Joerg Roedel wrote: A side-note: Might it be better to expose assigned devices in a guest on a seperate bus? This will make it easier to emulate an IOMMU for the guest inside qemu. I think

Re: [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority functions.

2011-08-25 Thread Daniel P. Berrange
On Thu, Aug 25, 2011 at 11:54:41AM +0100, Stefan Hajnoczi wrote: On Mon, Jul 4, 2011 at 11:00 PM, Raghavendra D Prabhu raghu.prabh...@gmail.com wrote: The gnutls_*_set_priority family of functions has been marked deprecated in 2.12.x. These functions have been superceded by

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Pekka Enberg
On Thu, Aug 25, 2011 at 1:59 PM, Stefan Hajnoczi stefa...@gmail.com wrote: Introducing yet another non-standard and non-Linux interface doesn't help though.  If there is no significant improvement over ivshmem then it makes sense to let ivshmem gain critical mass and more users instead of

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Sasha Levin
On Thu, 2011-08-25 at 11:59 +0100, Stefan Hajnoczi wrote: On Thu, Aug 25, 2011 at 11:37 AM, Pekka Enberg penb...@kernel.org wrote: Hi Stefan, On Thu, Aug 25, 2011 at 1:31 PM, Stefan Hajnoczi stefa...@gmail.com wrote: It's obviously not competing. One thing you might want to consider is

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Avi Kivity
On 08/25/2011 02:15 PM, Pekka Enberg wrote: On Thu, Aug 25, 2011 at 1:59 PM, Stefan Hajnoczistefa...@gmail.com wrote: Introducing yet another non-standard and non-Linux interface doesn't help though. If there is no significant improvement over ivshmem then it makes sense to let ivshmem

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Pekka Enberg
On Thu, Aug 25, 2011 at 2:30 PM, Avi Kivity a...@redhat.com wrote: On 08/25/2011 02:15 PM, Pekka Enberg wrote: On Thu, Aug 25, 2011 at 1:59 PM, Stefan Hajnoczistefa...@gmail.com  wrote:  Introducing yet another non-standard and non-Linux interface doesn't  help though.  If there is no

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Sasha Levin
On Thu, 2011-08-25 at 14:30 +0300, Avi Kivity wrote: On 08/25/2011 02:15 PM, Pekka Enberg wrote: On Thu, Aug 25, 2011 at 1:59 PM, Stefan Hajnoczistefa...@gmail.com wrote: Introducing yet another non-standard and non-Linux interface doesn't help though. If there is no significant

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Avi Kivity
On 08/25/2011 02:38 PM, Pekka Enberg wrote: If you or other KVM folks want to have a say what goes into tools/kvm, I'm happy to send you a pull request against kvm.git. Thanks, but I have my hands full already. I'll stop offering unwanted advice as well. Anyway, Sasha thinks ivshmem is

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Pekka Enberg
On 08/25/2011 02:38 PM, Pekka Enberg wrote: If you or other KVM folks want to have a say what goes into tools/kvm, I'm happy to send you a pull request against kvm.git. On Thu, Aug 25, 2011 at 2:51 PM, Avi Kivity a...@redhat.com wrote: Thanks, but I have my hands full already.  I'll stop

Re: kvm PCI assignment VFIO ramblings

2011-08-25 Thread Roedel, Joerg
On Wed, Aug 24, 2011 at 11:07:46AM -0400, Alex Williamson wrote: On Wed, 2011-08-24 at 10:52 +0200, Roedel, Joerg wrote: On Tue, Aug 23, 2011 at 01:08:29PM -0400, Alex Williamson wrote: On Tue, 2011-08-23 at 15:14 +0200, Roedel, Joerg wrote: Handling it through fds is a good idea.

Questions regarding ivshmem spec

2011-08-25 Thread Sasha Levin
Hello, I am looking to implement an ivshmem device for KVM tools, the purpose is to provide same functionality as QEMU and interoperability with QEMU. Going through the spec (I found here: https://gitorious.org/nahanni/guest-code/blobs/master/device_spec.txt ) and the code in QEMU I have

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Marcelo Tosatti
On Thu, Aug 25, 2011 at 07:42:10AM +0300, Avi Kivity wrote: On 08/25/2011 05:04 AM, Marcelo Tosatti wrote: It could increase the flood count independently of the accessed bit of the spte being updated, zapping after 3 attempts as it is now. But additionally reset the flood count if

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Marcelo Tosatti
On Thu, Aug 25, 2011 at 03:57:22PM +0800, Xiao Guangrong wrote: On 08/24/2011 03:09 AM, Marcelo Tosatti wrote: On Wed, Aug 24, 2011 at 12:32:32AM +0800, Xiao Guangrong wrote: On 08/23/2011 08:38 PM, Marcelo Tosatti wrote: And, i think there are not problems since: if the spte without

Re: [Qemu-devel] Questions regarding ivshmem spec

2011-08-25 Thread Avi Kivity
On 08/25/2011 04:29 PM, Sasha Levin wrote: 2. The spec describes DOORBELL as an array of DWORDs, when one guest wants to poke a different guest it would write something into the offset of the other guest in the DOORBELL array. Looking at the implementation in QEMU, DOORBELL is one DWORD, when

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Avi Kivity
On 08/25/2011 05:06 PM, Avi Kivity wrote: On 08/25/2011 04:21 PM, Marcelo Tosatti wrote: On Thu, Aug 25, 2011 at 07:42:10AM +0300, Avi Kivity wrote: On 08/25/2011 05:04 AM, Marcelo Tosatti wrote: It could increase the flood count independently of the accessed bit of the spte being

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Avi Kivity
On 08/25/2011 04:21 PM, Marcelo Tosatti wrote: On Thu, Aug 25, 2011 at 07:42:10AM +0300, Avi Kivity wrote: On 08/25/2011 05:04 AM, Marcelo Tosatti wrote: It could increase the flood count independently of the accessed bit of the spte being updated, zapping after 3 attempts as it

Re: [Qemu-devel] Questions regarding ivshmem spec

2011-08-25 Thread Sasha Levin
On Thu, 2011-08-25 at 17:00 +0300, Avi Kivity wrote: On 08/25/2011 04:29 PM, Sasha Levin wrote: 2. The spec describes DOORBELL as an array of DWORDs, when one guest wants to poke a different guest it would write something into the offset of the other guest in the DOORBELL array. Looking

[PATCH 02/14] KVM: PPC: Add papr_enabled flag

2011-08-25 Thread Alexander Graf
When running a PAPR guest, some things change. The privilege level drops from hypervisor to supervisor, SDR1 gets treated differently and we interpret hypercalls. For bisectability sake, add the flag now, but only enable it when all the support code is there. Signed-off-by: Alexander Graf

[PULL 00/14] ppc patch queue 2011-08-25

2011-08-25 Thread Alexander Graf
Hi Avi, This is my current patch queue for ppc. Please pull. Alex The following changes since commit ef7c782ea4a99fafb3d60dc8b8c057e0ef14f9f7: Nadav Har'El (1): KVM: SVM: Fix TSC MSR read in nested SVM are available in the git repository at: git://github.com/agraf/linux-2.6.git

[PATCH 04/14] KVM: PPC: Interpret SDR1 as HVA in PAPR mode

2011-08-25 Thread Alexander Graf
When running a PAPR guest, the guest is not allowed to set SDR1 - instead the HTAB information is held in internal hypervisor structures. But all of our current code relies on SDR1 and walking the HTAB like on real hardware. So in order to not be too intrusive, we simply set SDR1 to the HTAB we

[PATCH 13/14] KVM: PPC: book3s_pr: Simplify transitions between virtual and real mode

2011-08-25 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This simplifies the way that the book3s_pr makes the transition to real mode when entering the guest. We now call kvmppc_entry_trampoline (renamed from kvmppc_rmcall) in the base kernel using a normal function call instead of doing an indirect call through a

[PATCH 09/14] KVM: PPC: Support SC1 hypercalls for PAPR in PR mode

2011-08-25 Thread Alexander Graf
PAPR defines hypercalls as SC1 instructions. Using these, the guest modifies page tables and does other privileged operations that it wouldn't be allowed to do in supervisor mode. This patch adds support for PR KVM to trap these instructions and route them through the same PAPR hypercall

[PATCH 06/14] KVM: PPC: Add support for explicit HIOR setting

2011-08-25 Thread Alexander Graf
Until now, we always set HIOR based on the PVR, but this is just wrong. Instead, we should be setting HIOR explicitly, so user space can decide what the initial HIOR value is - just like on real hardware. We keep the old PVR based way around for backwards compatibility, but once user space uses

[PATCH 08/14] KVM: PPC: Stub emulate CFAR and PURR SPRs

2011-08-25 Thread Alexander Graf
Recent Linux versions use the CFAR and PURR SPRs, but don't really care about their contents (yet). So for now, we can simply return 0 when the guest wants to read them. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_emulate.c |4 1 files changed, 4

[PATCH 11/14] KVM: PPC: Add sanity checking to vcpu_run

2011-08-25 Thread Alexander Graf
There are multiple features in PowerPC KVM that can now be enabled depending on the user's wishes. Some of the combinations don't make sense or don't work though. So this patch adds a way to check if the executing environment would actually be able to run the guest properly. It also adds sanity

[PATCH 12/14] KVM: PPC: Assemble book3s{,_hv}_rmhandlers.S separately

2011-08-25 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This makes arch/powerpc/kvm/book3s_rmhandlers.S and arch/powerpc/kvm/book3s_hv_rmhandlers.S be assembled as separate compilation units rather than having them #included in arch/powerpc/kernel/exceptions-64s.S. We no longer have any conditional branches

[PATCH 10/14] KVM: PPC: Enable the PAPR CAP for Book3S

2011-08-25 Thread Alexander Graf
Now that Book3S PV mode can also run PAPR guests, we can add a PAPR cap and enable it for all Book3S targets. Enabling that CAP switches KVM into PAPR mode. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/powerpc.c |5 + include/linux/kvm.h|1 + 2 files

[PATCH 14/14] KVM: PPC: Implement H_CEDE hcall for book3s_hv in real-mode code

2011-08-25 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org With a KVM guest operating in SMT4 mode (i.e. 4 hardware threads per core), whenever a CPU goes idle, we have to pull all the other hardware threads in the core out of the guest, because the H_CEDE hcall is handled in the kernel. This is inefficient. This

[PATCH 05/14] KVM: PPC: Read out syscall instruction on trap

2011-08-25 Thread Alexander Graf
We have a few traps where we cache the instruction that cause the trap for analysis later on. Since we now need to be able to distinguish between SC 0 and SC 1 system calls and the only way to find out which is which is by looking at the instruction, we also read out the instruction causing the

[PATCH 01/14] KVM: PPC: move compute_tlbie_rb to book3s common header

2011-08-25 Thread Alexander Graf
We need the compute_tlbie_rb in _pr and _hv implementations for papr soon, so let's move it over to a common header file that both implementations can leverage. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_book3s.h | 33 +

[PATCH 07/14] KVM: PPC: Add PAPR hypercall code for PR mode

2011-08-25 Thread Alexander Graf
When running a PAPR guest, we need to handle a few hypercalls in kernel space, most prominently the page table invalidation (to sync the shadows). So this patch adds handling for a few PAPR hypercalls to PR mode KVM. I tried to share the code with HV mode, but it ended up being a lot easier this

[PATCH 03/14] KVM: PPC: Check privilege level on SPRs

2011-08-25 Thread Alexander Graf
We have 3 privilege levels: problem state, supervisor state and hypervisor state. Each of them can access different SPRs, so we need to check on every SPR if it's accessible in the respective mode. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_emulate.c | 25

Re: [Qemu-devel] Questions regarding ivshmem spec

2011-08-25 Thread Avi Kivity
On 08/25/2011 05:39 PM, Sasha Levin wrote: On Thu, 2011-08-25 at 17:00 +0300, Avi Kivity wrote: On 08/25/2011 04:29 PM, Sasha Levin wrote: 2. The spec describes DOORBELL as an array of DWORDs, when one guest wants to poke a different guest it would write something into the offset

Re: [Qemu-devel] Questions regarding ivshmem spec

2011-08-25 Thread Sasha Levin
On Thu, 2011-08-25 at 17:40 +0300, Avi Kivity wrote: On 08/25/2011 05:39 PM, Sasha Levin wrote: On Thu, 2011-08-25 at 17:00 +0300, Avi Kivity wrote: On 08/25/2011 04:29 PM, Sasha Levin wrote: 2. The spec describes DOORBELL as an array of DWORDs, when one guest wants to poke a

Re: Emulating LWZU Instruction for e500 powerpc

2011-08-25 Thread Alexander Graf
On 25.08.2011, at 04:30, Aashish Mittal wrote: On Thu, Aug 25, 2011 at 4:04 AM, Alexander Graf ag...@suse.de wrote: On 19.08.2011, at 06:45, Aashish Mittal wrote: Hi I'm trying to emulate the lwzu instruction in e500 powerpc kvm for my project . I've removed the read and write

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread David Evensky
Adding in the rest of what ivshmem does shouldn't affect our use, *I think*. I hadn't intended this to do everything that ivshmem does, but I can see how that would be useful. It would be cool if it could grow into that. Our requirements for the driver in kvm tool are that another program on

Re: kvm PCI assignment VFIO ramblings

2011-08-25 Thread Don Dutile
On 08/25/2011 06:54 AM, Roedel, Joerg wrote: Hi Alex, On Wed, Aug 24, 2011 at 05:13:49PM -0400, Alex Williamson wrote: Is this roughly what you're thinking of for the iommu_group component? Adding a dev_to_group iommu ops callback let's us consolidate the sysfs support in the iommu base.

Re: [PATCH 3/3] KVM: x86 emulator: fuzz tester

2011-08-25 Thread Marcelo Tosatti
On Mon, Aug 22, 2011 at 04:41:09PM +0300, Avi Kivity wrote: The x86 emulator is directly exposed to guest code; therefore it is part of the directly exposed attack surface. To reduce the risk of vulnerabilities, this patch adds a fuzz test that runs random instructions through the emulator.

RE: [Qemu-devel] Guest kernel device compatability auto-detection

2011-08-25 Thread Decker, Schorschi
From a security perspective, this not a great idea. Security isolation in virtualization is gaining ground, so anything that breaches the hypervisor/guest vale is by your typical enterprise/company security team considered completely illegal, a number of firms I have talked with all are

Re: kvm PCI assignment VFIO ramblings

2011-08-25 Thread Roedel, Joerg
On Thu, Aug 25, 2011 at 11:38:09AM -0400, Don Dutile wrote: On 08/25/2011 06:54 AM, Roedel, Joerg wrote: We need to solve this differently. ARM is starting to use the iommu-api too and this definitly does not work there. One possible solution might be to make the iommu-ops per-bus. When

Re: kvm PCI assignment VFIO ramblings

2011-08-25 Thread Alex Williamson
On Thu, 2011-08-25 at 12:54 +0200, Roedel, Joerg wrote: Hi Alex, On Wed, Aug 24, 2011 at 05:13:49PM -0400, Alex Williamson wrote: Is this roughly what you're thinking of for the iommu_group component? Adding a dev_to_group iommu ops callback let's us consolidate the sysfs support in the

Re: [Qemu-devel] [PATCH] KVM: Add wrapper script around QEMU to test kernels

2011-08-25 Thread Blue Swirl
On Wed, Aug 24, 2011 at 9:38 PM, Alexander Graf ag...@suse.de wrote: On LinuxCon I had a nice chat with Linus on what he thinks kvm-tool would be doing and what he expects from it. Basically he wants a small and simple tool he and other developers can run to try out and see if the kernel they

Re: [PATCH 3/3] KVM: x86 emulator: fuzz tester

2011-08-25 Thread Avi Kivity
On 08/25/2011 07:27 PM, Marcelo Tosatti wrote: On Mon, Aug 22, 2011 at 04:41:09PM +0300, Avi Kivity wrote: The x86 emulator is directly exposed to guest code; therefore it is part of the directly exposed attack surface. To reduce the risk of vulnerabilities, this patch adds a fuzz test

Re: [PATCH 0/3] Emulator fuzz tester

2011-08-25 Thread Lucas Meneghel Rodrigues
On 08/22/2011 10:41 AM, Avi Kivity wrote: As it is exposed directly to guest code, the x86 emulator is an interesting target for exploiters: a vulnerability may lead to compromise of the entire host. In an attempt to catch vulnerabilities before they make it into production code, this patchset

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread David Evensky
I've tested ivshmem with the latest git pull (had minor trouble building on debian sid, vnc and unused var, but trivial to work around). QEMU's -device ivshmem,size=16,shm=/kvm_shmem seems to function as my proposed --shmem pci:0xfd00:16M:handle=/kvm_shmem except that I can't

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Avi Kivity
On 08/26/2011 12:00 AM, David Evensky wrote: I've tested ivshmem with the latest git pull (had minor trouble building on debian sid, vnc and unused var, but trivial to work around). QEMU's -device ivshmem,size=16,shm=/kvm_shmem seems to function as my proposed --shmem

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Anthony Liguori
On 08/24/2011 05:25 PM, David Evensky wrote: This patch adds a PCI device that provides PCI device memory to the guest. This memory in the guest exists as a shared memory segment in the host. This is similar memory sharing capability of Nahanni (ivshmem) available in QEMU. In this case, the

Re: Guest kernel device compatability auto-detection

2011-08-25 Thread Anthony Liguori
On 08/25/2011 12:21 AM, Sasha Levin wrote: Hi, Currently when we run the guest we treat it as a black box, we're not quite sure what it's going to start and whether it supports the same features we expect it to support when running it from the host. This forces us to start the guest with the

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread David Evensky
On Thu, Aug 25, 2011 at 04:35:29PM -0500, Anthony Liguori wrote: dev.h --- linux-kvm/tools/kvm/include/kvm/virtio-pci-dev.h 2011-08-09 15:38:48.760120973 -0700 +++ linux-kvm_pci_shmem/tools/kvm/include/kvm/virtio-pci-dev.h 2011-08-18 10:06:12.171539230 -0700 @@ -15,10 +15,13 @@

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread David Evensky
I need to specify the physical address because I need to ioremap the memory during boot. The production issue I think is a memory limitation. We certainly do use QEMU a lot; but for this the kvm tool is a better fit. \dae On Fri, Aug 26, 2011 at 12:11:03AM +0300, Avi Kivity wrote: On

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Eric Northup
Just FYI, one issue that I found with exposing host memory regions as a PCI BAR (including via a very old version of the ivshmem driver... haven't tried a newer one) is that x86's pci_mmap_page_range doesn't want to set up a write-back cacheable mapping of a BAR. It may not matter for your

Re: [PATCH 3/3] KVM: x86 emulator: fuzz tester

2011-08-25 Thread Lucas Meneghel Rodrigues
On 08/22/2011 10:41 AM, Avi Kivity wrote: The x86 emulator is directly exposed to guest code; therefore it is part of the directly exposed attack surface. To reduce the risk of vulnerabilities, this patch adds a fuzz test that runs random instructions through the emulator. A vulnerability will

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread David Evensky
Thanks. My initial version did use the E820 map (thus the reason I want to have an 'address family'), but it was suggested that PCI would be a better way to go. When I get the rest of the project going, I will certainly test against that. I am going to have to do a LOT of ioremap's so that might

[PATCH] KVM test: Add cpu_hotplug subtest v2

2011-08-25 Thread Lucas Meneghel Rodrigues
Tests the ability of adding virtual cpus on the fly to qemu using the monitor command cpu_set, then after everything is OK, run the cpu_hotplug testsuite on the guest through autotest. Updates: As of the latest qemu-kvm (08-24-2011) HEAD, trying to online more CPUs than the ones already available

Re: [Autotest] [PATCH] KVM test: Add cpu_hotplug subtest

2011-08-25 Thread Lucas Meneghel Rodrigues
On Wed, Aug 24, 2011 at 1:25 AM, pradeep psuri...@linux.vnet.ibm.com wrote: On Wed, 24 Aug 2011 01:05:13 -0300 Lucas Meneghel Rodrigues l...@redhat.com wrote: Tests the ability of adding virtual cpus on the fly to qemu using the monitor command cpu_set, then after everything is OK, run the

Re: [PATCH 0/3] Emulator fuzz tester

2011-08-25 Thread Lucas Meneghel Rodrigues
On 08/22/2011 10:41 AM, Avi Kivity wrote: As it is exposed directly to guest code, the x86 emulator is an interesting target for exploiters: a vulnerability may lead to compromise of the entire host. In an attempt to catch vulnerabilities before they make it into production code, this patchset

Re: [PATCH 11/11] KVM: MMU: improve write flooding detected

2011-08-25 Thread Xiao Guangrong
On 08/25/2011 09:47 PM, Marcelo Tosatti wrote: I guess it is OK to be more trigger happy with zapping by ignoring the accessed bit, clearing the flood counter on page fault. Yeah, i like this way, is this patch good for you? Subject: [PATCH 11/11] KVM: MMU:

Re: kvm PCI assignment VFIO ramblings

2011-08-25 Thread David Gibson
On Wed, Aug 24, 2011 at 01:03:32PM +0200, Roedel, Joerg wrote: On Wed, Aug 24, 2011 at 05:33:00AM -0400, David Gibson wrote: On Wed, Aug 24, 2011 at 11:14:26AM +0200, Roedel, Joerg wrote: I don't see a reason to make this meta-grouping static. It would harm flexibility on x86. I think

Re: kvm PCI assignment VFIO ramblings

2011-08-25 Thread David Gibson
On Thu, Aug 25, 2011 at 08:25:45AM -0500, Alexander Graf wrote: On 25.08.2011, at 07:31, Roedel, Joerg wrote: On Wed, Aug 24, 2011 at 11:07:46AM -0400, Alex Williamson wrote: On Wed, 2011-08-24 at 10:52 +0200, Roedel, Joerg wrote: [...] We need to try the polite method of

Re: windows workload: many ept_violation and mmio exits

2011-08-25 Thread ya su
hi,Avi: I met the same problem, tons of hpet vm_exits(vector 209, fault address is in the guest vm's hpet mmio range), even I disable hpet device in win7 guest vm, it still produce a larget amount of vm_exits when trace-cmd ; I add -no-hpet to start the vm, it still has HPET device inside

[PATCH 02/14] KVM: PPC: Add papr_enabled flag

2011-08-25 Thread Alexander Graf
When running a PAPR guest, some things change. The privilege level drops from hypervisor to supervisor, SDR1 gets treated differently and we interpret hypercalls. For bisectability sake, add the flag now, but only enable it when all the support code is there. Signed-off-by: Alexander Graf

[PATCH 11/14] KVM: PPC: Add sanity checking to vcpu_run

2011-08-25 Thread Alexander Graf
There are multiple features in PowerPC KVM that can now be enabled depending on the user's wishes. Some of the combinations don't make sense or don't work though. So this patch adds a way to check if the executing environment would actually be able to run the guest properly. It also adds sanity

[PATCH 12/14] KVM: PPC: Assemble book3s{,_hv}_rmhandlers.S separately

2011-08-25 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This makes arch/powerpc/kvm/book3s_rmhandlers.S and arch/powerpc/kvm/book3s_hv_rmhandlers.S be assembled as separate compilation units rather than having them #included in arch/powerpc/kernel/exceptions-64s.S. We no longer have any conditional branches

[PULL 00/14] ppc patch queue 2011-08-25

2011-08-25 Thread Alexander Graf
Hi Avi, This is my current patch queue for ppc. Please pull. Alex The following changes since commit ef7c782ea4a99fafb3d60dc8b8c057e0ef14f9f7: Nadav Har'El (1): KVM: SVM: Fix TSC MSR read in nested SVM are available in the git repository at: git://github.com/agraf/linux-2.6.git

[PATCH 01/14] KVM: PPC: move compute_tlbie_rb to book3s common header

2011-08-25 Thread Alexander Graf
We need the compute_tlbie_rb in _pr and _hv implementations for papr soon, so let's move it over to a common header file that both implementations can leverage. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_book3s.h | 33 +

[PATCH 05/14] KVM: PPC: Read out syscall instruction on trap

2011-08-25 Thread Alexander Graf
We have a few traps where we cache the instruction that cause the trap for analysis later on. Since we now need to be able to distinguish between SC 0 and SC 1 system calls and the only way to find out which is which is by looking at the instruction, we also read out the instruction causing the

Re: Emulating LWZU Instruction for e500 powerpc

2011-08-25 Thread Alexander Graf
On 25.08.2011, at 04:30, Aashish Mittal wrote: On Thu, Aug 25, 2011 at 4:04 AM, Alexander Graf ag...@suse.de wrote: On 19.08.2011, at 06:45, Aashish Mittal wrote: Hi I'm trying to emulate the lwzu instruction in e500 powerpc kvm for my project . I've removed the read and write