All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3][RFC] PV Passthrough PCI Device Hotplug Support (Tools Part)
@ 2008-02-21 11:01 Yosuke Iwamatsu
  2008-02-22 10:04 ` Keir Fraser
  0 siblings, 1 reply; 8+ messages in thread
From: Yosuke Iwamatsu @ 2008-02-21 11:01 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

Tools part of PV PCI hotplug, applied to xen-unstable.hg cs17042.

Most of this part will be changed to adjust latest xen-unstable,
since there already exists HVM PCI hotplug code.

Thanks,
-------------------
Yosuke Iwamatsu
        NEC Corporation


[-- Attachment #2: pv_pcihp_tools.patch --]
[-- Type: all/allfiles, Size: 19740 bytes --]

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3][RFC] PV Passthrough PCI Device Hotplug Support (Tools Part)
  2008-02-21 11:01 [PATCH 1/3][RFC] PV Passthrough PCI Device Hotplug Support (Tools Part) Yosuke Iwamatsu
@ 2008-02-22 10:04 ` Keir Fraser
  2008-02-22 10:19   ` Yosuke Iwamatsu
  0 siblings, 1 reply; 8+ messages in thread
From: Keir Fraser @ 2008-02-22 10:04 UTC (permalink / raw)
  To: Yosuke Iwamatsu, xen-devel

On 21/2/08 11:01, "Yosuke Iwamatsu" <y-iwamatsu@ab.jp.nec.com> wrote:

> Tools part of PV PCI hotplug, applied to xen-unstable.hg cs17042.
> 
> Most of this part will be changed to adjust latest xen-unstable,
> since there already exists HVM PCI hotplug code.

I applied the other two patches (the Xen and Linux pieces) so please just
re-submit this one.

 -- Keir

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3][RFC] PV Passthrough PCI Device Hotplug Support (Tools Part)
  2008-02-22 10:04 ` Keir Fraser
@ 2008-02-22 10:19   ` Yosuke Iwamatsu
  2008-03-10  1:19     ` [PATCH] " Yosuke Iwamatsu
  0 siblings, 1 reply; 8+ messages in thread
From: Yosuke Iwamatsu @ 2008-02-22 10:19 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

Keir Fraser wrote:
> On 21/2/08 11:01, "Yosuke Iwamatsu" <y-iwamatsu@ab.jp.nec.com> wrote:
> 
>> Tools part of PV PCI hotplug, applied to xen-unstable.hg cs17042.
>>
>> Most of this part will be changed to adjust latest xen-unstable,
>> since there already exists HVM PCI hotplug code.
> 
> I applied the other two patches (the Xen and Linux pieces) so please just
> re-submit this one.

Thanks!
Now I'm going to look into xend and see how I can get along with
the existing HVM pcihp code.

-- Yosuke

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] PV Passthrough PCI Device Hotplug Support (Tools Part)
  2008-02-22 10:19   ` Yosuke Iwamatsu
@ 2008-03-10  1:19     ` Yosuke Iwamatsu
  2008-03-10  2:04       ` [PATCH] PV Passthrough PCI Device Hotplug Support(Tools Part) Masaki Kanno
  2008-03-10  7:17       ` [PATCH] PV Passthrough PCI Device Hotplug Support (Tools Part) Zhai, Edwin
  0 siblings, 2 replies; 8+ messages in thread
From: Yosuke Iwamatsu @ 2008-03-10  1:19 UTC (permalink / raw)
  To: Keir Fraser, xen-devel, Zhai, Edwin

