From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756572AbcGGLQP (ORCPT ); Thu, 7 Jul 2016 07:16:15 -0400 Received: from merlin.infradead.org ([205.233.59.134]:35811 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752616AbcGGLQN (ORCPT ); Thu, 7 Jul 2016 07:16:13 -0400 Date: Thu, 7 Jul 2016 13:15:54 +0200 From: Peter Zijlstra To: Wanpeng Li Cc: Paolo Bonzini , Pan Xinhui , linux-s390 , Davidlohr Bueso , mpe@ellerman.id.au, boqun.feng@gmail.com, will.deacon@arm.com, "linux-kernel@vger.kernel.org" , Waiman Long , virtualization@lists.linux-foundation.org, Ingo Molnar , Paul Mackerras , benh@kernel.crashing.org, schwidefsky@de.ibm.com, Paul McKenney , linuxppc-dev@lists.ozlabs.org, kvm Subject: Re: [PATCH v2 0/4] implement vcpu preempted check Message-ID: <20160707111554.GV30921@twins.programming.kicks-ass.net> References: <1467124991-13164-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <20160706065255.GH30909@twins.programming.kicks-ass.net> <14a24854-9787-e4a1-c9a8-76eba4e97301@redhat.com> <8e8edf1b-b64b-3c44-b580-b9271663844c@redhat.com> <20160707094215.GT30921@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 07, 2016 at 06:27:26PM +0800, Wanpeng Li wrote: > In addition, I see xen's vcpu_runstate_info::state is updated during > schedule, so I think I can do this similarly through kvm preemption > notifier. IIUC, xen hypervisor has VCPUOP_get_runstate_info hypercall > implemention, so the desired interface can be implemented if they add > hypercall callsite in domU. I can add hypercall to kvm similarly. So I suspect Xen has the page its writing to pinned in memory; so that a write to it is guaranteed to not fault. Otherwise I cannot see this working. That is part of the larger surgery required for KVM steal time to get 'fixed'. Currently that steal time stuff uses kvm_write_guest_cached() which appears to be able to fault in guest pages. Or I'm not reading this stuff right; which is entirely possible.