Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2855868rdh; Mon, 30 Oct 2023 09:32:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTF9foLt+ckRr/tw2rgUTH8OO+b5iVP1FVxVD36fI/RfncHZEZR5gEmiVPzmni5gT5+hTF X-Received: by 2002:a17:902:d18d:b0:1c6:b83:4720 with SMTP id m13-20020a170902d18d00b001c60b834720mr6282064plb.63.1698683527445; Mon, 30 Oct 2023 09:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698683527; cv=none; d=google.com; s=arc-20160816; b=Y3jJq08/vjOKuuWjDQvWQ0Y05lZh4TZTbmfqvWtZ1oPfxa3IJah6tbJglhuNo5vlT/ aSxKtzDSHtnkzOD0IRc2JxYwCzgXur2N6+/uel7ArF8BtYvuBXAb4t9FO+qXy21Yq0E2 RgXP1HlvgD6EnzDjNeXAsnA6RlbLsn4NCdTmwGnK1ORNDRDbzld6ksVsY51O/8qmv7jL H88PQ4E4AJHKmxXOWxkLpsURxRV6aKR3N+RFTGVYpK+rt5xt691gHi04/F6lOinfrbVr M6pq7ab+OkxbAzpy3Ee+DWYnO0WaVKF6SPbX/3f5giYQKgzKI8YWIMObBwvTDrANM78X nUDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=AFGN4ziW+95DqCrq4ZKBGZMP1faea1+XydZr6yChQh0=; fh=9GjpMzJz+uuhn19uB36EwSK3xE6lNesC+Xo4sskdlZ8=; b=roSp9OsJYsA3aVdLEo6HLIUm9QEy5TYdI+u1yr9h+Nfvy5F1jh4KkB7EOGABunWSvk En9b0KPk+I/NEfaT7x9eLAyhVDpoC80TNbDV50TJGwkAUIMGaXzQb+cIXIh91mK3/L2l hrzzl47udwQesbN1oNnGoU+zoxwc2Z8gap5Cx5Fv0GoLCZRrnullKc/LctiYVzybEGn+ +W+348kw87ikg3Ok1Kkj7YljXB/2ut2kuH47hbtHj6UVTubtTsxPDu/w5MmCNqzZ6wT4 l3QRKOScS3Qm0ibyk+1NUnYC/aGnZ2WUbGqzjoRibFJceSWjMV85srHE5LrXuf9aupSX tt0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QKgeY2zW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id q16-20020a170902dad000b001c73d73f163si497055plx.505.2023.10.30.09.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 09:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QKgeY2zW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 32556806500A; Mon, 30 Oct 2023 09:32:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233861AbjJ3QcE (ORCPT + 99 others); Mon, 30 Oct 2023 12:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231789AbjJ3QcC (ORCPT ); Mon, 30 Oct 2023 12:32:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9764CDD for ; Mon, 30 Oct 2023 09:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698683471; 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:autocrypt:autocrypt; bh=AFGN4ziW+95DqCrq4ZKBGZMP1faea1+XydZr6yChQh0=; b=QKgeY2zWAv/eD9RoIAWjBBfrgjM2gd55KCBP250TEs5K374GAslVlfY9D72cNF0RncLHsi NGUoB6gfj8AF++B1VdF5V23RvSMfUeyjZ5k1mwnNxk3jvonZfYdO/LHEGy5kgOaBj0HRcB FuQjnOn4SV8yLIVPpzoqnhYYm8W3s0c= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-YxM72HWJPbmo4cKW6RagTw-1; Mon, 30 Oct 2023 12:31:09 -0400 X-MC-Unique: YxM72HWJPbmo4cKW6RagTw-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-507cafb69e8so4904027e87.1 for ; Mon, 30 Oct 2023 09:31:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698683468; x=1699288268; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AFGN4ziW+95DqCrq4ZKBGZMP1faea1+XydZr6yChQh0=; b=CzUPihbWKCx23+o/1eZ+DNnzQveagqWXnM3+nDXROm+SJftMw7FGe8FDYepGL3+oEN h147Dt7BCulCKKdQL/8HI6cVSq4zxC7eVeLU7nlwcMKqwk0IppEGoFsoD/U1nYKsrwfn HPhhY7VbpFHKt9luLvA+GgGaEMfzhKH3Yy5YEiP9hiikzI/rsaggEmr/Zu7iOIOAWPKZ VPudfTOSHzAD//qNDOKCF5WIGcarNcOTl763HdSfT/aHx2bPFXHxH2XUvuO3xLEPniho 4+TSbryiDooKTfjIfewVddtJnVrY4bEAL3S+adWGfutRtt5W4OO2YH/HgNd6kPRty0O5 cHyA== X-Gm-Message-State: AOJu0Yybktd0olv9lX2uhbzcavXBmqAHBZIe4b3rhA6QVmlJKci31KyW hO0brShCekF+oVT+71nUNUB2lLQuKo0i/zWRa44YwUfavxTJCAcxvlQVf0YDnUEGVf9AzugJziY dzLwJfV5TsXNqKKQm63bR2tgJ X-Received: by 2002:a05:6512:3287:b0:500:aed0:cb1b with SMTP id p7-20020a056512328700b00500aed0cb1bmr7326654lfe.24.1698683467878; Mon, 30 Oct 2023 09:31:07 -0700 (PDT) X-Received: by 2002:a05:6512:3287:b0:500:aed0:cb1b with SMTP id p7-20020a056512328700b00500aed0cb1bmr7326601lfe.24.1698683467485; Mon, 30 Oct 2023 09:31:07 -0700 (PDT) Received: from [192.168.1.174] ([151.81.68.207]) by smtp.googlemail.com with ESMTPSA id k16-20020a05600c0b5000b0040586360a36sm12945400wmr.17.2023.10.30.09.30.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Oct 2023 09:31:06 -0700 (PDT) Message-ID: Date: Mon, 30 Oct 2023 17:30:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v13 03/35] KVM: Use gfn instead of hva for mmu_notifier_retry Content-Language: en-US To: Sean Christopherson , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8?= =?UTF-8?Q?n?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" References: <20231027182217.3615211-1-seanjc@google.com> <20231027182217.3615211-4-seanjc@google.com> From: Paolo Bonzini Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3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Oo6otaHmcxr35sWq1Jk tLkbn3wG+fPQCVudJJECvVQ//UAthSSEklA50QtD2sBkmQ14ZryEyTHQ+E42K3j2IUmOLriF dNr9NvE1QGmGyIcbw2NIVEBOK/GWxkS5+dmxM2iD4Jdaf2nSn3jlHjEXoPwpMs0KZsgdU0pP JQzMUMwmB1wM8JxovFlPYrhNT9MAEQEAAcLBMwQYAQIACQUCVEJx7gIbDAAKCRB+FRAMzTZp sadRDqCctLmYICZu4GSnie4lKXl+HqlLanpVMOoFNnWs9oRP47MbE2wv8OaYh5pNR9VVgyhD OG0AU7oidG36OeUlrFDTfnPYYSF/mPCxHttosyt8O5kabxnIPv2URuAxDByz+iVbL+RjKaGM GDph56ZTswlx75nZVtIukqzLAQ5fa8OALSGum0cFi4ptZUOhDNz1onz61klD6z3MODi0sBZN Aj6guB2L/+2ZwElZEeRBERRd/uommlYuToAXfNRdUwrwl9gRMiA0WSyTb190zneRRDfpSK5d usXnM/O+kr3Dm+Ui+UioPf6wgbn3T0o6I5BhVhs4h4hWmIW7iNhPjX1iybXfmb1gAFfjtHfL xRUr64svXpyfJMScIQtBAm0ihWPltXkyITA92ngCmPdHa6M1hMh4RDX+Jf1fiWubzp1voAg0 JBrdmNZSQDz0iKmSrx8xkoXYfA3bgtFN8WJH2xgFL28XnqY4M6dLhJwV3z08tPSRqYFm4NMP dRsn0/7oymhneL8RthIvjDDQ5ktUjMe8LtHr70OZE/TT88qvEdhiIVUogHdo4qBrk41+gGQh b906Dudw5YhTJFU3nC6bbF2nrLlB4C/XSiH76ZvqzV0Z/cAMBo5NF/w= In-Reply-To: <20231027182217.3615211-4-seanjc@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 09:32:06 -0700 (PDT) On 10/27/23 20:21, 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 page fault may not have a hva > associated, checking gfn(gpa) makes more sense. For existing hva based > shared memory, gfn is expected to also work. The only downside is when > aliasing multiple gfns to a single hva, the current algorithm of > checking multiple ranges could result in a much larger range being > rejected. Such aliasing should be uncommon, so the impact is expected > small. Reviewed-by: Paolo Bonzini Paolo