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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6037CC00A5A for ; Thu, 19 Jan 2023 15:25:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DADE26B0071; Thu, 19 Jan 2023 10:25:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D5DD16B0072; Thu, 19 Jan 2023 10:25:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFE856B0073; Thu, 19 Jan 2023 10:25:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B08BB6B0071 for ; Thu, 19 Jan 2023 10:25:15 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 84C6C1C5B94 for ; Thu, 19 Jan 2023 15:25:15 +0000 (UTC) X-FDA: 80371922190.28.82E8864 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf23.hostedemail.com (Postfix) with ESMTP id CE81D140018 for ; Thu, 19 Jan 2023 15:25:13 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=mBCVF1D4; spf=pass (imf23.hostedemail.com: domain of seanjc@google.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674141913; a=rsa-sha256; cv=none; b=YAVKWYqIUhJ7sHtjtqTSVrejueg7SYBI3U31g76W4Cp0ZkfbSunOQmfJFKD7g6pIA8ctA/ T2VWa5A7XJNBQOxauIG/d1DnPXrMROTV7jl3xWiVCooBnDDEObW9HGChvLIsaW/q/8Hoqc F3N1uT1975QCfMXivgVlPb5+NUYQyLE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=mBCVF1D4; spf=pass (imf23.hostedemail.com: domain of seanjc@google.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674141913; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=u3x+gqjTmgbestDAk4Awmq54vOdmydIW5Pid7KApIj0=; b=z9Ja00HQxHYbeNGV+E9wIU8DQlbPvWRAm4jvryxtlImWHbfWGU0xIvn4oih6FodcUSEHAR Wg0NSorYex8pTolT3kB+8OOvWiaeKYdFYZSzRZjl7hFuBrUffHM3UqX2Et1IejDZQloi1v iWSVJ6ZKxTCXu260OIYqF7Yx0kqqmk4= Received: by mail-pj1-f44.google.com with SMTP id m3-20020a17090a414300b00229ef93c5b0so1418387pjg.2 for ; Thu, 19 Jan 2023 07:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=u3x+gqjTmgbestDAk4Awmq54vOdmydIW5Pid7KApIj0=; b=mBCVF1D4CCb5Ux/a0sTklFD5Mi8L9pIXDGbMCkJlimD4PHSACap2p25+kVgwBgrsIq EvdnQ1DJdyozyD6i/NGQ9LHUxMYOj57ZDAvsSBtrXrWSIG9rE81ZQPLMflUW9tlr3kaQ W5HhRhzDrOZXVo2eJJX+pBBPi5F1VgqXmlz+Dn+5py/XCqnPsdSKBwTESeGVpPIz964i Y7hB+IGNBYCrP1QuYyMwMmClI1OOCW3cnNMzXyQEA2j3fMpJV5G+s3nKt4FHhRG/KAkL 4FVfZGb2GwNGLwVQhykEPhQCdeJbS7eHn+w6UX0yqcdlwsdurSpSSE/duLw9iP7/BBnl 1UDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=u3x+gqjTmgbestDAk4Awmq54vOdmydIW5Pid7KApIj0=; b=1aDjPW6ZWPfQ3h5rNj+XahJfJnaaArBYknrUGtSV5EtCw/Pen+4OYD/JXn5zgdQ1U3 kn8WirL7MPQcp0ZHMHP2C2zSSSe23KYgD82Iue2agCfT4EjF2Dm8Dj+RgsTfFzYCnb8u 39zJgoEv5fwjyp29Fg4PDoKt666ffsUYTRLA2P6opfyoE5AkxAU74SI3pUc/muWNGMzk zkQM01azkZ/Fz8I/sEuuhykA4lp2lVF0gKGtjbBtUu5yZyD8hy+NCrnD8hJDhmBSW1uN YjBxDyUV/xDN6GK+jz0E/Elt9w6csnGpl4GX6b+yk25J7Eo1SmzeXwGRdD0A/1lY5A56 Qciw== X-Gm-Message-State: AFqh2kpAoVIKcj6gkMDNSMRnK3OZcmnm8EkPRYqcEF0ZerfHlACf+Von ek1iNLKlRAEaXYK/FX1Nb4eBVw== X-Google-Smtp-Source: AMrXdXuFbwGpoS/BOsR3GLdQjSETsa46BfhBRwIB416u+GXbq71Q0+uUKVzOwXl/a9TU4tZ66S2N/Q== X-Received: by 2002:a05:6a20:ce43:b0:b8:c3c0:e7f7 with SMTP id id3-20020a056a20ce4300b000b8c3c0e7f7mr1187627pzb.1.1674141912349; Thu, 19 Jan 2023 07:25:12 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id z16-20020a170903019000b001945339354asm5530181plg.197.2023.01.19.07.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 07:25:11 -0800 (PST) Date: Thu, 19 Jan 2023 15:25:08 +0000 From: Sean Christopherson To: Isaku Yamahata Cc: Chao Peng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Arnd Bergmann , Naoya Horiguchi , Miaohe Lin , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , tabba@google.com, Michael Roth , mhocko@suse.com, wei.w.wang@intel.com Subject: Re: [PATCH v10 0/9] KVM: mm: fd-based approach for supporting KVM Message-ID: References: <20221202061347.1070246-1-chao.p.peng@linux.intel.com> <20230119111308.GC2976263@ls.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230119111308.GC2976263@ls.amr.corp.intel.com> X-Rspam-User: X-Rspamd-Queue-Id: CE81D140018 X-Rspamd-Server: rspam01 X-Stat-Signature: pg6bsnmyuj3odo8nie8u14h5ifckmdid X-HE-Tag: 1674141913-905912 X-HE-Meta: U2FsdGVkX1+fV1DSgwK8M6gzq5GmlY3XAuZodW/qtAUxpm0iVIQe0kW4aAZ/ghLAfhTSJVMhdhxuCm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bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 19, 2023, Isaku Yamahata wrote: > On Sat, Jan 14, 2023 at 12:37:59AM +0000, > Sean Christopherson wrote: > > > On Fri, Dec 02, 2022, Chao Peng wrote: > > > This patch series implements KVM guest private memory for confidential > > > computing scenarios like Intel TDX[1]. If a TDX host accesses > > > TDX-protected guest memory, machine check can happen which can further > > > crash the running host system, this is terrible for multi-tenant > > > configurations. The host accesses include those from KVM userspace like > > > QEMU. This series addresses KVM userspace induced crash by introducing > > > new mm and KVM interfaces so KVM userspace can still manage guest memory > > > via a fd-based approach, but it can never access the guest memory > > > content. > > > > > > The patch series touches both core mm and KVM code. I appreciate > > > Andrew/Hugh and Paolo/Sean can review and pick these patches. Any other > > > reviews are always welcome. > > > - 01: mm change, target for mm tree > > > - 02-09: KVM change, target for KVM tree > > > > A version with all of my feedback, plus reworked versions of Vishal's selftest, > > is available here: > > > > git@github.com:sean-jc/linux.git x86/upm_base_support > > > > It compiles and passes the selftest, but it's otherwise barely tested. There are > > a few todos (2 I think?) and many of the commits need changelogs, i.e. it's still > > a WIP. > > > > As for next steps, can you (handwaving all of the TDX folks) take a look at what > > I pushed and see if there's anything horrifically broken, and that it still works > > for TDX? > > > > Fuad (and pKVM folks) same ask for you with respect to pKVM. Absolutely no rush > > (and I mean that). > > > > On my side, the two things on my mind are (a) tests and (b) downstream dependencies > > (SEV and TDX). For tests, I want to build a lists of tests that are required for > > merging so that the criteria for merging are clear, and so that if the list is large > > (haven't thought much yet), the work of writing and running tests can be distributed. > > > > Regarding downstream dependencies, before this lands, I want to pull in all the > > TDX and SNP series and see how everything fits together. Specifically, I want to > > make sure that we don't end up with a uAPI that necessitates ugly code, and that we > > don't miss an opportunity to make things simpler. The patches in the SNP series to > > add "legacy" SEV support for UPM in particular made me slightly rethink some minor > > details. Nothing remotely major, but something that needs attention since it'll > > be uAPI. > > Although I'm still debuging with TDX KVM, I needed the following. > kvm_faultin_pfn() is called without mmu_lock held. the race to change > private/shared is handled by mmu_seq. Maybe dedicated function only for > kvm_faultin_pfn(). Gah, you're not on the other thread where this was discussed[*]. Simply deleting the lockdep assertion is safe, for guest types that rely on the attributes to define shared vs. private, KVM rechecks the attributes under the protection of mmu_seq. I'll get a fixed version pushed out today. [*] https://lore.kernel.org/all/Y8gpl+LwSuSgBFks@google.com