Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1605718rdb; Tue, 20 Feb 2024 01:02:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUaEg9SjyzijPhWfrZn5auwZGiVkU3qAhjpl4w15rB9VjhpT/9rMg/axKrIHJ0/PhqlsrTq8FrPKjFlHXr3ZTkTdKT3pMLXRLygMn8vJA== X-Google-Smtp-Source: AGHT+IEPFm578TVbSBAdUtFhheJaQ8u/oCtKDpBbXP9+ObhUncQVbYnGWIq94afG4AD+5ZYC8tyq X-Received: by 2002:a17:906:407:b0:a3e:a3dc:45c9 with SMTP id d7-20020a170906040700b00a3ea3dc45c9mr2932434eja.72.1708419729378; Tue, 20 Feb 2024 01:02:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708419729; cv=pass; d=google.com; s=arc-20160816; b=XPkqdH7GKthrRT1t7QT3msuxQAzgnAEBDJh6PQCiID9K8vTQIptCo1Z6NhV/3gTJrZ G9qDcWTaXbEnunZsGGkesX6KgsFo+7gaQAdH7CKEz/Xqt49aFllaTWqeSqYmgFIZuWWo O71rHuO0R6ZzaX6TZiWLOMzm0VWnt7q0iofSPxpTI8xvagk0ybOExqkwW/Vx2G6XRPUG jmd3aZIoMr7SZwp0zHnfCnYiYxt0vte13snF5YkxIvKRr/oLjYBB5g8RIr3mXmCEbghb arcyxUTFa0jizmk1kujx39ncAMebmZC0fTY5LchL0+tTKiqRMOyzWBAzPyPF/AUucetA NXSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :from:dkim-signature; bh=CioH3BsTUz1maYuaICq+/SgJ+oQ0/fhAEh2/1YJhMeI=; fh=nkspZp3TI6fwoNy6OiU84MpWffZs1F8b7FwNxQMba0c=; b=iPJjMGmXvwY43VAVSE+qINZBLTWPOPJoqnq5u2/zY+kRkp2dIEXXCbFG6BcBrSGsoQ mTSkv/NZp6KwfE4tME9A82wqjmWAWZJNe9XKyeKc8xsV5G22BSTKZcu0W2BPF7Cs7z0b bLbOp95UeQSTgqDyaCwOe3RVdJWtZqvqmWCSxT/xId5s3cDS52GUhLWvgc/GNp2EnW14 3lf9105xC8FaT0e00WmH82Mznasa4yyWHxHRL+TDo4ONW+V2DzPZYp6OFEBiMEh/mBOf oY0Vpb9LO7e8iIVoKOIHccMojSzZC2TjLnNKItRtDd2HQf/1fbG1jc5EDjwOpS+VbtL1 zJ0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VaVdyU6O; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-72631-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72631-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id rv27-20020a17090710db00b00a3e60a17a93si2239363ejb.498.2024.02.20.01.02.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:02:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72631-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VaVdyU6O; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-72631-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72631-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 281311F22548 for ; Tue, 20 Feb 2024 09:02:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D97575F57C; Tue, 20 Feb 2024 08:59:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VaVdyU6O" Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 7032A5F492; Tue, 20 Feb 2024 08:59:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419586; cv=none; b=rR6LqCT0p8hIoR8nT6wp2AT4YhvfXxKp0DjtJIEiearveXZwoWaDRaxm+C8TtNpFXb2bQVjaLXWkKLp2R6Q12m7nZVycrxJfXVO7IYAnsnweoLYAjyis90m45vbfUpuODcdmWnv+kCeD8YRat3UC7esCHr6WOHoKs3WEcSYmvCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419586; c=relaxed/simple; bh=kMRyy94TGbI5G9a7NUzCwy7GqE4yhZZpGtIMYZLgoSk=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=sH//qOB2w65i4izcaSqehvYGGJYb9MzOOzLTzZvJz1OeNjR4H6hMfX3pVAH0wsgbSWwUc+eVAuTUoKKGUdnZayru0OXIVmzd2mBIWWywm6AfvKaqwXH1k9NrJI/Tuq9Kal0lmjlV/pMOtmsrDhcLUmA3EmAQIWLmH0Ww6rCz3Rk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VaVdyU6O; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4127008decdso1780865e9.1; Tue, 20 Feb 2024 00:59:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708419583; x=1709024383; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:user-agent:mime-version:date :message-id:from:from:to:cc:subject:date:message-id:reply-to; bh=CioH3BsTUz1maYuaICq+/SgJ+oQ0/fhAEh2/1YJhMeI=; b=VaVdyU6Ob8JqmhehsbCvrPTtFGTcxsVwiBDrU6eUabGse5midM2FQU/V6VnOLMFEyB 3LCtl7S6u8f+4tKXNX29UrFjCh2APgta873hMBMyWIOzvekbeZTjNfTwSSZ4j9BNDtKw j7wo2wcA4BIMweYYMyRF2uvG+A+2UumIq7VxCu03AOgVok1V01yq0BQkGLAf4WbzaCyh 955GmrL8Llk/glh2yIYMqQJj5fMpt6k1ghsD5/XSIMYC9S4WTM4tZWdqXQPL1q63Pljf pOHc+gvhHAYy+0QryfqorI2bYOioEuBPMSJy9l+5ziBwzl5FEDXYoIdwwlamfnKFEUx/ 3MaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419583; x=1709024383; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:user-agent:mime-version:date :message-id:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CioH3BsTUz1maYuaICq+/SgJ+oQ0/fhAEh2/1YJhMeI=; b=kRXkfF6u+UnJTwo3glqWFeRF13mlM4xT9OFO+8wUmcbT5nZqHoV2ltgciWSpWNQohb IggZKyobc0jZC0GITccyzAp/8tYGQLlZJsxsxxc8khNvk+M9wKHRxJ8e5X84EIgqsTRF urkIH3GrNBvV1Mci7yL/hE+vIpsgue00UU6u6GaqF7hXsIkYiYXTcqQDgp26wEJVhM0Q 6Nufq/wuWkVIftWNs1wTAH+JmebLUbfA3eoZcW5pIwqds9ZqZ8AhTJE9b3yyitxCojyZ rYtU6+eooyZ8DAeI3ynddtV3ZUnjPzvmuce2ynIsTPrZIV0CyFQRq+O0Z0G2pi9Er8vr 8adA== X-Forwarded-Encrypted: i=1; AJvYcCUYhu9RICOLdzQjQRE3KMqyM8/2d4DClbAg5Yd9EmFQs7qQMGaun3NUlQCHfDfhVyEmOM9GSXe2/A7dWy/tL7AlcJXtaSkxPUyyXPAE8y7Ya+U/Alu/dQ3cIQhchB77bORJnOBUV4KDMKsS6oxVqsXVMFFU7PlqFuYtLPej9lp3tmlnRgnNhnuNrlj4moTX5CkvI/GVyeIZfsVdwmfLvsGOeGG7f0u79oZsgFxT1w0UqrYPEn5RKS1gkQ== X-Gm-Message-State: AOJu0YzZJeJn+9FZXOlPfDx5MTab3rKXNPkiFBseCt68sGbs9mumStlT dXah44LzzVkBe0zEImf8Es6b0WIR12D2aSxq5HjVdYV+K2Qkl7/Hc5lWMBrqHX8= X-Received: by 2002:a05:6000:1787:b0:33d:56a0:88e3 with SMTP id e7-20020a056000178700b0033d56a088e3mr3094047wrg.65.1708419582378; Tue, 20 Feb 2024 00:59:42 -0800 (PST) Received: from [10.24.67.19] ([15.248.2.239]) by smtp.gmail.com with ESMTPSA id co3-20020a0560000a0300b0033d70dd0e04sm279495wrb.8.2024.02.20.00.59.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:59:41 -0800 (PST) From: Paul Durrant X-Google-Original-From: Paul Durrant Message-ID: <7871cd67-156a-4823-9b0d-d54ee4b72dd0@xen.org> Date: Tue, 20 Feb 2024 08:59:39 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: paul@xen.org Subject: Re: [PATCH v13 04/21] KVM: pfncache: add a mark-dirty helper Content-Language: en-US To: Sean Christopherson 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 References: <20240215152916.1158-1-paul@xen.org> <20240215152916.1158-5-paul@xen.org> Organization: Xen Project In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/02/2024 21:42, Sean Christopherson wrote: > 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)); > } > Ok. Will change. >> +} >> + >> void kvm_sigset_activate(struct kvm_vcpu *vcpu); >> void kvm_sigset_deactivate(struct kvm_vcpu *vcpu); >> >> -- >> 2.39.2 >>