kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Amos Kong <akong@redhat.com>
Cc: seabios@seabios.org, kvm@vger.kernel.org, mst@redhat.com,
	jasowang@redhat.com, alex williamson <alex.williamson@redhat.com>
Subject: Re: [SeaBIOS] [SeaBIOS PATCH 2/2] hotplug: Add device per func in ACPI DSDT tables
Date: Mon, 19 Sep 2011 12:57:33 +0300	[thread overview]
Message-ID: <20110919095733.GO21417@redhat.com> (raw)
In-Reply-To: <a47a5d18-c5eb-4a98-bc23-385bddb6e920@zmail05.collab.prod.int.phx2.redhat.com>

On Mon, Sep 19, 2011 at 03:27:38AM -0400, Amos Kong wrote:
> 
> Only func 0 is registered to guest driver (we can
> only found func 0 in slot->funcs list of driver),
> the other functions could not be cleaned when
> hot-removing the whole slot. This patch adds
> device per function in ACPI DSDT tables.
> 
You can't unplug a single function. Guest surely knows that.

> Have tested with linux/winxp/win7, hot-adding/hot-remving,
> single/multiple function device, they are all fine.
> 
What was not fine before?

Have you looked at real HW that supports PCI hot plug DSDT? Does it
looks the same?

> new acpi-dst.hex(332K):
> http://amos-kong.rhcloud.com/pub/acpi-dsdt.hex
> 
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
>  src/acpi-dsdt.dsl |   31 +++++++++++++++++++++++++------
>  1 files changed, 25 insertions(+), 6 deletions(-)
> 
> diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
> index 08412e2..d1426ec 100644
> --- a/src/acpi-dsdt.dsl
> +++ b/src/acpi-dsdt.dsl
> @@ -128,9 +128,9 @@ DefinitionBlock (
>                  PCRM, 32,
>              }
>  
> -#define hotplug_slot(name, nr) \
> -            Device (S##name) {                    \
> -               Name (_ADR, nr##0000)              \
> +#define hotplug_func(name, nr, adr, fn) \
> +            Device (S##name##fn) {                \
> +               Name (_ADR, adr)                    \
>                 Method (_EJ0,1) {                  \
>                      Store(ShiftLeft(1, nr), B0EJ) \
>                      Return (0x0)                  \
> @@ -138,6 +138,16 @@ DefinitionBlock (
>                 Name (_SUN, name)                  \
>              }
>  
> +#define hotplug_slot(name, nr) \
> +	    hotplug_func(name, nr, nr##0000, 0)  \
> +	    hotplug_func(name, nr, nr##0001, 1)  \
> +	    hotplug_func(name, nr, nr##0002, 2)  \
> +	    hotplug_func(name, nr, nr##0003, 3)  \
> +	    hotplug_func(name, nr, nr##0004, 4)  \
> +	    hotplug_func(name, nr, nr##0005, 5)  \
> +	    hotplug_func(name, nr, nr##0006, 6)  \
> +	    hotplug_func(name, nr, nr##0007, 7)
> +
>  	    hotplug_slot(1, 0x0001)
>  	    hotplug_slot(2, 0x0002)
>  	    hotplug_slot(3, 0x0003)
> @@ -842,13 +852,22 @@ DefinitionBlock (
>              Return(0x01)
>          }
>  
> -#define gen_pci_hotplug(nr)                                       \
> +#define gen_pci_hotplug_func(nr, fn)                              \
>              If (And(\_SB.PCI0.PCIU, ShiftLeft(1, nr))) {          \
> -                Notify(\_SB.PCI0.S##nr, 1)                        \
> +                Notify(\_SB.PCI0.S##nr##fn, 1)                    \
>              }                                                     \
>              If (And(\_SB.PCI0.PCID, ShiftLeft(1, nr))) {          \
> -                Notify(\_SB.PCI0.S##nr, 3)                        \
> +                Notify(\_SB.PCI0.S##nr##fn, 3)                    \
>              }
> +#define gen_pci_hotplug(nr) \
> +	    gen_pci_hotplug_func(nr, 0)    \
> +	    gen_pci_hotplug_func(nr, 1)    \
> +	    gen_pci_hotplug_func(nr, 2)    \
> +	    gen_pci_hotplug_func(nr, 3)    \
> +	    gen_pci_hotplug_func(nr, 4)    \
> +	    gen_pci_hotplug_func(nr, 5)    \
> +	    gen_pci_hotplug_func(nr, 6)    \
> +	    gen_pci_hotplug_func(nr, 7)
>  
>          Method(_L01) {
>              gen_pci_hotplug(1)
> -- 
> 1.7.6.1
> 
> _______________________________________________
> SeaBIOS mailing list
> SeaBIOS@seabios.org
> http://www.seabios.org/mailman/listinfo/seabios

--
			Gleb.

  reply	other threads:[~2011-09-19  9:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19  6:53 [SEABIOS PATCH 0/2] fix of hotplug multi-func device Amos Kong
2011-09-19  6:53 ` [SeaBIOS PATCH 1/2] Fix regression of commit 87b533bf Amos Kong
2011-09-19  7:27   ` [SeaBIOS PATCH 2/2] hotplug: Add device per func in ACPI DSDT tables Amos Kong
2011-09-19  9:57     ` Gleb Natapov [this message]
2011-09-19 10:02       ` [SeaBIOS] " Michael S. Tsirkin
2011-09-19 10:12         ` Gleb Natapov
2011-09-19 10:32           ` Gleb Natapov
2011-09-19 12:18             ` [SeaBIOS] " Michael S. Tsirkin
2011-09-19 16:27         ` Marcelo Tosatti
2011-09-19 19:08           ` Michael S. Tsirkin
2011-09-20 10:45             ` [SeaBIOS PATCH v2] " Amos Kong
2011-09-20 11:47               ` Marcelo Tosatti
2011-09-21  1:48               ` Kevin O'Connor
2011-09-21  5:39                 ` Amos Kong
2011-09-21 11:09                   ` Michael S. Tsirkin
2011-09-21 12:47                     ` Kevin O'Connor
2011-09-21 13:14                       ` Michael S. Tsirkin
2011-12-06  5:39                         ` [SeaBIOS PATCH v3] " Amos Kong
2011-12-06 11:36                           ` Michael S. Tsirkin
2011-12-07  0:32                             ` Amos Kong
2011-12-14  1:06                               ` Kevin O'Connor
2011-12-19  8:45                                 ` Amos Kong
2011-09-20 10:44           ` [SeaBIOS PATCH] " Amos Kong
2011-09-20 11:42             ` Marcelo Tosatti
2011-09-20  8:00   ` [SeaBIOS PATCH v2] Fix regression of commit 87b533bf Amos Kong
2011-09-20 23:52     ` Kevin O'Connor
     [not found] ` <20110919065347.22802.53640.stgit@t>
     [not found]   ` <20110919093644.GC4501@redhat.com>
2011-09-19  9:49     ` [SeaBIOS PATCH 2/2] hotplug: Add device per func in ACPI DSDT tables Michael S. Tsirkin
2011-09-19 10:04     ` Michael S. Tsirkin

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=20110919095733.GO21417@redhat.com \
    --to=gleb@redhat.com \
    --cc=akong@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=seabios@seabios.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).