From patchwork Sat Dec 31 05:45:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 9492609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 320AB60416 for ; Sat, 31 Dec 2016 05:49:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2091C22689 for ; Sat, 31 Dec 2016 05:49:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1548C25250; Sat, 31 Dec 2016 05:49:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 46B4822689 for ; Sat, 31 Dec 2016 05:49:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNCVA-0003zC-S3; Sat, 31 Dec 2016 05:46:44 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNCV9-0003z6-Ec for xen-devel@lists.xen.org; Sat, 31 Dec 2016 05:46:43 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id 5B/31-12836-24647685; Sat, 31 Dec 2016 05:46:42 +0000 X-Brightmail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com!1483163199!77577927!1 X-Originating-IP: [104.47.34.79] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 49576 invoked from network); 31 Dec 2016 05:46:41 -0000 Received: from mail-by2nam01on0079.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.79) by server-6.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 31 Dec 2016 05:46:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1eikBWm9PMSFxpyQF9GmF5ZnXwTA0IKG+dpQ/JAIW9c=; b=HR33hVX/+y8tqSYJufnoZb6pZaU0fUUanLbJdn6e3RZOabiBIt7BoYA3NgcTyh55fP9aCFjFjDyi3hrfd9coF7g7gP4OJfI2qCn+oa9VmNsNDRzwEM6YxhXxvazeSzcDMDzKWM2rWmjitetn4VaJx8tRpNR1khf5ac65W5UMRPY= Received: from localhost.localdomain (114.109.128.54) by MWHPR12MB1453.namprd12.prod.outlook.com (10.172.55.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Sat, 31 Dec 2016 05:46:35 +0000 From: Suravee Suthikulpanit To: Date: Fri, 30 Dec 2016 23:45:52 -0600 Message-ID: <1483163161-2402-2-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483163161-2402-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1483163161-2402-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-Originating-IP: [114.109.128.54] X-ClientProxiedBy: PS1PR0601CA0058.apcprd06.prod.outlook.com (10.167.43.154) To MWHPR12MB1453.namprd12.prod.outlook.com (10.172.55.22) X-MS-Office365-Filtering-Correlation-Id: bee1bb55-24ef-4e1d-94ba-08d43140638a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR12MB1453; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1453; 3:kWARStqFdR7uqrYFjOCSoL7wEqP7aCXLmDKlaI02QvqvF2UrW+2VfyVLLtZ2n61ji9m3leQPPRwscNx7cnXIQtlclGvA3cydUpLQhw3SIP5woQAFkD6lgn1dA9BAv3FJokOeXQvnTpPrwdA3BRvVnIR37isfs2Dw2xujC1cW5DRRt9usNioANaRqBG7jdEGMwz8e1lCZSkiA7vX2oEceO23a5ZV9hfpxWMOjg4KsU/6Xe49SW+EG+qdtYA+cflVVTaBl2d+fqaVMR99ZLptBNg== X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1453; 25:yqw3Si57u6+PSllzNrv3wqE9Y8nQsYjFYcdhOBuCilw4tyjy9cgh1ickQoqduYtXRq+co5ki0RVijYY0j8719HZVV6RKpQsVwoP8dIF6gPezHsG0iCjR2a7tkZ3aBdekLGEKfqHFEQeS43ZmkdH5JiiXu0DnYS/LR/G7MQQfcAbBcmY/hSDHl3NkEDVId5VQW5k3W/A8BqOjToj5+tm2Sdrt9IxWbZCVrBYl7Z6orK3byR8AoOx1N94NTg0YwmyEHyxzCwXC55EFEjDqU9merG2VcwSGsBclsvEmK89j0cuOQYu8JKz+MjNEZSLY+C/BXA8MS5ic/Rinb8UcQc5Jhyv2bN+yPMyVHyF8B/rtqX2h/1BvsrUDZjzuZ1O5tbbLTSTfMe6UQCWSYDoOO8bBrCIOx8eOJtN02R7CYWnyvCOxl1VQJCtk7rtBew3Tg/2rHBd3pL0HKNmvCf/snW1DRx/Y49GCzbfNPRH06DK0DTv3+AN8EuUg+0TS2f+sSFzNAz46plIkKrM8V/5y1AmFlWtml24dMMuN3uSPb075dYjq3I1Wuu3Ed+aiwoqJQ/ZIwJ1sRFKi7S4I2nUbN8zGDmDIvT1/VkgthmGs0uf2D0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report-Test: UriScan:(767451399110)(146099531331640)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(6072148); SRVR:MWHPR12MB1453; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1453; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1453; 4:tpNPgeSkhHFJLeU85IE6uiMxcHUoFrN6EZL2dbnQqTm/YhrWjyu3TNHJe3A6QR+V6IdFpNB3DCpSFNY0NDMwnShligriKLJuwbwnnZSdJ+7QFH0oR+3rAMnecLWnOT9aHxR2WQThF/4kFFav4G2hCExw4fkS8r/Zjwp+LNPQQobiHYhIvJu1nbDoeu+N1lNUOqoKANpfKkrNmkL6kdFh7aqE5WzQpGzLtQRcaLt84A9O+2o09tiw9kqx+OtZm2qb1OF7tEtFhukSXtk7SaqbSjcwIrC9fdkfHyV/iCoSgs3UnIEw0e6ePLOvN6kxR8eF4fwKPGrrbkV9o3dThCDmzT9VazdsSVPFofqoq20prme+x3Wi9IpMOYa2PSYJ4YPxIOyPdplIGBMGCQxgIvFbbDBUmA2P9RN/2z0BO2hr8rmeNONeLY4gDjGPPinJWwz2NHR35jQfPCq1dFLVS9x+ti3yiYLBNdB7QNblG1W0Pw0ixxUleL8Cc42l8GiRbIobrCzwnf6EMyUKyFJEaaRvQCXTl4iRTJkrgY85b+aVpFxjSKuUAykPdMYJ9JwH15A9JrE7I+tRZ63w/ly5NsAV402xpqI3ZZIuvcoCkd/sa+MvlpvrdOvQTgHiqqg4+lZdLLJfjYowEGJCllWUNFWmK1YOtNaFRXtiTOLtEukGp2gHFRUbBd21fj/dQAJq1Wzfa0gsOO/FYYeFEnq4Z1HfgA== X-Forefront-PRVS: 0173C6D4D5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39860400002)(39840400002)(39850400002)(39410400002)(39450400003)(199003)(189002)(92566002)(68736007)(4326007)(25786008)(105586002)(48376002)(50466002)(81166006)(101416001)(305945005)(110136003)(7736002)(5003940100001)(8676002)(2351001)(3846002)(36756003)(106356001)(50986999)(6116002)(8666007)(81156014)(189998001)(42186005)(2950100002)(33646002)(76176999)(97736004)(66066001)(47776003)(54906002)(6666003)(86362001)(38730400001)(5660300001)(2906002)(6486002)(6506006)(6916009)(50226002)(6512006); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1453; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1453; 23:gfUsujKc3j7a406YWLx08aaMt1rN7V4seb2XeKdYo?= =?us-ascii?Q?vwsCsnkawXix/mHLaXYzWwTvk52m6u7TOF6TxJkmcd0nPMVmU01cEu/MMfov?= =?us-ascii?Q?z4qs7lYO2Q+p4QOMp4sLXhuNEY6SuFeLU+Usr/QMqyt74DHmdc9e28p4IDz8?= =?us-ascii?Q?t8goDwO/WBIgAAk3E6NHsq2h+pqafGVEo1f7gJnzT/Ac47TEaAdeAZ5tL3TF?= =?us-ascii?Q?MFj4k2TaU8MRVAFv4NlqK5cMNf0H8vC4z36IkCtR4oqj/8uYgPMEijZ4aM5L?= =?us-ascii?Q?Pp4QqobFNuAJ7zwLn0ivAkyW9dMt0T5bX0uFqAwneqAaoxYzy1n4SNx4LST3?= =?us-ascii?Q?43F4EZZ7Xm6QjvU8WqOk0ObM/dAURgkv6tbsO0+v0fHOawS+z+j/OCDrKP15?= =?us-ascii?Q?22xb77u5qH5GHQVgAgYoC2LxPY7o2UpwnbpgwGGPA2AlZw26FXgY7pIiaUMJ?= =?us-ascii?Q?7BkEiJOrc8USwWl17IR1pzMNJ1PApDYbQtssg4tlFCCfHEEmbvQXRSBIrGEo?= =?us-ascii?Q?UPR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v6D9gL1sOutmGuO4R177GQrYfmGbTmTThZf5aWApTWNJ+WIrBgfY9NgUoZXBFJckoVwrovsvyEcf2t+A+VgB+th6n71/9QJ1+PKJleK1CjJ2Q89KERyLQxhosT4HfOaSg9YXDqYFdk6PJVSlNuK+hD8LpaQ8GdeDFCcDbyH7s/5v1Jrrs7WZC568EycKQiVdituR+P8yhIMnNB30V7rCfsIoIvieQwj0dI0zzHf4fWgLExRx0dADHoWdoZcJ84EzIOSVq/9ErNgCU8vTwc9VIzT4XynY3+cdHUywONzq08IoTJfNKOHc/0gGW54IiVElFkNoWC/RF1nM5pOeVacwinnihDyfVU74mJUG80B/7G2tEg==; 5:tV14iJxllOxzIQPd67iX7jdE6a2aqbNpS47aaZLfBV3/Xg7pvBOhF4G+q+KVf8iQZupdbALo0hkcqBbp/qGyhKGvHYMFqhSGHTa3IDuhzkkTiq6x8DP90YWL9E4EbPiq7JUlYM/95yhnWmPbP73XRrREAHeBNNfLEKYd2oyz2Og=; 24:lk6vMJ3IWEQ6W6u5hl98h8H+W9/8jzRYgodMh/EPs8mZwSe6AloxPJnNAxvv2TQeqPrteZdoVITkkIPppayr1qF0VaVXP6gsau9QdaS9DaE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1453; 7:8YKf5PCxLyRNgA6PozWQpBhErwGpAprkqwtOSz0kJB4/1BEIY0LJnLuUXGT91y1cVHnklOUnWYv63zOhn9fRiD2BqZmBvCy4fZzDl2PezolbvxniWSvLKH2bZDSdvRVQDinYGJvju4ARUoeqL/xhY9KE5TPtTvpC+tGKtiAuXScf44NIx4GxrdzQ876hhp8WnU0Go3tb/JHfmcxCS5JV3EEho1aGHRTe7DrKsrgkZeS3pZts0XBAghx63vUU5c+bvJozHrkVUD5okXxEBkAO65PZPCcN8bAotNV27eC3p9k64tMMGMQxjZcMMkPXXUqCDXIWZOV8++QxEXqtdLq04xX7GiH3Sia/vIdz0IiaA2p/VxvfEOumoihxlQKFk8zPQmI0XUUq7fhVGNzG5doH0h5C3l4U/fb+0WlnFccWAUMlk9mDo0HjLJpXuKAWyY8kLKnoI6G0hjr6OLTbHt3KKw==; 20:hZw1bucNWn6pTb2GRhb5UlGcR/zeIL4YCa2vinXkWbhxe6q1tBowLXbaFlKf+wE/navJK36KaKd2mSWEABjsBl38zRDjrSSm/c0P/Y2lMbsUSb0NDlQ1VPk/N4BWwR5JdxP3/8ik/PmiY46IntD7339f24e5KC2wEPbGRbn9w6WDpiuyl3jAk0hSOicaOusDEmu5R78IUYuo75TKGX8qfJ/MDvwGZvcQ56u527d4SyXFHqaByUoafde2MeKpHzgY X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Dec 2016 05:46:35.3331 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1453 Cc: Kevin Tian , jbeulich@suse.com, Jun Nakajima , andrew.cooper3@citrix.com, Suravee Suthikulpanit , sherry.hurwitz@amd.com, boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH v2 01/10] x86/HVM: Introduce struct hvm_pi_ops 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" X-Virus-Scanned: ClamAV using ClamSMTP The current function pointers for managing hvm posted interrupt can be used also by SVM AVIC. Therefore, this patch introduces the struct hvm_pi_ops in the struct hvm_domain to hold them. Signed-off-by: Suravee Suthikulpanit Reviewed-by: Konrad Rzeszutek Wilk Cc: Boris Ostrovsky Cc: Jun Nakajima Cc: Kevin Tian --- xen/arch/x86/hvm/vmx/vmx.c | 32 +++++++++---------- xen/include/asm-x86/hvm/domain.h | 63 ++++++++++++++++++++++++++++++++++++++ xen/include/asm-x86/hvm/hvm.h | 4 +-- xen/include/asm-x86/hvm/vmx/vmcs.h | 59 ----------------------------------- 4 files changed, 81 insertions(+), 77 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 7b2c50c..3f6d888 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -204,12 +204,12 @@ void vmx_pi_hooks_assign(struct domain *d) if ( !iommu_intpost || !has_hvm_container_domain(d) ) return; - ASSERT(!d->arch.hvm_domain.vmx.vcpu_block); + ASSERT(!d->arch.hvm_domain.pi_ops.vcpu_block); - d->arch.hvm_domain.vmx.vcpu_block = vmx_vcpu_block; - d->arch.hvm_domain.vmx.pi_switch_from = vmx_pi_switch_from; - d->arch.hvm_domain.vmx.pi_switch_to = vmx_pi_switch_to; - d->arch.hvm_domain.vmx.pi_do_resume = vmx_pi_do_resume; + d->arch.hvm_domain.pi_ops.vcpu_block = vmx_vcpu_block; + d->arch.hvm_domain.pi_ops.pi_switch_from = vmx_pi_switch_from; + d->arch.hvm_domain.pi_ops.pi_switch_to = vmx_pi_switch_to; + d->arch.hvm_domain.pi_ops.pi_do_resume = vmx_pi_do_resume; } /* This function is called when pcidevs_lock is held */ @@ -218,12 +218,12 @@ void vmx_pi_hooks_deassign(struct domain *d) if ( !iommu_intpost || !has_hvm_container_domain(d) ) return; - ASSERT(d->arch.hvm_domain.vmx.vcpu_block); + ASSERT(d->arch.hvm_domain.pi_ops.vcpu_block); - d->arch.hvm_domain.vmx.vcpu_block = NULL; - d->arch.hvm_domain.vmx.pi_switch_from = NULL; - d->arch.hvm_domain.vmx.pi_switch_to = NULL; - d->arch.hvm_domain.vmx.pi_do_resume = NULL; + d->arch.hvm_domain.pi_ops.vcpu_block = NULL; + d->arch.hvm_domain.pi_ops.pi_switch_from = NULL; + d->arch.hvm_domain.pi_ops.pi_switch_to = NULL; + d->arch.hvm_domain.pi_ops.pi_do_resume = NULL; } static int vmx_domain_initialise(struct domain *d) @@ -901,8 +901,8 @@ static void vmx_ctxt_switch_from(struct vcpu *v) vmx_restore_host_msrs(); vmx_save_dr(v); - if ( v->domain->arch.hvm_domain.vmx.pi_switch_from ) - v->domain->arch.hvm_domain.vmx.pi_switch_from(v); + if ( v->domain->arch.hvm_domain.pi_ops.pi_switch_from ) + v->domain->arch.hvm_domain.pi_ops.pi_switch_from(v); } static void vmx_ctxt_switch_to(struct vcpu *v) @@ -916,8 +916,8 @@ static void vmx_ctxt_switch_to(struct vcpu *v) vmx_restore_guest_msrs(v); vmx_restore_dr(v); - if ( v->domain->arch.hvm_domain.vmx.pi_switch_to ) - v->domain->arch.hvm_domain.vmx.pi_switch_to(v); + if ( v->domain->arch.hvm_domain.pi_ops.pi_switch_to ) + v->domain->arch.hvm_domain.pi_ops.pi_switch_to(v); } @@ -3963,8 +3963,8 @@ void vmx_vmenter_helper(const struct cpu_user_regs *regs) struct hvm_vcpu_asid *p_asid; bool_t need_flush; - if ( curr->domain->arch.hvm_domain.vmx.pi_do_resume ) - curr->domain->arch.hvm_domain.vmx.pi_do_resume(curr); + if ( curr->domain->arch.hvm_domain.pi_ops.pi_do_resume ) + curr->domain->arch.hvm_domain.pi_ops.pi_do_resume(curr); if ( !cpu_has_vmx_vpid ) goto out; diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h index f34d784..779927b 100644 --- a/xen/include/asm-x86/hvm/domain.h +++ b/xen/include/asm-x86/hvm/domain.h @@ -72,6 +72,67 @@ struct hvm_ioreq_server { bool_t bufioreq_atomic; }; +struct hvm_pi_ops { + /* + * To handle posted interrupts correctly, we need to set the following + * state: + * + * * The PI notification vector (NV) + * * The PI notification destination processor (NDST) + * * The PI "suppress notification" bit (SN) + * * The vcpu pi "blocked" list + * + * If a VM is currently running, we want the PI delivered to the guest vcpu + * on the proper pcpu (NDST = v->processor, SN clear). + * + * If the vm is blocked, we want the PI delivered to Xen so that it can + * wake it up (SN clear, NV = pi_wakeup_vector, vcpu on block list). + * + * If the VM is currently either preempted or offline (i.e., not running + * because of some reason other than blocking waiting for an interrupt), + * there's nothing Xen can do -- we want the interrupt pending bit set in + * the guest, but we don't want to bother Xen with an interrupt (SN clear). + * + * There's a brief window of time between vmx_intr_assist() and checking + * softirqs where if an interrupt comes in it may be lost; so we need Xen + * to get an interrupt and raise a softirq so that it will go through the + * vmx_intr_assist() path again (SN clear, NV = posted_interrupt). + * + * The way we implement this now is by looking at what needs to happen on + * the following runstate transitions: + * + * A: runnable -> running + * - SN = 0 + * - NDST = v->processor + * B: running -> runnable + * - SN = 1 + * C: running -> blocked + * - NV = pi_wakeup_vector + * - Add vcpu to blocked list + * D: blocked -> runnable + * - NV = posted_intr_vector + * - Take vcpu off blocked list + * + * For transitions A and B, we add hooks into vmx_ctxt_switch_{from,to} + * paths. + * + * For transition C, we add a new arch hook, arch_vcpu_block(), which is + * called from vcpu_block() and vcpu_do_poll(). + * + * For transition D, rather than add an extra arch hook on vcpu_wake, we + * add a hook on the vmentry path which checks to see if either of the two + * actions need to be taken. + * + * These hooks only need to be called when the domain in question actually + * has a physical device assigned to it, so we set and clear the callbacks + * as appropriate when device assignment changes. + */ + void (*vcpu_block) (struct vcpu *); + void (*pi_switch_from) (struct vcpu *v); + void (*pi_switch_to) (struct vcpu *v); + void (*pi_do_resume) (struct vcpu *v); +}; + struct hvm_domain { /* Guest page range used for non-default ioreq servers */ struct { @@ -148,6 +209,8 @@ struct hvm_domain { struct list_head list; } write_map; + struct hvm_pi_ops pi_ops; + union { struct vmx_domain vmx; struct svm_domain svm; diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index 7e7462e..b1e4c75 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -638,8 +638,8 @@ unsigned long hvm_cr4_guest_reserved_bits(const struct vcpu *v, bool_t restore); struct vcpu *v_ = (v); \ struct domain *d_ = v_->domain; \ if ( has_hvm_container_domain(d_) && \ - (cpu_has_vmx && d_->arch.hvm_domain.vmx.vcpu_block) ) \ - d_->arch.hvm_domain.vmx.vcpu_block(v_); \ + (d_->arch.hvm_domain.pi_ops.vcpu_block) ) \ + d_->arch.hvm_domain.pi_ops.vcpu_block(v_); \ }) #endif /* __ASM_X86_HVM_HVM_H__ */ diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h index 997f4f5..4ec8b08 100644 --- a/xen/include/asm-x86/hvm/vmx/vmcs.h +++ b/xen/include/asm-x86/hvm/vmx/vmcs.h @@ -77,65 +77,6 @@ struct vmx_domain { unsigned long apic_access_mfn; /* VMX_DOMAIN_* */ unsigned int status; - - /* - * To handle posted interrupts correctly, we need to set the following - * state: - * - * * The PI notification vector (NV) - * * The PI notification destination processor (NDST) - * * The PI "suppress notification" bit (SN) - * * The vcpu pi "blocked" list - * - * If a VM is currently running, we want the PI delivered to the guest vcpu - * on the proper pcpu (NDST = v->processor, SN clear). - * - * If the vm is blocked, we want the PI delivered to Xen so that it can - * wake it up (SN clear, NV = pi_wakeup_vector, vcpu on block list). - * - * If the VM is currently either preempted or offline (i.e., not running - * because of some reason other than blocking waiting for an interrupt), - * there's nothing Xen can do -- we want the interrupt pending bit set in - * the guest, but we don't want to bother Xen with an interrupt (SN clear). - * - * There's a brief window of time between vmx_intr_assist() and checking - * softirqs where if an interrupt comes in it may be lost; so we need Xen - * to get an interrupt and raise a softirq so that it will go through the - * vmx_intr_assist() path again (SN clear, NV = posted_interrupt). - * - * The way we implement this now is by looking at what needs to happen on - * the following runstate transitions: - * - * A: runnable -> running - * - SN = 0 - * - NDST = v->processor - * B: running -> runnable - * - SN = 1 - * C: running -> blocked - * - NV = pi_wakeup_vector - * - Add vcpu to blocked list - * D: blocked -> runnable - * - NV = posted_intr_vector - * - Take vcpu off blocked list - * - * For transitions A and B, we add hooks into vmx_ctxt_switch_{from,to} - * paths. - * - * For transition C, we add a new arch hook, arch_vcpu_block(), which is - * called from vcpu_block() and vcpu_do_poll(). - * - * For transition D, rather than add an extra arch hook on vcpu_wake, we - * add a hook on the vmentry path which checks to see if either of the two - * actions need to be taken. - * - * These hooks only need to be called when the domain in question actually - * has a physical device assigned to it, so we set and clear the callbacks - * as appropriate when device assignment changes. - */ - void (*vcpu_block) (struct vcpu *); - void (*pi_switch_from) (struct vcpu *v); - void (*pi_switch_to) (struct vcpu *v); - void (*pi_do_resume) (struct vcpu *v); }; struct pi_desc {