From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/6] kdump: crash-time virt disable function Date: Thu, 30 Oct 2008 15:50:31 +0200 Message-ID: <4909BBA7.1020307@redhat.com> References: <1225373687-6960-1-git-send-email-ehabkost@redhat.com> <1225373687-6960-2-git-send-email-ehabkost@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Andrew Morton , kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Haren Myneni , Simon Horman , "Eric W. Biederman" , Vivek Goyal To: Eduardo Habkost Return-path: In-Reply-To: <1225373687-6960-2-git-send-email-ehabkost-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kexec-bounces-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Errors-To: kexec-bounces+glkk-kexec=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: kvm.vger.kernel.org Eduardo Habkost wrote: > This patch adds an interface to set a function to be called on crash time, > on each CPU. The function will be set by code that enables virtualization > extensions on the CPUs (i.e. KVM). It will be called once on each CPU > by machine_crash_shutdown(), and should do the very least to disable > virt extensions on the CPU where it is being called. > > The function will be used by KVM to disable virtualization before halting > the CPUs, otherwise the booting of the kdump kernel may hang. It does > hang, when vmx is enabled, and I wouldn't be surprised if having svm > enabled also causes problems. > > The functions that set the function pointer uses RCU synchronization, > just in case the crash NMI is triggered while KVM is unloading. > > We can't just use the same notifiers used at reboot time (that are used > by non-crash-dump kexec), because at crash time some CPUs may have IRQs > disabled, so we can't use IPIs. The crash shutdown code use NMIs to > tell the other CPUs to be halted, so the notifier call is hooked into > the CPU halting code that is on the crash shutdown NMI handler. > > +static void (*virt_disable_fn)(unsigned int cpu); > Since you never use the cpu argument, I suggest dropping it. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.