Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1528005lqt; Sat, 8 Jun 2024 01:53:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWK1DoZ8zPxPiT2QBAtcxRi2dgk0UjOQItMutCgo2bZ2lApTLSgNDqhl3QwMq3lLK7S71E6b1Fgt8JAHvvra6phhLjsYqZd2bkJRpVDww== X-Google-Smtp-Source: AGHT+IEuh/TmJpoUmi1dcA6u/eCJVH+WSjYqLVLBtYgUudbs0VggXA8IeFQ05GRSQWjHDMk885Os X-Received: by 2002:a50:c345:0:b0:57c:54af:713b with SMTP id 4fb4d7f45d1cf-57c54af72admr2638823a12.14.1717836784314; Sat, 08 Jun 2024 01:53:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717836784; cv=pass; d=google.com; s=arc-20160816; b=OjVZ7AlEkdia/m3EHmi4oGy8fdNN+8yfQMBBFQ8oNzW3aidPXobRk2P9F8mztYFvBE usptSznF9/h6q7DtUqu+hFhnySx12ESDDi6VB93FEAp8ySLHz2IdU0tY6bi1bFFbJAzr 3uUsbg18EmsP0yYQNfFu51pAT3wRXMhwxwKAtqcESui8SWU4QMwa69pJVRrRt0A3nRma lz+BGiWihmwpn4NvYeI9+mX1kaK4KjueXFH98ovSym+TweUeg63OK1Olj7426mRX8IQw LjqZgRbl1hyyreLCDwvAoK/j4rKsFZCPXDm/x3v2fWRDeRQliG1d+2T1vn87eT1WGsYn 1LDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=JE0Afv2+MSIgjGY50KIS26TxZdTfOBnblGzJXPbJMP0=; fh=ncvwNpcGmJnbqaGi4cz+3QM5VQqt8l+FtYHMCpL9rJw=; b=FnvB7uwdNKY0kdXBSn5o6PzEGvipM+U46NAoGct2re+aJHa5T/pf7rDZkdOQpJONOZ oWLIF/AtIbg5aO1q/YWELMMCsdtDk179vlqdY97V9lwARyCMVJJLKT1r076X11nnsgK7 8p72kxqPwNH8RjXucd7laGyZVE9P50FrzEQk04tSDkRnwRUqI6P1TOuAPP/PPzVwd7Ij qmsb+yhipK+alueNS1YiFf1yShzqW/pwCd2F/4anXbUC0neQKxAeHulJ7ki6wVca6ZkA N0OH28FWum4ZErEnxTeF18GuIrlGm5Ur2YrT/JsfzCi5ZtA9T4kHGJCWd0OOg4M2sI0h Zj+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Q/CD+ZK/"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-206960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206960-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c5f711cd2si1232973a12.256.2024.06.08.01.53.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 01:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Q/CD+ZK/"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-206960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206960-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 461E91F222FD for ; Sat, 8 Jun 2024 08:53:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6DFA177983; Sat, 8 Jun 2024 08:52:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q/CD+ZK/" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60B41176FC0 for ; Sat, 8 Jun 2024 08:52:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717836766; cv=none; b=oPfqznKCjgSKhIh3vsDSYAQkcAizhd+hZnISUcxI9iXH8ipYtVVgn70THTy1CXfeYsIOOPnY/RTJc2GkEAVaB1DDru+LdJnsuGTWkjHHIIOOPeP9i/r933syICy/J/I1Vb2PQq8vgwinvhg5Ovnzk7xdNvGYp8Yfh2LMvkBwySc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717836766; c=relaxed/simple; bh=j/pc0aDSaoMD5Z4FefrtiCAvHYjnJdayUYaFlXoI2g8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=J7DWNJaDO2XcIUugRRwa6Z43vVaADYe+Fh/29tCLIWHoPMY09KJbao+biTiAS8Vm8WOYC4f0bQYNqnZHK3pcWmfoNJP2psUqHR5zvEKm0nOpupCoMJAF37IvmJQVBWdSDPhrpqNnTe2OKmV3SW7kkWVq4BaeXCkNLaC+sucqMwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Q/CD+ZK/; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717836763; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JE0Afv2+MSIgjGY50KIS26TxZdTfOBnblGzJXPbJMP0=; b=Q/CD+ZK/h4wRgq+cJFWnjjkbKd+E59YBkzXbj1OXGO9BDigD2XmKm5MBTcu7bP8zXb64Ll GOEkF9p2wAbLogbAmHmAYMSuV/gxkAWST1GhwCl7HTOxsNStDbIjXkPFot6IJpOtewok+6 RRsqkg9gtVuE1BTNEDNehN+iow7OGOs= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-270-3KvID8H7Mx6mGYPfS0L-8g-1; Sat, 08 Jun 2024 04:52:39 -0400 X-MC-Unique: 3KvID8H7Mx6mGYPfS0L-8g-1 Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-5e4df21f22dso2277754a12.0 for ; Sat, 08 Jun 2024 01:52:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717836758; x=1718441558; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JE0Afv2+MSIgjGY50KIS26TxZdTfOBnblGzJXPbJMP0=; b=u+TK2uxMy+1z5g9/RMTxNRIC6lVifEf9i03b9w2dEpNysjqGbxt1aBqaHghqRJdk8k MUrtAIR3S7MoRFh5iLPMJUliTJw+I3769AysG1WOONWuMEdOmHaUlLdf8iyZmV0PKZ38 dP7FCKAV5jLfFYtIfddeWvmma6XyRJ4oTticd/dAyMGrLVkPaIFhofFldOxUvLz8KHWa GPSFsnfZ+YEqU/pCoMiCgs0MpOXRxvnONY2CJuvIe9ZPi/gVq4WmNcRvwJ4kLnNPKZr6 EoliXClpuha9Wdg8PP9IrvPIn/bblcknTQz7awD0VuleL92G+DqzZ+ePBHamAXmYx0Qv z2gQ== X-Forwarded-Encrypted: i=1; AJvYcCW6i5Ptsvxhrc8+X4Iq33gezqHJN4Ibl6HpuNFewzAjktG/pO6iBACj4o4oeAsq5n0J3CfqaSeb2H/2Xpz66vPNKJZ6LPZZHgz/BJS3 X-Gm-Message-State: AOJu0Yx5CLKo1yCj8oMn6N9bj/0UAtxQV4CmgEb2BDEFUyHduoEmU6qZ XHGgkGvybfpbre2Zk+cLTKi8PlKgU4rR1prdhaGyT1hm/aaDqqx7nF7XZ1f/DDfqTwsjw9LicUI ICDD1kxPpdf9If6Gs+VRg6QZVEE/G0RCQXwIBQ91TBZsFJXBtmApLmtnoTc/mKn6bP8vSXTWiL7 WGS9zD7qKtWPU7uJwhq9ZEgFdl5dbXfwFxZ/8W X-Received: by 2002:a17:90a:528e:b0:2c0:d4d:837 with SMTP id 98e67ed59e1d1-2c2b89aadbemr6759884a91.12.1717836758294; Sat, 08 Jun 2024 01:52:38 -0700 (PDT) X-Received: by 2002:a17:90a:528e:b0:2c0:d4d:837 with SMTP id 98e67ed59e1d1-2c2b89aadbemr6759862a91.12.1717836757895; Sat, 08 Jun 2024 01:52:37 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240530210714.364118-1-rick.p.edgecombe@intel.com> <20240530210714.364118-7-rick.p.edgecombe@intel.com> <9423e6b83523c0a3828a88f38ffc3275a08e11dd.camel@intel.com> In-Reply-To: <9423e6b83523c0a3828a88f38ffc3275a08e11dd.camel@intel.com> From: Paolo Bonzini Date: Sat, 8 Jun 2024 10:52:24 +0200 Message-ID: Subject: Re: [PATCH v2 06/15] KVM: x86/mmu: Support GFN direct mask To: "Edgecombe, Rick P" Cc: "seanjc@google.com" , "Huang, Kai" , "sagis@google.com" , "linux-kernel@vger.kernel.org" , "Aktas, Erdem" , "Zhao, Yan Y" , "dmatlack@google.com" , "kvm@vger.kernel.org" , "Yamahata, Isaku" , "isaku.yamahata@gmail.com" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 7, 2024 at 8:39=E2=80=AFPM Edgecombe, Rick P wrote: > > > + return kvm_gfn_direct_mask(kvm); > > > > Ok, please excuse me again for being fussy on the naming. Typically I > > think of a "mask" as something that you check against, or something > > that you do x &~ mask, not as something that you add. Maybe > > kvm_gfn_root_offset and gfn_direct_offset? > > As for the name, I guess I'd be less keen on "offset" because it's not cl= ear > that it is a power-of-two value that can be used with bitwise operations. > > I'm not sure what the "fixed" adds and it makes it longer. Also, many PTE= bits > cannot be moved and they are not referred to as fixed, where the shared b= it > actually *can* be moved via GPAW (not that the MMU code cares about that > though). > > Just "bits" sounds better to me, so maybe I'll try? > kvm_gfn_direct_bits() > kvm_gfn_root_bits() Yep, kvm_gfn_direct_bits and kvm_gfn_root_bits are good. Paolo