Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3187614ybi; Mon, 17 Jun 2019 18:41:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqx50RFY6H825titjxNMZDCxVwZdRHU5dKmyyIgMf/dunv8nx20eQfAA1k/cZfqseXJRCKGX X-Received: by 2002:a17:90a:258b:: with SMTP id k11mr2222049pje.110.1560822065853; Mon, 17 Jun 2019 18:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560822065; cv=none; d=google.com; s=arc-20160816; b=UcKs0ioAXSMyb7i1qxQQqiq5Lenb1vSoKgNz2+APxzDBwtdvG0qakm0+0nrcaikO3J LPOZ9qIfepnISJCDWDilOSmLbgJodV68ars9IkVRzqFd8nvys9ZTgf1dmjbVDC25HayJ +w7iHfnvpCobqjATtwSy0E1ggaiNCZ6tu4fwC9G8l8rAx7iqBGYUGz3h3Oq4TC774v5f BOPSsbRzCSq/4FA3RoEGQwhMJ4H3zIMRFJo1Yyh1852+j42BVQXa7j49EXqE7wOHDDrD j3qWW7UCI4euk8DuL+MeIuCaELV71ejYQ4Bg2XswNKqD/JDkqy8hZZTYZF0xpRZqv0By z7kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=e8n1dhH05vKni7panA8EPqi7kyq4X1nEgLodhwt9/EE=; b=qjPt5J0+FJxzBXsMFrpY3yRZpmylavy+BZVS12rtnkX+50/Y4Cumw2J0wa3M4Tc5kI tRNbUanTs87uaqWtuorQ3oppEADfKbrJW9yKtJQ5kh1p0Mni8o2PSyT0jlThi5Q7FqyN A1Lho51mHuOK5LB3o5prz8+0IkxOQzqe3+Y9KKM2R87+lv7EeLDRWPuh/Pa2HkiWnW7u MQSKIV7qy0ndjM9j63Cm+jqrzQR78H5nvHV5ICHidlI98VaaVRTCOjIpKasZkL6aOBxm 9KztyNRcd3TafV/BXoHdRDmwnzAdRjapzCjcyBwoYHer1ZrcCLa6UB2hqm8fTHUmYF05 9x/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tAYxS8Cz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si12271047pgv.584.2019.06.17.18.40.49; Mon, 17 Jun 2019 18:41:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tAYxS8Cz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727105AbfFRBkp (ORCPT + 99 others); Mon, 17 Jun 2019 21:40:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:55186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726215AbfFRBko (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 DFAD22147A 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 a15so1341089wmj.5 for ; Mon, 17 Jun 2019 18:40:43 -0700 (PDT) X-Gm-Message-State: APjAAAUCTkKMsuNBcn77uSTJD8CX12iBx2mdE41TqgB8d5VAfBWvJqy+ fuNQDc+qHbzvFJ17n2QrdbMBaDPR+CuTbdIsWkBQVg== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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?