From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 AE33F802 for ; Sat, 18 Jan 2025 01:03:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737162204; cv=none; b=Um3mP7jinxekEr0Pr1eJG8b5qAuaqAKH7UuB5C9Fc4pIspS8wjOrPRA3uoJFdBWX26y+yIZkPVRJSTgg2oB12gRc+vjCKbgm2CP95s5c1fnLtQwt5uq00SWFurzail7Ce1VFGW9TXEc8COGVSLA4Imk5nNERweGoB5shr2Rvz54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737162204; c=relaxed/simple; bh=HlxP1ROhyAwe+sd3E3k/ENg7lbYK6YOws5OMifhDAOE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=DW+ytfd2j7nJyUzWWixBiCgJMa38WjVCGe9UJeBDUPGLpAg77SyTLRLEqm+E0bWHRm/uOcQHFccJBlCbvZ4dAQcq9R6FNH3TiWLIBidVE8LoWc48zZ841wUDEIZvopd8OCmkEEVi6C+cXnsaRmHj2IInS8KF7FMqnvM2LvhkrkA= 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=toKG0H5r; arc=none smtp.client-ip=209.85.216.73 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="toKG0H5r" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ef114d8346so5001210a91.0 for ; Fri, 17 Jan 2025 17:03:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737162202; x=1737767002; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=zonpfQT/ajJGPh0ub+FuSmkrsukWr4fji6jPEoxB7w8=; b=toKG0H5rh5MJiBJjs9lljSuI2NcHt2xd6nKMeaFPJcnRw5B+XTuq93JVDoi3UdwQ8d GL1FBmiwYmjJj376N/NW+68GfSAZZCV8QQ5eUi4Z+a8OYtLcswzyyLRB8NfLOAqsPfbd 7UNKWVdZpJtPzKzSZ3J2Hgj7LxrVTu96k9lYJGZZARs5MstcbabRFooQsqOkG7zkwmQw X5s3oK3vz8E2KgsM0X5KU9v08y8Z13k/a7AWHJzo3BEBX0PCfQJ9WOJ2L8zvs/aH62Wz 1b1OksCjNKpjXO3MgRnUAon9EtGwP9lqmKFpO/ZItWj3K/KOGW8HCComfwfNE2e6spg4 m1YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737162202; x=1737767002; h=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=zonpfQT/ajJGPh0ub+FuSmkrsukWr4fji6jPEoxB7w8=; b=v7nLa3Fd0GKYgYLJtTokIRRzPdyLWWucYjk7FbeNaC3DXv6BYExEhJzP2tl7t802lN zAUhwvInpnp4e7hqs/xXmI3xlKABS0bBsoEiVeJ5pDiOnHgMWXAICozs2uOmqU0Pgx08 pAzcv6CWumGN0mPJ7fr6OiVu8ad4HSeVNOI0L9b1bQEMod1kgqbscjsSeUTHL3rhKIJs 7yi13z1TtQyh2wRfQssBCBfy5UyXZZ99LdUVaK1m5dCFwvcVW6reKtu7z9S6CBICBGdr edGqPU9UgTCs17QPFKALaxN9PIvYBayn1JSOZQIG5D/vx2qie3NBxPmtO2vDpPxwIWEA A+lQ== X-Gm-Message-State: AOJu0YzmxoG+780JirtI2hRPqQlSYFHmQCdabQ/KACRQ/sQQ48kBSzkw 4eQgI/yPse9FAOaxPV8yQyyZ5KHgPd9Oy/WjVt7p1Z7diMzglwYryTBM/N1cN5cqBUEqQebB/3h LKw== X-Google-Smtp-Source: AGHT+IHZ09xqZNOKCu4yQuHB4sHubgEBTOhXjbMbVTOVHGeTcnsry9C/bl1de60TMr6Z/3+U/QQUwnXhzZ4= X-Received: from pjc15.prod.google.com ([2002:a17:90b:2f4f:b0:2e0:52d7:183e]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:c890:b0:2ee:cd83:8fe7 with SMTP id 98e67ed59e1d1-2f782d9ee9amr6677906a91.35.1737162202024; Fri, 17 Jan 2025 17:03:22 -0800 (PST) Date: Fri, 17 Jan 2025 17:03:20 -0800 In-Reply-To: <20241222193445.349800-9-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241222193445.349800-1-pbonzini@redhat.com> <20241222193445.349800-9-pbonzini@redhat.com> Message-ID: Subject: Re: [PATCH v6 08/18] KVM: x86/mmu: Support GFN direct bits From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, yan.y.zhao@intel.com, isaku.yamahata@intel.com, binbin.wu@linux.intel.com, rick.p.edgecombe@intel.com Content-Type: text/plain; charset="us-ascii" On Sun, Dec 22, 2024, Paolo Bonzini wrote: > Since TDX only needs to shift the mapping like this for the shared bit, > which is mapped as the normal TDP root, add a "gfn_direct_bits" field to > the kvm_arch structure for each VM with a default value of 0. It will > have the bit set at the position of the GPA shared bit in GFN through TD > specific initialization code. Keep TDX specific concepts out of the MMU > code by not naming it "shared". ... > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index cae88f023caf..95f2b0890a58 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -1542,6 +1542,8 @@ struct kvm_arch { > */ > #define SPLIT_DESC_CACHE_MIN_NR_OBJECTS (SPTE_ENT_PER_PAGE + 1) > struct kvm_mmu_memory_cache split_desc_cache; > + Not urgent, i.e. shouldn't hold up anything, but can someone add a comment here to explain what "direct" means? I know all of the concepts and code in play, and I still don't really know what "direct" means in this context. I doubt others will fair much better :-) > + gfn_t gfn_direct_bits; > };