[-- Attachment #1: Type: text/plain, Size: 1487 bytes --]

Hi,

This is the updated patch of PV PCI passthrough hotplug (tools portion).

Changes to xm command:
- Let 'xm pci-attach' command use <domain:bus:slot.func> expression
   rather than use separated arguments like <domain> <bus> <slot> <func>.
   This is the same expression of the domain configuration file and I
   believe it is more user-friendly.
- Let 'xm pci-detach' command use the same <domain:bus:slot.func>
   expression. Formerly, <virtual slot> was used as the key to indicate
   which device we were detaching. But for the current implementation of
   PV PCI hotplug, virtual slots don't have much meaning. I think using
   the same physical device name in both attachment and detachment is
   appropriate here.

Changes to xend:
- Both attach and detach commands are received by device_configure()
   and handled by pci_device_configure().
- HVM specific processings are done in hvm_pci_create_device() and
   hvm_destroyPCIDevice().

The major problem I encoutered during this work is that, I don't have
a vt-d enabled machine and could not confirm that HVM PCI hotplug would
still work after modifications :-(
Then I hacked libxc a little to pretend as if there existed a vt-d
hardware, and could see HVM PCI attach/detach working correctly.
So now I'm pretty sure that we can do both PV and HVM hotplugs with
this patch, but I would appreciate it if someone could test this on
a real vt-d machine.

Regards,
-------------------
Yosuke Iwamatsu
         NEC Corporation


[-- Attachment #2: pv_pcihp_tools_merge.patch --]
[-- Type: all/allfiles, Size: 31631 bytes --]

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PV Passthrough PCI Device Hotplug Support(Tools Part)
  2008-03-10  1:19     ` [PATCH] " Yosuke Iwamatsu
@ 2008-03-10  2:04       ` Masaki Kanno
  2008-03-10  2:26         ` Yosuke Iwamatsu
  2008-03-10  7:17       ` [PATCH] PV Passthrough PCI Device Hotplug Support (Tools Part) Zhai, Edwin
  1 sibling, 1 reply; 8+ messages in thread
From: Masaki Kanno @ 2008-03-10  2:04 UTC (permalink / raw)
  To: Yosuke Iwamatsu, Keir Fraser, xen-devel, Zhai, Edwin

Hi Iwamatsu,

 def xm_pci_detach(args):
-    arg_check(args, 'pci-detach', 2)
-    dom = args[0]
-    dev = args[1]
-    server.xend.domain.destroyDevice(dom, 'dpci', dev)
+    arg_check(args, 'pci-detach', 2, 2)  <----------------- here!!
+    (dom, pci) = parse_pci_configuration(args, 'Closing')
+    server.xend.domain.device_configure(dom, pci)
+

The last "2" is not necessary. 
With your patch, the following strange error message is shown. 

# xm pci-detach
Error: 'xm pci-detach' requires between 2 and 2 arguments.
                                ^^^^^^^^^^^^^^^
Usage: xm pci-detach  <Domain> <virtual slot>

Remove a domain's pass-through pci device.


Best regards,
 Kan

Mon, 10 Mar 2008 10:19:10 +0900, Yosuke Iwamatsu wrote:

>Hi,
>
>This is the updated patch of PV PCI passthrough hotplug (tools portion).
>
>Changes to xm command:
>- Let 'xm pci-attach' command use <domain:bus:slot.func> expression
>   rather than use separated arguments like <domain> <bus> <slot> <func>.
>   This is the same expression of the domain configuration file and I
>   believe it is more user-friendly.
>- Let 'xm pci-detach' command use the same <domain:bus:slot.func>
>   expression. Formerly, <virtual slot> was used as the key to indicate
>   which device we were detaching. But for the current implementation of
>   PV PCI hotplug, virtual slots don't have much meaning. I think using
>   the same physical device name in both attachment and detachment is
>   appropriate here.
>
>Changes to xend:
>- Both attach and detach commands are received by device_configure()
>   and handled by pci_device_configure().
>- HVM specific processings are done in hvm_pci_create_device() and
>   hvm_destroyPCIDevice().
>
>The major problem I encoutered during this work is that, I don't have
>a vt-d enabled machine and could not confirm that HVM PCI hotplug would
>still work after modifications :-(
>Then I hacked libxc a little to pretend as if there existed a vt-d
>hardware, and could see HVM PCI attach/detach working correctly.
>So now I'm pretty sure that we can do both PV and HVM hotplugs with
>this patch, but I would appreciate it if someone could test this on
>a real vt-d machine.
>
>Regards,
>-------------------
>Yosuke Iwamatsu
>         NEC Corporation
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PV Passthrough PCI Device Hotplug Support(Tools Part)
  2008-03-10  2:04       ` [PATCH] PV Passthrough PCI Device Hotplug Support(Tools Part) Masaki Kanno
@ 2008-03-10  2:26         ` Yosuke Iwamatsu
  0 siblings, 0 replies; 8+ messages in thread
From: Yosuke Iwamatsu @ 2008-03-10  2:26 UTC (permalink / raw)
  To: Masaki Kanno; +Cc: Keir Fraser, xen-devel, Zhai, Edwin

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

Masaki Kanno wrote:
> Hi Iwamatsu,
> 
>  def xm_pci_detach(args):
> -    arg_check(args, 'pci-detach', 2)
> -    dom = args[0]
> -    dev = args[1]
> -    server.xend.domain.destroyDevice(dom, 'dpci', dev)
> +    arg_check(args, 'pci-detach', 2, 2)  <----------------- here!!
> +    (dom, pci) = parse_pci_configuration(args, 'Closing')
> +    server.xend.domain.device_configure(dom, pci)
> +
> 
> The last "2" is not necessary. 

All right.
The revised patch is attached.

-- Yosuke


[-- Attachment #2: pv_pcihp_tools_merge-r1.patch --]
[-- Type: all/allfiles, Size: 31591 bytes --]

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PV Passthrough PCI Device Hotplug Support (Tools Part)
  2008-03-10  1:19     ` [PATCH] " Yosuke Iwamatsu
  2008-03-10  2:04       ` [PATCH] PV Passthrough PCI Device Hotplug Support(Tools Part) Masaki Kanno
@ 2008-03-10  7:17       ` Zhai, Edwin
  2008-03-10 11:22         ` Yosuke Iwamatsu
  1 sibling, 1 reply; 8+ messages in thread
From: Zhai, Edwin @ 2008-03-10  7:17 UTC (permalink / raw)
  To: Yosuke Iwamatsu; +Cc: Keir Fraser, xen-devel, Zhai, Edwin

Yosuke,

Thanks for you work.
I have tested your patch works on HVM VT-d side.

One suggestion is error handling for user input. e.g. following input error 
should be caught by xm:

[root@vt-gang32 ~]# xm pci-attach EdwinHVMDomainVtd2 0:2.0.0    (should be 
0:2:0.0)

Error: pci: failed to locate device and parse it's resources - [Errno 2] No such 
file or directory: '/sys/bus/pci/devices/0000:00:02.0/driver'
Usage: xm pci-attach <Domain> <domain:bus:slot.func> [virtual slot]



On Mon, Mar 10, 2008 at 10:19:10AM +0900, Yosuke Iwamatsu wrote:
> Hi,
> 
> This is the updated patch of PV PCI passthrough hotplug (tools portion).
> 
> Changes to xm command:
> - Let 'xm pci-attach' command use <domain:bus:slot.func> expression
>   rather than use separated arguments like <domain> <bus> <slot> <func>.
>   This is the same expression of the domain configuration file and I
>   believe it is more user-friendly.
> - Let 'xm pci-detach' command use the same <domain:bus:slot.func>
>   expression. Formerly, <virtual slot> was used as the key to indicate
>   which device we were detaching. But for the current implementation of
>   PV PCI hotplug, virtual slots don't have much meaning. I think using
>   the same physical device name in both attachment and detachment is
>   appropriate here.
> 
> Changes to xend:
> - Both attach and detach commands are received by device_configure()
>   and handled by pci_device_configure().
> - HVM specific processings are done in hvm_pci_create_device() and
>   hvm_destroyPCIDevice().
> 
> The major problem I encoutered during this work is that, I don't have
> a vt-d enabled machine and could not confirm that HVM PCI hotplug would
> still work after modifications :-(
> Then I hacked libxc a little to pretend as if there existed a vt-d
> hardware, and could see HVM PCI attach/detach working correctly.
> So now I'm pretty sure that we can do both PV and HVM hotplugs with
> this patch, but I would appreciate it if someone could test this on
> a real vt-d machine.
> 
> Regards,
> -------------------
> Yosuke Iwamatsu
>         NEC Corporation
> 



-- 
best rgds,
edwin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PV Passthrough PCI Device Hotplug Support (Tools Part)
  2008-03-10  7:17       ` [PATCH] PV Passthrough PCI Device Hotplug Support (Tools Part) Zhai, Edwin
@ 2008-03-10 11:22         ` Yosuke Iwamatsu
  0 siblings, 0 replies; 8+ messages in thread
From: Yosuke Iwamatsu @ 2008-03-10 11:22 UTC (permalink / raw)
  To: Zhai, Edwin; +Cc: Keir Fraser, xen-devel

Zhai, Edwin wrote:
> Yosuke,
> 
> Thanks for you work.
> I have tested your patch works on HVM VT-d side.

I'm relieved to hear that. Thank you.

> 
> One suggestion is error handling for user input. e.g. following input error 
> should be caught by xm:
> 
> [root@vt-gang32 ~]# xm pci-attach EdwinHVMDomainVtd2 0:2.0.0    (should be 
> 0:2:0.0)
> 
> Error: pci: failed to locate device and parse it's resources - [Errno 2] No such 
> file or directory: '/sys/bus/pci/devices/0000:00:02.0/driver'
> Usage: xm pci-attach <Domain> <domain:bus:slot.func> [virtual slot]

Okay.
The small patch below should fix the issue.
(applied after the previous patch)

Thanks,
   Yosuke Iwamatsu

---------

xm: Fix parsing pci device name.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>

diff -r 9233270dfe6a tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py	Mon Mar 10 17:58:25 2008 +0900
+++ b/tools/python/xen/xm/main.py	Mon Mar 10 20:26:49 2008 +0900
@@ -2240,7 +2240,7 @@ def parse_pci_configuration(args, state)
      pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \
              r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
              r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + \
-            r"(?P<func>[0-9a-fA-F])", pci_dev_str)
+            r"(?P<func>[0-7])$", pci_dev_str)
      if pci_match == None:
          raise OptionError("Invalid argument: %s %s" % (pci_dev_str,vslt))
      pci_dev_info = pci_match.groupdict('0')

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-03-10 11:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-21 11:01 [PATCH 1/3][RFC] PV Passthrough PCI Device Hotplug Support (Tools Part) Yosuke Iwamatsu
2008-02-22 10:04 ` Keir Fraser
2008-02-22 10:19   ` Yosuke Iwamatsu
2008-03-10  1:19     ` [PATCH] " Yosuke Iwamatsu
2008-03-10  2:04       ` [PATCH] PV Passthrough PCI Device Hotplug Support(Tools Part) Masaki Kanno
2008-03-10  2:26         ` Yosuke Iwamatsu
2008-03-10  7:17       ` [PATCH] PV Passthrough PCI Device Hotplug Support (Tools Part) Zhai, Edwin
2008-03-10 11:22         ` Yosuke Iwamatsu

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.