From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06B91C4332F for ; Mon, 30 Oct 2023 18:22:36 +0000 (UTC) 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=rGSzgTOw; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SK1pM2wWyz3cSH for ; Tue, 31 Oct 2023 05:22:35 +1100 (AEDT) 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=rGSzgTOw; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=google.com (client-ip=2a00:1450:4864:20::32b; helo=mail-wm1-x32b.google.com; envelope-from=dmatlack@google.com; receiver=lists.ozlabs.org) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 4SK1nN6pPzz2xLN for ; Tue, 31 Oct 2023 05:21:44 +1100 (AEDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4083dbc43cfso32007575e9.3 for ; Mon, 30 Oct 2023 11:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698690100; x=1699294900; darn=lists.ozlabs.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+/9ggluaJ++InohprDPxvdU7Uw478trPLaD3bhLrtl4=; b=rGSzgTOwrwAjfFxViIOogkLK1x6Tryp7tha2xvlpWPjRnEHBrcaV7PxBCXA16G8D5g CxP6vkAZb1owV3/LE6YDi68Qo7cLuYgJulW90DdOoKqJN91G5mMWt5T0VQ46GYYpNBnI qZZciijPaZNwBu6SEmanaO8eMO+z2XqH+oh1pui13yxqIkuVPAWTKF2m031eD54h5x4I xebO+YE+3kzuHxJpIccDY7zKx0P5nejIU08YWOZ0jxP+o8bwTIOqpsZN5rL5T9eFVhh6 yE3x19BPPGFVNGN9ir+vWP9ysYz9d3KMtYszXdLWq4Z5o4dCgX31WlzpaTsszh+yKgwj pIXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698690100; x=1699294900; 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=+/9ggluaJ++InohprDPxvdU7Uw478trPLaD3bhLrtl4=; b=gMZ5ja4OSZOZE/PRL2Mlg2T722KArhWlXG0Tl1ZkymGHWoEGoKTHrrnPdH6lQY6zQI wCDXZF0vx87E9h0FT17+dzuODesNjCKK7XQhYc81hJOEosgq7tsS0ARPROzGMCOHSspj rFvLsep3OeJOo8cECt5TPE8QYugATcKPe0yqgi+NbG5SSlZN/bwqFlDA7rel6D5kPhJA BDmM93QObuaoTyUNmls48sS1GyqtXxJKQzKxRZkt7TZIR3ggQ5LroX6aqLi4a8JG5/v/ vzS9AShYwM72QoArYmlpdFYT7JRBzeGvVnIyZLoE9cm6wStNYDuuBbvw1Tz62CD+3TMK pm9w== X-Gm-Message-State: AOJu0YzRxuU++JjTvqLVEh4QwEosbFgLbHSUY3MY5dBjS68/aP3Lo3TO /hVR8uUKj3T5q5csdJM+v26oSFSgH4ZGnymevPWmAA== X-Google-Smtp-Source: AGHT+IEmwHEAyRl4O1ADBUXlJ8Ir1QajxdHcmQhP1+JwZ6AL7EQf1l2WpAn/vfiQDkHuuhxFizw+5mWU1UT2yp1CF+k= X-Received: by 2002:a05:600c:524a:b0:408:4160:1528 with SMTP id fc10-20020a05600c524a00b0040841601528mr8760818wmb.30.1698690100370; Mon, 30 Oct 2023 11:21:40 -0700 (PDT) MIME-Version: 1.0 References: <20231027182217.3615211-1-seanjc@google.com> <20231027182217.3615211-4-seanjc@google.com> In-Reply-To: From: David Matlack Date: Mon, 30 Oct 2023 11:21:12 -0700 Message-ID: Subject: Re: [PATCH v13 03/35] KVM: Use gfn instead of hva for mmu_notifier_retry To: Paolo Bonzini Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: , Cc: kvm@vger.kernel.org, David Hildenbrand , Anup Patel , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Chao Peng , linux-riscv@lists.infradead.org, Isaku Yamahata , Marc Zyngier , Huacai Chen , Xiaoyao Li , "Matthew Wilcox \(Oracle\)" , Wang , Fuad Tabba , Yu Zhang , Maciej Szmigiero , Albert Ou , Vlastimil Babka , Michael Roth , Ackerley Tng , Alexander Viro , Paul Walmsley , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , Isaku Yamahata , Christian Brauner , Quen tin Perret , Sean Christopherson , linux-mips@vger.kernel.org, Oliver Upton , Jarkko Sakkinen , Palmer Dabbelt , "Kirill A . Shutemov" , kvm-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, Liam Merwick , Andrew Morton , Vishal Annapurve , linuxppc-dev@lists.ozlabs.org, Xu Yilun , Anish Moorthy Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Oct 30, 2023 at 10:01=E2=80=AFAM Paolo Bonzini wrote: > > On Mon, Oct 30, 2023 at 5:53=E2=80=AFPM David Matlack wrote: > > > > On 2023-10-27 11:21 AM, Sean Christopherson wrote: > > > From: Chao Peng > > > > > > Currently in mmu_notifier invalidate path, hva range is recorded and > > > then checked against by mmu_notifier_retry_hva() in the page fault > > > handling path. However, for the to be introduced private memory, a pa= ge > > ^^^^^^^^^^^^^^^^^^^^^^^^ > > > > Is there a missing word here? > > No but there could be missing hyphens ("for the to-be-introduced > private memory"); possibly a "soon" could help parsing and that is > what you were talking about? Ah that explains it :) > > > > if (likely(kvm->mmu_invalidate_in_progress =3D=3D 1)) { > > > + kvm->mmu_invalidate_range_start =3D INVALID_GPA; > > > + kvm->mmu_invalidate_range_end =3D INVALID_GPA; > > > > I don't think this is incorrect, but I was a little suprised to see thi= s > > here rather than in end() when mmu_invalidate_in_progress decrements to > > 0. > > I think that would be incorrect on the very first start? Good point. KVM could initialize start/end before registering notifiers, but that's extra code.