All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khalid Aziz <khalid_aziz@hp.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	Neil Horman <nhorman@redhat.com>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	Simon Horman <horms@verge.net.au>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"linux-driver@qlogic.com" <linux-driver@qlogic.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Vivek Goyal <vgoyal@redhat.com>,
	Andrew Vasquez <andrew.vasquez@qlogic.com>
Subject: Re: In place kexec
Date: Fri, 30 Jul 2010 15:18:16 -0600	[thread overview]
Message-ID: <1280524696.30160.34.camel@localhost> (raw)
In-Reply-To: <4C533922.10901@zytor.com>

On Fri, 2010-07-30 at 20:42 +0000, H. Peter Anvin wrote:
> On 07/30/2010 09:53 AM, David Woodhouse wrote:
> > On Thu, 2010-07-29 at 21:41 -0700, Eric W. Biederman wrote:
> >> There isn't a bus master shut off at the core level.  
> > 
> > Effectively, there is if you have an IOMMU.
> 
> With the "core level" I meant Linux kernel code, as opposed to hardware
> level which is slightly different; I meant it would make sense to at
> least set the bus master control bit (PCI_COMMAND_MASTER) to zero before
> kexec.

Before kexec patch for ia64 was merged into mainline kernel, Zou Nan Hai
and I had added a device_shootdown() routine to arch/ia64/kernel/crash.c
that was called from machine_crash_shutdown(). device_shootdown() did
exactly what you are proposing:

+static void device_shootdown(void)
+{
+       struct pci_dev *dev;
+       irq_desc_t *desc;
+       u16 pci_command;
+
+       list_for_each_entry(dev, &pci_devices, global_list) {
+               desc = irq_descp(dev->irq);
+               if (!desc->action)
+                       continue;
+               pci_read_config_word(dev, PCI_COMMAND, &pci_command);
+               if (pci_command & PCI_COMMAND_MASTER) {
+                       pci_command &= ~PCI_COMMAND_MASTER;
+                       pci_write_config_word(dev, PCI_COMMAND, pci_command);
+               }
+               disable_irq_nosync(dev->irq);
+               desc->handler->end(dev->irq);
+       }
+}

There were some discussions regarding this and this code was removed by
the time it was merged into mainline kernel. I can't remember the
details of why. I remember one report of kernel hang on kexec that
seemed to happen in device_shootdown(). I will look for any discussion
threads I can find.

-- 
Khalid
====================================================================
Khalid Aziz                             Telco Platform Software, ISB
(970)898-9214                                        Hewlett-Packard
khalid.aziz@hp.com                                  Fort Collins, CO

"The Linux kernel is subject to relentless development" 
                                - Alessandro Rubini


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2010-07-30 21:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 21:57 In place kexec H. Peter Anvin
2010-07-28 22:02 ` Eric W. Biederman
2010-07-29 13:43   ` Neil Horman
2010-07-29 15:03     ` H. Peter Anvin
2010-07-29 15:06       ` Neil Horman
2010-07-29 17:51         ` H. Peter Anvin
2010-07-29 18:06           ` Eric W. Biederman
2010-07-29 18:29             ` H. Peter Anvin
2010-07-29 19:16               ` Vivek Goyal
2010-07-29 19:51                 ` Eric W. Biederman
2010-07-29 19:55                   ` Randy Dunlap
2010-07-30  3:38                     ` H. Peter Anvin
2010-07-30  4:41                       ` Eric W. Biederman
2010-07-30  5:04                         ` H. Peter Anvin
2010-07-30 16:30                           ` Eric W. Biederman
2010-07-30 16:41                             ` H. Peter Anvin
2010-07-30 18:36                               ` Eric W. Biederman
2010-07-30 22:52                                 ` Andrew Vasquez
2010-07-30 23:25                                   ` H. Peter Anvin
2010-07-30 23:40                                     ` Eric W. Biederman
2010-07-30 16:53                         ` David Woodhouse
2010-07-30 18:21                           ` Eric W. Biederman
2010-07-30 18:34                             ` Vivek Goyal
2010-07-30 18:50                               ` David Woodhouse
2010-07-30 18:56                                 ` Vivek Goyal
2010-07-30 19:17                                   ` David Woodhouse
2010-07-30 19:39                                     ` Eric W. Biederman
2010-07-30 19:46                                       ` David Woodhouse
2010-07-30 20:08                                         ` Eric W. Biederman
2010-07-30 20:15                                           ` David Woodhouse
2010-07-30 21:11                                             ` H. Peter Anvin
2010-07-30 20:42                           ` H. Peter Anvin
2010-07-30 21:18                             ` Khalid Aziz [this message]
2010-07-30 21:44                               ` Khalid Aziz
     [not found]                                 ` <20120425211512.GA8583@ldl.usa.hp.com>
2012-04-25 22:06                                   ` Vivek Goyal
2010-07-29 20:06                   ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1280524696.30160.34.camel@localhost \
    --to=khalid_aziz@hp.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=dwmw2@infradead.org \
    --cc=ebiederm@xmission.com \
    --cc=horms@verge.net.au \
    --cc=hpa@zytor.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-driver@qlogic.com \
    --cc=nhorman@redhat.com \
    --cc=randy.dunlap@oracle.com \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.