Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754777AbdGXUKC (ORCPT ); Mon, 24 Jul 2017 16:10:02 -0400 Received: from mail-by2nam01on0070.outbound.protection.outlook.com ([104.47.34.70]:17488 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753936AbdGXUHQ (ORCPT ); Mon, 24 Jul 2017 16:07:16 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: Thomas Gleixner , Borislav Petkov , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?=5C=22Radim=20Kr=C4=8Dm=C3=A1=C5=99=5C=22?= , Tom Lendacky , Brijesh Singh Subject: [RFC Part2 PATCH v3 19/26] KVM: svm: Add support for SEV GUEST_STATUS command Date: Mon, 24 Jul 2017 15:02:56 -0500 Message-Id: <20170724200303.12197-20-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170724200303.12197-1-brijesh.singh@amd.com> References: <20170724200303.12197-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM3PR12CA0049.namprd12.prod.outlook.com (10.161.151.17) To BY2PR12MB0145.namprd12.prod.outlook.com (10.162.82.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41c64db9-9e68-481d-ee1c-08d4d2cf170f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: 1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4/IuSpE/md9I6Ii+LrsT+PfwfQNNstBDK/qz2xICvryygXB5KBxPTEaDg2YhFYsRpMGzwPTTtS4j1J81H7lX0LVx+e7qHrIUN61XTXvGiHZMs8J6psGWlSbtRRXbwbOmI43MSVcSWil5gZAy6/Rxp089SQwffVp/7C9pQ/SnsURSKnxEkSy4D41fOFXCGUja/SAHTheZ/cxNKNqTzAmjBFKamKOYjF5CH+IDdKs4l7QA9bYolMWPVo43jwU30yyiMARGDXaX6ORMP0Xtzl5/n22ePTz4pwN34/pBqZr/zqzoseigYRNc00g/Z1/0xHLZauzjjPfbGk84dlIhIIFTwRwfURavbIPdcQFVIuXupHxK3KtXs0k54Ectj8h4= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:EKYpaQ5/pjkmNombZWp1GxvxfEgzWvLoWGtrMlaZnp7GlI1x/+nBIZHgziF43Xh7TTJBxlCnrz5PuSRhgbqVcos2+oQ8pswUWZa+NJMbsEsKPd0G0oIPPSQHKHJBkDaSD7QxXLquT6W++g+MOwy7rPqnHA4+JgLG4eAg25kCL3edOEOKeLaZfEygK1hVgOGBMyyt2BM37OqBioH16OjyyX7q9+DuTjqEanOCM5fk72WQClABOwiMfeDe4Qpxg6lcDmNzu1ikwBOoxByah7OgQ3wp2w2A2hBojmZ3xg8mwxnnt69AyCl9BQvx19aIA+WTG6GBcjKg8WKcgNzawovw6VrCKF7ZdJO/GWziVvr6ZsZj4z3fzMrRTXa5Rd3/aIYLVFg69Xsi0ekCijYeb8bPj4FOwvJqvOgJdp5dyf0th8ID23YvY/c8xK6X3PUK3wfTw62Q9qfkDU41l4QFJJJZfP9DxdRteiymW+ihoxWy6QwU07aV7LzjogZ4F+wPnLFM X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR12MB0145;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;4:1UulbfKSOu/LrxwdaD835GLPFqdAJbJ4nOu34xypdk?= =?us-ascii?Q?2gV+2O6QKp2V+8KOeT1bbkB233VzKAMyYD1OP4PHQqXT9PEen88a6U/NZajP?= =?us-ascii?Q?RfoBX68YvMlCm85jVYQJFzUrG9+BY2UNnWbMyPPXTKqL7oZ4nqNqMZRAlzKp?= =?us-ascii?Q?60tyZ4ruluunqHT8j8yFF0wG/ulzO/N5Z0tEsmf9vQw2tJItV/axwibJyzJO?= =?us-ascii?Q?QEG353aR9C0nOK4H6snF38/MnMGsJGe66Ke6xj/v68SUugC5ub1N1POVrx9a?= =?us-ascii?Q?0SnDAsLfsqi8eTYDBnpkc3NypOrsXhRJpTzMDVg4cuoTsDx5tmB2hB90u4kg?= =?us-ascii?Q?6UT+V0I9qXoVw4m+t8T0OAfK6WnR33IOx5T+dlHb5v2AuToHXHvjMBXUQvaR?= =?us-ascii?Q?HuI30FAza6oJPpX6LCBm5VVEvfLvGMYhmSexf5aQbT8Myz6JeYbOl7M6sMpo?= =?us-ascii?Q?21lVWMjD9N2JzzHpEpRMBmVO8bvSTY40aE/+79dsILQ5MsFSQKdpaHMD5jLg?= =?us-ascii?Q?ZPziDZnBWkuk7Gcqu2OvPw6F6N2OPMR3lMRZn3YqBkfs5IEFIOWweTLN70Rn?= =?us-ascii?Q?+pc/klQ9jP3Xmkr/DSfnE8MPzaqdTtK4yL9Xk2wDsLiyOsxouFMfwUDV8k3a?= =?us-ascii?Q?La93TOsP14JFtRSK+RMiBXff+JrGnygFWDhbC08SC6RheOGr8hn2j5tm3EOz?= =?us-ascii?Q?Jqwf6jc2IGeKjBFxNC9kP348xshSIAbb1Xf66MatKIa/11gc5kIij8P0WyIH?= =?us-ascii?Q?oyxcExP/pp0K9fQtmedgvGx1EA7Tj6Rb+oWLIWwZj8xr3xh7CK8NxKLkmiyS?= =?us-ascii?Q?KdpH+kwI2+RBtkAkkaDyikWcdsZ2J/e3EF+lczimqg2aOe6GEviJMwDQ+Ksj?= =?us-ascii?Q?2Mrs8/5ALp7GN1KkgACO0B4KRe79ZZykIvN7Vmyl7TiYZfvtfDptSb1bR9SX?= =?us-ascii?Q?qe9kVjeOuzLxX8cek8epxoDJzl5fhHNKw8M0gpyZa6isMT0QI5JLaVVnSCfJ?= =?us-ascii?Q?RAjbD9pytPN1D2qTagxd7H0vqkuw8nhI5Jqc6cbJ9RapVbxdjqHqv/TJjNWC?= =?us-ascii?Q?wjRZjZVSLI6oplSTZ7Tg4bnc98eo++mlYb3yAFcyZItlsI5jg3w/vIH9uoBs?= =?us-ascii?Q?eKIUHKFxfo3XKmX2rfO8YIoADB7R5Q2ta4yEVccyH1I+3rd7Gx30VFH7uGfI?= =?us-ascii?Q?01j1QWOz++QqeK0q7RtRfKSzydgW8jU9WI?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(189002)(199003)(7350300001)(68736007)(53416004)(105586002)(54906002)(97736004)(50466002)(6486002)(48376002)(2906002)(106356001)(33646002)(6116002)(1076002)(53936002)(3846002)(189998001)(101416001)(6666003)(2950100002)(478600001)(50986999)(76176999)(81156014)(50226002)(38730400002)(47776003)(5003940100001)(86362001)(25786009)(4326008)(36756003)(42186005)(8676002)(81166006)(110136004)(5660300001)(66066001)(7736002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR12MB0145;H:ubuntu-010236106000.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;23:QhCTree8lSyF20CQFgb6d9vEwLPGT64ZgcLF+E+Sr?= =?us-ascii?Q?jzvPXvkrEZ58nofgf7v2itbhQkSS31tGTrFkD/tqzYV/WlJJwRpyM98DHK4L?= =?us-ascii?Q?YnfRr8rNhMqUPRV1FTrft/XeYTkFHCkWma6+Lf1GKyEqsbd79a++SsBdnAe1?= =?us-ascii?Q?FlfktilD2K905KQpqVNG5R0nmZjQulGFAAPSqdKIk9YgMcBMFXfYLorAj1QK?= =?us-ascii?Q?/K+Pqj8iVzEq2EB2YaYBHIy0kSgrEvHVDQV2M25oFe0gJh2n388pA2+YdYMW?= =?us-ascii?Q?X+39HcDNlKSpg+I9BVoeNnNfKO7BJ89EBrV3iV5keK9bMEvj4lOaWbwOm//h?= =?us-ascii?Q?pu0EY+0M0gWY+KbDhke1AF2yK2sVow4xJK9kj4oBrDOkbqSekIib8qWO0rLp?= =?us-ascii?Q?oO8E4f2G4uOAHDNWmi1E61TWzl9og7KSMHeb/aIhh0fEiYHI4IDYthzfldWP?= =?us-ascii?Q?m7GTaYbxxvxWD7yk/3N9BL5X2aNr76f4WVnPegYoCHurP3iSHxDEiLJ5vejE?= =?us-ascii?Q?kOTkItsMIFzJ9K3E2WQJg/dIxHNq8tqBzIGURKeeA4LDyotlxCEDGw0AXPtA?= =?us-ascii?Q?NtPlqC57Z9pXDkdmQfH+ZhqD/VVo0qQjhn7x1kmFhJnOQFncN57Z9t2Xm60m?= =?us-ascii?Q?17fXPLvkys17Afc6U4e8NA1U+bymuMJSCRZLvfrzfVzvuKuTkL9/mA90wM+Z?= =?us-ascii?Q?cEuHakcinQLWhiKao6htkwfKUxiKo+43rmNfj6IDYieiwI757VjSQSlJ7Vep?= =?us-ascii?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Up1ZmaZM4tI2ZQBREvHx/SR9X9HPlncdTntKdg48YT9JRz+xH6TC6HGo1qO1AyunWhNuDLquqETwxX9BA05yO7ncpfKANejCht8Ppff9pYiEfA1Xlbw65fifZZQ2R6miCXQybfGF64lJUmXio9738kiYW8rMFoJ2zule6olHS8FdxeLCZIjGlSFZExeHJ0/SoiWs50cEMX4oYQLaWy+9wpjGoOdXCZ41j4SjFaEMeRHSyoF/OZTz9lJyj7AoNsHIPG1A= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:tySQhPlG1FHC3qcMGyDHWVO9UZiBiwgUGY21ToPd8Ll9gkQsSGQuK6uUtidECp5o7FMEJWwrhqBoFabH1OhRPS2hspXzqVc5twesC+5m2qK6YrNrvnfKYd2jij1waK3L4ApaIsxNOwLwbtWNtdQ31FtfF9MOwzyp13k1s4kIpPEyNIx2MvyIxDr3ZT4iY99P0FW221pTOzHRo1Y9rbL8UaRIYycHhK6ZL1v7Riiwfmx6tnFjTfOM2U16R4XJ04/k X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 20:03:44.3378 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0145 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1623 Lines: 65 The command is used for querying the SEV guest status. Signed-off-by: Brijesh Singh --- arch/x86/kvm/svm.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 7a77197..21f85e1 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -6024,6 +6024,40 @@ static int sev_launch_finish(struct kvm *kvm, struct kvm_sev_cmd *argp) return ret; } +static int sev_guest_status(struct kvm *kvm, struct kvm_sev_cmd *argp) +{ + struct kvm_sev_guest_status params; + struct sev_data_guest_status *data; + int ret; + + if (!sev_guest(kvm)) + return -ENOTTY; + + if (copy_from_user(¶ms, (void *) argp->data, + sizeof(struct kvm_sev_guest_status))) + return -EFAULT; + + data = kzalloc(sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->handle = sev_get_handle(kvm); + ret = sev_issue_cmd(kvm, SEV_CMD_GUEST_STATUS, data, &argp->error); + if (ret) + goto e_free; + + params.policy = data->policy; + params.state = data->state; + params.handle = data->handle; + + if (copy_to_user((void *) argp->data, ¶ms, + sizeof(struct kvm_sev_guest_status))) + ret = -EFAULT; +e_free: + kfree(data); + return ret; +} + static int svm_memory_encryption_op(struct kvm *kvm, void __user *argp) { struct kvm_sev_cmd sev_cmd; @@ -6055,6 +6089,10 @@ static int svm_memory_encryption_op(struct kvm *kvm, void __user *argp) r = sev_launch_finish(kvm, &sev_cmd); break; } + case KVM_SEV_GUEST_STATUS: { + r = sev_guest_status(kvm, &sev_cmd); + break; + } default: break; } -- 2.9.4