Received: by 2002:ac8:1418:0:b0:3ab:920c:4c8b with SMTP id k24csp438933qtj; Thu, 19 Jan 2023 08:12:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXtEbLj5492D6xP0PD13vaNG5V2z++zfTImxobd5s+b15QzAvXFyZLcyo28nMFiQF0sW2ecV X-Received: by 2002:a05:6a20:47d6:b0:b6:53cf:8455 with SMTP id ey22-20020a056a2047d600b000b653cf8455mr9948893pzb.56.1674144747415; Thu, 19 Jan 2023 08:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674144747; cv=none; d=google.com; s=arc-20160816; b=b93QM++TCOLcGB9EGaRI5tkyaIBsSeJb2qJ3L1Mj6z9Lzyi0uFNFpsGmsNwRpYaFic q6Uu/gQHOgts6e/ynvm4xSOffrvkJAQRtFh01S3+TCxaTUgqYZNRvmVYJ5660zC0D6uq 5yuJJRDfR+saVgJKvmrloMvRtdvy9iU7qdqZaJWFq41+QWKCzVifUNj1sezP5GaJb6Uw rKT2B70ru8/gfLqdr6G7Mx0vIHxo25DY0N1oKvPMxAPus74Evz/tVfK/xIS9qkn4IUVy d/Cz8K/Aejr1uvsMfzE5QF+/ixlD4OQjkhMSyT4hgi72UQihd6THGNyls5zRCYKOQIsN ASYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=u3x+gqjTmgbestDAk4Awmq54vOdmydIW5Pid7KApIj0=; b=oocHg5F3yatIJSGEbgQm1qZ9uohomCryUrZmi/Nr3tPtwC6l4NThJAmiUVzhBTwFZ/ eaJpxoSzWXJ2n7HSNHG2HAE1MMZDqg2PGrQc5K0jFySxPGcb/7eBQPcZrP60J6qEcMRX ut9YT75fiQoo2y64wwJeJNgIlz8GhcrqEesJDpmKXgV8eTIWJyCb6QKDc5UVznn8o3Md Lt6pjcxZXKIFevz0RQFEI4Pjbo4H03TuTV187dYbqsnim06Tno5XrI/XVeq7ZROyZ79X ginmJ56EIFdOlw6cT63nCkfaq/yDMykRaDE1P0TGxVEI3CQFmudxk9q5Cendt/MNnbo7 1Ykw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mBCVF1D4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k62-20020a638441000000b004cf4fcf9c15si8532578pgd.52.2023.01.19.08.12.22; Thu, 19 Jan 2023 08:12:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mBCVF1D4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbjASPZY (ORCPT + 45 others); Thu, 19 Jan 2023 10:25:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbjASPZQ (ORCPT ); Thu, 19 Jan 2023 10:25:16 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BD8E80882 for ; Thu, 19 Jan 2023 07:25:13 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id z1-20020a17090a66c100b00226f05b9595so2151456pjl.0 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=g3lknP+GODbvbf2YGQmS/H0T40FnJuyO9/rq1cuNQiHFydZ2GTOwZNcOLBpAf8nJ7Y 0AkB4bW/zoOpGLrMSeOnHxuoCBUK+lQsugRRRl0S2BeAfxv1ZrHHrF4Be/QHEhb8ETQz tu6uEs6W+pAU5+/uOu7npuGa7rSboL/EfkbEa6gGYmuBNQX2E0fr1yffdxJ2EgmLB2vs ONOV5B5zPsAARhl5U/Zac8a9n+jO2qZOW8z0PXB2pjZxHIjsMrNwLmLnMEXfF/pxcE20 qJ4CatEX0uMbubBrNAtjOKvv0elNJ7cfdLUXCEaDEWneE7TgIMZOzuc2rGQhnjsxXoGs FmOQ== X-Gm-Message-State: AFqh2krw+z5HeKnY4uaKHc0v1L+DOFu5N5MrfhWMx4iOc/AI566bD6ff tkgMzNIIavTci6xftU2RDFidnw== 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-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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