Message ID | 20180215153955.3253-26-brijesh.singh@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.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 35A04602CB for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 15 Feb 2018 15:51:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25E3229506 for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 15 Feb 2018 15:51:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F87E295BB; Thu, 15 Feb 2018 15:51:23 +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=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 803FE29506 for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 15 Feb 2018 15:50:54 +0000 (UTC) Received: from localhost ([::1]:60788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1emLoD-00051L-Bh for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 10:50:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1emLew-0004o7-8L for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:41:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1emLes-0003f3-Ao for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:41:18 -0500 Received: from mail-bn3nam01on0048.outbound.protection.outlook.com ([104.47.33.48]:15268 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1emLer-0003eo-S1 for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:41:14 -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=DfL+ftRLjOYEQmBwNI5wynVcOHNt/nQ0bdhyMh5mMXA=; b=wH7eQL6NR27N0rI5TaJDGLEqb8jZefYvQLwTD1CYiMcFI9esAUSiDw6wkhGgVUyBuGSmPSgI6ivqsm+3xJRKi7c0xP7PdTsqLvfGtjERnYc+G0+ELUBWG1hkMPLnZQjrB6YUDcrLSc7/JtD8P5hhYpfnkl4Ym1HhcXKaaWl3Y8I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0157.namprd12.prod.outlook.com (10.162.3.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.18; Thu, 15 Feb 2018 15:41:09 +0000 From: Brijesh Singh <brijesh.singh@amd.com> To: qemu-devel@nongnu.org Date: Thu, 15 Feb 2018 09:39:51 -0600 Message-Id: <20180215153955.3253-26-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180215153955.3253-1-brijesh.singh@amd.com> References: <20180215153955.3253-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR04CA0044.namprd04.prod.outlook.com (10.172.133.30) To SN1PR12MB0157.namprd12.prod.outlook.com (10.162.3.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 65efbf7b-b1c8-4acb-23eb-08d5748a89bc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SN1PR12MB0157; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 3:TVPOmjBFAfHax7WLeQSYVbKGYSrZn5/VpwNwRbl82QEKcpjEPs6bJuj3i/ZHwQ4+4Bh+1JuOQKPha/PUCvijUECGR3ak4C19a7Sx2A6+jhuSZOBI2UQaYg9bGfoi2xKsxmCAggARwXuCG/BOfLPTCjfXPJZk7ssbLPwuatT3eWE25PK04EE9vlUISCo8VqYB45USmwsc+AahQ9LVRwT/iTF9ndwIEFBeZS5lSBvvrm0lIKGnpzyFTspSGo59Jv4E; 25:FfKk52yUGj4FrybHJB87rNFbWmXvjymCGHWkjI7D3jzyWwEich02k3D5s6WC7nivxC6tBNQZU2kP8XAZtyOWNVCWJOM7QQT7MSTH97+anXb0NoNUifOPBmKpSoNoM9kdABsgQZiymf4VNxukBkbEJK+uPgyWDB4wmCXqkbPgrKLpbQgnXGAHBBJ+hZfBf1pVcJZzO/fbPu93l5QCrEEm1sdglXiJx+BljO3RmgHCsi+kYtGLff8/X4faxX1w6dntlL14QmzSBkzRYFKidpPJC8HDUSAysm0elZh5osTd/ij4cDibw/QgqMUAH/v9HNillebmonnTZ2FG+mmO8fwBYg==; 31:n3/8d5yAdCMunBZPjjvunP7P3EYmbgPvO5HymfknsgAXHX/FbNLHedwMoGr6pmmthNbdN/twESU5qltTiWfMXoMpq4ea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: <SN1PR12MB0157CD0F2DE43CFB4A1DDFD3E5F40@SN1PR12MB0157.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231101)(944501161)(6055026)(6041288)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:SN1PR12MB0157; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0157; X-Forefront-PRVS: 058441C12A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(376002)(39380400002)(346002)(396003)(39860400002)(366004)(189003)(199004)(26005)(3846002)(386003)(8936002)(5660300001)(186003)(16526019)(316002)(6666003)(8666007)(1076002)(54906003)(6116002)(48376002)(50466002)(7416002)(478600001)(8676002)(68736007)(86362001)(16586007)(2906002)(50226002)(39060400002)(2351001)(6916009)(7736002)(106356001)(51416003)(8656006)(52116002)(25786009)(4326008)(97736004)(2950100002)(6486002)(2361001)(36756003)(76176011)(81166006)(53416004)(66066001)(53936002)(81156014)(47776003)(305945005)(105586002)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0157; H:wsp141597wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; SN1PR12MB0157; 23:IxKvP7BpGdbe28mW/F57MhsZhz/YrlqPIEWZsgb1q?= =?us-ascii?Q?bIPBiUlv/Fx7SCPmA+xc0Hrz1GUwo3ch5J2DY8wzKzdXGPEzkmm3SR67w7M/?= =?us-ascii?Q?j3b99zKsNhnwzPpVLzeUQVX2AmfZa1iE0+4goUA214PR2pgKy97blzi0HARq?= =?us-ascii?Q?Yr2hCf4QsCc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TlpqxA0oApI16TfvlvyTShrMW0F/1ftMzC9Y9asTqcQl8u0Ab4O4ZODeAQow6QsbultjgHDo7gkZ3Eeq1my2cAgPvJ4gwNbCwcTCXF3SBd8juL+tNCmwd6EywY0rZRpPxMfFFb4B/0Frg10ESFlXArF3PeNqdnu1bj2INn3jwJYfuAziPkt0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:yE6VKB0PzfxfwJfQOyFls0oF+5CCZlAsGrQsE3mhYUYBrpQhynjttAJlilzzt1zHKqeQJY/yY3LILnD7GPgJb5MgQRU3zYJiFIGMAmKsyGf1f1xdiTPFmqrTueKOFj8R1nZftT1DcQ3Zia8xqRzy8s/YZUl9E0yz0AtcSOE7mn6DmEu+espJ7Ew3EaClqzmLuSjh+Im6/ipuiuYWNbCro57vYIHO4Trpj2Pc8u1nTjHaCsLBBMvcM92Q3kILak7u X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2018 15:41:09.1347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65efbf7b-b1c8-4acb-23eb-08d5748a89bc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0157 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.48 Subject: [Qemu-devel] [PATCH v9 25/29] sev/i386: add support to KVM_SEV_GUEST_STATUS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, Brijesh Singh <brijesh.singh@amd.com>, kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>, Stefan Hajnoczi <stefanha@gmail.com>, Alexander Graf <agraf@suse.de>, "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>, Markus Armbruster <armbru@redhat.com>, Bruce Rogers <brogers@suse.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Marcel Apfelbaum <marcel@redhat.com>, Borislav Petkov <bp@suse.de>, Thomas Lendacky <Thomas.Lendacky@amd.com>, Eduardo Habkost <ehabkost@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Alistair Francis <alistair.francis@xilinx.com>, Cornelia Huck <cornelia.huck@de.ibm.com>, Richard Henderson <rth@twiddle.net>, Peter Crosthwaite <crosthwaite.peter@gmail.com>, Paolo Bonzini <pbonzini@redhat.com> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/target/i386/sev.c b/target/i386/sev.c index e3236f5bb7b6..559881084d50 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -437,6 +437,22 @@ 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; + + if (current_sev_guest_state == SEV_STATE_UNINIT) { + return; + } + + 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: Richard Henderson <rth@twiddle.net> Cc: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> --- target/i386/sev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)