Message ID | 20180207160638.98872-25-brijesh.singh@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <kvm-owner@kernel.org> 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 74B1D60247 for <patchwork-kvm@patchwork.kernel.org>; Wed, 7 Feb 2018 16:08:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6575925E13 for <patchwork-kvm@patchwork.kernel.org>; Wed, 7 Feb 2018 16:08:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 596822902B; Wed, 7 Feb 2018 16:08:13 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 C063029025 for <patchwork-kvm@patchwork.kernel.org>; Wed, 7 Feb 2018 16:08:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754638AbeBGQIK (ORCPT <rfc822;patchwork-kvm@patchwork.kernel.org>); Wed, 7 Feb 2018 11:08:10 -0500 Received: from mail-bl2nam02on0064.outbound.protection.outlook.com ([104.47.38.64]:53920 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754700AbeBGQH7 (ORCPT <rfc822;kvm@vger.kernel.org>); Wed, 7 Feb 2018 11:07:59 -0500 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=8EKwBtbVBrtd2l25fgn4kSfFSjwkUbMO1nctKQYeInw=; b=GgR6TOxEvoGij5EyNXJ8BcE/FMOelJHGzOlV+wxb928M+Y/7v3YAmkOorTSCx/3zhTu2GyaQP6hVXmwmfhvi0CJi4UAQoS20jClr0o0czJ7XacNiHzPoS7BtpVZuAphwCfNP44QYHqg/TiMF59vEx6hDFZbDvzpEcgYvKxAVM0Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by CY1PR12MB0152.namprd12.prod.outlook.com (10.161.173.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Wed, 7 Feb 2018 16:07:32 +0000 From: Brijesh Singh <brijesh.singh@amd.com> To: qemu-devel@nongnu.org Cc: Alistair Francis <alistair.francis@xilinx.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Cornelia Huck <cornelia.huck@de.ibm.com>, "Daniel P . Berrange" <berrange@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>, Eduardo Habkost <ehabkost@redhat.com>, Eric Blake <eblake@redhat.com>, kvm@vger.kernel.org, Marcel Apfelbaum <marcel@redhat.com>, Markus Armbruster <armbru@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Crosthwaite <crosthwaite.peter@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Richard Henderson <richard.henderson@linaro.org>, Stefan Hajnoczi <stefanha@gmail.com>, Thomas Lendacky <Thomas.Lendacky@amd.com>, Borislav Petkov <bp@suse.de>, Brijesh Singh <brijesh.singh@amd.com> Subject: [PATCH v7 25/26] sev: add support to KVM_SEV_GUEST_STATUS Date: Wed, 7 Feb 2018 10:06:37 -0600 Message-Id: <20180207160638.98872-25-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180207160638.98872-1-brijesh.singh@amd.com> References: <20180207160638.98872-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM3PR12CA0071.namprd12.prod.outlook.com (10.161.151.143) To CY1PR12MB0152.namprd12.prod.outlook.com (10.161.173.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 01a9edb1-d5f3-4fe8-2d3f-08d56e44e5fb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY1PR12MB0152; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0152; 3:6X65XYa0i8rutftnJh8ywphYe0xZpuLNdHsqHc5lRvkNh43FovuCIKXFBXgOJNYplxm6QJucyH/mPWtVqcdEGFwD9tKlgAG/JEopxPCoY4UDtkeoGmzRSMcG6A5HZK2vw7fifz5ojPOD49ANqMNFkwL4A/gvrBvJ5VwckKM8lMNbe7cWbqIw36N9shvNTcYxsbezn8CQI8PbuSB+UT2e3zS4m70zKeZklQ8xAEc3zIHDgPD3KLZF9H+2Wdg6eY5j; 25:TRRLb8bXVqLja5WRaoJ2+Lr+Y7oKfRaceNaWRNbjAOtlyH/ZCAME9E0RZfJLOC15BhX0cGizFovOgmP9PGXJJ8IDzLaPsaeEyoVWU+hYNquiqSu4BDoafxjJQBP81VBYCMKjzsDTHj4/yS/IerEePsOE5jono2paZ0aLdwAgvKl9PWesd8rE8bTAdkoihXVqR8KcBNZXW8dBqFjcd5FWkNTRWMIDpAfWPZU9x+ri/jy67jqR9EBh0BzcgaSmROvF3DazmJYxGdVKt7e1Q6S9JGWsGiX/uajTSyF9oIuxcHcRX5zyt4RnaMbPLfNNdxpa57mW3MRd+QOh/Q6j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RSGrWU3+IIPDM+l5LR6jlool7Hzg54sT9qONC8cnGOMR+767vSW/ClzYfM/BAysd7rDswjlm09RrpMWXFtUakh0KMSVU7Ydp7f+R6nQ== X-Microsoft-Antispam-PRVS: <CY1PR12MB01524863FA5CF2136F7551F9E5FC0@CY1PR12MB0152.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231101)(2400082)(944501161)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:CY1PR12MB0152; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0152; X-Forefront-PRVS: 0576145E86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39860400002)(366004)(39380400002)(346002)(396003)(376002)(199004)(189003)(50226002)(68736007)(8666007)(51416003)(6916009)(7696005)(16526019)(1076002)(50466002)(6486002)(53416004)(7736002)(305945005)(53936002)(8656006)(8936002)(8676002)(7416002)(86362001)(4326008)(81156014)(81166006)(52116002)(2950100002)(478600001)(2351001)(66066001)(16586007)(2906002)(54906003)(5660300001)(106356001)(2361001)(47776003)(48376002)(105586002)(3846002)(6116002)(36756003)(386003)(316002)(39060400002)(26005)(97736004)(186003)(76176011)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0152; H:wsp141597wss.amd.com; 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; CY1PR12MB0152; 23:Oy1ADm8z5dUU3ch6Xs0uD3IyUi8HIMlYmpOab1EGJ?= =?us-ascii?Q?6+YdLd6UXctWk9RbqVlYybOmV3WPnrvakU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; 7:QxocMWXhalLqj+q9dp4iyjLLpoKqbGupNkkh9x+PCHKYya40M+R/Qgzbnx0j7JDiaeCiLwjGb3ykR1AN6Y48ZbBm01Kj1Nd/9yFDTE63sIVdW7H5l1yiTVlV/lHoe9PGC5/cGE/XUEIk42O4kJ8l8zvZlVibAjFeyXHo5xrVdeGi/nl29idcmnsCJlTv9HrRog/K9CbPQ8T5sirz3mOnqTchJuobkdR88F/TqgYjuy0fFm3AqO9GFc5XXzdUotiR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0152; 20:mr3GRGucrH4qRfRR6iX3D0cKvkUKoLQMJ+Db7U5lzd8t1IVPgSz82zmIE/TpbiTfxPqwjsYbWs2Rsui/UrW28D09wVhfK0qLaxyc3OmeYPkYbrwztxehp71Rw9aKOZDOpkR4kNwqQiuD4quKrIQ7lCgyo1RmCCUknqqA3L1iDMvw7zw6sQUzjWusuGd6E5e5ZqNTSiNEKWsjdUFh3P2z+Z4hp7VUE1oFt6ycfsrSEgdqcIExWGDcX5BrOkQh6FPU X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2018 16:07:32.8693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01a9edb1-d5f3-4fe8-2d3f-08d56e44e5fb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0152 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: <kvm.vger.kernel.org> X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/accel/kvm/sev.c b/accel/kvm/sev.c index 186834364eed..b149f4ae6441 100644 --- a/accel/kvm/sev.c +++ b/accel/kvm/sev.c @@ -418,6 +418,18 @@ sev_get_fw_version(uint8_t *major, uint8_t *minor, uint8_t *build) void sev_get_policy(uint32_t *policy) { + struct kvm_sev_guest_status status = {}; + int r, err; + + r = sev_ioctl(KVM_SEV_GUEST_STATUS, &status, &err); + if (r) { + error_report("%s: failed to get platform status ret=%d " + "fw_error='%d: %s'", __func__, r, err, + fw_error_to_str(err)); + return; + } + + *policy = status.policy; } static int
The command is used to query the current SEV guest status. We use this command to query the guest policy for QMP query-sev command. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: kvm@vger.kernel.org Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> --- accel/kvm/sev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)