From patchwork Sat May 21 23:33:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 68311 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp554740qge; Sat, 21 May 2016 16:35:50 -0700 (PDT) X-Received: by 10.55.217.3 with SMTP id u3mr10218408qki.109.1463873750790; Sat, 21 May 2016 16:35:50 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 76si24228586qgp.119.2016.05.21.16.35.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 May 2016 16:35:50 -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 1b4GPU-0000vJ-J9; Sat, 21 May 2016 23:34:20 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4GPT-0000v7-I6 for xen-devel@lists.xen.org; Sat, 21 May 2016 23:34:19 +0000 Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id C4/A3-03757-A70F0475; Sat, 21 May 2016 23:34:18 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1VSbUhTYRTuvbu7u5qz6zQ9mlkOJLOUloXan0y hJFpFRJL7kde6usU+ZHfGFIqJoaJ9gVkq+RHaH8ssG6lokfODtATRqYVlBYtEQre0VlTWvbvT 7P31PO/znPOcA4cUyS4SYSRjNjFGPa2VE754baJeFVvgTE7f0dZIJDa5GvFklNbf9RM7ijLEG n2WwZwpVn+yWlHuKGFu/11BWJBdXIZ8SZwqEUFb87CIJ4i6iqD7cR/OExllQ2AtGkZlyIckqC i48/aphMdB1FmY+VYt4U0iqhCBq2oE44VAKhVKKsc8GOcKZlsf4DyWUodgwWYT8xioCBgcqPB gH0oJ45cqPQEyzjPZ/lAi+ANgsNrhqRVRAD0zMyKhdjO0u90EHwxUMYIe64C3OAbG+noIwaSE K2/KccHkxuBXsY0jJEf2w7vp7cL/ZQJaO3pFAumUwEzhhDdCC0U3hyQCjoH7465lE4Jxq8NrC oeStmHvPnU4OJ9sE0x2X6gqqZUIxCmGcssjTHAB1L8o9FYfgV57qfd/J8wtNYivociaVYvXrF q8AWHNaAvLGM8xxtiEuCyjJkdt0tEabaxCsStOx7AsncNo6Sw27rRB14a4W1jDvQ602JRqQ6E kJl8vZcr3psv8swxn8tU0qz5lzNMyrA2Fk6QcpMHzyemyACOTw5izNVruoJZlIP3kQdLbc5ws ZXNpHavJEaQhFE82fJ9qwciRyukWTIbrDXomLEQawneieKs6T7/SaPk4R9HGsEAp4kaT+eUyR p3G9L8+i0JIJA+UzvGBfhq9aSVvlhsF40b5sMEzion+J4VZEDHvqlDB+dKI8etVf5KeY0PvB9 xBmwZuJJtQhsr/YKQjuqjzi9aSkvRabb7gHE34CJOJ8Qd0DgX5g4nYqlw62e1eKlib2V++LyL ErponM6PSsru0hcpXdXa/zpfB99YtTk49U0YV19fm70455jreGHXr857oExcnQu9+VS1MHJbj rJpWxIiMLP0XLexjYZcDAAA= X-Env-Sender: Suravee.Suthikulpanit@amd.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1463873657!43055945!1 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 53861 invoked from network); 21 May 2016 23:34:17 -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:17 -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=HBZ94YKOUjZsRyLhtx4FVzYghEAYarIvZmOdaDYIlgc=; b=g6FOgq2J+OcSAAf+CQ5Cmp9a2cYE0mhtHWpgIdLuJRCE8XfVdXYj8lou8rjQiGQ3Gq8o50TbumYjVPqrWOvs1Cc+upbCOrCGvF+1igUKcIpiUpbQLuYB+RiV06FbKhC486qP+9TGt9K8Pm5iIFeLEdt9KWaRYJtlKf1sHuCaeKU= 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:09 +0000 From: To: , , , Date: Sat, 21 May 2016 18:33:56 -0500 Message-ID: <1463873638-6807-2-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: d07ca074-21c2-43f7-93fa-08d381d06bb8 X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 2:36S5UZQuDh0zKddsRqMf6kJyz0VNGVgKt0EhdbLssi/JZxG9hsLHuSEsS+AO90ZBWpTz4Sf1/VVhqyE2cD9jcW1rwHyjiS93X1uwGM7b3v5HbOuUYAfXRaiKPHpNogk5PsSRLJsX0mtq/l6nGdN0nqp+T57Qm+t4YCmeKpvWSw53TVeZ7XlkcgVdgPjWN4Pq; 3:lW7zfr2i9ft4vaqb2bDixs6fRrpjYKkczaew3MVf+7o2Go9xL7HhE+7tjNZ5u27mhi4X29hduHw2eFJoFT0ZKDRb19kyvbXDjfbR/h3BRz2oHAXVvmIVbCqdMXuMjVRt X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0434; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 25:CCQ+7wzxc32SEUzPGIkoRB6xYgXcjoqGk08a2us7WHCDAv1o4/TIccaOyH77oFznzfn4qKoomv6/iL73hGIE7htHuMSQm4gaHKvVKs+VnuehR2822eq7FEhmRVIxIbI26HeoTdyVD0v1QSCLwLpOfmk0dMO64rHK8M5P0vm60PkGEeUq78+TYIQBSJj6loK8X0W5pGuNJjGw6+eT//zoK9UC3EKqRIh38kSEoWVofVk5OR0E31rFkA7yKeCJu+zA/85hWCw/FGaIxEaR7HFlEENwcezwfA/dsnfxjWB/EsJf44ZLgmr+NfTDDN2QQhXG2mrkknHGhHJq7VB/bSQ8ZwxfwzQda0IgNRsdbC+1mZ5VR4WmUakNkEzYX7cLMHG+/SHEfktONFUYz/3dKkX41t7LXWiCBZ/NYtamUZWac3vlTeoWTw+A3S9qjHhiZOeOCM2URdWjIkDDTX7CMyHjEG9Kdy55bzmtixCk2yeE8++BIhVv79nlyiH3yEmi5r3wopfZiDMFVix2dgCuB4JyoymPoglbNrsVitIUWxr1UyNYWni7gC4keCMbXb8pTlc1DmS7vqfjRuhDMGgx3vJUriCs5DxWGyn22KYB/COdR4fg52XuOdBcsIDdAp1GOy12J6KQEs3IrWRHXS6tOYSmY/U5rayEhKEDt6hxoZWo2N47tpWyLi/uDi2KQWTRtwHMXese0ILrDSTc6msF6iPTbg== X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0434; 20:wwpJ7sHzTHaT+QVTpGFUfB6FpoFThl8vbxiz0HfpXgL25Fcvt3Cs+L013IcpRF/m9zn8tEnykn5qMNeKLuvT/A6dE2ZdNS8r4jeeoZDkTwksQIvFyPHAxZs/I35VibANOW6nJ+vTEjb9HcXMc6HnTBq4fb16b4S4HM8Xf9SOLe4562FljXW2NC0L9LFVhb5nVLmbtmyxNgkdkYBhKS9jFUgbEqCu/FEuXATIFvWhLNNfE+55KryjbG0Cd4iDtCLZWtoT//0lFkk3F0RzdqS5gw3pd7Din9Q/HW2fEzD3/lU7FY3mJSyf/efKfiIrmiNE6IUTWUI/8Egtz8IcPNMXX+bteJvA+N1cpGzITfX1UVDxyPB8g1sLQsia0aBSm9G0ux7IoDefiOElyzCVUH+ugzMKJad5vIrM4oWMuDvJZbaKm/i3CCza4+/Q36dyGq+lq0s75Y3nK4pF/dRVno51ysZAGCC4vskorGJRQrBjMdGBG4XXoQMCK08fpUjMKxV9; 4:ThIwaYe8Wc7WYRYHf2gQcBrD4rh2ZJmKANTPDZnvJy2Kn7i5KqX9V1YdBrxqIB6YI6MGzYaIb27qKC2wS1zf7ZmTMOJLy1u02wZLAD6IalbVooWov0mmJAWd9D3p7oePHnNrG6mdBq2sZO3UVp4cBY4tkeuiFg+33X7aIsiMs3odoxJg7ibTlnxEGqsHhBspmmv5MVKlLIDb28HJA4OmpmfnkKuul+wFXB6HtGnObINEupvHOpasD3rLJt7E/HaieuRkZO+Lh/cAqAC9IEgVcnVDQZeClfoVZCQrQB/mes8LGhQYwRFRZi4W4JhcDaBw5G8RSo1csTOeuLXa0Ymxw6Qa8CDOwF3ntNeRGeVdIDY2nvmlCZBDeVOjwp6D8cWt X-Microsoft-Antispam-PRVS: 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:QUfHbFLg0puElaxVJPzmC9n/cVyx+FKxK+/BeBlYV?= =?us-ascii?Q?xk3oOkoj0Kq+mlmjxzDjCVzYYA8PoSPDCuG6en6YrRax65EJtvwJsNh5UPkO?= =?us-ascii?Q?aVdtN8ebfc1zuJIvNnXyYgEFklbLJNTotDec/QPzSVMdcQBq5ED5E/nIt3Rx?= =?us-ascii?Q?u1j5IRzzKxk+BKG+jsmkNgEigmdqPxR9Izzz4VOw8UeM2F2BjmveYYg2s4Hw?= =?us-ascii?Q?2U84/NqqJcwrT7lfVp6D3/kn7MCgXDXnyt8L0YO1OVr4uQWDh9fPKG641ehn?= =?us-ascii?Q?YoesmcRImJddPTgUB0HCXRCgli42bftEU8u4Tku3/2XcLxIZpXGc282HAXqP?= =?us-ascii?Q?xzNCUnU70Rs+l1IAwmAMndUymXT+nXGMmb/AtIvrPMP4ZE8+s0d7ATm/UaXN?= =?us-ascii?Q?/dDqmc9bHPxkvvfEi0s1HYfoxnP29h1GmjfwwDjel8jnC/N4YAq9IQBes/Mh?= =?us-ascii?Q?cXNNSlyDnkI9enzeJr25Pj+gtcikRwdVGjKZLedC6X2vyX+454/m6my28U4g?= =?us-ascii?Q?ow55aOEWXHr5X5MS6+/DbWPj2KnLUIE/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IpkaFk8YlwemDaiDYoUh+6Nx+Fxx1pS6FtiKGm53Ndn/HlB2Ep2ywQIusOj62XFvyGMZf/vIn1fO/DOJvI+anRubJolkaYOYkV/IXJEWK8HnKxHp/1RTMHJ8ylRTBf6M6w1tMTJEIkecz8N5NWzVVWMtVyFMVXceVdIbeH0asUhG2sULB5vf0ePvHtP8TCeaRWDFXOyl1pKqvteWVb8H+B X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2016 23:34:09.5278 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0434 Cc: keir@xen.org, Suravee Suthikulpanit Subject: [Xen-devel] [PATCH v3 1/3] 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. 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..2f8d57f 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);