Re: [PATCH 04/11] KVM: page track: add the framework of guest page tracking

2015-12-15 Thread Kai Huang
On 12/15/2015 04:46 PM, Xiao Guangrong wrote: On 12/15/2015 03:06 PM, Kai Huang wrote: Hi Guangrong, I am starting to review this series, and should have some comments or questions, you can determine whether they are valuable :) Thank you very much for your review and breaking the

Re: [PATCH 08/11] KVM: MMU: use page track for non-leaf shadow pages

2015-12-15 Thread Kai Huang
On 12/15/2015 05:10 PM, Xiao Guangrong wrote: On 12/15/2015 03:52 PM, Kai Huang wrote: static bool __mmu_gfn_lpage_is_disallowed(gfn_t gfn, int level, @@ -2140,12 +2150,18 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu, hlist_add_head(>hash_link,

Re: [PATCH v7 16/19] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-15 Thread Marc Zyngier
On 15/12/15 08:49, Shannon Zhao wrote: > From: Shannon Zhao > > When calling perf_event_create_kernel_counter to create perf_event, > assign a overflow handler. Then when the perf event overflows, set the > corresponding bit of guest PMOVSSET register. If this counter is

Re: [PATCH v7 19/19] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-15 Thread Marc Zyngier
On 15/12/15 08:49, Shannon Zhao wrote: > From: Shannon Zhao > > Add a new kvm device type KVM_DEV_TYPE_ARM_PMU_V3 for ARM PMU. Implement > the kvm_device_ops for it. > > Signed-off-by: Shannon Zhao > --- >

Re: [PATCH kvm-unit-tests 0/6] Improve the output of test runners

2015-12-15 Thread Andrew Jones
On Tue, Dec 15, 2015 at 02:13:25PM +0100, Radim Krčmář wrote: > 2015-12-15 11:19+0100, Paolo Bonzini: > > On 14/12/2015 22:24, Radim Krčmář wrote: > >> This series is a mix of patches that change the output of run_tests.sh > >> and x86-run. The output of ./run_tests.sh now looks like this: > > >

Re: [PATCH v7 00/19] KVM: ARM64: Add guest PMU support

2015-12-15 Thread Marc Zyngier
On 15/12/15 08:49, Shannon Zhao wrote: > From: Shannon Zhao > > This patchset adds guest PMU support for KVM on ARM64. It takes > trap-and-emulate approach. When guest wants to monitor one event, it > will be trapped by KVM and KVM will call perf_event API to create a

Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-15 Thread Eduardo Habkost
On Mon, Dec 14, 2015 at 07:17:27PM -0500, Raj, Ashok wrote: > On Mon, Dec 14, 2015 at 11:37:16PM +0100, Borislav Petkov wrote: > > On Mon, Dec 14, 2015 at 02:11:46PM -0500, Raj, Ashok wrote: > > > This is mostly harmless.. since the MCG_CAP space is shared and has no > > > conflict between

Re: [PATCH kvm-unit-tests 3/6] x86/pmu: expect failure with nmi_watchdog

2015-12-15 Thread Andrew Jones
On Tue, Dec 15, 2015 at 02:01:01PM +0100, Radim Krčmář wrote: > 2015-12-14 16:05-0600, Andrew Jones: > > On Mon, Dec 14, 2015 at 10:24:18PM +0100, Radim Krčmář wrote: > >> diff --git a/x86/pmu.c b/x86/pmu.c > >> @@ -291,7 +292,7 @@ static void check_counters_many(void) > >>if

Re: [PATCH 07/11] KVM: page track: add notifier support

2015-12-15 Thread Xiao Guangrong
On 12/16/2015 01:53 PM, Jike Song wrote: On 12/01/2015 02:26 AM, Xiao Guangrong wrote: Notifier list is introduced so that any node wants to receive the track event can register to the list Two APIs are introduced here: - kvm_page_track_register_notifier(): register the notifier to receive

Re: [PATCH v2] KVM: PPC: Exit guest upon fatal machine check exception

2015-12-15 Thread Daniel Axtens
Hi, > This patch also introduces a new KVM capability to > control how KVM behaves on machine check exception. > Without this capability, KVM redirects machine check > exceptions to guest's 0x200 vector if the address in > error belongs to guest. With this capability KVM > causes a guest exit

Re: [PATCH v2] KVM: PPC: Exit guest upon fatal machine check exception

2015-12-15 Thread Daniel Axtens
Hi, > This patch also introduces a new KVM capability to > control how KVM behaves on machine check exception. > Without this capability, KVM redirects machine check > exceptions to guest's 0x200 vector if the address in > error belongs to guest. With this capability KVM > causes a guest exit

Re: [PATCH v7 19/19] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-15 Thread Shannon Zhao
On 2015/12/16 4:47, Christoffer Dall wrote: > On Tue, Dec 15, 2015 at 03:59:31PM +, Marc Zyngier wrote: >> > On 15/12/15 15:50, Shannon Zhao wrote: >>> > > >>> > > >>> > > On 2015/12/15 23:33, Marc Zyngier wrote: > >> On 15/12/15 08:49, Shannon Zhao wrote: >> > From: Shannon

Re: [PATCH 06/11] KVM: MMU: let page fault handler be aware tracked page

2015-12-15 Thread Kai Huang
On 12/15/2015 05:03 PM, Xiao Guangrong wrote: On 12/15/2015 04:11 PM, Kai Huang wrote: On 12/01/2015 02:26 AM, Xiao Guangrong wrote: The page fault caused by write access on the write tracked page can not be fixed, it always need to be emulated. page_fault_handle_page_track() is the fast

RE: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-12-14 Thread Wu, Feng
> -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On > Behalf Of Radim Krcmár > Sent: Friday, December 11, 2015 10:38 PM > To: Wu, Feng <feng...@intel.com> > Cc: pbonz...@redhat.com; kvm@vger.kernel.org; linux-ker...@vger.

Re: [PATCH] vgaarb: fix signal handling in vga_get()

2015-12-14 Thread David Herrmann
Hi On Mon, Dec 14, 2015 at 9:19 AM, Kirill A. Shutemov wrote: > On Thu, Dec 10, 2015 at 11:28:58AM +0100, David Herrmann wrote: >> Hi >> >> On Mon, Nov 30, 2015 at 3:17 AM, Kirill A. Shutemov >> wrote: >> > There are few defects in vga_get() related

Re: [PATCH] target-i386: check vcpu features before accessing MSR_TSC_AUX

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 12:07, Haozhong Zhang wrote: > This patch fix a bug that prevents VM rebooting on recent versions of > KVM (from commit 9dbe6cf). > > kvm_get_msrs() is called to save guest MSR_TSC_AUX and other MSRs across > rebooting. It only checks whether KVM exposes MSR_TSC_AUX to userspace.

Re: [PATCH] vgaarb: fix signal handling in vga_get()

2015-12-14 Thread Kirill A. Shutemov
On Mon, Dec 14, 2015 at 11:20:00AM +0100, David Herrmann wrote: > Hi > > On Mon, Dec 14, 2015 at 9:19 AM, Kirill A. Shutemov > wrote: > > On Thu, Dec 10, 2015 at 11:28:58AM +0100, David Herrmann wrote: > >> Hi > >> > >> On Mon, Nov 30, 2015 at 3:17 AM, Kirill A. Shutemov >

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-14 Thread Michael S. Tsirkin
On Sun, Dec 13, 2015 at 11:47:44PM +0800, Lan, Tianyu wrote: > > > On 12/11/2015 1:16 AM, Alexander Duyck wrote: > >On Thu, Dec 10, 2015 at 6:38 AM, Lan, Tianyu wrote: > >> > >> > >>On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: > > Ideally, it is able to

Re: [PATCH 08/11] KVM: MMU: use page track for non-leaf shadow pages

2015-12-14 Thread Kai Huang
On 12/01/2015 02:26 AM, Xiao Guangrong wrote: non-leaf shadow pages are always write protected, it can be the user of page track Signed-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_page_track.h | 8 + arch/x86/kvm/mmu.c| 26

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-14 Thread Michael S. Tsirkin
On Fri, Dec 11, 2015 at 03:32:04PM +0800, Lan, Tianyu wrote: > > > On 12/11/2015 12:11 AM, Michael S. Tsirkin wrote: > >On Thu, Dec 10, 2015 at 10:38:32PM +0800, Lan, Tianyu wrote: > >> > >> > >>On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: > Ideally, it is able to leave guest driver

Re: [PATCH v3 22/22] arm64: KVM: Remove weak attributes

2015-12-14 Thread Christoffer Dall
On Mon, Dec 07, 2015 at 10:53:38AM +, Marc Zyngier wrote: > As we've now switched to the new world switch implementation, > remove the weak attributes, as nobody is supposed to override > it anymore. > > Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall

Re: [PATCH v3 10/22] arm64: KVM: Implement guest entry

2015-12-14 Thread Christoffer Dall
On Mon, Dec 07, 2015 at 10:53:26AM +, Marc Zyngier wrote: > Contrary to the previous patch, the guest entry is fairly different > from its assembly counterpart, mostly because it is only concerned > with saving/restoring the GP registers, and nothing else. > > Signed-off-by: Marc Zyngier

Re: [PATCH v1] kvm/x86: Remove Hyper-V SynIC timer stopping

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 16:33, Andrey Smetanin wrote: > It's possible that guest send us Hyper-V EOM at the middle > of Hyper-V SynIC timer running, so we start processing of Hyper-V > SynIC timers in vcpu context and stop the Hyper-V SynIC timer > uncoditionally and lose time expiration which Windows

Re: [PATCH] KVM: MTRR: fix fixed MTRR segment look up

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 15:39, Alexis D...t wrote: > It fixes the slow-down of VM running with pci-passthrough, since some MTRR > range changed from MTRR_TYPE_WRBACK to MTRR_TYPE_UNCACHABLE. > > Fixes: fa61213746a ("KVM: MTRR: simplify kvm_mtrr_get_guest_memory_type") > Bugzilla:

Re: [PATCH] KVM: MTRR: fix fixed MTRR segment look up

2015-12-14 Thread Alexis D...t
>From what I see in my case, it was especially gfn from 0x0 to 0xA0 which are deadly impacted by the wrong cache property. 2015-12-14 16:36 GMT+01:00 Paolo Bonzini : > > > On 14/12/2015 15:39, Alexis D...t wrote: >> It fixes the slow-down of VM running with pci-passthrough,

Re: [PATCH 0/1] virtio/s390: one fix

2015-12-14 Thread Michael S. Tsirkin
On Mon, Dec 14, 2015 at 04:02:33PM +0100, Cornelia Huck wrote: > On Thu, 3 Dec 2015 17:23:59 +0100 > Cornelia Huck wrote: > > > Michael, > > > > here's one fix for the virtio-ccw driver. > > > > Patch is against master, as your git branches on mst/vhost.git seem > >

Re: [PATCH] KVM: MTRR: fix fixed MTRR segment look up

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 17:06, Alexis D...t wrote: > From what I see in my case, it was especially gfn from 0x0 to 0xA0 > which are deadly impacted by the wrong cache property. Yes, indeed. I'll send the patch to Linus this week; I've now posted to the BZ a second patch for GFNs above 4GB. Paolo >

Re: [PATCH 04/11] KVM: page track: add the framework of guest page tracking

2015-12-14 Thread Kai Huang
Hi Guangrong, I am starting to review this series, and should have some comments or questions, you can determine whether they are valuable :) See below. On 12/01/2015 02:26 AM, Xiao Guangrong wrote: The array, gfn_track[mode][gfn], is introduced in memory slot for every guest page, this is

Re: [PATCH 05/11] KVM: page track: introduce kvm_page_track_{add,remove}_page

2015-12-14 Thread Kai Huang
On 12/01/2015 02:26 AM, Xiao Guangrong wrote: These two functions are the user APIs: - kvm_page_track_add_page(): add the page to the tracking pool after that later specified access on that page will be tracked - kvm_page_track_remove_page(): remove the page from the tracking pool, the

Re: [RFC PATCH 3/3] x86: Create dma_mark_dirty to dirty pages used for DMA by VM guest

2015-12-14 Thread Michael S. Tsirkin
On Sun, Dec 13, 2015 at 01:28:31PM -0800, Alexander Duyck wrote: > This patch is meant to provide the guest with a way of flagging DMA pages > as being dirty to the host when using a direct-assign device within a > guest. The advantage to this approach is that it is fairly simple, however > It

Re: kvmclock doesn't work, help?

2015-12-14 Thread Paolo Bonzini
On 11/12/2015 22:57, Andy Lutomirski wrote: > I'm still not seeing the issue. > > The formula is: > > (((rdtsc - pvti->tsc_timestamp) * pvti->tsc_to_system_mul) >> > pvti->tsc_shift) + pvti->system_time > > Obviously, if you reset pvti->tsc_timestamp to the current tsc value > after

Re: [PATCH] target-i386: check vcpu features before accessing MSR_TSC_AUX

2015-12-14 Thread Haozhong Zhang
On 12/14/15 12:51, Paolo Bonzini wrote: > > > On 14/12/2015 12:07, Haozhong Zhang wrote: > > This patch fix a bug that prevents VM rebooting on recent versions of > > KVM (from commit 9dbe6cf). > > > > kvm_get_msrs() is called to save guest MSR_TSC_AUX and other MSRs across > > rebooting. It

Re: [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2015-12-14 Thread Michael S. Tsirkin
On Mon, Dec 14, 2015 at 03:20:26PM +0800, Yang Zhang wrote: > On 2015/12/14 13:46, Alexander Duyck wrote: > >On Sun, Dec 13, 2015 at 9:22 PM, Yang Zhang wrote: > >>On 2015/12/14 12:54, Alexander Duyck wrote: > >>> > >>>On Sun, Dec 13, 2015 at 6:27 PM, Yang Zhang

Re: kvmclock doesn't work, help?

2015-12-14 Thread Marcelo Tosatti
On Fri, Dec 11, 2015 at 01:57:23PM -0800, Andy Lutomirski wrote: > On Thu, Dec 10, 2015 at 1:32 PM, Marcelo Tosatti wrote: > > On Wed, Dec 09, 2015 at 01:10:59PM -0800, Andy Lutomirski wrote: > >> I'm trying to clean up kvmclock and I can't get it to work at all. My > >>

Re: [PATCH] target-i386: check vcpu features before accessing MSR_TSC_AUX

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 14:54, Haozhong Zhang wrote: >> > That commit is not in any released kernel. > Right, it's currently only in kvm next. But I assume it would finally come > into a released kernel. Yes, but until it is, it's easier (and better) to fix KVM instead of QEMU. > > It's better if we

Re: [PATCH 0/1] virtio/s390: one fix

2015-12-14 Thread Cornelia Huck
On Thu, 3 Dec 2015 17:23:59 +0100 Cornelia Huck wrote: > Michael, > > here's one fix for the virtio-ccw driver. > > Patch is against master, as your git branches on mst/vhost.git seem > to be quite old. Is there some branch I can base my own branch on, > or do you

Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-14 Thread Eduardo Habkost
Hi, Comments below: On Thu, Dec 10, 2015 at 02:41:21PM -0500, Ashok Raj wrote: > This patch adds basic enumeration, control msr's required to support > Local Machine Check Exception Support (LMCE). > > - Added Local Machine Check definitions, changed MCG_CAP > - Added support for

Re: [RFC PATCH 3/3] x86: Create dma_mark_dirty to dirty pages used for DMA by VM guest

2015-12-14 Thread Alexander Duyck
On Mon, Dec 14, 2015 at 6:00 AM, Michael S. Tsirkin wrote: > On Sun, Dec 13, 2015 at 01:28:31PM -0800, Alexander Duyck wrote: >> This patch is meant to provide the guest with a way of flagging DMA pages >> as being dirty to the host when using a direct-assign device within a >>

Re: [PATCH v1] kvm/x86: Remove Hyper-V SynIC timer stopping

2015-12-14 Thread Andrey Smetanin
On 12/14/2015 07:09 PM, Paolo Bonzini wrote: On 14/12/2015 16:33, Andrey Smetanin wrote: It's possible that guest send us Hyper-V EOM at the middle of Hyper-V SynIC timer running, so we start processing of Hyper-V SynIC timers in vcpu context and stop the Hyper-V SynIC timer uncoditionally

Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-14 Thread Borislav Petkov
On Mon, Dec 14, 2015 at 02:23:56PM -0200, Eduardo Habkost wrote: > > -#define MCE_CAP_DEF (MCG_CTL_P|MCG_SER_P) > > +#define MCE_CAP_DEF (MCG_CTL_P|MCG_SER_P|MCG_LMCE_P) > > This makes mcg_cap change when upgrading QEMU. > > VMs with MCG_LMCE_P enabled shouldn't be migratable to hosts >

Re: [PATCH v1] kvm/x86: Remove Hyper-V SynIC timer stopping

2015-12-14 Thread Andrey Smetanin
On 12/14/2015 07:09 PM, Paolo Bonzini wrote: On 14/12/2015 16:33, Andrey Smetanin wrote: It's possible that guest send us Hyper-V EOM at the middle of Hyper-V SynIC timer running, so we start processing of Hyper-V SynIC timers in vcpu context and stop the Hyper-V SynIC timer uncoditionally

Re: [RFC PATCH 3/3] x86: Create dma_mark_dirty to dirty pages used for DMA by VM guest

2015-12-14 Thread Michael S. Tsirkin
On Mon, Dec 14, 2015 at 08:34:00AM -0800, Alexander Duyck wrote: > > This way distro can use a guest agent to disable > > dirtying until before migration starts. > > Right. For a v2 version I would definitely want to have some way to > limit the scope of this. My main reason for putting this

Re: kvmclock doesn't work, help?

2015-12-14 Thread Marcelo Tosatti
On Mon, Dec 14, 2015 at 10:07:21AM -0800, Andy Lutomirski wrote: > On Fri, Dec 11, 2015 at 3:48 PM, Marcelo Tosatti wrote: > > On Fri, Dec 11, 2015 at 01:57:23PM -0800, Andy Lutomirski wrote: > >> On Thu, Dec 10, 2015 at 1:32 PM, Marcelo Tosatti > >>

Re: [PATCH backport v3.12..v3.14 2/4] MIPS: KVM: Fix ASID restoration logic

2015-12-14 Thread Jiri Slaby
On 12/11/2015, 06:06 PM, James Hogan wrote: > commit 002374f371bd02df864cce1fe85d90dc5b292837 upstream. Applied 2/4 -- 4/4 to 3.12. Thanks. -- js suse labs -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-14 Thread Eduardo Habkost
On Mon, Dec 14, 2015 at 02:11:46PM -0500, Raj, Ashok wrote: > On Mon, Dec 14, 2015 at 05:37:38PM +0100, Borislav Petkov wrote: > > > > ... and obviously LMCE is vendor-specific so it cannot be enabled on > > !Intel guests with a define like that. mce_init() in qemu should check > > vendor too. >

Re: [RFC PATCH 3/3] x86: Create dma_mark_dirty to dirty pages used for DMA by VM guest

2015-12-14 Thread Alexander Duyck
On Mon, Dec 14, 2015 at 9:20 AM, Michael S. Tsirkin wrote: > On Mon, Dec 14, 2015 at 08:34:00AM -0800, Alexander Duyck wrote: >> > This way distro can use a guest agent to disable >> > dirtying until before migration starts. >> >> Right. For a v2 version I would definitely want

Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-14 Thread Raj, Ashok
On Mon, Dec 14, 2015 at 05:37:38PM +0100, Borislav Petkov wrote: > > ... and obviously LMCE is vendor-specific so it cannot be enabled on > !Intel guests with a define like that. mce_init() in qemu should check > vendor too. > > The same mistake was done with SER_P but that's much harder to

Re: kvmclock doesn't work, help?

2015-12-14 Thread Andy Lutomirski
On Fri, Dec 11, 2015 at 3:48 PM, Marcelo Tosatti wrote: > On Fri, Dec 11, 2015 at 01:57:23PM -0800, Andy Lutomirski wrote: >> On Thu, Dec 10, 2015 at 1:32 PM, Marcelo Tosatti wrote: >> > On Wed, Dec 09, 2015 at 01:10:59PM -0800, Andy Lutomirski wrote: >>

Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-14 Thread Raj, Ashok
Hi Eduardo, Thanks for the feedback. All the suggestions make sense.. On Mon, Dec 14, 2015 at 02:23:56PM -0200, Eduardo Habkost wrote: > > +static void feature_control_init(X86CPU *cpu) > > +{ > > + CPUX86State *cenv = >env; > > + > > + cenv->msr_ia32_feature_control = ((1<<20) | (1<<0)); >

Re: [PATCH] vgaarb: fix signal handling in vga_get()

2015-12-14 Thread Kirill A. Shutemov
On Thu, Dec 10, 2015 at 11:28:58AM +0100, David Herrmann wrote: > Hi > > On Mon, Nov 30, 2015 at 3:17 AM, Kirill A. Shutemov > wrote: > > There are few defects in vga_get() related to signal hadning: > > > > - we shouldn't check for pending signals for

Re: [PATCH kvm-unit-tests 3/6] x86/pmu: expect failure with nmi_watchdog

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:18PM +0100, Radim Krčmář wrote: > Host's nmi_watchdog takes one slot, making the "all counters" unit-test > fail. We know exactly what happens, mark it as expected failure. > > PMU test is now executed regardless of host_nmi_watchdog. > > Signed-off-by: Radim

Re: [PATCH kvm-unit-tests 2/6] x86/*: report skipped tests

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:17PM +0100, Radim Krčmář wrote: > No care to consistency or exhaustivity was given. > > (svm-disabled test should be redone and it's weird that x86/hyperv_synic > is about the only one that does report_skip when unsupported.) > > Signed-off-by: Radim Krčmář

Re: [PATCH kvm-unit-tests 4/6] run_tests: generalize check

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:19PM +0100, Radim Krčmář wrote: > config attribute "check" is currently unused. > Provide a simple implementation instead of removing it. > > Signed-off-by: Radim Krčmář > --- > run_tests.sh | 15 --- > 1 file changed, 4

Re: [PATCH kvm-unit-tests 1/6] lib/report: allow test skipping

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 04:00:19PM -0600, Andrew Jones wrote: > On Mon, Dec 14, 2015 at 10:24:16PM +0100, Radim Krčmář wrote: > > This patch allows us to explicitly mark a unit-test as skipped. > > If all unit-tests were skipped, the whole test is reported as skipped as > > well. This also

Re: [RFC PATCH 3/3] x86: Create dma_mark_dirty to dirty pages used for DMA by VM guest

2015-12-14 Thread Alexander Duyck
On Mon, Dec 14, 2015 at 12:52 PM, Michael S. Tsirkin wrote: > On Mon, Dec 14, 2015 at 09:59:13AM -0800, Alexander Duyck wrote: >> On Mon, Dec 14, 2015 at 9:20 AM, Michael S. Tsirkin wrote: >> > On Mon, Dec 14, 2015 at 08:34:00AM -0800, Alexander Duyck wrote: >>

Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-14 Thread Borislav Petkov
On Mon, Dec 14, 2015 at 02:11:46PM -0500, Raj, Ashok wrote: > This is mostly harmless.. since the MCG_CAP space is shared and has no > conflict between vendors. Also just the CAP being set has no effect. Of course it does - we check SER_P in machine_check_poll() and when I emulate an AMD guest

Re: [PATCH kvm-unit-tests 1/6] lib/report: allow test skipping

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:16PM +0100, Radim Krčmář wrote: > This patch allows us to explicitly mark a unit-test as skipped. > If all unit-tests were skipped, the whole test is reported as skipped as > well. This also includes the case where no report()s were done, but > the test still ended

Re: kvmclock doesn't work, help?

2015-12-14 Thread Marcelo Tosatti
On Mon, Dec 14, 2015 at 02:44:15PM +0100, Paolo Bonzini wrote: > > > On 11/12/2015 22:57, Andy Lutomirski wrote: > > I'm still not seeing the issue. > > > > The formula is: > > > > (((rdtsc - pvti->tsc_timestamp) * pvti->tsc_to_system_mul) >> > > pvti->tsc_shift) + pvti->system_time > > > >

Re: [PATCH kvm-unit-tests 0/6] Improve the output of test runners

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:15PM +0100, Radim Krčmář wrote: > This series is a mix of patches that change the output of run_tests.sh > and x86-run. The output of ./run_tests.sh now looks like this: > > > PASS apic (14 tests, 0 unexpected failures) > > PASS ioapic (19 tests, 0 unexpected

Re: kvmclock doesn't work, help?

2015-12-14 Thread Andy Lutomirski
On Mon, Dec 14, 2015 at 2:00 PM, Marcelo Tosatti wrote: > On Mon, Dec 14, 2015 at 02:44:15PM +0100, Paolo Bonzini wrote: >> >> >> On 11/12/2015 22:57, Andy Lutomirski wrote: >> > I'm still not seeing the issue. >> > >> > The formula is: >> > >> > (((rdtsc -

Re: [RFC PATCH 3/3] x86: Create dma_mark_dirty to dirty pages used for DMA by VM guest

2015-12-14 Thread Michael S. Tsirkin
On Mon, Dec 14, 2015 at 09:59:13AM -0800, Alexander Duyck wrote: > On Mon, Dec 14, 2015 at 9:20 AM, Michael S. Tsirkin wrote: > > On Mon, Dec 14, 2015 at 08:34:00AM -0800, Alexander Duyck wrote: > >> > This way distro can use a guest agent to disable > >> > dirtying until before

Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-14 Thread Raj, Ashok
On Mon, Dec 14, 2015 at 11:37:16PM +0100, Borislav Petkov wrote: > On Mon, Dec 14, 2015 at 02:11:46PM -0500, Raj, Ashok wrote: > > This is mostly harmless.. since the MCG_CAP space is shared and has no > > conflict between vendors. Also just the CAP being set has no effect. > > Of course it does

Re: [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2015-12-13 Thread Yang Zhang
On 2015/12/14 5:28, Alexander Duyck wrote: This patch set is meant to be the guest side code for a proof of concept involving leaving pass-through devices in the guest during the warm-up phase of guest live migration. In order to accomplish this I have added a new function called dma_mark_dirty

Re: [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2015-12-13 Thread Alexander Duyck
On Sun, Dec 13, 2015 at 6:27 PM, Yang Zhang wrote: > On 2015/12/14 5:28, Alexander Duyck wrote: >> >> This patch set is meant to be the guest side code for a proof of concept >> involving leaving pass-through devices in the guest during the warm-up >> phase of guest live

Re: [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2015-12-13 Thread Yang Zhang
On 2015/12/14 12:54, Alexander Duyck wrote: On Sun, Dec 13, 2015 at 6:27 PM, Yang Zhang wrote: On 2015/12/14 5:28, Alexander Duyck wrote: This patch set is meant to be the guest side code for a proof of concept involving leaving pass-through devices in the guest

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-13 Thread Lan, Tianyu
On 12/11/2015 1:16 AM, Alexander Duyck wrote: On Thu, Dec 10, 2015 at 6:38 AM, Lan, Tianyu wrote: On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: Ideally, it is able to leave guest driver unmodified but it requires the hypervisor or qemu to aware the device

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-13 Thread Alexander Duyck
On Sun, Dec 13, 2015 at 7:47 AM, Lan, Tianyu wrote: > > > On 12/11/2015 1:16 AM, Alexander Duyck wrote: >> >> On Thu, Dec 10, 2015 at 6:38 AM, Lan, Tianyu wrote: >>> >>> >>> >>> On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: > > >

Re: [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2015-12-13 Thread Alexander Duyck
On Sun, Dec 13, 2015 at 9:22 PM, Yang Zhang wrote: > On 2015/12/14 12:54, Alexander Duyck wrote: >> >> On Sun, Dec 13, 2015 at 6:27 PM, Yang Zhang >> wrote: >>> >>> On 2015/12/14 5:28, Alexander Duyck wrote: This patch set is meant

Re: [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking

2015-12-13 Thread Yang Zhang
On 2015/12/14 13:46, Alexander Duyck wrote: On Sun, Dec 13, 2015 at 9:22 PM, Yang Zhang wrote: On 2015/12/14 12:54, Alexander Duyck wrote: On Sun, Dec 13, 2015 at 6:27 PM, Yang Zhang wrote: On 2015/12/14 5:28, Alexander Duyck wrote:

Re: [PATCH v3 07/22] arm64: KVM: Implement system register save/restore

2015-12-12 Thread Mario Smarduch
On 12/11/2015 10:29 AM, Marc Zyngier wrote: > Hi Mario, > > On 11/12/15 03:24, Mario Smarduch wrote: >> Hi Marc, >> >> On 12/7/2015 2:53 AM, Marc Zyngier wrote: >>> Implement the system register save/restore as a direct translation of >>> the assembly code version. >>> >>> Signed-off-by: Marc

Re: [PATCH v2] vhost: replace % with & on data path

2015-12-12 Thread Andy Shevchenko
On Fri, Dec 4, 2015 at 10:19 PM, Venkatesh Srinivas wrote: > On Mon, Nov 30, 2015 at 11:15:23AM +0200, Michael S. Tsirkin wrote: >> We know vring num is a power of 2, so use & >> to mask the high bits. >> >> Signed-off-by: Michael S. Tsirkin >> --- > > The

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-11 Thread Borislav Petkov
On Thu, Dec 10, 2015 at 07:15:19PM +0100, Paolo Bonzini wrote: > Yeah, wait_lapic_expire also have to be moved before __kvm_guest_enter. Yeah, v2 doesn't splat on the Intel box anymore but the AMD box still has, and it is a different problem. With the v2 applied, it still explodes, see below.

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-11 Thread Paolo Bonzini
On 11/12/2015 11:22, Borislav Petkov wrote: > On Thu, Dec 10, 2015 at 07:15:19PM +0100, Paolo Bonzini wrote: >> Yeah, wait_lapic_expire also have to be moved before __kvm_guest_enter. > > Yeah, v2 doesn't splat on the Intel box anymore but the AMD box still > has, and it is a different problem.

Re: [GIT PULL] Please pull my kvm-ppc-fixes branch

2015-12-11 Thread Paolo Bonzini
On 10/12/2015 04:12, Paul Mackerras wrote: > git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git > kvm-ppc-fixes Pulled, thanks. Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [GIT PULL] Please pull my kvm-ppc-fixes branch

2015-12-11 Thread Paolo Bonzini
On 10/12/2015 04:12, Paul Mackerras wrote: > git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git > kvm-ppc-fixes Pulled, thanks. Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-11 Thread Paolo Bonzini
On 11/12/2015 12:41, Borislav Petkov wrote: > On Fri, Dec 11, 2015 at 11:41:30AM +0100, Paolo Bonzini wrote: >> It would be a kvm hypervisor page, not a kvm guest page, hence unrelated >> to the zapping thing. > > Ah right, guest pages should be userspace addresses, come to think of > it. > >>

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-11 Thread Borislav Petkov
On Fri, Dec 11, 2015 at 11:41:30AM +0100, Paolo Bonzini wrote: > You can disable it (well, make it take a few days to appear) with this: > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 484079efea5b..a9070e260c72 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c >

Re: [PATCH 01/11] qapi: Rename qjson.h to qobject-json.h

2015-12-11 Thread Paolo Bonzini
On 11/12/2015 00:53, Eric Blake wrote: > We have two different JSON visitors in the tree; and having both > named 'qjson.h' can cause include confusion. Rename the qapi > version. > > Kill trailing whitespace in the renamed tests/check-qobject-json.c > to keep checkpatch.pl happy. > >

Re: [PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko

2015-12-11 Thread Alex Bennée
Stefan Hajnoczi writes: > From: Asias He > > VM sockets vhost transport implementation. This module runs in host > kernel. As per previous checkpatch comments. > > Signed-off-by: Asias He > Signed-off-by: Stefan Hajnoczi

Re: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-12-11 Thread Radim Krcmár
2015-12-10 01:52+, Wu, Feng: >> From: Radim Krčmář [mailto:rkrc...@redhat.com] >> (Physical xAPIC+x2APIC mode is still somewhat reasonable and xAPIC CPUs >> start with LDR=0, which means that operating system doesn't need to >> utilize mixed mode, as defined by KVM, when switching to

Re: kvmclock doesn't work, help?

2015-12-11 Thread Marcelo Tosatti
On Wed, Dec 09, 2015 at 01:10:59PM -0800, Andy Lutomirski wrote: > I'm trying to clean up kvmclock and I can't get it to work at all. My > host is 4.4.0-rc3-ish on a Skylake laptop that has a working TSC. > > If I boot an SMP (2 vcpus) guest, tracing says: > > qemu-system-x86-2517 [001]

Re: kvmclock doesn't work, help?

2015-12-11 Thread Marcelo Tosatti
On Wed, Dec 09, 2015 at 02:27:36PM -0800, Andy Lutomirski wrote: > On Wed, Dec 9, 2015 at 2:12 PM, Paolo Bonzini wrote: > > > > > > On 09/12/2015 22:49, Andy Lutomirski wrote: > >> On Wed, Dec 9, 2015 at 1:16 PM, Paolo Bonzini wrote: > >>> > >>> > >>> On

Re: [PATCH v3 02/22] arm64: KVM: Add a HYP-specific header file

2015-12-11 Thread Christoffer Dall
On Mon, Dec 07, 2015 at 10:53:18AM +, Marc Zyngier wrote: > In order to expose the various EL2 services that are private to > the hypervisor, add a new hyp.h file. > > So far, it only contains mundane things such as section annotation > and VA manipulation. > > Signed-off-by: Marc Zyngier

Re: [PATCH v3 06/22] arm64: KVM: Implement timer save/restore

2015-12-11 Thread Christoffer Dall
On Mon, Dec 07, 2015 at 10:53:22AM +, Marc Zyngier wrote: > Implement the timer save restore as a direct translation of > the assembly code version. > > Signed-off-by: Marc Zyngier Reviewed-by: Christoffer Dall -- To unsubscribe from this

Re: kvmclock doesn't work, help?

2015-12-11 Thread Marcelo Tosatti
On Wed, Dec 09, 2015 at 01:10:59PM -0800, Andy Lutomirski wrote: > I'm trying to clean up kvmclock and I can't get it to work at all. My > host is 4.4.0-rc3-ish on a Skylake laptop that has a working TSC. > > If I boot an SMP (2 vcpus) guest, tracing says: > > qemu-system-x86-2517 [001]

Re: [PATCH v3 11/22] arm64: KVM: Add patchable function selector

2015-12-11 Thread Christoffer Dall
On Mon, Dec 07, 2015 at 10:53:27AM +, Marc Zyngier wrote: > KVM so far relies on code patching, and is likely to use it more > in the future. The main issue is that our alternative system works > at the instruction level, while we'd like to have alternatives at > the function level. > > In

Re: kvmclock doesn't work, help?

2015-12-11 Thread Andy Lutomirski
On Thu, Dec 10, 2015 at 1:32 PM, Marcelo Tosatti wrote: > On Wed, Dec 09, 2015 at 01:10:59PM -0800, Andy Lutomirski wrote: >> I'm trying to clean up kvmclock and I can't get it to work at all. My >> host is 4.4.0-rc3-ish on a Skylake laptop that has a working TSC. >> >> If I

RE: [Patch V2 2/2] x86, mce: Need to translate GPA to HPA to inject error in guest.

2015-12-11 Thread Chen, Gong
Hi, Ashok Please add " original author by Huang Ying " at some place. Thanks. > -Original Message- > From: Raj, Ashok > Sent: Friday, December 11, 2015 3:41 AM > To: kvm@vger.kernel.org > Cc: Chen, Gong; Gleb Natapov; Paolo Bonzini; qemu-de...@nongnu.org; >

Re: [PATCH] KVM: arm/arm64: vgic: Fix kvm_vgic_map_is_active's dist check

2015-12-11 Thread Marc Zyngier
On 10/12/15 21:46, Christoffer Dall wrote: > External inputs to the vgic from time to time need to poke into the > state of a virtual interrupt, the prime example is the architected timer > code. > > Since the IRQ's active state can be represented in two places; the LR or > the distributor, we

Re: [PATCH] x86/platform/uv: Include clocksource.h for clocksource_touch_watchdog()

2015-12-11 Thread Andy Lutomirski
On Fri, Dec 11, 2015 at 12:06 AM, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > >> diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h >> index f80d70009ff8..6d7d0e52ed5a 100644 >> --- a/arch/x86/include/asm/fixmap.h >> +++

Re: [PATCH v3 4/4] VSOCK: Add Makefile and Kconfig

2015-12-11 Thread Alex Bennée
Stefan Hajnoczi writes: > From: Asias He > > Enable virtio-vsock and vhost-vsock. > > Signed-off-by: Asias He > Signed-off-by: Stefan Hajnoczi > --- > v3: > * Don't put vhost vsock driver into staging > * Add

Re: [PATCH 2/5] x86, vdso, pvclock: Simplify and speed up the vdso pvclock reader

2015-12-11 Thread Andy Lutomirski
On Fri, Dec 11, 2015 at 12:42 AM, Paolo Bonzini wrote: > > > On 11/12/2015 08:52, Ingo Molnar wrote: >> >> * Paolo Bonzini wrote: >>> >>> Reviewed-by: Paolo Bonzini >> >> Thanks. I've added your Reviewed-by to the 1/5 patch as well

Re: [PATCH kvm-unit-tests] x86: always inline functions called after set_exception_return

2015-12-11 Thread David Matlack
On Wed, Dec 9, 2015 at 7:02 AM, Paolo Bonzini wrote: > On 07/12/2015 21:36, David Matlack wrote: >> set_exception_return forces exceptions handlers to return to a specific >> address instead of returning to the instruction address pushed by the >> CPU at the time of the

Re: [PATCH v3 07/22] arm64: KVM: Implement system register save/restore

2015-12-11 Thread Marc Zyngier
Hi Mario, On 11/12/15 03:24, Mario Smarduch wrote: > Hi Marc, > > On 12/7/2015 2:53 AM, Marc Zyngier wrote: >> Implement the system register save/restore as a direct translation of >> the assembly code version. >> >> Signed-off-by: Marc Zyngier >> Reviewed-by: Christoffer

Re: [PATCH 2/5] x86, vdso, pvclock: Simplify and speed up the vdso pvclock reader

2015-12-11 Thread Paolo Bonzini
On 11/12/2015 08:52, Ingo Molnar wrote: > > * Paolo Bonzini wrote: > >> >> >> On 10/12/2015 00:12, Andy Lutomirski wrote: >>> From: Andy Lutomirski >>> >>> The pvclock vdso code was too abstracted to understand easily and >>> excessively paranoid.

Re: [PATCH v3 03/22] arm64: KVM: Implement vgic-v2 save/restore

2015-12-11 Thread Christoffer Dall
On Mon, Dec 07, 2015 at 10:53:19AM +, Marc Zyngier wrote: > Implement the vgic-v2 save restore (mostly) as a direct translation > of the assembly code version. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/Makefile | 1 + > arch/arm64/kvm/hyp/Makefile

Re: [PATCH v3 04/22] KVM: arm/arm64: vgic-v3: Make the LR indexing macro public

2015-12-11 Thread Christoffer Dall
On Mon, Dec 07, 2015 at 10:53:20AM +, Marc Zyngier wrote: > We store GICv3 LRs in reverse order so that the CPU can save/restore > them in rever order as well (don't ask why, the design is crazy), s/rever/reverse/ > and yet generate memory traffic that doesn't completely suck. > > We need

Re: [PATCH v3 05/22] arm64: KVM: Implement vgic-v3 save/restore

2015-12-11 Thread Christoffer Dall
write_gicreg(cpu_if->vgic_lr[VGIC_V3_LR_INDEX(9)], ICH_LR9_EL2); > + case 8: > + write_gicreg(cpu_if->vgic_lr[VGIC_V3_LR_INDEX(8)], ICH_LR8_EL2); > + case 7: > + write_gicreg(cpu_if->vgic_lr[VGIC_V3_LR_INDEX(7)], ICH_LR7_EL2); > + case 6: > + write_gic

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Bandan Das
Paolo Bonzini writes: > On 10/12/2015 18:58, Bandan Das wrote: >>> > Allowing userspace to stop the guest with an emulation failure is a >> This one I don't :) Userspace started the guest after all, there are other >> ways for it to kill the guest if it wanted to. > > I mean

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 19:09, Borislav Petkov wrote: > On Thu, Dec 10, 2015 at 06:38:57PM +0100, Paolo Bonzini wrote: >> Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a >> lockdep splat. >> >> Cc: sta...@vger.kernel.org >> Reported-by: Borislav Petkov >>

<    1   2   3   4   5   6   7   8   9   10   >