From patchwork Tue Nov 1 15:52:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9407551 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 2F59260585 for ; Tue, 1 Nov 2016 15:57:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20B1429A41 for ; Tue, 1 Nov 2016 15:57:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1458D29A49; Tue, 1 Nov 2016 15:57:04 +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 652FB29A41 for ; Tue, 1 Nov 2016 15:57:03 +0000 (UTC) Received: from localhost ([::1]:48857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1bQs-00085V-AK for patchwork-qemu-devel@patchwork.kernel.org; Tue, 01 Nov 2016 11:57:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1bMy-000515-TU for qemu-devel@nongnu.org; Tue, 01 Nov 2016 11:53:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1bMu-0003gj-PO for qemu-devel@nongnu.org; Tue, 01 Nov 2016 11:53:00 -0400 Received: from mail-cys01nam02on0048.outbound.protection.outlook.com ([104.47.37.48]:42624 helo=NAM02-CY1-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 1c1bMu-0003gd-IT for qemu-devel@nongnu.org; Tue, 01 Nov 2016 11:52:56 -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=h/DfOzvktHHnH5XYJKDGEez+DFhU2AX/63KGE2DRpts=; b=R/5SxxTBfegmqjafJImNVSisPtuLp/K+tjhXXIP2RBdPfoQo7htLQ2fiG6qcceyeq6EhPxx/Ps0Z98IQQPQKRRfcyoGcS8B7n9u20hmUM8ZGZkbl/bnaFXDOvaWarkXHNaxQcvvu6vAr2ZQBR6tdb+CqAstfwrDd+LwdIyKIeKM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by SN1PR12MB0670.namprd12.prod.outlook.com (10.163.208.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Tue, 1 Nov 2016 15:52:53 +0000 From: Brijesh Singh To: , , , , , , , , , Date: Tue, 1 Nov 2016 11:52:50 -0400 Message-ID: <147801557056.18237.12861373512227468895.stgit@brijesh-build-machine> In-Reply-To: <147801550845.18237.12915616525154608660.stgit@brijesh-build-machine> References: <147801550845.18237.12915616525154608660.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR03CA0053.namprd03.prod.outlook.com (10.173.137.15) To SN1PR12MB0670.namprd12.prod.outlook.com (10.163.208.28) X-MS-Office365-Filtering-Correlation-Id: 57e8996c-a16d-4319-40ab-08d4026f24d8 X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 2:XklusHjQq53VrmDJujG1avWkL1/bcKTxHYFejq1Qanflbe9x3j6GRRPV3FucXLWNIuHCpeKi++PXe8AgHL5bs2U6/l3VKe4XYK1qc8+puJyJQxT2Gjp5xga8jFj2SxInb9IT+dEYOuugMABdgGfZp4JUYuODgwTsU3DUzvXsZXwDkOKWxqEVLM6xlYwmskh16enBjaHh24bXtLsDC1ORoQ==; 3:LsQZLcoyPZjti7vHoOcUbwh+rsAzg2rGp/LIsU6//yW38kgRhl24cxfHlBtyOXRwer3xVQiedPS6A8bnp2kAmcIaN5GeRid4kbfwer2jCbTZaN9/sTeZ7ygy5OyJ8Ky3MMpcXMIiGpPIFWUVzMeOjg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0670; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 25:NEslXcjhZt3H5TIAkQSb44QzzfGGijonH6GAR3wy2k4hJd06K7xS+Hwrq6WbR4YabL/0GZwcLIId3NqtZ78E2jNWCJvGKjXdoXtYlX8cAjNWnO6DEIJApL6Yzq0uDBG30/PQ2WZPUtETyy2yEPDsC/pQxJVlxPVPMicsntEusRGPEjFqp/loTp6FavXk4LDDOFVPeRJs8moO50KhSUhAkiyeAMpezcqSOLRdSPQb4wlPddgJh3Z60hzX0ZbB23v2861IPC9uEvnIdS8MvvmFGodaVOagMNbh2R5QuoIXhctYsktOUmIt3jQ9g/ny7ka6GIXP3gM7m4fY+7LJm3z3uFdW/aza/Clw/uwruwSbCT3vGKeX+RJ5kpn1XGYtwRmFyNJ0vCIttkRZf0wqTbDM0RvZWa+X9Yge709dqxRB+JL3OgxlxtCln3RFgdxQaiRIh/55typCKHQjFUgOU+cv9WVCMACHwTUbV+8U/h2DUgGI58THJamtl2suTceRFqwGuVVKdMkq3dpIkmDnJwKeFcCI1MeXVq0/lng4cW9sBWbh5xODtVR/SHCP66NmCe5ZT/0GxeltmakBcrNj/2VVvQRPZroZjyOviKOb1yts0wsCzvpTSVOhjayg+OHdGnXx4ZCpS2H6j6CVcw2PZS8XjauQITDOKLRjJv84GkCeI+TIPOShmK4Fv5G6+To1TuMTT1mREdDQC1jJbWl/pWEQAqVaC9eJA/hWlJIr5UJwp04= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 31:mx4kM5gp12pdpet+si8xhsw4/fjalMZ4rHzghIdUrhasTPTSS5+O/5CNMDVJlHj+iHouMeybmXnNr9NgLWvD6mScsOO4yRkuKfom7S4YQv1Nv2zLTeq2ZihorAn+Psdisi3/ZgxCzNifwFhSFHrLHzIH7tVSH5MeUPXz9j4bt2VXBc04Z+0au4ShR+z49PebnXPjTt0ANfzvQ9oSNantP14kagMRK+6Ncgd4+OSBuH54Rn6YEt1oOD6+Lfcr3RIH; 20:ki0D4plMuCpZmPK/ZCYvCqXKHounhxOtnS8R9y8HxpcQizvTKcC2UumM/6U50B71aPSQoqGbRTszVkwwnQu9vHRl7PYIOcErrEUCL1xAF55saVPG6mJUAsFqEO/6m5V7PgLoV5z6BoPX12QYLkWDUyEtUFc+z3ojZ2J+vo60cfEU6JwG7bL3Z2Frb1mP6gp73CHSjTQCxwbfL7GTBD6KUOVF/p7BQDtHjf+19o6kzRXsY0pJXk9Y56UFUxIA59KZIRupo666jp1DN/u38udkH331dturTllimyL2290qa/HqxyMjzWflsD6IZvgXzfDnlW+3SCkud1+MVl2/2MmhlGqhh9RKF2BZbqzmRa1MvqFu6bA/33Cfu5JX+bzWli5XZyoMHD++VtAW5wQp1Kcx4Y9w792g+KpxiUQ1MwmvvNqz/iKj7pdppO1CWuu1GCkfkWopRWHSm8Rp5EMW5Vgqm+cZXrRh4GDEWy6Epan+49nT9AJ4xYSmQTBAzE2ddRBw 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)(10201501046)(3002001)(6055026); SRVR:SN1PR12MB0670; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0670; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 4:sxbXnmOF11lQzyVQsJsk+fZeWd9d27SbwNukwtlBIcBr8zTJTHK4kuvCgiVOdhxJji2J3LlS+lGUfddxjKGikD2VLkq+3p2LjS47kgeXhjo+QLhWX3cmzyios3XoqI7we49/RmZp783vGWi783P8uxnILgSZujpqnUifm5ye/W42uisNX7dKnYl3p081QYBK62qw78hLi5YBE7Zo27UqU6wWgbGvdGldWEJtQSlruQiozafMZq6J4+8OjlRqlbnqEczAv3qIlRNJBhYeJzx/QJMzf1FsDkDjkB921j1hs5YJJCOJWQJpfua4g3XnScBqKuU3BnMKpvVObXIb3Dce+YFPR4Jm5La57Xn6EvZyXLo8sAM7TvVwjHvMvYNxqRoDMtpNzZxVXnQF8AlhAby3DGK6unIP4U51OqZ/ajk3chg7WmH+iDKqIsLtjyAK+lCS9V1KXce2PE2VkP1h2jd/eA== X-Forefront-PRVS: 01136D2D90 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(106356001)(586003)(5001770100001)(77096005)(4326007)(33646002)(54356999)(105586002)(103116003)(76176999)(3846002)(50986999)(92566002)(23676002)(5660300001)(97736004)(4001350100001)(6116002)(42186005)(7416002)(229853001)(101416001)(19580395003)(19580405001)(66066001)(68736007)(189998001)(305945005)(2906002)(230700001)(7846002)(7736002)(50466002)(47776003)(2950100002)(33716001)(83506001)(9686002)(86362001)(8676002)(2201001)(81156014)(81166006)(921003)(1121003)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0670; 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?MTtTTjF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LiWEFGOcIJrNb8mpYZ8FE=; 20:sSgEpix79CqGTVD2St0ow9iKiYuYcB28WsPaEFS4H8Q9gIgvru/NNRAvdR/Q8XMkXXIDpHaZ+KUEF3gn9TR2jOtT9swoMsRyBU5XOn+tRlnFfaBTQh8eBX4jTHTzqWwxop+jr7r3//zON+936in2sMuqHhBCofdDIUzUUAQw2Eba1KpZKuwfsKDTWk/7YCrGMplikzT8lVVAPTlN/OW86ewY3BwEXTRyyDr88cvi3wDuBleYytPzhnKQ0GPuObHu X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2016 15:52:53.9602 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0670 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.48 Subject: [Qemu-devel] [RFC PATCH v3 06/18] kvm: add memory encryption APIs 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: brijesh.ksingh@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add APIs to provide guest memory encryption support. Signed-off-by: Brijesh Singh --- include/sysemu/kvm.h | 8 ++++++ kvm-all.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index df67cc0..db00673 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -227,6 +227,14 @@ int kvm_init_vcpu(CPUState *cpu); int kvm_cpu_exec(CPUState *cpu); int kvm_destroy_vcpu(CPUState *cpu); +bool kvm_memory_encryption_enabled(void); +int kvm_memory_encryption_start(void); +int kvm_memory_encryption_finish(void); +void *kvm_memory_encryption_get_handle(void); +void kvm_memory_encryption_set_debug_ops(MemoryRegion *mr); +int kvm_memory_encryption_dec(uint8_t *dst, const uint8_t *src, uint32_t len); +int kvm_memory_encryption_enc(uint8_t *dst, const uint8_t *src, uint32_t len); + #ifdef NEED_CPU_H #include "cpu.h" diff --git a/kvm-all.c b/kvm-all.c index 330219e..86c810e 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -36,6 +36,7 @@ #include "qemu/event_notifier.h" #include "trace.h" #include "hw/irq.h" +#include "sysemu/security-policy.h" #include "hw/boards.h" @@ -101,6 +102,16 @@ struct KVMState #endif KVMMemoryListener memory_listener; QLIST_HEAD(, KVMParkedVcpu) kvm_parked_vcpus; + + /* memory encryption support */ + void *ehandle; + int (*mem_encrypt_start)(void *ehandle); + int (*mem_encrypt_finish)(void *ehandle); + int (*mem_encrypt_dec)(void *ehandle, uint8_t *dst, const uint8_t *src, + uint32_t len); + int (*mem_encrypt_enc)(void *ehandle, uint8_t *dst, const uint8_t *src, + uint32_t len); + void (*mem_encrypt_debug_ops)(void *ehandle, MemoryRegion *mr); }; KVMState *kvm_state; @@ -127,6 +138,59 @@ static const KVMCapabilityInfo kvm_required_capabilites[] = { KVM_CAP_LAST_INFO }; +bool kvm_memory_encryption_enabled(void) +{ + return kvm_state->ehandle ? true : false; +} + +int kvm_memory_encryption_start(void) +{ + if (kvm_state->mem_encrypt_start) { + return kvm_state->mem_encrypt_start(kvm_state->ehandle); + } + + return 1; +} + +int kvm_memory_encryption_finish(void) +{ + if (kvm_state->mem_encrypt_finish) { + return kvm_state->mem_encrypt_finish(kvm_state->ehandle); + } + + return 1; +} + +int kvm_memory_encryption_dec(uint8_t *dst, const uint8_t *src, uint32_t len) +{ + if (kvm_state->mem_encrypt_dec) { + return kvm_state->mem_encrypt_dec(kvm_state->ehandle, dst, src, len); + } + + return 1; +} + +int kvm_memory_encryption_enc(uint8_t *dst, const uint8_t *src, uint32_t len) +{ + if (kvm_state->mem_encrypt_enc) { + return kvm_state->mem_encrypt_enc(kvm_state->ehandle, dst, src, len); + } + + return 1; +} + +void kvm_memory_encryption_set_debug_ops(MemoryRegion *mr) +{ + if (kvm_state->mem_encrypt_debug_ops) { + return kvm_state->mem_encrypt_debug_ops(kvm_state->ehandle, mr); + } +} + +void *kvm_memory_encryption_get_handle(void) +{ + return kvm_state->ehandle; +} + int kvm_get_max_memslots(void) { KVMState *s = KVM_STATE(current_machine->accelerator);