Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1380950rdb; Mon, 19 Feb 2024 13:42:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXP23djNahtBVgcps7D3/ZhQ0F09lPNUNXVFwjQO49v0e8/1t66EljWg+GUX4BTRomHAUZEWoEtnbaKoFE33tv2Hn+YC68VTa22GAXpzA== X-Google-Smtp-Source: AGHT+IF1kwMlRRr720/j4ZI2/rd8+4YvtRTzsJqnv3IhkQqhxnZMFOGMZJQzzGDYrDjpEePNr5Vw X-Received: by 2002:a37:e21a:0:b0:787:1fa5:912d with SMTP id g26-20020a37e21a000000b007871fa5912dmr24185990qki.4.1708378945968; Mon, 19 Feb 2024 13:42:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708378945; cv=pass; d=google.com; s=arc-20160816; b=X8ESJ2TDT1iOFNmFWcqx1wLDtr/G2o48nyq+51QJfR8V2aBxnJLyK4KQSmJKaR76Gz /eMehJLL3sffF9fHG+TocyLPcPNJUD/i9H3TrfgwptjQqW9nim4dV93jVSC9NuMp1+ET KrlNYFzt/dc9jvwZQ80lW/ALLoTFYuzNq3w0nobF/x+yIaD0uhrjF34x9QaNYvJsZEOn tMw5lm6G5kw2ACnc47i9l8GiSxemZ3Hr1gu1DQUg5COwPQKovt2HnerLTBqJHS9pwDEW 7xIikh/bKC4A1el9UXyeeNa/t2GCQ1pDy/5l4ju8mXOtk65bBuWTMJbvEDjFyYI2CTKO Lmig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=g8pCPeHHqio6jkpHM74ywYCDIbICUYC0WuI3ZsK0Xes=; fh=j4a//O7wBX4D9dV7AQ50Twtmnm33VE45S6zFn1lm5P4=; b=ibC41CFAkcY8kLaR/CZtXtvaTJOxNrFm5NR97Gk9L6XKzNYKuKGg5dWXLYBq7h9Xgt Yv5F3JTtm+2NinRauXowKgfImA/beIIC1Eua0um0RIP+RMVcSF2qKs1V/WPjN23iQkjT HPO7ADuy08gnGIRWWA1qth4HL8mwB1Bww5r6z6cEiPFN3DzytLTUZV0oygzxXtZqHRmo RIMvfZuva4JzHR+W0CUAlTjWHrndpY7On4LSxWcTP27OD5Sav53tcthWHyW0+4+K7rYR IDAbhiT3idjzZe84bt6+91OZ8IMeD+fnNR2ilCaI3AbioIciAombmog8hwhSHaJf3P+2 gTXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=D8W6g3xF; 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-72020-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72020-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 l6-20020a05620a210600b00787698dabb7si3003263qkl.564.2024.02.19.13.42.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 13:42:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72020-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=D8W6g3xF; 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-72020-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72020-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 A9EF81C218D9 for ; Mon, 19 Feb 2024 21:42:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D37B65577E; Mon, 19 Feb 2024 21:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="D8W6g3xF" Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (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 25E4B54750 for ; Mon, 19 Feb 2024 21:42:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708378932; cv=none; b=ZyaLKhoITZ9km202SGGKszZOcLWPS7E8CK16Nla3G7fTDCb8mR5iS9ACt/Z+PJoNf2gA6dUnP6UYgG4sMFgfZkHKx1a4G+OEMsqN7Nr9Oj2Z+7wH7Qt5khdm/+WMkX8KtaFHqIQkeyZCSU/+JMTEIUQeXMPKX48YaXqWsV/HDbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708378932; c=relaxed/simple; bh=X/JQNewlP0vjO6jTDKr0e8KEBVYmNgVrFfyXrgV4mFQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=O7w/dlw08FhrH1N0eV1gMcd0H0mZWvwuZVPEbpyRoL23oMXd0fAhGg13CbZoRM4ugPxybNUxbsoYy3qBuXaeQYyfnCUyy1nIxKukjsC0q2gWyYQL2/bGZtNJRE17J7pxClTtWM4Knzmw2pIxEQibQhyffwXdFyZtmsprvO1VjxQ= 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=D8W6g3xF; arc=none smtp.client-ip=209.85.215.201 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-pg1-f201.google.com with SMTP id 41be03b00d2f7-5d8dbe37d56so4479340a12.0 for ; Mon, 19 Feb 2024 13:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708378928; x=1708983728; 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=g8pCPeHHqio6jkpHM74ywYCDIbICUYC0WuI3ZsK0Xes=; b=D8W6g3xFdxsLnpo9T3gSkE+PwxH+Rz3RgvW2UCiVvziW27U7KYoVdlK5E45sITSc7x MuKfqe+bIhFbWfSgsNTJqnF2g5lp7sEwCnDxw/jyJuzo2pJWeZwe7yBZR/1eAmIA3WH7 Jt9ls/brQsJoJ8Pd3y5TnwiXKoxNYzYkd2AKSg1bn+qvwVt75gSxmf7AuxcL9VgEJ3Gf /O+OsrYF8ko4cWiZCWk1OXhugUk6K+uUJieP9eci7xUSiLniMY3LTi35gDCzaIbZbn+d JR6gIYnAvpw+QlBT/ecpHXxB84cy4qAvW6lSQh5pHYKMtHQnLkweiD0CypSA166rnb4u kDIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708378928; x=1708983728; 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=g8pCPeHHqio6jkpHM74ywYCDIbICUYC0WuI3ZsK0Xes=; b=n9DSNEP8x7xWVaTJMQCzEWcH9P4Tr6mcJQ/ySEnLKb52WDdSwH7ziHVcYFKoj0ihuA TjiOmCrRAL7tTRDb7GQdMd21S9lNaqWk5u1D/U6KAAL5/41rjPZMo+iesL7pMpQn0z3+ MrqGJb/z/zhkMaN+H21XQN3J8wmzIL3GZ6qJ8W2X+fklpj0+w3S/LEHbSFFbX7ebMx+W nHmNcezpENXVkKGshXwVNl1ooSPk1C8gwTu9lUIURVk8bZq2MzqG4f59PKksaUEqOkVB RCe/CwAQadofgg4Nl48XPXKwDnV6mDmK75Gl7zDCH/NnKFQ/DiizSEK3vAepo0eoB/Wu h0mA== X-Forwarded-Encrypted: i=1; AJvYcCVdZNHSaxEb06DxA7mG3uW5boNDUnLp+bOWeiN5uU1rgrECtyqR+NTjjBTC8cgC0x4M97kkjKDVSDwcVJcr40a9UEAwfjdxXv30649y X-Gm-Message-State: AOJu0YwKKu0vUYdLcDO3HacSd3hJ/3KxD393SsiT1VVkHwCB+w1rYqnz UUIbK+870YN2FJhhCtdGMiluxOjhi7LWCD5PmXlHV7rbHnqKcd4TOe8d35UMDMDBLlpKyUrlIPz PWA== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a65:6742:0:b0:5db:e194:873f with SMTP id c2-20020a656742000000b005dbe194873fmr35852pgu.10.1708378927816; Mon, 19 Feb 2024 13:42:07 -0800 (PST) Date: Mon, 19 Feb 2024 13:42:06 -0800 In-Reply-To: <20240215152916.1158-5-paul@xen.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240215152916.1158-1-paul@xen.org> <20240215152916.1158-5-paul@xen.org> Message-ID: Subject: Re: [PATCH v13 04/21] KVM: pfncache: add a mark-dirty helper From: Sean Christopherson To: Paul Durrant Cc: Paolo Bonzini , Jonathan Corbet , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , David Woodhouse , Shuah Khan , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, Feb 15, 2024, Paul Durrant wrote: > +/** > + * kvm_gpc_mark_dirty_in_slot - mark a cached guest page as dirty. > + * > + * @gpc: struct gfn_to_pfn_cache object. Meh, just omit the kerneldoc comment. > + */ > +static inline void kvm_gpc_mark_dirty_in_slot(struct gfn_to_pfn_cache *gpc) > +{ > + lockdep_assert_held(&gpc->lock); > + if (gpc->memslot) > + mark_page_dirty_in_slot(gpc->kvm, gpc->memslot, > + gpc->gpa >> PAGE_SHIFT); It's kinda silly, but I think it's worth landing this below gpa_to_gfn() so that there's no need to open code the shift. And I have a (very) slight preference for an early return. static inline void kvm_gpc_mark_dirty_in_slot(struct gfn_to_pfn_cache *gpc) { lockdep_assert_held(&gpc->lock); if (!gpc->memslot) return; mark_page_dirty_in_slot(gpc->kvm, gpc->memslot, gpa_to_gfn(gpc->gpa)); } > +} > + > void kvm_sigset_activate(struct kvm_vcpu *vcpu); > void kvm_sigset_deactivate(struct kvm_vcpu *vcpu); > > -- > 2.39.2 >