From patchwork Wed Mar 8 20:52:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9612011 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 237316016C for ; Wed, 8 Mar 2017 21:36:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1541228480 for ; Wed, 8 Mar 2017 21:36:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 081B72862A; Wed, 8 Mar 2017 21:36:56 +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 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 63D9B28480 for ; Wed, 8 Mar 2017 21:36:55 +0000 (UTC) Received: from localhost ([::1]:58574 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cljGQ-00062S-Dn for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Mar 2017 16:36:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clj7D-0007Aw-8e for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:27:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clj7A-0005pf-3I for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:27:23 -0500 Received: from mail-dm3nam03on0044.outbound.protection.outlook.com ([104.47.41.44]:60518 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1clj79-0005pP-RO for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:27:20 -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=x5BcGg8p5Rf79wV1wMLk3VTkcRjrpkJR/buizSRWwvE=; b=M4wSawU3e6IHmp0CE70NGV6X69F2CqDqAuWmESAmRvcxE67DuQ4lKdAiGc1vAQRX4/9oA4kiKHM1dkmcvYqqLAgmiumXl5MXgKqHnOoFY3rcHvsCkhNxbAFkq+mZYSxXJqlk3iLQpglfMiotRs7h3IEY7JllPYviYpN2y8P6UDM= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from [127.0.1.1] (165.204.77.1) by DM5PR12MB1610.namprd12.prod.outlook.com (10.172.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Wed, 8 Mar 2017 20:52:30 +0000 From: Brijesh Singh To: , , , , , , , , Date: Wed, 8 Mar 2017 15:52:26 -0500 Message-ID: <148900634659.27090.2157657994637303677.stgit@brijesh-build-machine> In-Reply-To: <148900626714.27090.1616990932333159904.stgit@brijesh-build-machine> References: <148900626714.27090.1616990932333159904.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR07CA0011.namprd07.prod.outlook.com (10.172.94.21) To DM5PR12MB1610.namprd12.prod.outlook.com (10.172.40.16) X-MS-Office365-Filtering-Correlation-Id: 6bf25bd8-bdf4-4161-e6e8-08d466650a7a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:DM5PR12MB1610; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1610; 3:zX2rKVdiRFaXSah4ftdios9/bPdP9yw/IR6lzyTCFK7I1SZD7Lqs02YRGmjpncABDEq/GEI4ypcUzdwoTMWUdFx8VAFc00s59XShJo6gs0BO0ZBwdKEDQUPwC5nbYg6cx4/t5aDkjJxrFAyJykL67ILGhJCUHYJcKTbCdest5JTPkWlBSXKW8FUB3Q41fAHTmHDDvKOvTmq9tCJpHUYHSaz6o/5RRXYNMWkbbdyEon5d7Tt2in6QSwn07weWmfHseXKDRLMDUJh7pkPJQNIDJjnPx7pkT2HAbeqYo5cMY68=; 25:D2TFpsikRcTmMosJizAfkHVCiz/iXK1kRzFaQ4sMgTa4Gwl5GXcMdsav8Odg9EG29zIT02PKqzQW2mNMJ6JMCc43g0kpNsOT5nkcAdGsfYNBu+cTmC9dHuOy1GfQIe9FDz2TNzVEQFKTi8jPR7/U75HpvwN4aR6GsJz5vV2rAXN0RplS4WU7x0LoxLpkDvtGLxc4S8J9Hwk509agicUwWme34fiy79pMqL08F4eYteLazb3faeIjD16Djp0FlQqB79OGEK1QD0OflOJgt2SVA3YA2pi6wj3N2CndwaZOe43pohAEGHpuO4FH14oe6eFIezmHPeiDdsW0E7Q12tIwZFsvecVb39l9/7KmEacg4mNLP/pEkTCAbD/khhZTac3olU8X4tyEHAD/IlEXM+9wKFsDRF1i4B/VWVKs587KSeED4gUYh4JLbHRg/Ey6/8+PLxfbtIyDxls8m+j501JZeA== X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1610; 31:eHywI2wjubV/4ipPCWgMWw2agjQThhxh8ylYe+njbG/R4cPCqcPaXEY1rYot4hQmYy0w5qkjsGjCXcqzX6+ezyLe01e/66P7MnVC2mkbOaYBBzokbw+8JChryAaTAtC5ZkT9+KpLzi93yWp/qU1ZRNFmKl7LNvtqzts9WUvjHZArnNLAQDx3OeL4yMyV8fHLQwL2OSoLnpkmXGSXnoXYMp0h23u3QVPBbPORrfGpCV77k0o8RvyisZ3tzyArMMef; 20:zKqwahDHRnkBSyNTsDzhPqDiktwxqaytdH6PRzZ7TZ/HZOj2Iimr9zAxkzrmNgcva5RkpwyfKvq/rDDiho86bH+HgX2yQ5NpvvKhXRYKzm4n/GDoN2YmJXiKIhmfiSIVuxsP2OL0lafilatIQTOZsbAL2XZIXOQ8/WzZbr7fcGRfF4jG+KOvT/OJ8cVjtlNXPS93FVSH3mXNsus8y3Fvr7XRe806KUSxOytQKAb27rUK78iRHV8zwKQBTftT+weP7ectE3VJjYadG1b3z6/fQm7gldyvHRxupQU60J6JkqTH7E25uje+02/uJRaI/Gzz6Ai+MEU4r0NtD/f6vtWfH45aEOC+8x+Bjt/qFmigdLakMdCW/mL2TtCOaHat3UXDbtAJqzwyNaws589O+QoXWExypYzJiRmyQdvfv65yFB6RofZ1F5CfS3ouHysrcUWdYed71Xj0Q2Z0VH29Fp+pIQwVce/8Kj6a+O3G1X4DwPe99kynKcepWz+9StSycIqr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123558025)(20161123564025)(6072148); SRVR:DM5PR12MB1610; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB1610; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1610; 4:xdC/SVlA/RePTRAxdmKQs6liW9gwPC2So7EeGmjbyT4onOtoWjDT46hBAPoprQmkXSvdCWoqTB5UUu03jjihvM4RTf7c3pk8N3t4WXXLm0+vbSvXP27cTxBGdQ12TfSSf9u2SlFx9JlO6qdQa6M06YIsihhaaZ51By+RS4wWRT+GaCMucgA03hJVJvnw9cjpvHCVJznR8YWJl7QhNeT5sBO6A4jt0tm/nVso/K2WVPqBmWR7zK0Lwip1ml1SyFTJvuHMANscW/nLp++8iLcg7JyrGgI7dxa1nJmR31OcwiBUq6485njeorCBEjNIOragV5xIAVt7XDCc/pt9jbd1wBYNpRSJ3IxEDB1b7GYP7JC4zik7/pX1msfBRuLSsTU2tfalX2QdjIp6N9ksD6sG1eDfnE5JJ0QZHaX9V1bC1CvOmJT8zcwIpdqY9oJCMNWn9rmZBt4nG788Y6Tx77EZ3MRXhnd+DnyRtAplu5ucsCMKsDYcy0wkIRBmRbCO/dft4Z2UWMHlHKh3JaCwy6HMT3liU7OBFqVEQ/573lalNS58/diB7sXu5lyqr7Xa6DDpNzMiOm89Y3Cd/5VEm4kS4feLFDvrPWgsqhYSSjYQSbEHNlWvb2kZR9O/7/65LeQ1UV1qYPrQ7UxR/HfST1kTc3oakPJe6g1u0Sc1tI+99Io= X-Forefront-PRVS: 02408926C4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(39840400002)(39860400002)(39450400003)(39850400002)(39410400002)(305945005)(47776003)(5660300001)(33646002)(6666003)(6116002)(3846002)(66066001)(2906002)(90366009)(2201001)(6486002)(7736002)(77096006)(81166006)(230700001)(8676002)(2950100002)(33716001)(575784001)(86362001)(103116003)(38730400002)(83506001)(42186005)(25786008)(54906002)(50986999)(76176999)(54356999)(9686003)(53936002)(189998001)(50466002)(4326008)(23676002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1610; H:[127.0.1.1]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxNjEwOzIzOndqQ2hvQjZrbVgrZXk5S3dtaXpHUlpZWkJp?= =?utf-8?B?S2d1SENMaTR4cnd0dFVOMnRrSnRMTCt0ODdHN1ZYTkhDVUV5MGpSRTNtaEhk?= =?utf-8?B?TmNyWEo3alNWMDdmUER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DyqevhpzF03kaJkKs9SR8Ixd/zq5sRpeZ4oFfD4malXC16J4t8ndcJlvx+hIcj3pODYsnybaH0faZJXNoefKDNx5aGCMcoCoJ/ceg1O6Rkxxh/45BWiroKrIrVUbv0W66/3038Vhb2KYG1elaK4RG30S15KQuULm09yBGQ/cs=; 24:oRgnrHNhKy62REryq31ecFMgjjLJWwLybudhhxr4MVBKOnncqj3taasHcyTi+bLIq0C0SFr32P4PDcH5pAvMjelxyzLokp1fDqyHOhi/pdY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1610; 7:uqHIJXjwdVr64/DmziuwvmLAWINn3PrbgNO1cFc5fUtvqaNzpTmouOHIem/Yn+0ipYrDAK5OT+BgPtoxhX5jFpZxTD7MDOnUXk4usk0l33LQxQrLKAMzJtVqm1t5Lk0BQL/03dXzEvtqIuUI0lE6lPOMcU+FL8tu/d29R/0Avqp7YhGsUy0ymAfzODZpb/Jh3qEB8WH1yXCPcq1Wvfq+DooTmLi3p+xm0nYMibx/4VGlOZ/UoZRXQOjb4+cpI89edl+kQlyjhe8NQ6qf3wTwPpEaVWmlBUivoDcfEE4K+rM9yyB4uqzHKyEirHEA6XUlhbslmjuiiFDMyOE1ifQsWQ==; 20:IByQZR35BTZ15RG4ggXzXNjH5q+3TKi0ga6trufAvKgVpnoclrrchA+C8a8pHFFRnsJOLS1xQ/XlLdOsT7Ucn9e6a13ToSEBrJbjF01/sSCl6qg7k9zqXE5+dYdx8jaY+tbJKO8aJhtJtRa+wj1CHuRfjkZAG2dvuHiXQhSer+MHd8ZsdcpCpXA6PzaTgWYN5Us7hnrlmcHpbzKcfbDrpwANwWEci/xLPPKJ8CiUks0N/R47TYJ/050Dsk5NFbPZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2017 20:52:30.7989 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1610 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.41.44 Subject: [Qemu-devel] [RFC PATCH v4 07/20] kvm: add memory encryption api support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas.Lendacky@amd.com, brijesh.singh@amd.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add high level API's to provide guest memory encryption support. Signed-off-by: Brijesh Singh --- include/sysemu/kvm.h | 7 +++++++ kvm-all.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ kvm-stub.c | 31 ++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 24281fc..6f88a06 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -227,6 +227,13 @@ int kvm_init_vcpu(CPUState *cpu); int kvm_cpu_exec(CPUState *cpu); int kvm_destroy_vcpu(CPUState *cpu); +bool kvm_memcrypt_enabled(void); +void *kvm_memcrypt_get_handle(void); +void kvm_memcrypt_set_debug_ops(MemoryRegion *mr); +int kvm_memcrypt_create_launch_context(void); +int kvm_memcrypt_release_launch_context(void); +int kvm_memcrypt_encrypt_launch_data(uint8_t *ptr, uint64_t len); + #ifdef NEED_CPU_H #include "cpu.h" diff --git a/kvm-all.c b/kvm-all.c index 9040bd5..bba0f39 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -36,6 +36,7 @@ #include "qemu/event_notifier.h" #include "trace-root.h" #include "hw/irq.h" +#include "sysemu/security-policy.h" #include "hw/boards.h" @@ -101,6 +102,13 @@ struct KVMState #endif KVMMemoryListener memory_listener; QLIST_HEAD(, KVMParkedVcpu) kvm_parked_vcpus; + + /* memory encryption support */ + void *ehandle; + int (*create_launch_context)(void *ehandle); + int (*release_launch_context)(void *ehandle); + int (*encrypt_launch_data)(void *ehandle, uint8_t *dst, uint64_t len); + void (*memcrypt_debug_ops)(void *ehandle, MemoryRegion *mr); }; KVMState *kvm_state; @@ -128,6 +136,50 @@ static const KVMCapabilityInfo kvm_required_capabilites[] = { KVM_CAP_LAST_INFO }; +bool kvm_memcrypt_enabled(void) +{ + return kvm_state->ehandle ? true : false; +} + +int kvm_memcrypt_create_launch_context(void) +{ + if (kvm_state->create_launch_context) { + return kvm_state->create_launch_context(kvm_state->ehandle); + } + + return 1; +} + +int kvm_memcrypt_release_launch_context(void) +{ + if (kvm_state->release_launch_context) { + return kvm_state->release_launch_context(kvm_state->ehandle); + } + + return 1; +} + +int kvm_memcrypt_encrypt_launch_data(uint8_t *dst, uint64_t len) +{ + if (kvm_state->encrypt_launch_data) { + return kvm_state->encrypt_launch_data(kvm_state->ehandle, dst, len); + } + + return 1; +} + +void kvm_memcrypt_set_debug_ops(MemoryRegion *mr) +{ + if (kvm_state->memcrypt_debug_ops) { + return kvm_state->memcrypt_debug_ops(kvm_state->ehandle, mr); + } +} + +void *kvm_memcrypt_get_handle(void) +{ + return kvm_state->ehandle; +} + int kvm_get_max_memslots(void) { KVMState *s = KVM_STATE(current_machine->accelerator); diff --git a/kvm-stub.c b/kvm-stub.c index ef0c734..20920aa 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -105,6 +105,37 @@ int kvm_on_sigbus(int code, void *addr) return 1; } +bool kvm_memcrypt_enabled(void) +{ + return false; +} + +void *kvm_memcrypt_get_handle(void) +{ + return NULL; +} + +void kvm_memcrypt_set_debug_ops(MemoryRegion *mr) +{ + return; +} + +int kvm_memcrypt_create_launch_context(void) +{ + return 1; +} + +int kvm_memcrypt_release_launch_context(void) +{ + return 1; +} + +int kvm_memcrypt_encrypt_launch_data(uint8_t *ptr, uint64_t len) +{ + return 1; +} + + #ifndef CONFIG_USER_ONLY int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev) {