From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 159EA72 for ; Wed, 1 Sep 2021 17:50:18 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id x16so137782pll.2 for ; Wed, 01 Sep 2021 10:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lTCwx671qN0Uv7CtZL+BVS1+Oy6Uwn1k3lSPRkK+jKg=; b=tX+iQK/XObeHHie9CEoItYwWrUuxY48SNGKS8OIkVuSOl9Zy8ONZjSy2CselzwLN6U fyDvLPYuMEHd2HtKTTBEpeJFwD9IiR/4nv0idT+PmOH6YFqIuelzoQtvb0nTX4PVmdXv OWdqauuhaUkvyAW9xaC+yanWAiLb+viasEaEDcErrr4YaU66XQV37GdSUJlrAI18OJ58 Xf2pXFmsPLt9vio2mK5Noy6PET+oEXr+jLkXY/5X2AQu7JJ++uEMK2w4L6v0f84FrkGP aOmqGtD7El0+sCcQxz1LVQjZB3IidTm9OdswbBH+7IPFy1A9z08/jb25AhGGV9cLIDNs V6HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lTCwx671qN0Uv7CtZL+BVS1+Oy6Uwn1k3lSPRkK+jKg=; b=jgETznlDEUxhkhLecL8P91g6oXDelNAKQ2fSPcbb8vDy1V9zGQBEV5F2SM67zU0PVh kqh83Z5eoYo6qKeolP/vPWm6vDu6kAc4T8oi7QPYMV0ST/+IdMPdspgVasNmGsGty8v3 Gte9t1zDctl8zBfh049Atv3JqgSsAL44k40D92xEFvEcjhGedtwQBhTnl6WmCxE0Y4sP p75F+Mg4TgBjhyMGIfgdkfdvDj2aPUAmT3SLRm089A83B0RFZmGgZlPSbzngTialCQk5 fG80FnymOe9sEsTpEQs4baCEbmyrDhXSBgIh76XrmeN7sKgW9ldlstgwjuAdhDCa6UoO XRpQ== X-Gm-Message-State: AOAM531p46b2KkihxSQZsBSxCWbSChM2XAK3hBWKUJlKXoChEjZKVuPg 6OS4tusRrS9slPUFEEfgTc1/MA== X-Google-Smtp-Source: ABdhPJyTBcvoxYT1UazLo75DFYLRiAcTN2BKdr2FfvtOwvNd4cqBc9u77mrXNn/DJzvrSUbkCYr6XQ== X-Received: by 2002:a17:902:f683:b0:138:fe47:4e47 with SMTP id l3-20020a170902f68300b00138fe474e47mr675191plg.60.1630518617183; Wed, 01 Sep 2021 10:50:17 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id o10sm122146pfk.212.2021.09.01.10.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 10:50:16 -0700 (PDT) Date: Wed, 1 Sep 2021 17:50:12 +0000 From: Sean Christopherson To: David Hildenbrand Cc: jejb@linux.ibm.com, Andy Lutomirski , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm list , Linux Kernel Mailing List , Borislav Petkov , Andrew Morton , Joerg Roedel , Andi Kleen , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , "Peter Zijlstra (Intel)" , Ingo Molnar , Varad Gautam , Dario Faggioli , the arch/x86 maintainers , linux-mm@kvack.org, linux-coco@lists.linux.dev, "Kirill A. Shutemov" , "Kirill A . Shutemov" , Sathyanarayanan Kuppuswamy , Dave Hansen , Yu Zhang Subject: Re: [RFC] KVM: mm: fd-based approach for supporting KVM guest private memory Message-ID: References: <61ea53ce-2ba7-70cc-950d-ca128bcb29c5@redhat.com> <9ec3636a-6434-4c98-9d8d-addc82858c41@www.fastmail.com> <0d6b2a7e22f5e27e03abc21795124ccd66655966.camel@linux.ibm.com> <1a4a1548-7e14-c2b4-e210-cc60a2895acd@redhat.com> <4b863492fd33dce28a3a61662d649987b7d5066d.camel@linux.ibm.com> <214ca837-3102-d6d1-764e-6b4cd1bab368@redhat.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <214ca837-3102-d6d1-764e-6b4cd1bab368@redhat.com> On Wed, Sep 01, 2021, David Hildenbrand wrote: > > > > Well not necessarily, but it depends how clever we want to get. If > > > > you look over on the OVMF/edk2 list, there's a proposal to do guest > > > > migration via a mirror VM that invokes a co-routine embedded in the > > > > OVMF binary: > > > > > > Yes, I heard of that. "Interesting" design. > > > > Heh, well what other suggestion do you have? The problem is there > > needs to be code somewhere to perform some operations that's trusted by > > both the guest and the host. The only element for a confidential VM > > that has this shared trust is the OVMF firmware, so it seems logical to > > use it. > > > > Let me put it this way: I worked with another architecture that doesn't > fault on access of a secure page, but instead automatically exports/encrypts I thought s390 does fault on insecure accesses to secure pages, and it's the kernel's fault handler that "automatically" converts the page? E.g. trap 0x3d -> do_secure_storage_access() -> arch_make_page_accessible(). > it so it can be swapped. It doesn't send a MCE and kills the host. It > doesn't require fancy code in the guest firmware to export a page. > > The code runs in the ultravisor -- yes, I'm talking about s390x. Now, I am > not an expert on all of the glory details of TDX, SEV, ... to say which > attack surface they introduced with that design, and if it can't be > mitigated. I can only assume that there are real reasons (e.g., supporting > an ultravisor is problematic, patents? ;) ) why x86-64 is different. > > So whenever I see something really complicated to work around such issues, > it feels to me like a hardware/platform limitation is making our life hard > and forces us to come up with such "interesting" designs. Oh, 100% agree, the TDX "limitation" of poisoning cache line and leaving a land mine to trip over is absolutely abhorrent. SEV-ES and SEV aren't much better in that they happily corrupt guest memory. I am quite jealous of s390 behavior of simply faulting on the actual access. SEV-SNP does fault on the access and could do something similar to s390, but I'm not totally convinced that's actually desirable as it has ramifications with respect to debugging host and/or guest. But it'd be nice to have the option... > Sure, it's logical in this context, but it feels like "The house doesn't Heh, for some definitions of "logical". > have a door, so I'll have to climb through the window.". It gets the job > done but isn't ideally what you'd want to have. If you understand what I am > trying to say :) > >