From patchwork Wed Jun 1 19:53:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 69065 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp280881qge; Wed, 1 Jun 2016 12:54:52 -0700 (PDT) X-Received: by 10.31.166.72 with SMTP id p69mr3016835vke.14.1464810892084; Wed, 01 Jun 2016 12:54:52 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 189si4486309vkv.141.2016.06.01.12.54.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2016 12:54:52 -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 ) id 1b8CCs-0002C6-Cg; Wed, 01 Jun 2016 19:53:34 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b8CCq-0002Aq-Eu for xen-devel@lists.xen.org; Wed, 01 Jun 2016 19:53:32 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 7C/10-06513-B3D3F475; Wed, 01 Jun 2016 19:53:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1WSe0gUcRDH77e3d7eaK+t56Whnj8OwREVPIks LQQv/OLMXHfqPrrV5J/eQ2zMu+iMlzexlIYIapqBGGpZGZqYIvirN8IkVPghM8BGlhp5YZrvu afbfzHy+M/MdGEIsX5N4E4zNylhMtEEldcZLwsxnA8OPxGmDS+qlYRXz5Xgkiuls+oWdRAkSv SnZbEuS6EpG27G0LJlt+v4EnoGypDeRM4FTOWKYePxazCeIykPQ/LID5xM51Yrg48oslzgRUm ovVI61yPhYQaXC1FKRjBeJqUwE84V9GA/cqShoG5vjgIyb6wtPtvFVktLA2kLW+higdkLXm3w JHztRsdBc28ItJrhdGqh44CfI3aCr6Ou6XEwBtE5NiYXW3dBgt6+bBiobwc/bOetATvnDYEer VBDFwuCXXFwQ2TH41PEB4xcAdRxmq3VCfVECT/sXHZPqcVitmHG4M0Du5DskNMRAc0mAUG5EM P6WFvR3cOitWXZYUkLP9yyZED/EoWouVoiHnGGl3uFiTgIDN144RACl7zMdzXFQMJGJ3UOq4i 1nF285uwxh1ciPZSyXGEugOijZok/RWY203hAYEhwaZGRYlk5hDHQyG3TebHyOuDe4KhKhV6j 7WlQb8iIw1Xayzj1OK3dNNl+4rKNZXaIl3cCwbUhJECog1REcc7MwKYztot7A/dIGBsJFpSDt 4Rwm2TTayOpTBNSNQomy5ZEajOgrGK/B5LjJbGK8PckeXkrxUl26aXPQxl8OIB9vdxKJRCK5S xpjMeqt//MZ5EkglTsp5v246E3WzX0znBWMs5Ko0/BWrPQ/5J2BqOhx2X7FD81hxWiYMkI9pi 03pyZNdmqnW4rDq9hvHnGhjQN7NHVL8Wfq/iweXNDm7VpdUn6+FTBijMwm8idP7BtW1zb0/za pyADXRC/Jo0FbvOyYfV7p62MvO9VbeTpzx92jQ9FNfZLaQ1XPEofbiYTr5wo9SnPDiUC690rL ARXO6ugQf7GFpf8CO/2jUJIDAAA= X-Env-Sender: Suravee.Suthikulpanit@amd.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1464810809!42678823!1 X-Originating-IP: [157.56.111.84] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36733 invoked from network); 1 Jun 2016 19:53:30 -0000 Received: from mail-bn1bon0084.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (157.56.111.84) by server-13.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 1 Jun 2016 19:53:30 -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=GcyynpFRnQXaMPDz9oiYDm1PotBupsoXm+TZbbV5AY4=; b=vA+hN/xKU/GtX/FJkRMbsdY8GmwznGAmzy4xrGYG3AB4PRfC2LzZoKVsYsiTtNw1d2iuLMUn2mSZFaFw91mqo9WMDE6lJjQV29DI2PL0Blfca+O5rMSpMnKQB9SCvSNYzT9i3b1ED6Kxyt3gb6FV/XCQvXzi36vn3Aburg+MMrE= Received: from ssuthiku-cz-dev.amd.com (165.204.77.1) by BLUPR12MB0433.namprd12.prod.outlook.com (10.162.92.139) with Microsoft SMTP Server (TLS) id 15.1.506.9; Wed, 1 Jun 2016 19:53:21 +0000 From: To: , , , Date: Wed, 1 Jun 2016 14:53:00 -0500 Message-ID: <1464810780-1640-3-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464810780-1640-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1464810780-1640-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BY1PR14CA0021.namprd14.prod.outlook.com (10.161.91.31) To BLUPR12MB0433.namprd12.prod.outlook.com (10.162.92.139) X-MS-Office365-Filtering-Correlation-Id: b384a852-4af6-40bb-41b3-08d38a566616 X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0433; 2:xczjhOq4fEB8bXYXFWIqqGoSonoxgfc7bkxSHjKPrWNnA4ivDFQJrPlJUtiQnI3vtGcUv+G9uo/PuEzsCc38XZxo6W/HYbi4zWN3+Xg7tesxvpZmYGjlMDIVdPRc+Z99thvTjz0FfivYQzCSJoZQflQa2zikuWNU+8v+dtYlgkk551U7Rf13IXTVr+/u7hl2; 3:snnwKA3jZ1BN2Lp2K+C1Ac1Dt86aunVeIaatg6E6WkCqTyGtszPQWV3hP9a09BQU0q5P/Mo0I3FdhS2gga8OlXQ8Rn6GsRqAFHpy9xAa0gEqSLfPFghDopykq9KzmmUC X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0433; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0433; 25:0XaVlegDHmYT53LN8rMlrgw4SCO+V4mD+ddQGeH8R7mvQH805cS22w2alMSN8nDiwnfHlsi0PlnEpebajn7Un+b6tTigakgaUszMt1jGnhPuPFFh+BekYrdHXnp6LnTLvvEXud8OmfSEch9Q44sEfGBmm5o9f//SBR6P0uHEcy4E4lJqg4L7kFM6qgXN+6LfPEua2Ga1UZymXROLAUztFJ+WA6RO1AqMUjYtZ6VG9MZD3+v80IM1g2C5DVoi+U+Fjcd+o/wMpDLTklKpCvpVMEsIrqrKheWcMVIvVuvT6zXDa/l49wLW790RThSmBmEsxt5yub/70x5KsGtl5fgf9TL8hr6xCvZVJgks/ACzMw1DrXaA+bJD3EDw6P2rxPQBUBm9NUAyLVsqKJxCDxqyshElnPpXaPlR3CkBtQBHxmf4C8pUfSY46O2OukW0tXpd525f1uvlNHMHizBoMO/Hxww5WGv122kL7BXDdw46geNPm1NK8URvrFRN/JPmc9svFenmsUBOakCFjdC7DxJptvYPuObEgMLZoopxELgz7yR96UNT4yV3Pg7vLCVLcYlVfus+cR1rLYvSYqn1Dz+pHeTCPk/dY8ON02PvUj9QDgvO237PW+GfryTNOUZZ1TaIJbPcCd5Z699AqJ5BDu1QqR4l4VF6EHK2QSmHfYgm5ji946uB+uZN9g/AeVmfd9UC X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0433; 20:9lb4VOPTbFo+UaCLz5IcOyt/JjcJJddkT2sQ0fB5TIn6OZmMfuk9jpHx6uBYIRM5x4HEXnE23VTGuATBEsKKeLI3P5RG4j+Tcgo4hh02sVNxkp2VLvZWNF02ohe42sxtO1ijOLZ2pUxqFJLi0YxCXAH0bECrL/Bq0jAW0vRgvcyD8yqM8r5GfVwp4MKTom9wl/oRh552lkEm3CdodjoXD9nlt/BaIaeD1LsmsYdj8XD6EgyF+4ahVBACSw1NhsnKRM1NarhtuGJeOKQSyNNwjJnLLAwQgZgTS37k/t9yLS6WcQj3i9lpN9XulBi7C9QjOyRAQvC/8BmQyvs9ldE4yUl3ZfxEqnx/R/ZCvdYBjPGMBfiGmUhLrjHsiYXNeY/cSdrIlnB0Wgv15Y4Ik/sEIOhut75sWcElmNo1jLNrcpkCHoOrkWxj5Kz1R0yEXnNCa7eIlmaZW5AUkIjVbflvhR+G0FqQC/j9Y06JJV9AAkKmznuhlz+TFLy5WVsHx7WY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(70601490899591); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BLUPR12MB0433; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0433; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0433; 4:S2q55Gb8lbVX4dhjl5Pe1TlwWSQ4oQg93LraTIUKLuTyYO8WCxKDKK9P6nScsVUBYaWigsALJ/9Fmilx+EJk4FVndJUc8BP6R6j5Rdh2Hb7WWH96cQPvCxKPiy0iyvcBXtXTggTNYrPfK5HLRg1d656DqBYWqiTA2/r7VBezvP3J1KB4HfDFlNMfJCu3fBVjAys8nt9T7v0CgbRkTXqhr/99aM6rePxHISEOBz3y5JGKDSLKqPCwouENZ4jjms4qedBm3fGV6R55UmZ8C8bHll62xHoQcLTB9jDqV5TRTN9GWsjD9mhsLCkyDAME/4RC5d3aBIyYiwVkXt27WhdrRaaVYb8nf8Vbe8Lzvk0TY9Grm1J4tU2n5jnrNckMGtDbmfB4IMD68YhlPo+6+zVDG7LQvva1rNi6IOuSWhKwEgKSY80S2q78qA2V4kVl/VeD0ZNRi9kxiBfbJqVSnx7Wnw== X-Forefront-PRVS: 096029FF66 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(76176999)(50986999)(5004730100002)(5001770100001)(586003)(36756003)(3846002)(33646002)(86362001)(42186005)(53416004)(6116002)(8666004)(2201001)(50226002)(86152002)(5008740100001)(189998001)(2950100001)(229853001)(2876002)(92566002)(48376002)(19580405001)(81166006)(2906002)(5003940100001)(4326007)(47776003)(50466002)(66066001)(19580395003)(8676002)(77096005)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0433; H:ssuthiku-cz-dev.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR12MB0433; 23:PSUluLeWmJajp07b/GbJcdBpvjfO+FeFdSPlZPH/i?= =?us-ascii?Q?HAkGwuO38jI8dwop3i9c8i0FmDCIVNG3RHGFn117XdJICt0WnDdgC4A35Qz+?= =?us-ascii?Q?xrQpZlpeGbZhTQt5aI5swQpTFvr97x7JwnfG5J4RZ+rjvWzaaR+f/WjAo+94?= =?us-ascii?Q?yjBaNPccsqbpbV1cds2uDYChEEIPvGDn6woxqowoyLYwd0818FVHREIPrilp?= =?us-ascii?Q?rAJhkSiIP0L+LrLG/1yd5/X3yQX2yfD38h8w6BdFazF6cM9n68eyWY9n1+b+?= =?us-ascii?Q?jI+JHzlPyKT4tzassFcU2noWDeN8uZaNJ2s/GVXffoq2SU+5zs1W4TaXrtoz?= =?us-ascii?Q?7xPkAZ++4LNIXFcrHd+MLHZE2Fffoab8PZtK9etpdARMuf7v4zlZWHgJ0vqL?= =?us-ascii?Q?EkbtATdxFPMYToc9x0X2MBEu0czRYtWtJ1NPckO2yMX1hb/NCc6elfgyPma3?= =?us-ascii?Q?hI1/uMcdCbopZ1RjiB6gUQX8UI4b7afeC6kWX+tG8oej5fBzmld4rhCCrl0G?= =?us-ascii?Q?2WsoyBHEghX2eUECgWSPnjlDTPidhORslWXasBNH/i1itJpNEahXkF/tWQCg?= =?us-ascii?Q?jm17AyDEE2fUrFRm9hHAkXGeze3CvKCklxC4zItdjgw0hgMV0+QGxcCdv7Uw?= =?us-ascii?Q?MFMjTyE5SeiCkGKKakXAe3FHQZQxALWAx5xxyOMIEwuwZtRnMNfGjnGhqfGW?= =?us-ascii?Q?Q40cfhyVbI0PGGh0QGpltsODmbmtSBM3mqVmRPbCVgNCBiynKX8P+MhMe2rH?= =?us-ascii?Q?vLK+9YDXlNHKJCZKE+iYLuxj20WE/BBgSU7SBNLTXe+5lnPvPROvJod5/Jl7?= =?us-ascii?Q?Sa4YGT2Ulyf1p/oIDup4xJHMt0pBihVqfL5DK3Ep33izfBy15VidE5y+2w/N?= =?us-ascii?Q?9/WnOohbhWFrVMPcpNchmOt4Niub1borMatBYua6wATQ+DGEKXv+T+s+vH6k?= =?us-ascii?Q?hdh0imqZLGmAKWraWIz/U+j1eIS7hPe20XLQJ9nVajC3Ilfc2d6qivmgH3kf?= =?us-ascii?Q?aY=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0433; 5:n5snbE3PqKGUb4XCUxqwjdwQslgViY0bw/R2sQxqVDI43EDNHjhi+Sh7xcQFg0vPLuZ97+yH+ucRuNavYQQphg2OfFtMCDYlmPPBk2O9FboR+B4Z4X2t8Sci7Rb2kAdue6gta1jk00zuWF+3j50PNg==; 24:DkaxSW1eGiIA0Tb3dXc/EGp5qpNnhYIxjbzdbTwriaDXdeMQ319OoHKoH6Esor4dK5VS6vjYstz2yFL340Co8WsPHf2z40gd3sH+HCYFtGo=; 7:/uY5MPTHne19ShIKIBvHLdTgn6uyYC4bjQ4eOKrkbFzaMkZUnBMRJirmouDK41y9v0hCUnlFpvGDccTGmkymxZ3D5NFaZ5gh43IITqKTGGS8oYdy/XUkGdPjMuZcOxjC0TAMQuOlmTq3xxhbeEj0TX0OXATqxAmphFYvGFOb+XA=; 20:OYP/Q+wCNJSPug5CZ/7egzfwC7krvX9GwxDptiPF0yaUZL9KdcQGDhxbAcu5jNH9v9LMIqkrcvjHKe5YvWcTzOR2O90mkJbmmbL+UapZftA3zB8xhNMEpLt8UJhfD72CWy7Iv/nLC9mDBdmh4teXZmpsWwttX4TBkQwnyOreiF8mqMtKLo25LUmRjjsAZz1Fr1ccr+P4NyekMDb0jV7sTWPTj2FTDVmrVy3bjuRNo7ZcrgrQWRSufE/EEAgMZtja X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2016 19:53:21.2049 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0433 Cc: keir@xen.org, Suravee Suthikulpanit Subject: [Xen-devel] [PATCH v4 2/2] x86/hvm: Add check when register io handler X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" From: Suravee Suthikulpanit At the time of registering HVM I/O handler, the HVM domain might not have been initialized, which means the hvm_domain.io_handler would be NULL. In the hvm_next_io_handler(), this should be asserted. Reviewed-by: Paul Durrant Signed-off-by: Suravee Suthikulpanit --- xen/arch/x86/hvm/intercept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c index fc757d0..bf141c9 100644 --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct domain *d) { unsigned int i = d->arch.hvm_domain.io_handler_count++; + ASSERT(d->arch.hvm_domain.io_handler); + if ( i == NR_IO_HANDLERS ) { domain_crash(d);