From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C67BAC31E5B for ; Tue, 18 Jun 2019 01:40:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A042520B1F for ; Tue, 18 Jun 2019 01:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560822048; bh=KsbO8zqRDwjqNqLUKDtxw38bKGpR6/rXffGf+dHWdqY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=0KgaFhUafSupgR7B33j+M8vFL5SFMjGWOI6HUb4U24J/ckG9yyz0wfNoECW652fkr 6Xb+xWzF4pNaMoejdYLJHlcp7I1MAaaftbABUbmMJN1fiPjQ6KdvPVw4KzCmhAyQsY 44aAN8dcPzZ2fO4xntHIACp08JrDRxMekgrDy5Lw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbfFRBkp (ORCPT ); Mon, 17 Jun 2019 21:40:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:55172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbfFRBko (ORCPT ); Mon, 17 Jun 2019 21:40:44 -0400 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D18C0208E4 for ; Tue, 18 Jun 2019 01:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560822044; bh=KsbO8zqRDwjqNqLUKDtxw38bKGpR6/rXffGf+dHWdqY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tAYxS8CzDFuv2tQZHZR4A3RbB0atwX6vH4WU+fA+oZHmeDZ2QCd8tIftSy05dWYvx Zr2+5L9RCAkPUy8diltaJF7/yaAZ9lLrLPKmiWFNUhWORvS5gl44MTXH5S00eMh8Dm CARK3lbj5/kG+g8UA3DoM4IVv0LeK7RA1QPw8H0E= Received: by mail-wm1-f41.google.com with SMTP id u8so1351146wmm.1 for ; Mon, 17 Jun 2019 18:40:43 -0700 (PDT) X-Gm-Message-State: APjAAAWUL0YEgHylDhDwgDoaL+cydCsjkdoOiSy3BIy0Qyv1SFxa6wNy 9IECsgAjlNchDWy3FnjvR5gmgL/hKZrzKFKStxVseg== X-Google-Smtp-Source: APXvYqzS0tk+KNMV6hutqJZNe+OpQ2triMNDvKY2XNxjx+/s7nYJx2KaD0PtMpxVPGCU2zuqJwIgx5ai1DRb5gWNARw= X-Received: by 2002:a7b:cd84:: with SMTP id y4mr928755wmj.79.1560822042435; Mon, 17 Jun 2019 18:40:42 -0700 (PDT) MIME-Version: 1.0 References: <20190508144422.13171-1-kirill.shutemov@linux.intel.com> <20190508144422.13171-46-kirill.shutemov@linux.intel.com> <3c658cce-7b7e-7d45-59a0-e17dae986713@intel.com> <5cbfa2da-ba2e-ed91-d0e8-add67753fc12@intel.com> <1560815959.5187.57.camel@linux.intel.com> In-Reply-To: From: Andy Lutomirski Date: Mon, 17 Jun 2019 18:40:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH, RFC 45/62] mm: Add the encrypt_mprotect() system call for MKTME To: "Lendacky, Thomas" Cc: Kai Huang , Dave Hansen , Andy Lutomirski , "Kirill A. Shutemov" , Andrew Morton , X86 ML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Peter Zijlstra , David Howells , Kees Cook , Jacob Pan , Alison Schofield , Linux-MM , kvm list , "keyrings@vger.kernel.org" , LKML Content-Type: text/plain; charset="UTF-8" Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Jun 17, 2019 at 6:34 PM Lendacky, Thomas wrote: > > On 6/17/19 6:59 PM, Kai Huang wrote: > > On Mon, 2019-06-17 at 11:27 -0700, Dave Hansen wrote: > > > > And yes from my reading (better to have AMD guys to confirm) SEV guest uses anonymous memory, but it > > also pins all guest memory (by calling GUP from KVM -- SEV specifically introduced 2 KVM ioctls for > > this purpose), since SEV architecturally cannot support swapping, migraiton of SEV-encrypted guest > > memory, because SME/SEV also uses physical address as "tweak", and there's no way that kernel can > > get or use SEV-guest's memory encryption key. In order to swap/migrate SEV-guest memory, we need SGX > > EPC eviction/reload similar thing, which SEV doesn't have today. > > Yes, all the guest memory is currently pinned by calling GUP when creating > an SEV guest. Ick. What happens if QEMU tries to read the memory? Does it just see ciphertext? Is cache coherency lost if QEMU writes it?