From patchwork Thu Jul 21 18:33:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12925687 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 7612AC43334 for ; Thu, 21 Jul 2022 18:33:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 66CBF6B0075; Thu, 21 Jul 2022 14:33:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CE468E0001; Thu, 21 Jul 2022 14:33:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F8FB6B007B; Thu, 21 Jul 2022 14:33:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 320776B0075 for ; Thu, 21 Jul 2022 14:33:49 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0DD471A0A77 for ; Thu, 21 Jul 2022 18:33:49 +0000 (UTC) X-FDA: 79711955778.20.C58AC04 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 863DA140082 for ; Thu, 21 Jul 2022 18:33:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658428427; 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; bh=HJB4awZMcHCUKT/brNSroFnUPIWlUAvdMcDbLhHOPQQ=; b=DVqFdK0RCPl81yWAduhQQjYvSGS5Y/DoRn3Ep4hItpbq7xh1d6UAJc6Q8rpPluZW9pFsPq 42fJFzPLw7dhOK68v8j/o5/M57V2ORy8uiPHIuNOAhImGjQ988nTZj0wgYTw6sGMeF6Sqv 9R54WANPXHGavYRyOPA4WP3O9Xgglzg= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-532-o7IwCVuhMqyHwq7O00zBeQ-1; Thu, 21 Jul 2022 14:33:41 -0400 X-MC-Unique: o7IwCVuhMqyHwq7O00zBeQ-1 Received: by mail-qt1-f198.google.com with SMTP id x11-20020ac84d4b000000b0031ed94d739dso1523038qtv.11 for ; Thu, 21 Jul 2022 11:33:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HJB4awZMcHCUKT/brNSroFnUPIWlUAvdMcDbLhHOPQQ=; b=odBa8cQn9EauWOLgVomFPwXpzsq2hGpu2fqNgc2oMD2Lhmsk6ulo+tO+LbOVaUOugU aABB0Fgx4r+V5HDT2vlHolkd9Y+1WhtiAJ9008HfpTVVc+PA7XwJVbJfpwp0Fj5kTUdm p9E4OG4Q3x53Yad7wpCIsSx7zcxxlBoiI3+jL/YXBNmcs7XGxDtrMJKzATmeyKqHyfdV E7xl5diSz/sULUEJbAocwM9zLeNrZa4unuN7Evh18O4Pv2DbXvndMYMZ1OFRwqPn5N09 h8+ZdcMeyM15S1Nm44ZNPUQ3fTxTtbm3cm/7JT5QoQ2yWCdNe38KpSKwyp7XMGRpLbH3 dPYA== X-Gm-Message-State: AJIora8Ngz4AuPE2K6rndL2Dp83s4/rjsrT33xkaTQp04/Tgz8bKUWvv gzgZNux1qbkPrs1dgHnxipB6BvrlzB75ynu5nGyPqfEiZAKfTIXc5f61ETMyhEaM7ietJZgoPuR WS8ZOarU/WW4= X-Received: by 2002:a05:620a:2556:b0:6a7:9f07:602 with SMTP id s22-20020a05620a255600b006a79f070602mr28249676qko.207.1658428420860; Thu, 21 Jul 2022 11:33:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t+xOHzxLKS6RXNOCj6oemogjHOTFszZibiB4umcqn73ukKiPEyCMActk/gwgysEap2Ss5eIg== X-Received: by 2002:a05:620a:2556:b0:6a7:9f07:602 with SMTP id s22-20020a05620a255600b006a79f070602mr28249669qko.207.1658428420648; Thu, 21 Jul 2022 11:33:40 -0700 (PDT) Received: from localhost.localdomain (bras-base-aurron9127w-grc-35-70-27-3-10.dsl.bell.ca. [70.27.3.10]) by smtp.gmail.com with ESMTPSA id bj9-20020a05620a190900b006a6a7b4e7besm1878519qkb.109.2022.07.21.11.33.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 21 Jul 2022 11:33:40 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Nadav Amit , peterx@redhat.com, Andrew Morton , David Hildenbrand , Andrea Arcangeli Subject: [PATCH v3 0/3] mm/mprotect: Fix soft-dirty checks Date: Thu, 21 Jul 2022 14:33:35 -0400 Message-Id: <20220721183338.27871-1-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658428428; a=rsa-sha256; cv=none; b=EapulGFIZOQoLsldDRuOYDkzCf7kdWuJLrl0I9znrF9mG0PdhyiMsSonS5dF2UgkmJLbhd e2Bc1bN1xpRDxVr+7ZX900AVcEwmVgPHv/k3Ee/AYcBsQUKL/k3JIcfj0pzAFK7zlci+fw BKlaV0WhuTffXGOHqYAadf+dAag+rMM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DVqFdK0R; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf26.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658428428; 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: references:dkim-signature; bh=HJB4awZMcHCUKT/brNSroFnUPIWlUAvdMcDbLhHOPQQ=; b=eYKPUjIxUGLkWsw22fL5sOuTi50aQejkrL+FZapHbHQpXfQQ7rnYvs3JudPfiJwgBT+fQI sIq79N2gKsDOUbEruM7YLDDj4pLkjWyBy/KgBVt+JmqmGEv4yeKwh6ImZOSoAmiT4uPHaJ JFpCiQTtiG3HP82w0QERIiFX6k0npBs= X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 863DA140082 X-Stat-Signature: hyd6gz9wasf8ppx4ckqfuyo6drxiii97 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DVqFdK0R; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf26.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com X-HE-Tag: 1658428428-532212 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: v2: https://lore.kernel.org/lkml/20220720220324.88538-1-peterx@redhat.com/ Patch 1 is the previous patch and real fix. Two more test patches added to add mprotect test to soft-dirty.c, meanwhile add soft-dirty test into the vm test loop. Please review, thanks. Peter Xu (3): mm/mprotect: Fix soft-dirty check in can_change_pte_writable() selftests: soft-dirty: Add test for mprotect selftests: Add soft-dirty into run_vmtests.sh mm/internal.h | 18 ++++++ mm/mmap.c | 2 +- mm/mprotect.c | 2 +- tools/testing/selftests/vm/run_vmtests.sh | 2 + tools/testing/selftests/vm/soft-dirty.c | 69 ++++++++++++++++++++++- 5 files changed, 90 insertions(+), 3 deletions(-)