Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp817429rwd; Tue, 16 May 2023 08:05:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Y1/loaUGGPtsquSyveTektL7+/3SW3tup4mT3Kh7foanp0+SKNLDLGuAEfn1KOqT1o4hH X-Received: by 2002:a05:6870:1842:b0:187:860f:ea31 with SMTP id u2-20020a056870184200b00187860fea31mr17233019oaf.44.1684249519762; Tue, 16 May 2023 08:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684249519; cv=none; d=google.com; s=arc-20160816; b=xn6QnPTOHZRvkJoORVb3nvv8XLXj0gxyAw69jK/uCgn9rrLiK4lSAdC1b0eThQ8jod LOEqsCFjHFzuanQy40hbMoy54GFQvzOIFdH39rKsyaLi8skP+T+uj+fnxGuf8wljCaLH RT919UNzdgghv66r4FUUFaoYALdMWq8XCm8n/6YWHUff6N1ABjyIlAuEkQPQncJ22XIZ O9lw2tqeOj0HHJccGtxrnITj5AClqfEU85PQ0kS240ot4e79YPNDS6tngtu4A3KP7I4R HC/2NkSMYQikfjAp26Plf0gMWwj1NVKEnc3Glyy5XW5hn4TR81VldfDYHdvdmk+Qn8qB 3SjQ== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=HDtlWQaTJft8O2op6owZ91p6/RHXC3pnklg9iA3D7Gs=; b=r94CRnok7oO4y4jXVcE9RFTnJqHaHrOiC1jOkaCYYsJNmNiQvCz24Oh3SGiul0kIRj DIQ75kglma9VXfSJynynnPbYxVWvvF+HuWpiK5P9Twx5ce/zYx8dGbsXZRcw4CH583A0 ABrGyv476BUHUvGQ5K2ZWdsXirUCZnSA57UgqsXR1FaQNCnKmeENZ49xiXNA2rAJ0BKN rbgsIFYu6Zm+JbISku4cR3We9+3bO5tZ6eX/4sB49YZt1kUXVj6qU4OM8Ls/z0+JVCx+ X9VKQjyNFK+0G7FRWToJ4FhF9dAogufDxKtwlv+197yMngYnSskTjFCucYlu6XJKWNQY T09w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=clY8y2Jd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a14-20020a056870d60e00b00192b9f651basi18777561oaq.198.2023.05.16.08.05.06; Tue, 16 May 2023 08:05:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=clY8y2Jd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234012AbjEPOgx (ORCPT + 99 others); Tue, 16 May 2023 10:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233282AbjEPOgs (ORCPT ); Tue, 16 May 2023 10:36:48 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9657FA8 for ; Tue, 16 May 2023 07:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684247763; 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; bh=HDtlWQaTJft8O2op6owZ91p6/RHXC3pnklg9iA3D7Gs=; b=clY8y2JdvJussDMqGzd+NG0jvmQpmNLGrzYUXVIwXOsMSunrcailfjLYVBbhGgpjnUCQ2q Fndb0SblLIJKvzzU5wlk/c6ZI1D9OmJo3+zktxNd7IF181Yx/yy7PQwBAsuLkBYJJGhaM3 17yNeUjieTh6cvpvxoDyvabAw7tNBPs= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-448-xqEiwh52M22pyl7gyasrEw-1; Tue, 16 May 2023 10:36:01 -0400 X-MC-Unique: xqEiwh52M22pyl7gyasrEw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-30643d4a430so5106610f8f.0 for ; Tue, 16 May 2023 07:36:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684247760; x=1686839760; h=content-transfer-encoding:in-reply-to:organization: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=HDtlWQaTJft8O2op6owZ91p6/RHXC3pnklg9iA3D7Gs=; b=RHBPYchmMfzyrr2BbwUjP7edIZDDHppZ2tBoWW1Rfz4Vqkw+dCuFP620hzxTwhYenf 5U/3evfn1gDlhvKWTTbtZlHSpgESJNCNj3XQRzuaavRiQVl6jXG05sTSUP1rmN41xDk6 9cqIn4W26gP+VENQd3JXfgB+5ynQxOAR4rLa2f8PKPlygzSg25/AI2VfsLIf7Vs6qXCh h7m5pjEsECt5hgeO0KiT+7a+3M+O6KaaUPyHyoqMSgpQYfxMsH2Ki7+g/VsKwBWFcJ16 w4k72kyPme4Z5Xzgh5cFle4ErWMrhtJ6DtI52YsSS7D/3yhPH8LVD3fnhPBgSyaLeViO z4cg== X-Gm-Message-State: AC+VfDzzCQYr8wi4226xPwkVut2ida1m21UZA03tEhY+KBO/bJdlQuoy VY6FTxbP0q5XmV8Qkt3XAOADm+x9UE5sbwQplMB+aB8fgeXclduAbromFrpFECfsDGLhk+73cJz Mk0/UxtYouaDZOTnMTQUsaNnw X-Received: by 2002:adf:f58f:0:b0:306:b3f9:e2c9 with SMTP id f15-20020adff58f000000b00306b3f9e2c9mr28308369wro.6.1684247760145; Tue, 16 May 2023 07:36:00 -0700 (PDT) X-Received: by 2002:adf:f58f:0:b0:306:b3f9:e2c9 with SMTP id f15-20020adff58f000000b00306b3f9e2c9mr28308347wro.6.1684247759798; Tue, 16 May 2023 07:35:59 -0700 (PDT) Received: from ?IPV6:2003:cb:c74f:2500:1e3a:9ee0:5180:cc13? (p200300cbc74f25001e3a9ee05180cc13.dip0.t-ipconnect.de. [2003:cb:c74f:2500:1e3a:9ee0:5180:cc13]) by smtp.gmail.com with ESMTPSA id x2-20020a05600c21c200b003f508777e33sm2586081wmj.3.2023.05.16.07.35.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 May 2023 07:35:59 -0700 (PDT) Message-ID: <7e9651d6-382a-287c-cd08-03762ccce1f7@redhat.com> Date: Tue, 16 May 2023 16:35:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v5 1/6] mm/gup: remove unused vmas parameter from get_user_pages() Content-Language: en-US To: Sean Christopherson Cc: Lorenzo Stoakes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Matthew Wilcox , x86@kernel.org, linux-sgx@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kvm@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Jarkko Sakkinen , "H . Peter Anvin" , Xinhui Pan , David Airlie , Daniel Vetter , Dimitri Sivanich , Arnd Bergmann , Greg Kroah-Hartman , Paolo Bonzini , Jens Axboe , Pavel Begunkov , Jason Gunthorpe , John Hubbard , Christian Konig , Jason Gunthorpe References: From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 16.05.23 16:30, Sean Christopherson wrote: > On Tue, May 16, 2023, David Hildenbrand wrote: >> On 15.05.23 21:07, Sean Christopherson wrote: >>> On Sun, May 14, 2023, Lorenzo Stoakes wrote: >>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c >>>> index cb5c13eee193..eaa5bb8dbadc 100644 >>>> --- a/virt/kvm/kvm_main.c >>>> +++ b/virt/kvm/kvm_main.c >>>> @@ -2477,7 +2477,7 @@ static inline int check_user_page_hwpoison(unsigned long addr) >>>> { >>>> int rc, flags = FOLL_HWPOISON | FOLL_WRITE; >>>> - rc = get_user_pages(addr, 1, flags, NULL, NULL); >>>> + rc = get_user_pages(addr, 1, flags, NULL); >>>> return rc == -EHWPOISON; >>> >>> Unrelated to this patch, I think there's a pre-existing bug here. If gup() returns >>> a valid page, KVM will leak the refcount and unintentionally pin the page. That's >> >> When passing NULL as "pages" to get_user_pages(), __get_user_pages_locked() >> won't set FOLL_GET. As FOLL_PIN is also not set, we won't be messing with >> the mapcount of the page. For completeness: s/mapcount/refcount/ :) > > Ah, that's what I'm missing. -- Thanks, David / dhildenb