Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp929136lqb; Wed, 17 Apr 2024 15:26:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXiwnSaPxgTYWE2yVF/7Wzy1lyviOe+P6EvsmQwte+XHByzIJniefHTrfBsMGZkKh9gGp4IXN+Bp1pmS5N+yYLvGs1XfqfGud2x+LtVHw== X-Google-Smtp-Source: AGHT+IG8ZvR+LQXiX/eUgJWLhr0Cophu7Qst3C8HBRJiVNHb7HEL1ep5rnSzqadsI8c36vWL4Ofw X-Received: by 2002:a25:9186:0:b0:dcd:3d6:68ad with SMTP id w6-20020a259186000000b00dcd03d668admr860195ybl.0.1713392811137; Wed, 17 Apr 2024 15:26:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713392811; cv=pass; d=google.com; s=arc-20160816; b=s8dl+uLDirpPjeqU/kWrqcMWnzMyp3bM8Kq5jTMLGJDg44a42Rd6eRkaU8QM3fvPU7 ZDbkWvWvlI4itFUkr8+ADveLrk0GSsFaOjl7f6X0F/x0BpSXI3IX3iTASvPd7uvDPNlb mZyQnMite6yVGjtHG9Q7Sf83SEXiGvWCAgPyCWAwAFZQEErn0czTpnmQkPVWOzA/PFQ5 h4ippz1GkRESFQnJuCoZwJ9lYmUdnN5rpgN1JfoFDjv/rQWpkBTb/zM3VfV2Oz0/KcOu /9VgLKchLIktHON/9BDe92pXQ3tARAyVunzl4YNsLdTpFWC0jnE17ketmLXVEcN2gdhS +vyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=BiFELyysG8+48TNhbAr5tpc1m8bNuNEGFuwVu5J7UpA=; fh=yK3GKIDyoPLB52TOJp5veFuVUe/KZ3MiH9HMH72Eoi0=; b=dl6mZpycqKhjXk8fIraiKO+dfdjeQocMe3tk+VKn2AgxGREDoug+NaFYBwTuK4wepH OnE9K3Xeg8Ot+2cds0LUJ97UTipIdufRqpcNRZV4qxPIDmb4vV+sSDI0DbeJDbF88aor xMSlJRjT4r4s5L6l3vrnmf/YN5eSYe8rzF8Yls8JeTCKR6u/CIRUjl+8iFtKSKl5GzJg MsG/MEEL8AYgcfZ4y/gd6wATsy5eXuqgeqI+TBvWzarQJTh2CbDnWnjGr8OhXVANijIe Lp69+GyxqaNlfE6d7XtzhLdV0O8rvgf2JAt54uw0FuQbvOWy9dabUNQ7gTKfgb2sk8WK 1oWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=TRvFn44g; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-149279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149279-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gy5-20020a056214242500b0069b43edda1fsi179270qvb.40.2024.04.17.15.26.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 15:26:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=TRvFn44g; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-149279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149279-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D67411C21238 for ; Wed, 17 Apr 2024 22:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66A3814830C; Wed, 17 Apr 2024 22:26:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TRvFn44g" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 4DA152134B for ; Wed, 17 Apr 2024 22:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713392800; cv=none; b=omj+Lj5cAlVkO9hOqFFdHWJI2oQ+lSnFTNK9cd0N2TqWh+Vm9E3qkeAm/szUWtc2m/s9tcsqdPlsE1juFptLXsIq2xKpY4nKl0SjVqyCm53TOzQUKmV/tMKGxfo44ZXgfWtadkG0bbezwxOhMHJR3D8od93zdh0+aJcLnWD0Pw0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713392800; c=relaxed/simple; bh=XmJUdCd/Xl3LfoQUvHoCZ8uS6N6zHJE4OLXgnHRlR/s=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=lGPYBTVn6J7fjUxd/TDbrbb4TsZKyOvKTRebY3lRUaJ+XqluRUmzX4B1F14O0RwONljR7FEyjCw6fnYvHpT7hVfMWmEUfNpVU4yvNVHhBcXAmt1rGF/Jjt4pSVdPZjytmRQyGO63aDSbbCWkIW7+Xn8F2fvHBvH4ss6BcEUIrbw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=TRvFn44g; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-61510f72bb3so3806767b3.0 for ; Wed, 17 Apr 2024 15:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713392798; x=1713997598; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=BiFELyysG8+48TNhbAr5tpc1m8bNuNEGFuwVu5J7UpA=; b=TRvFn44gPZyrGFTvHYx8L25f69jm3X1FB7kd35jCseL3yKvm6xyUKAO1ROw4FbsfJV a7VZQSSz8M/onglawRnAroFfoFZlyN1EhEaDIm1cKksmhGPDwqtChYSGvWncxDva1awR Lh1GOJbQlt3w6dNNRDFZjoBeWGIUCLzUUg3bUL7X2bUM+hZIsAbGcVYOwdbJUQUnB2Mv HKvhrXheD7KZQ/W1uoMIPTtHexXItTD5FQMagt+J/ZQlvV9YUCgxFNKXvnSAJ2IPtuD1 HFrBe/x3wVN2vphfftMr73Bk7drMNXxuGv75rXxNvrFSmlMf/wdj9TZ1t30B+0jQs69c XaLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713392798; x=1713997598; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=BiFELyysG8+48TNhbAr5tpc1m8bNuNEGFuwVu5J7UpA=; b=qnD7u0H41q46ocW3bSWjwxpbtmIYOz7nYKybTMuZpZjz/vAC4Esfj2YPM/vwCeqRsI JIeWDQmTHthK0Z2I9qPCaAm1sTWzUPMx1Xw8jcBw7LOSm8ETu7TMBLF3MSuF5gl4P8M/ c4aAwq02B5VRdpweA8I8VRd1eFTkGGFH28a8iwM9cM2irHYlakqPK5KtlWnIZm81C9BI cMVu9/0mFue1HBhIULusIuN2ZAJ/uJiWpkIwLKC/ZurxlrcLosNsM+qJjzsLqAGkSGVw J5kQNwNl8F3+YqLhP7opMgCQ1l+0zy8us5cTbb/CPv4XkJDFewTDxFu8epxNA8rMss/0 J8nQ== X-Gm-Message-State: AOJu0YyUU+a/Sr5Oq4B3xxpb3qDSwDuYynYmy+TdXkqzp+fgOy6yDzSZ 2HSoBy2iW/hKbZmEAhOI5ilXxm7b2iBsLlhwOdXXK8F+80+rFLCvsRvfIXRzxG1l9PDfsmAq13g O0Q== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a0d:ccce:0:b0:61b:1346:3cd5 with SMTP id o197-20020a0dccce000000b0061b13463cd5mr143602ywd.9.1713392798464; Wed, 17 Apr 2024 15:26:38 -0700 (PDT) Date: Wed, 17 Apr 2024 15:26:36 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240417153450.3608097-1-pbonzini@redhat.com> <20240417153450.3608097-6-pbonzini@redhat.com> Message-ID: Subject: Re: [PATCH 5/7] KVM: x86/mmu: Introduce kvm_tdp_map_page() to populate guest memory From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, isaku.yamahata@intel.com, xiaoyao.li@intel.com, binbin.wu@linux.intel.com, rick.p.edgecombe@intel.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2024, Paolo Bonzini wrote: > On Wed, Apr 17, 2024 at 11:24=E2=80=AFPM Sean Christopherson wrote: > > Do we want to restrict this to the TDP MMU? Not for any particular rea= son, > > mostly just to keep moving towards officially deprecating/removing TDP > > support from the shadow MMU. >=20 > Heh, yet another thing I briefly thought about while reviewing Isaku's > work. In the end I decided that, with the implementation being just a > regular prefault, there's not much to save from keeping the shadow MMU > away from this. Yeah. > The real ugly part is that if the memslots are zapped the > pre-population effect basically goes away (damn > kvm_arch_flush_shadow_memslot).=20 Ah, the eternal thorn in my side.=20 > This is the reason why I initially thought of KVM_CHECK_EXTENSION for the= VM > file descriptor, to only allow this for TDX VMs. I'm fairly certain memslot deletion is mostly a QEMU specific problem. All= egedly (I haven't verified), our userspace+firmware doesn't delete any memslots du= ring boot. And it might even be solvable for QEMU, at least for some configurations. = E.g. during boot, my QEMU+OVMF setup creates and deletes the SMRAM memslot (desp= ite my KVM build not supporting SMM), and deletes the lower RAM memslot when reloc= ating BIOS. The SMRAM is definitely solvable, and the BIOS relocation stuff seem= s like it's solvable too.