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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CE96C4332F for ; Wed, 19 Oct 2022 12:31:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E00976B0071; Wed, 19 Oct 2022 08:31:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D62266B0073; Wed, 19 Oct 2022 08:31:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDC2D6B0074; Wed, 19 Oct 2022 08:31:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id ACF046B0071 for ; Wed, 19 Oct 2022 08:31:21 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 389241A06A5 for ; Wed, 19 Oct 2022 12:31:21 +0000 (UTC) X-FDA: 80037634362.26.2E6A0D9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id A7B921C002A for ; Wed, 19 Oct 2022 12:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666182679; 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=vdyF20motJAcGwhEZFkcIJUXHpFy/FT1+InzXbprcxQ=; b=dixvTUWCpV1hNhuHHlJ50BYnYtd/ddnmCoHXZ514wlPMuDCvbASEEEDf1MssVsrI8HKOwG QxMlYrOuLspN+TZb6Mm6kHk1+mmcXccin+pncRouof9GTFMmwBN1JFPBVFOgO1VvAHm5WT f/ifio+UAaHNX54DQPqfdEvViBMvYgU= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-185-YOJmvdnqOjej7_j3vEvlOg-1; Wed, 19 Oct 2022 08:31:18 -0400 X-MC-Unique: YOJmvdnqOjej7_j3vEvlOg-1 Received: by mail-wm1-f69.google.com with SMTP id az11-20020a05600c600b00b003c6e3d4d5b1so9615568wmb.7 for ; Wed, 19 Oct 2022 05:31:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vdyF20motJAcGwhEZFkcIJUXHpFy/FT1+InzXbprcxQ=; b=5JBDcPbx2ROksVxWqDk2NUbVXTl586XFXseLzUT/EnXu+U3MM0G/lWz+YfA4tlmlgA 0u4cJ+LhDjiz4WMEFJktH+m1Cq3q0xtOjfCnRZYVEJ/tVZ5BCwuG6Vau+FE8IOKWDUTt ZZQd4MnCYuwVzT3sXnO/x4zHErKMidlCEF91CGX8oqkKzcqloLce///SzJlbQJF7plC2 ucBA9JkKDYYPDFX09iCqZz2MPYz1fCsU4U+pG5kF8ZmZWaMM4V/up95RLvaMnRJYFGal Fo2ALDx+Gky40STvH8/lYTEJ1BHcX1xvJXW0tKQWEtWny8Mbla7Yb1Z6ZvaWq0j+erH0 TZPA== X-Gm-Message-State: ACrzQf15+WSIehd/yjX7P6ozhaK5fb6Rm+M+6WsKwpvR/Ish2e58eh4+ 2laL6b6WIxMpKq/8vNeBV8s3GJet18edg/BBkPkQBth2BdUJ7erGxItsB9+WHuxGhadxNri3cqj 55ZP/vmuZwhc= X-Received: by 2002:adf:e2d2:0:b0:22f:6a2a:92ab with SMTP id d18-20020adfe2d2000000b0022f6a2a92abmr4785881wrj.545.1666182677364; Wed, 19 Oct 2022 05:31:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6vpRf1nx8zR6YQpm368M0MQZZnl74qgOl7S9XqjCF6QToT5rTsmXN0Wg87YGXaLyxnO8ihgw== X-Received: by 2002:adf:e2d2:0:b0:22f:6a2a:92ab with SMTP id d18-20020adfe2d2000000b0022f6a2a92abmr4785851wrj.545.1666182677037; Wed, 19 Oct 2022 05:31:17 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:2c00:d4ac:d2c:4aee:dac1? (p200300cbc7072c00d4ac0d2c4aeedac1.dip0.t-ipconnect.de. [2003:cb:c707:2c00:d4ac:d2c:4aee:dac1]) by smtp.gmail.com with ESMTPSA id u5-20020a5d5145000000b00232251d71c7sm13533415wrt.68.2022.10.19.05.31.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 05:31:16 -0700 (PDT) Message-ID: <74adbb51-6e33-f636-8a9c-2ad87bd9007e@redhat.com> Date: Wed, 19 Oct 2022 14:31:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v1 7/7] selftests/vm: anon_cow: add R/O longterm tests via gup_test To: linux-kernel@vger.kernel.org, Andrew Morton Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Shuah Khan , Jason Gunthorpe , John Hubbard , Nadav Amit , Peter Xu , Andrea Arcangeli , Vlastimil Babka , Mike Rapoport , Christoph von Recklinghausen , Don Dutile References: <20220927110120.106906-1-david@redhat.com> <20220927110120.106906-8-david@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220927110120.106906-8-david@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666182680; h=from:from:sender: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:dkim-signature; bh=vdyF20motJAcGwhEZFkcIJUXHpFy/FT1+InzXbprcxQ=; b=8Ag/G6hn7Ca22S2EkIHe+7o2Fvx834ST/bxrXaoNbKtompUvIypGmt50xG3iWWD5woKUOr ta+vxKzhACulqGgjJiFh7mrAVZKLmaNNcgYTQatJLCHWRMKGbm5TdNtUtUD9IZ0C3PEMr8 LoY3kraum2kW+MwVFQ8nVNuSKlcVgY4= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dixvTUWC; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666182680; a=rsa-sha256; cv=none; b=HYmhxlZ6Kdbm5DD4BAo+DO/+AiaLcXTHPEu76ykPFLAaMPUbh4LGfZK0rSDaJHGjDYXN8q h0N3QIU9zQTZLc6wJAGDnl1auR3wZwsT8GKEqoFxojS6wpgo+CXPfzjAIJR27vIePucDN3 +9YpAS8Jc9oFpmD4u5qds4l1vMKro4g= X-Rspamd-Server: rspam12 X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dixvTUWC; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: khs1rb4p9746no8i8wjot9cbqdjyoekf X-Rspamd-Queue-Id: A7B921C002A X-HE-Tag: 1666182680-92284 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 27.09.22 13:01, David Hildenbrand wrote: > Let's trigger a R/O longterm pin on three cases of R/O mapped anonymous > pages: > * exclusive (never shared) > * shared (child still alive) > * previously shared (child no longer alive) > > ... and make sure that the pin is reliable: whatever we write via the page > tables has to be observable via the pin. > > Signed-off-by: David Hildenbrand > --- The following on top should silence the warning on 32bit: https://lore.kernel.org/all/202210182101.XOyPZEQV-lkp@intel.com/T/#u diff --git a/mm/gup_test.c b/mm/gup_test.c index 2bbfacd31f5a..57c343f2dc51 100644 --- a/mm/gup_test.c +++ b/mm/gup_test.c @@ -299,7 +299,8 @@ static inline int pin_longterm_test_read(unsigned long arg) for (i = 0; i < pin_longterm_test_nr_pages; i++) { void *addr = page_to_virt(pin_longterm_test_pages[i]); - if (copy_to_user((void __user *)user_addr, addr, PAGE_SIZE)) + if (copy_to_user((void __user *)(unsigned long)user_addr, addr, + PAGE_SIZE)) return -EFAULT; user_addr += PAGE_SIZE; } -- Thanks, David / dhildenb