From patchwork Mon Aug 22 23:24:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9294783 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 7DB3B607FF for ; Mon, 22 Aug 2016 23:59:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FB7D288C3 for ; Mon, 22 Aug 2016 23:59:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 640E528A54; Mon, 22 Aug 2016 23:59:20 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AD4F288C3 for ; Mon, 22 Aug 2016 23:59:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932787AbcHVX6u (ORCPT ); Mon, 22 Aug 2016 19:58:50 -0400 Received: from mail-cys01nam02on0065.outbound.protection.outlook.com ([104.47.37.65]:41796 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756934AbcHVX62 (ORCPT ); Mon, 22 Aug 2016 19:58:28 -0400 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=VWIG+VBcl4MerO2ZW6dDY1UyNxeiCxqiCIxRiZO43Jg=; b=4KcReQ8T4eVWOeV/hCxHyo97ja+64MqFedUh9pO3kxsNKjTcMoFnZA5rI4SIIE7/u6CwHoQ19gVCEbMx54XWXT6WYT4uNs/tltD2d27XeM/gn+DlKFcQ8P9io/C2eo7QGATvZ4ODgbkvw9IsgbnftkrL8qnjVpu3A9hQvT5FIV0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by SN1PR12MB0669.namprd12.prod.outlook.com (10.163.208.27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.13; Mon, 22 Aug 2016 23:24:51 +0000 Subject: [RFC PATCH v1 06/28] KVM: SVM: Add SEV feature definitions to KVM From: Brijesh Singh To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Date: Mon, 22 Aug 2016 19:24:46 -0400 Message-ID: <147190828659.9523.13390615310993962670.stgit@brijesh-build-machine> In-Reply-To: <147190820782.9523.4967724730957229273.stgit@brijesh-build-machine> References: <147190820782.9523.4967724730957229273.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR08CA0054.namprd08.prod.outlook.com (10.172.144.16) To SN1PR12MB0669.namprd12.prod.outlook.com (10.163.208.27) X-MS-Office365-Filtering-Correlation-Id: 70fe9802-4009-4ef2-9fd1-08d3cae38621 X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0669; 2:IIWtFT20LuMXksmgjXDGv7VmlXYCDShhwIpN0/8RHuD8kXDq6SqCeNVTxULkL7NrBX1xGqu9Tec4zhxd7TO+qXGtYEE5ZBuG/qAZ2FAhQN2DiLlTvnV9lKCROZWcK04aG7mEqxJZV+72sn+af+zeK3nzIj6KT/vJ8spditJgvGPmyTxKsfynS72bY5y8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tyj2OKJ8E3G81X9YuLKQPtcR1j49XbIl7jzm2ZgPpb34ueBBSrYZgGq//6Ri+dW7QnS576TD6KRW6MoOqXM24QljjJYp3sa/NuPCsf4Ab4lb8p05S7hJe9XeuNj0bdWlo5ffQqjDz2g40rz7ZPUN11vtoI/kvnz1EvGtMUcYAsd8W4SUU=; 20:P0Cph4h3BCqcs4QVBObaTSRfX5+M0ndKQdcueKmIUb5DkbImApF5IHMBDSCvzz0GCnAlcE0Z0ladMO7EFn8f3sT9NC9YIftWNJ1M6QDLuSa1bF5I2qRlYNg1KMybEykVQCsat/ygF+soi+5/vHzxCJAovW40/7jeax9ktP6sPpnCLc/QcbmwWQm5Id+0YKNNuA1LtaA8uswWZwOMjgb0dKJ5cAagu0rRF1uE+8aAf0nlWBO8p3eNx2ljWQA2sIpE5C1uTGqUdeIIe7QJ08OJQMKw+TlZJm+rLS5KGjin99Z6AoPEcN2W3hVy4Ql7yPDvs/IJT3eIcvBS6LJKYRcHPZlBIA5r/NL6DpYVzgA37XxlDebw6u6I4VLItb/OufYTyyZDXAAYHtKbLcezoS3EjNXKAXKJdjpGeL+0NExP9w1V95cAh03nzUMwicHZPYhRdb6SR10uraoDbMMA3WvmJ2oPE4MZfHb01CKtY/26T3ZvtxMqfB+n8Roji34XF+Lj 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:SN1PR12MB0669; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0669; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0669; 4:kJTgSc9LkbMurBHViB7JA45/5abeWO1fs3yAhQDFWYbRVnpTQNsH3xrsgSzM4vNyK8XGcK4TGF6fZzPtVod5tNk0K4mOz0B1N0PufIhfdeTe16bY0oGtxbWQjJI7+CPqSpmeQ/6yPmaz33RAVTC4VHpInwH/6GHvF8OTjAChQ4qfj4UWYXTFu72TiN0spr7Lql2NQjEoAvqzIYHT2P1dzFUJkeg4vKo5qq6UD2fHR7P11Du7PvuoGQkiGMDHNdKYyqSzcKw4iCFG9HwBIIRNxMGD3WU/t39QUO00ZZvj9oJQcvHSlNBo0kMBY2TsQusp+uZMgNIkqEu4vWV26IT+Ll58AYcd5WvinYbFJIg+D6ZriLzP4kQg1VHnxHI/qQjt7/P7oa5vkchqV7pksve9QOfpApCTXeDPi3fUeO4jfzklr3Nyap7Tz/zLtpUU0bgP X-Forefront-PRVS: 00429279BA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(199003)(189002)(586003)(68736007)(50986999)(76176999)(23676002)(189998001)(47776003)(54356999)(107886002)(50466002)(6116002)(3846002)(229853001)(97736004)(5001770100001)(7406005)(7416002)(19580395003)(4001350100001)(77096005)(103116003)(2950100001)(101416001)(9686002)(83506001)(305945005)(105586002)(7736002)(2906002)(7846002)(19580405001)(92566002)(66066001)(33716001)(2201001)(86362001)(33646002)(81166006)(81156014)(8676002)(230700001)(5660300001)(42186005)(106356001)(921003)(217873001)(1121003)(2101003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0669; H:[127.0.1.1]; 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: =?utf-8?B?MTtTTjFQUjEyTUIwNjY5OzIzOm1TVGE3M2h6c3NkWk9rVEh5cFRmMkx6Vkcw?= =?utf-8?B?OWozNGp2VUR3a1pEOTNLckNYOWc0eG04S1FLanFJSEhmT1NwWVNqQm5yaXVr?= =?utf-8?B?MzcyYkYyaS95Q2I4NWhPc3FMWUNEM0wyTm9RcDRsNlZIV0h2eVlldDI1UitI?= =?utf-8?B?NTFIeXJPUTNGQzJJekt4TEpkWm5iaEJpbUtlZ0lNWGthbjJqNkJ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GoFHLDEcjF7C/387axV6A/FNLOdcYl58mKqz2hNWi6xIznesMLP3fIgE+SHrzzFIEi/H7eovRkrVs8VylL+S6HJh5eeOFTqteTHykUgX/bepJmFQ0sMgJPYZcMKp9vvXv69qEw1vq5BcOJMgtVxdnGBPoL2ykg==; 5:dGPaRnGZhtANg8Q0wx0DPsOoMJKtlQpSnRrASB9QvK6q9Sp8R7I5IC1yi7mI7NdF69ou1G+uVrlWclspqNYG37BL7UqzHs5xIPyqKKnirVYdxCP6HXOvnvns2hlpQWOK54AtG+EQSbSEkTwwqs0b0w==; 24:TiurfS87xzf1XQZoLKxoSlC5h23QMDbbqDilfgtKa1J5x0ez7JHVzswZWBh2thJ7UDp+QLFGu8+hXgeQkbuLGRIL50coFHLA4ByHuiE4Hq0=; 7:f+EyyJIa/UbjnMNasxOfSuLIieFkpLSIvYlmX5q2e7hhujFTi2zHwRBozYVyrrExDc0oYaF1/bIaUMVaJAqA2+R5/+XDoftAUjKyJfmsZCXvLcEVTsMiohcHFCErVLfYLsVcfV69VWFgwwQnpprwhrtlmhQHLFVJrW+lSNpj3F6Ss5W0luZtoA33tAWEnNfVHLgfBWTVhfRqh60LL+Tv5tKMrkq5ZD0BwwiIfzxZ1GRbpidRZibCLqQ9ay4awCKU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0669; 20:YkEtRT/DFxpAHdJfk3VfdazOpodweerIltXSNX3dqH53/tLkT/tfxkPIF+rLb9wpXBXQFUKL7LDQr6+QF6kwMd4I4vfqDdmleAxIG3m97RBkEu8CB4HuPGiddcP2G22qN8V0BKozALEzLUX5hKUAEkIqNx0VK9cYcBfxt1q6zTB6oO8Bmnvnl48SgcV7zbVfdHDGoGeD2xwaSqeHqnvBYx+1zAUbMYc9dXwxkVnrpwdw0xu6n/pihDQgMQmcslcp X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2016 23:24:51.3252 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0669 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tom Lendacky Define a new KVM cpu feature for Secure Encrypted Virtualization (SEV). The kernel will check for the presence of this feature to determine if it is running with SEV active. Define the SEV enable bit for the VMCB control structure. The hypervisor will use this bit to enable SEV in the guest. Signed-off-by: Tom Lendacky --- arch/x86/include/asm/svm.h | 1 + arch/x86/include/uapi/asm/kvm_para.h | 1 + 2 files changed, 2 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index 2aca535..fba2a7b 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -137,6 +137,7 @@ struct __attribute__ ((__packed__)) vmcb_control_area { #define SVM_VM_CR_SVM_DIS_MASK 0x0010ULL #define SVM_NESTED_CTL_NP_ENABLE BIT(0) +#define SVM_NESTED_CTL_SEV_ENABLE BIT(1) struct __attribute__ ((__packed__)) vmcb_seg { u16 selector; diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h index 94dc8ca..67dd610f 100644 --- a/arch/x86/include/uapi/asm/kvm_para.h +++ b/arch/x86/include/uapi/asm/kvm_para.h @@ -24,6 +24,7 @@ #define KVM_FEATURE_STEAL_TIME 5 #define KVM_FEATURE_PV_EOI 6 #define KVM_FEATURE_PV_UNHALT 7 +#define KVM_FEATURE_SEV 8 /* The last 8 bits are used to indicate how to interpret the flags field * in pvclock structure. If no bits are set, all flags are ignored.