From patchwork Fri Jul 26 23:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 1965593 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=Q6Oiuof0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WW5Yw4NMwz1ybY for ; Sat, 27 Jul 2024 10:47:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=Q6Oiuof0; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WW5Yw3M5hz30Vv for ; Sat, 27 Jul 2024 10:47:32 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=Q6Oiuof0; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--seanjc.bounces.google.com (client-ip=2607:f8b0:4864:20::1149; helo=mail-yw1-x1149.google.com; envelope-from=3atekzgykdkqwierngksskpi.gsqpmrybttg-hizpmwxw.sdpefw.svk@flex--seanjc.bounces.google.com; receiver=lists.ozlabs.org) Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4WW4Pm0lZYz3fVN for ; Sat, 27 Jul 2024 09:55:23 +1000 (AEST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-66c0f57549fso7730647b3.0 for ; Fri, 26 Jul 2024 16:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722038122; x=1722642922; darn=lists.ozlabs.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=dTOlfH+mhloY9mYg+/p0IQai80b+6RXS/WhBEV7av3U=; b=Q6Oiuof0MqMKTa+QE1w4VoknZ6imipw3dTgYdL8UxxsJOyO8Llmjv5o7FKNiNEHC7D UGE329eYT0uElfByXw4fBnKg5eyOJ3gC7/X9dHkPQfc6OIrtBiGK3x6NAqWBOBfLamWv zj6opCQVp0hcamQefKXBANuu7sUddofej2D9DtTPvxIQZ6KMgamaEEuGdlsUEYe28Yeq qOLElSsUK5tjWEgzhR5cFGaz6VfDupz80vhyHe1ERf3SyS6vTEYW7ZJPQc8+6Bp1egC8 Fyqa5y2SL4/k8r9glpTmsFkZteiGv2aHGjYK3vNRKgof06cC+gB2JAqKnPdhyDkrg4RH CJuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722038122; x=1722642922; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dTOlfH+mhloY9mYg+/p0IQai80b+6RXS/WhBEV7av3U=; b=tjwfdpZ8sj5ZYMAhWFMLWcQi9tyRKo2V3jKBAq64W3jVuf7JGqRAKhmV2UlSrIpwBF EoZucLywRTwc+RN4YzaHRLBBkz2aljsvLOD4JlZP6c6vfrcdYu/4u+K9ohbmepF9wyve VGdHCEUTlxeAb7k6MET0tT+EJpn6qxc/AR7ghUMgrIfoIzFjujDtPAgZXP+Kcgzt36O9 Df2oLRaumRpYMSZai9cYKh/wb8Irf8wingQHCnCF84Ix37Gm2RoAPR53iO0iGYw5ha+k V3wk5zXQczoo6XerFu2S6giVIYfN0eAHcv+GQvg8rCqXIVoO2TWK0aj69Rw9M4nd//zG lkKQ== X-Forwarded-Encrypted: i=1; AJvYcCVI3cZs91BHXrfDfDEZ5+tEJIlQB511OiDOH664lQHFNr8tMkVk5s8dFVLDwC8EKGwrirw/d8gfMUGAvYNv/DSbX18hbF2KHMhRFrSZBg== X-Gm-Message-State: AOJu0YwmpsZcodyVKH0LnaYhswh4mJ2m6odqKvP5jXNwejjjfVVaf1o8 4AuCy8DzpOc9Cu5oYxc3oZ3e+f7aFvb4c/PqiflJcskW0FgrCTPLTeZ9qvJeeZE4PYede5CVqDH kWg== X-Google-Smtp-Source: AGHT+IGgifSFTGz9fVU5jdzVocA5wMp2MITnk/v5MkueXs++Udesz0kCsEkHm8VEDJpbtR+Hv7uv12YKgg8= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:f0a:b0:62f:1f63:ae4f with SMTP id 00721157ae682-67a052e5dccmr429907b3.1.1722038121721; Fri, 26 Jul 2024 16:55:21 -0700 (PDT) Date: Fri, 26 Jul 2024 16:52:28 -0700 In-Reply-To: <20240726235234.228822-1-seanjc@google.com> Mime-Version: 1.0 References: <20240726235234.228822-1-seanjc@google.com> X-Mailer: git-send-email 2.46.0.rc1.232.g9752f9e123-goog Message-ID: <20240726235234.228822-80-seanjc@google.com> Subject: [PATCH v12 79/84] KVM: s390: Use kvm_release_page_dirty() to unpin "struct page" memory From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Sean Christopherson X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Sean Christopherson Cc: kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , David Stevens , loongarch@lists.linux.dev, kvmarm@lists.linux.dev, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Use kvm_release_page_dirty() when unpinning guest pages, as the pfn was retrieved via pin_guest_page(), i.e. is guaranteed to be backed by struct page memory. This will allow dropping kvm_release_pfn_dirty() and friends. Signed-off-by: Sean Christopherson --- arch/s390/kvm/vsie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 566697ee37eb..f6f1569be1cc 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c @@ -670,7 +670,7 @@ static int pin_guest_page(struct kvm *kvm, gpa_t gpa, hpa_t *hpa) /* Unpins a page previously pinned via pin_guest_page, marking it as dirty. */ static void unpin_guest_page(struct kvm *kvm, gpa_t gpa, hpa_t hpa) { - kvm_release_pfn_dirty(hpa >> PAGE_SHIFT); + kvm_release_page_dirty(pfn_to_page(hpa >> PAGE_SHIFT)); /* mark the page always as dirty for migration */ mark_page_dirty(kvm, gpa_to_gfn(gpa)); }