Message ID | 1463873638-6807-3-git-send-email-suravee.suthikulpanit@amd.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp554749qge; Sat, 21 May 2016 16:35:55 -0700 (PDT) X-Received: by 10.176.65.68 with SMTP id j62mr4868831uad.106.1463873755527; Sat, 21 May 2016 16:35:55 -0700 (PDT) Return-Path: <xen-devel-bounces@lists.xen.org> Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 80si5881761uas.17.2016.05.21.16.35.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 May 2016 16:35:55 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@amdcloud.onmicrosoft.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from <xen-devel-bounces@lists.xen.org>) id 1b4GPX-0000wf-QV; Sat, 21 May 2016 23:34:23 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from <Suravee.Suthikulpanit@amd.com>) id 1b4GPW-0000vg-JD for xen-devel@lists.xen.org; Sat, 21 May 2016 23:34:22 +0000 Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id 1C/A0-03753-D70F0475; Sat, 21 May 2016 23:34:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLKsWRWlGSWpSXmKPExsUy1yIvWrfqg0O 4wb0GDYslHxezODB6HN39mymAMYo1My8pvyKBNWPW6eWMBf/4KlZPmsfYwDiBp4uRi4NFoJ1Z 4sm5uWwgDqNAP6PEnm1HWEAcIYFDjBLPO1awdzFycrAJqEosvbsPzBYRyJJ48W0mmM0s4Clxc sEVZhBbWCBW4mvHbUYQmwWo/mrrSlYQm1fAR+LnndssILaEgJzEyWOTweKcAr4SV3umgtULAd Vc376RHaJeUOLkzCcsEPMlJA6+eMEM0asgsf37d7BLJQTaGCUObjkG1awlcfnIQTaIIl+JNzc Xs0IULWeT+LZkOlA3B5DjJnH/ng5E/AK7xNqpj6CmZkvMa4T4UgJo0LqrH5khinYwSuy8eQNq qoxE+6azUFPnskhsn7QL6o7LXBKvP01lh3Des0r8XTkDapaExPzTjVA7/CW+tbVAxY0k3v1bw AphO0hcuj+TdQKjwiwkj89C8vgCRqZVjOrFqUVlqUW65npJRZnpGSW5iZk5uoaGJnq5qcXFie mpOYlJxXrJ+bmbGIFJgQEIdjB+WeJ8iFGSg0lJlDe12z5ciC8pP6UyI7E4I76oNCe1+BCjDAe HkgSv2HuHcCHBotT01Iq0zBxgeoJJS3DwKInwLnwHlOYtLkjMLc5Mh0idYtTluDD13lomIZa8 /LxUKXFecZAZAiBFGaV5cCNgqfISo6yUMC8j0FFCPAWpRbmZJajyrxjFORiVhHnfgaziycwrg dv0CugIJqAjHkqDHVGSiJCSamDcesL7Im9/v27l4yqTVb5Vfl6Hum0+687U7G6wu312tnaq7M Itxx/JPp46Pcbqz58MVsmimKAtru7N94LX/3toHnOh6+I82dvXuRW1F25SlVzveMyJk+PFj/C A3kmcp9YHtXq8DQtPE/yxtbma2anoU1fShvl651UitWKrpHJik79Eni26flCJpTgj0VCLuag4 EQAebLT8kAMAAA== X-Env-Sender: Suravee.Suthikulpanit@amd.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1463873657!43055945!2 X-Originating-IP: [157.56.110.91] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 53875 invoked from network); 21 May 2016 23:34:18 -0000 Received: from mail-bn1on0091.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (157.56.110.91) by server-12.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 21 May 2016 23:34:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bttQxBokcodSjUEavvM4KoE6QAd0MmEqOfiby0m6G5E=; b=rYAKPCEZ0GIlcB40xH4fW0J1zcuAJNdAdbSf3OASu7dID5cwEe0fBxibsSEBF1GmxDsoo2sZfWU2hi1cY4cN+sxlNDNmW15tnp1UiF6lkng2Ei0DYbYbB4JbQd23sJY022l8w9+4AVVVz8j88TA76BXfbDciwixKS24SBDtdutY= Received: from ssuthiku-cz-dev.amd.com (165.204.77.1) by BLUPR12MB0434.namprd12.prod.outlook.com (10.162.92.14) with Microsoft SMTP Server (TLS) id 15.1.497.12; Sat, 21 May 2016 23:34:15 +0000 From: <suravee.suthikulpanit@amd.com> To: <xen-devel@lists.xen.org>, <paul.durrant@citrix.com>, <jbeulich@suse.com>, <george.dunlap@citrix.com> Date: Sat, 21 May 2016 18:33:57 -0500 Message-ID: <1463873638-6807-3-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463873638-6807-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1463873638-6807-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR07CA0023.namprd07.prod.outlook.com (10.162.170.161) To BLUPR12MB0434.namprd12.prod.outlook.com (10.162.92.14) X-MS-Office365-Filtering-Correlation-Id: cb2d4339-a2d5-4100-4118-08d381d06c26 X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 2:unHq7D3ZYbfYjlJRfma0R4Uu4UOVXkvevcUukI7HYo9wlsCbNq/JZZpiG7R6R9sCm7CSKlQB5jRbsvHIhQAjAcXXHc1ucPJQxXRwutZk0UOzdHWIW1omHlEyGbsZasBvCQDKqt0/yVontTQoEYFlASVvCwd9VC+fS2Gn01j//aEBYgVtNGMmegj/SwK6SFvq; 3:eMrk0WefSL3AV0GiSILmjw+bwFDgK72EKkG9Y6kx7auTGIGZiOZrZ2ocq13acG8YsR9aUTQA9+vnYAbBSTjqgzr76ctaAxwgDTZgbW5qvPypVTpXegj905dPXBDrK+pN; 25:TRmMCnbTfHrUlrbelAwOLWP+T4GKFK92GmuPAheyvy3c9wQGSUN/Q8+k3iOHZHDW8p25FO0ACikL0TY8uKJcDX1fgedS50zufOveeoP/hEj+OmXNcI9gw9CJReWnM259c4+3p5qiCx8VEVoSBRFk/lqAa7RrrfBnhmCMPE+BOf0NjHdGUija+/c0OGBFnGTzz5IC/t7pYHFHKURMvUQHtPT9W45X1n5X7XbVisd3vpsOuSfU0RUCY8hsWF1anzDVPm/ME0Mxu4rH+AiMgcKPYCeB1yRaNC+8n+b7zOJRrf+O7fS21lx0XEGclrXRdUEV+Aze53Iemgj/L9PaxqXh30vJQBEuMj92Fc3w4/frJqqpvYNJnanFNHnCVfOXFP52WWr0srzJrQEc/S3Y8CXapEgiT4SHlhlaw2hqctO1MjI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0434; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 20:0qx/T73xgeISYY7nrtFnE12F8jBkOPoRZno6JDARmbwVf4QNgrR15k3ktOhWgpv0knfhGgSwRv3k7tKa9A/n70enwgTdCWOLB6i2YeaN+FZyq6WJq9YvoxZeVurlibQEA9IrlYtalJoy5snTx1HL5cPAz3AewQFdqaCarZxK270JWA7/rHaYzUkCLmJY7atLpYWAnmlWDBifnWhz0E2dx+00QPviykFDZWqlFOT7wAHLcqSu2WSK+LEgSC/2OlpwzasiqBJxtfNoVN6Cl1JKnuV+zkGCLGzXfe0+O9xC59tqQmUJl15FHhUEeKXbLI7chBsSlAZaVLi1W6cXe7Ly3ThlsM01ca25iWNW9klH3maGMaAz0fl2PLoNTdAk7IdyMjyMb7iZOiDn6gNWcy4HU1cq1ygsOI0HjHZMHjqi4ZxTkxTVT66rs6MjPpO23KUgBkrG2MRYgWA+jCiztwwRvl1Uw3VeZpCpm8VVgL70MIef3sGvOcvUNqiocEZrd3k7; 4:xkCbw1uaX2EdjeRXed2nXEYsP0GCAsfpX3bj7jDYw7/RRjdCZx64J993K/3l4ngFVHYZEkLmKq2W9syGX55itNM1sohl2Xunxxr1p97ljWxDaS4mUNFKwtqIJ3A8Bre2XIJek0mo9tBB1FdGs2gx3wYmQpbP6/itFxVF9kVU9+/dKkWjaE8DH/pORtvNYdZ8RirxC2+FKw1chvPeDJ8wtSX3v+Se6vXA7m+KHgMYSqiXZ2rEA+qJ7koahYhKp5Rah3WK2AQwdztZE19pcl+8LbahlQmFIBlsDKpdJhz2WqCBh6bhnutU66WxPtadYQlkcKml6iwW9SHUsoyx+yY6gC1UQpYxYRiEjLcNi/FoUn5gw1spKsVZYjXYiRwmkqyHpZcJc4+z5eS/XA8K+rRHFA== X-Microsoft-Antispam-PRVS: <BLUPR12MB043465220FE352DF16606323F34C0@BLUPR12MB0434.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BLUPR12MB0434; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0434; X-Forefront-PRVS: 09497C15EB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6116002)(189998001)(3846002)(4326007)(50466002)(86362001)(48376002)(5001770100001)(2876002)(50986999)(76176999)(5003940100001)(86152002)(2950100001)(2201001)(47776003)(42186005)(53416004)(33646002)(8666003)(66066001)(36756003)(5008740100001)(2906002)(50226002)(586003)(19580395003)(77096005)(229853001)(92566002)(19580405001)(5004730100002)(8676002)(81166006)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0434; H:ssuthiku-cz-dev.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR12MB0434; 23:eNJBVDYs/wezG+8tk+OaK/6FMM5lMPz3XcMBcOEiF?= =?us-ascii?Q?EKXGFo3fGglESNVJj97RbdwQK2xzMO+Hm72/V8fBGfrEpmnJzHF5Ufw2eKoT?= =?us-ascii?Q?8EJO798Tpk+y4z1D79YvJL/MHZerEbdII3wHw0+By3wBUsRwNGpALiVzI/Hf?= =?us-ascii?Q?jHwox50o+ieo+G1tMflfqgDr/M6BBN6nV6zNx3hD8Yp5oQkYQT9ptSeK5PSx?= =?us-ascii?Q?7rc4P1v/3srYJWSHrD1JmAGXrMEVUloWY52ivygfO3et5b44ZNUS3KmKrKWT?= =?us-ascii?Q?YKtd4J3Xg1AT9WZ/gVwNQiT/KOHOJhUq1n8l0OAiiq4UEdYasn2r1L4jH4aX?= =?us-ascii?Q?BUDIVU9A5tVOc7o/8ZZKGmrUd/H89gOAtQIHIJlx7ouwFZmZwTo3BsmK4sOy?= =?us-ascii?Q?9qcdxcQUkhouUDLpq9wV5vszGiDUsR+5td5RxccAdxUXCH3kcgGrBEJMqwgH?= =?us-ascii?Q?ouxBvJPBaWAJdN8LcDcRsH/Mb/aDmZHyL6dlOiiipFEo4k11/vG597ezpnMR?= =?us-ascii?Q?2E/m9SGaTMwYLUAEN9iRqmgqOlP7mx2GKTh+TkTzzMy0wAfGNwQbyOeZkiqe?= =?us-ascii?Q?Fg10ztZPCOdsr0BVMX3wPBhg+VVExd5Sp0rtYy31Zm7ChuPj+BXFErA8mCpc?= =?us-ascii?Q?mCByCWsT1QJQG/eOqJEiWVsQZ4j5GieazYgInE4oQKKbgqpTNWgNDe9V2gt+?= =?us-ascii?Q?N7sfFIs/XGl0YRK0KIJGV5vq3P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8jd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2016 23:34:15.2780 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0434 Cc: keir@xen.org, Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Subject: [Xen-devel] [PATCH v3 2/3] svm: iommu: Only call guest_iommu_init() after initialized HVM domain X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xen.org> List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xen.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xen.org> List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help> List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xen.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" <xen-devel-bounces@lists.xen.org> |
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 5af2cc5..0260e01 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -642,9 +642,6 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags, if ( (rc = init_domain_irq_mapping(d)) != 0 ) goto fail; - - if ( (rc = iommu_domain_init(d)) != 0 ) - goto fail; } spin_lock_init(&d->arch.e820_lock); @@ -660,6 +657,9 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags, /* 64-bit PV guest by default. */ d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0; + if ( !is_idle_domain(d) && (rc = iommu_domain_init(d)) != 0 ) + goto fail_1; + /* initialize default tsc behavior in case tools don't */ tsc_set_info(d, TSC_MODE_DEFAULT, 0UL, 0, 0); spin_lock_init(&d->arch.vtsc_lock); @@ -675,6 +675,9 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags, return 0; + fail_1: + if ( has_hvm_container_domain(d) ) + hvm_domain_destroy(d); fail: d->is_dying = DOMDYING_dead; psr_domain_free(d);