From patchwork Mon Sep 19 05:52:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 76498 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp794707qgf; Sun, 18 Sep 2016 22:56:02 -0700 (PDT) X-Received: by 10.36.110.196 with SMTP id w187mr9651344itc.28.1474264562337; Sun, 18 Sep 2016 22:56:02 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id l20si26121869iol.242.2016.09.18.22.56.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Sep 2016 22:56:02 -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 1blrWR-0004NU-6X; Mon, 19 Sep 2016 05:53:43 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blrWQ-0004Lh-9k for xen-devel@lists.xen.org; Mon, 19 Sep 2016 05:53:42 +0000 Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id 07/80-26103-56D7FD75; Mon, 19 Sep 2016 05:53:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1WSfUgTcRjH+93ttnN4cU7Tp5GCi1Q0TUNBkNK QJCIhQhj0ot7y2gZ7kbtZK02MREklJf+aTNPKCmcYgrFI8CUzTSdiZKmVFIkvWSYlkil2t1Oz ++v7+32+z/P9PcdD4qo1Qk2ydhvLWRiTRq6UGQ5EHI/OuTqpjW39tDfx3uJdWQo69uLZH+wkO k0YLTqrPZswzLVME7nXfe2uoQ6sCNUpy5CSlNHFOLxs8KAy5EMiOgu+T9YTIlDRRRgsNFbiIp DTSTDnfK8QdQAdDK4yp0I04XQpgqrfb73V/nQafBvuIkQto/dBa1uzV1N0OrRXVHo9QIdAf2+ 1995HuJ/+LCaTQtoJmH4cJdn9oN/xRSZqnAbompnBpVINOJ4UycVcoEsQuJvveE0qOhJe93TJ JVM6PFj5gCTTMgatgx0KCaTBUG8fJoEGOfyceCSTDo1y6O6ZICSXCSZ/1W7kJUJ5w+pGq24EP zxuTAJLOFQOhUl6D9zoqVBIphoCblVOyaWBsmDFmbrxWAp6m+oI6TChAMe8C5f+mBoW3P2oCo XVbJu8Ztvk9QhrQuE8y11kuej4GB1n1BtsZsZoio6LTYgxszzP6FkTo+NjzlvNrUhYhR3C50b jN1O70W4S0+yi3LaPWtVOnTXnsoHhDVlcnonlu1EESdKzza5hpJZZrBZWA9S1gkmtyo9j9az9 gtEk7NamFUhfTQB1ScQUn8uYeaNeQq9QqDqIChABLQJDnmWrbHMrR1Cw2p9CwqNUvrksZzba/ udzKIhEGn+qL1/o4mu02La6zwnBmBDsqpkQg23MP6QuQoHygbGDD+YXrO3FndVPR5XrmYsFS0 sZ5tVOx5n7ulqHOjU/caFtP5m8PhAeX+UpXYWW+ihN7KkrOYVqT8Qo95wjndEP+960l2Qaxqc aB0duJ0VmB2SMnU1OGAk9jB05qq3TpYWsKGedh0J99MtfAx3nCstNScY18l1KRo/ORyPjDUxc JM7xzF819lNvkAMAAA== X-Env-Sender: Suravee.Suthikulpanit@amd.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1474264417!44189674!2 X-Originating-IP: [104.47.40.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19471 invoked from network); 19 Sep 2016 05:53:40 -0000 Received: from mail-co1nam03on0074.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) (104.47.40.74) by server-2.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 19 Sep 2016 05:53:40 -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=N+qMeRhQwYEFoWgO+ob1LiCC4A1KklhZ+8Q8my0D83g=; b=xiMaC/zH5y15T3/ShjrPwFouIlGhwnXPW6QCJfEIqiUVuTq+bu0rnrnEd1K+4FuRvNFsCAb2ZyisPtnttemD2LFlhm4JHXdNpQhZFuY09HPeym3sLwL7wsli4MRPbnunyaYTChKbvg5wh2PIElktWAZuJKjIJgU4Hb3SyrNq8l8= Received: from localhost.localdomain (114.109.128.54) by BN6PR12MB1442.namprd12.prod.outlook.com (10.172.24.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Mon, 19 Sep 2016 05:53:36 +0000 From: Suravee Suthikulpanit To: Date: Mon, 19 Sep 2016 00:52:48 -0500 Message-ID: <1474264368-4104-10-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474264368-4104-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1474264368-4104-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-Originating-IP: [114.109.128.54] X-ClientProxiedBy: HK2PR02CA0002.apcprd02.prod.outlook.com (10.163.104.140) To BN6PR12MB1442.namprd12.prod.outlook.com (10.172.24.19) X-MS-Office365-Filtering-Correlation-Id: 6ee7b524-d9fa-4726-2d01-08d3e0514da5 X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1442; 2:6+Z51zMbhQ++PL0PyknhsA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x6lNdzkyGEbGE7BPfCVdpexRCxpxCdCeQuq5KTAM3UaEIxJfOh8wMA+evvoYCt+SHu9uA= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1442; 31:AxU+wSsZbrwwphrH+sATtrsqpoHUHkE4RNKp9JcuDXJ9INI3oAqUm2i4YtdfhEYgqUodOX4QEgPkqUaZGPYcJVi+N6Yq+qXyaNLl9rBUL8JLhnu+infOSoCim7Z47/+HotNgH0MCBjhKz/gGlrPlphlgTastM8m926KE3y/TDjxxFxS62Lh6Jx6NHLUSzSiAQOutTZehRsMPcUbgupn/sskqW2vv7YeA5vxTkeC8Szs=; 20:r5jIMVUjtIkTBnJ5zjWay3CL+Qrud0yE/CDgDfNhFPMH2ExrJTyu0QKlRwNM3mdU1Dk6UMhd9b1Qz7zWwD3MkpdhRgG51UUWNt15DGLZ6InzaKZpIJGPxVnwSFWyuJvu16bjUYUtnQj/ffNXs18lQ0dTlKBk6T2+NV1io8u1KC2Xd9eEsnXHrpOO6aF5rdEu6WpDi2PVzHOlAXW8e1RpgsdG2AY6kyIv8hts1W0fdeOYmRrJKMseh+OV5+XM6SCE75s76spXwipQ9ldpdhHEKP5mj2Crh3W946f1GPQqf1uCp8oLuh/TLYhvGGB0bzgHjZa3C1xyE5z1XWVMs5XW9k0V7cUWDS9EZhlAWq80p1uc/qnnGRlRLvmMchW1z7fN1SVxrVwIV+WcW9HyK0wYcKNNydEfIB99dHb4CyIT96fsY9LW5/ml6YwvpL/4kUKLeEJFYXyZU8xdkUnhYzx/XupON+Ey4RSLxD7Fs7YDotBOGOUmRQXHiMhEBAbvHsqg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BN6PR12MB1442; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1442; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1442; 4:KfN4ET8qEFrWGa4y+V8hyqtZO1yYbwECGBNQYLe7ghXbzXo2rGceZtmCx5tD26AhKfvGj26DEs7j9OacnURHyPMxeq4NhYo3Oqystq5BdFDzj4chYI2YUyCtq71beHyCFUR99RTpTqNAcANKHR0I5M61qcMjeCi1+AMHERppgr1yCNydounras+vA2e5/As4iugHTerbBzVP6YLd+3cnbF89+n2XXR8dQs5vf0bncdRc5mVw41VVXFTRTosYmCFI4BMLSbzCm1IVae+o+RyJ5SVKWZsS4rr0F0bcNAb8HzQT1Ek+NzSDE2SmaPKT1YE6MLg4r9hkX7mPg2Ry4U2uXzIlEo0WopZfnloOgbCbbaBblqI3mU5kgZSnH97g5vW7w4uyPJZVQLvZgCQCeM41IhtzirE05/iwgYRenUAjt/Y8TlvSWjU4ksXojMx1IGoQ X-Forefront-PRVS: 0070A8666B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(2351001)(229853001)(5660300001)(81156014)(81166006)(33646002)(8666005)(8676002)(19580405001)(7846002)(5003940100001)(7736002)(19580395003)(77096005)(305945005)(110136003)(2950100001)(92566002)(105586002)(106356001)(101416001)(2906002)(586003)(86362001)(4326007)(6116002)(3846002)(42186005)(66066001)(97736004)(47776003)(50986999)(36756003)(76176999)(48376002)(50466002)(189998001)(68736007)(50226002)(52103001)(158003001)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1442; 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; BN6PR12MB1442; 23:4y0yj+c9dUdy+KEDUl7jRjuL2ymb2Q5eE/Pq27OaQ?= =?us-ascii?Q?lSy8Jvykgr8fK66UZW6dVNBACeS9KEv3RjXRSnf2H4i+KVEzSbFaAXKsIA4W?= =?us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MS4RjlPqGt2torGBz8JtB2HudCQy3U2OGz/WLA4E9pQ4EdlmgwbzjyKd6mKYiQR8XpPf6KTPYiPNST6yKOMtIRtneqOpjg7JM3KnFTHYXlH6hMMChNYU+qm+WjzpPofwxlV4SwD6OA4xTjSxtWz2KVCk7PiB8BzozJk/mCPONKmWdtqSCDg21UQiMNGj4bGtCavfhZDUnMulJarM5f4ACMyqbcsf4eIusoOaS4Ae+gKOn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1442; 20:2FsCjkyDSDpaEqYECQn6U7ajNDRkDTVkaYqnK8dFO9IvpOQlx5LxkaqvmGMrq5G4VHxkjPXSYVszOqZhqXk1kb5PG12xfgZOappmkzZRDy9C72vPRXaAHFxSbomyRKRWOfaz9VKf5q0i/yOCUbAD3mTbTMwcS/9WfNP2Ln3X6HsaSF/k/YJDmcrmoS5RBT2oZ11VCIImgRO5ipzCEiZgDaCVeUoSYDZS9X+ivLZ/zI/0cV2xIfAS6FypYO46daqY X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2016 05:53:36.7227 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1442 Cc: andrew.cooper3@citrix.com, Suravee Suthikulpanit , jbeulich@suse.com, sherry.hurwitz@amd.com Subject: [Xen-devel] [RFC PATCH 9/9] x86/SVM: Hook up miscellaneous AVIC functions 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" Hook up virtual_intr_delivery_enabled and deliver_posted_intr functions when AVIC is enabled. Signed-off-by: Suravee Suthikulpanit --- xen/arch/x86/hvm/svm/svm.c | 10 ++++++++++ xen/include/asm-x86/hvm/svm/avic.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index caf9984..a9c09a7 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1495,6 +1495,16 @@ const struct hvm_function_table * __init start_svm(void) svm_function_table.hap_capabilities = HVM_HAP_SUPERPAGE_2MB | ((cpuid_edx(0x80000001) & 0x04000000) ? HVM_HAP_SUPERPAGE_1GB : 0); + if ( !cpu_has_svm_avic ) + svm_avic = 0; + + if ( svm_avic ) + { + svm_function_table.deliver_posted_intr = svm_avic_deliver_posted_intr, + svm_function_table.virtual_intr_delivery_enabled = svm_avic_enabled, + printk("SVM: AVIC enabled\n"); + } + return &svm_function_table; } diff --git a/xen/include/asm-x86/hvm/svm/avic.h b/xen/include/asm-x86/hvm/svm/avic.h index e1eb66c..8411854 100644 --- a/xen/include/asm-x86/hvm/svm/avic.h +++ b/xen/include/asm-x86/hvm/svm/avic.h @@ -41,4 +41,9 @@ void svm_avic_vmexit_do_incomp_ipi(struct cpu_user_regs *regs); void svm_avic_vmexit_do_noaccel(struct cpu_user_regs *regs); void svm_avic_deliver_posted_intr(struct vcpu *v, u8 vector); + +static inline int svm_avic_enabled(void) +{ + return svm_avic; +} #endif /* _SVM_AVIC_H_ */