All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Wang <wei.wang2@amd.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 7 of 7 V4] libxl: Introduce a new guest config file parameter
Date: Fri, 20 Jan 2012 16:57:09 +0100	[thread overview]
Message-ID: <4F198ED5.6090902@amd.com> (raw)
In-Reply-To: <e71836563bfabed56c01.1327074287@gran.amd.com>

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1327074009 -3600
# Node ID e71836563bfabed56c0140ad0bcaab517d82c894
# Parent  a768bb39d0bc64360055e7fce0e890be71920e63
libxl: Introduce a new guest config file parameter
Use guest_iommu = {1,0} to enable or disable guest iommu emulation.
Default value is 0.

Signed-off-by: Wei Wang <wei.wang2@amd.com>

diff -r a768bb39d0bc -r e71836563bfa docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Fri Jan 20 14:40:32 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Fri Jan 20 16:40:09 2012 +0100
@@ -820,6 +820,10 @@ certainly belong in a more appropriate s

  Enable graphics device PCI passthrough. XXX which device is passed 
through ?

+=item B<guest_iommu=BOOLEAN>
+
+Enable virtual iommu device for hvm guest. It should be enabled to 
passthrough AMD GPGPU.
+
  =item B<nomigrate=BOOLEAN>

  Disable migration of this domain.  This enables certain other features
diff -r a768bb39d0bc -r e71836563bfa tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Jan 20 14:40:32 2012 +0100
+++ b/tools/libxl/libxl_create.c	Fri Jan 20 16:40:09 2012 +0100
@@ -93,6 +93,7 @@ int libxl_init_build_info(libxl_ctx *ctx
          b_info->u.hvm.timer_mode = 1;
          b_info->u.hvm.nested_hvm = 0;
          b_info->u.hvm.no_incr_generationid = 0;
+        b_info->u.hvm.guest_iommu = 0;
          break;
      case LIBXL_DOMAIN_TYPE_PV:
          b_info->u.pv.slack_memkb = 8 * 1024;
@@ -183,13 +184,15 @@ int libxl__domain_build(libxl__gc *gc,
          vments[4] = "start_time";
          vments[5] = libxl__sprintf(gc, "%lu.%02d", 
start_time.tv_sec,(int)start_time.tv_usec/10000);

-        localents = libxl__calloc(gc, 7, sizeof(char *));
+        localents = libxl__calloc(gc, 9, sizeof(char *));
          localents[0] = "platform/acpi";
          localents[1] = (info->u.hvm.acpi) ? "1" : "0";
          localents[2] = "platform/acpi_s3";
          localents[3] = (info->u.hvm.acpi_s3) ? "1" : "0";
          localents[4] = "platform/acpi_s4";
          localents[5] = (info->u.hvm.acpi_s4) ? "1" : "0";
+        localents[6] = "guest_iommu";
+        localents[7] = (info->u.hvm.guest_iommu) ? "1" : "0";

          break;
      case LIBXL_DOMAIN_TYPE_PV:
diff -r a768bb39d0bc -r e71836563bfa tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Jan 20 14:40:32 2012 +0100
+++ b/tools/libxl/libxl_types.idl	Fri Jan 20 16:40:09 2012 +0100
@@ -185,6 +185,7 @@ libxl_domain_build_info = Struct("domain
                                         ("timer_mode", integer),
                                         ("nested_hvm", bool),
                                         ("no_incr_generationid", bool),
+                                       ("guest_iommu", bool),
                                         ])),
                   ("pv", Struct(None, [("kernel", libxl_file_reference),
                                        ("slack_memkb", uint32),
diff -r a768bb39d0bc -r e71836563bfa tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Jan 20 14:40:32 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Jan 20 16:40:09 2012 +0100
@@ -768,6 +768,8 @@ static void parse_config_data(const char
              b_info->u.hvm.timer_mode = l;
          if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
              b_info->u.hvm.nested_hvm = l;
+        if (!xlu_cfg_get_long (config, "guest_iommu", &l, 0))
+            b_info->u.hvm.guest_iommu = l;
          break;
      case LIBXL_DOMAIN_TYPE_PV:
      {
_______________________________________________
osrc-patches mailing list
osrc-patches@elbe.amd.com
https://elbe.amd.com/mailman/listinfo/osrc-patches

           reply	other threads:[~2012-01-20 15:57 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <e71836563bfabed56c01.1327074287@gran.amd.com>]

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=4F198ED5.6090902@amd.com \
    --to=wei.wang2@amd.com \
    --cc=xen-devel@lists.xensource.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.