Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1025812pxu; Thu, 8 Oct 2020 00:58:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV++WrTNTPUIa44uY3tl/j6fKNjHr6o8CrZbFd20iWfvXG3gs9SlSJcQfljajh4bjqIXZe X-Received: by 2002:aa7:d2d5:: with SMTP id k21mr7321336edr.62.1602143882333; Thu, 08 Oct 2020 00:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602143882; cv=none; d=google.com; s=arc-20160816; b=oh2OLRoCmJvUoC+BkoLCfKzXWFgXx8y3Fbzd+XSnddJqsZkgYiEAtBCO5YtbYVRNpc Rqap/AX/llKCOil0O2JMH8LmacrW89AjM0b1OR5fWNODV9BasUlFPxjVxMGOqkYDNEEb ho1XhOxKCpsfyWbO9zfI0S4Wxdtfm2NDP1NNEY2dFnVjRO10pSQ0WJQ+s7EDMMF8JIz7 pS9bGDaXsQkEbttTsSepBCPAMvUwn8GkN6XjlnWTtMgdtPJRMuPgi0bu1sDTQTxHIejb eDY9iiGcj8pDW7JKnUp4sGESyWvtxMaCb58j+IBo9iI8zxhvUC3iNQg7rq1qc5vbKJ1O uLKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=baP6qc0YYj+DmTYY1P4mAyPBjNnkQzpG/qxwTfH16NY=; b=udLN27seWt5L2Axm6BmIO0anDkmLkEp2b7AjC0OtMbQxYHbq9+NA1MWkE9+9HoIfH8 QMqGhNR7D5/LNUQLUSoE1aCa6COSZ+u10RJ+eCuSa0FsXEU1aBd819GTjFLK7HqT2yTl wT3m/veyv+yn6iWNVLRxE66ESYZ6K0F03L/O5PSQ7cXwHm8GmKDx+Z3gskXcTAz80Xdc xSUq5IFNGMPB/lRkD56igM6FeLfinrZPPFXfcZ98H14D8w/381Vm3sOGKolE+XK6A0th euysWBsEtngUYWathul7o0mvgnjSjzNDhIT3R3ESPRG7Na9QLoLQ+PPLVpI0y5dA7OnY 5cDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HlUSHDav; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q28si3037065edw.303.2020.10.08.00.57.39; Thu, 08 Oct 2020 00:58:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HlUSHDav; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729135AbgJHHzx (ORCPT + 99 others); Thu, 8 Oct 2020 03:55:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728620AbgJHHzm (ORCPT ); Thu, 8 Oct 2020 03:55:42 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29DAEC0613DC; Thu, 8 Oct 2020 00:55:40 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id c6so2363443plr.9; Thu, 08 Oct 2020 00:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=baP6qc0YYj+DmTYY1P4mAyPBjNnkQzpG/qxwTfH16NY=; b=HlUSHDav+EhjoX8LnlxBqvY2+riyA8I6hOwYOI9ZJa/Jg3ppNe1yOU9rIeK4RDmlYN SVOsNko6yENO0fWa1FL+DZrDXX/SSwYM1px2al6NBrI9MFDU3W5ieC193pUPoxS1uIjC l66JFsudPvUe3au7r25G8o/B+VK68M/JLPfSUMtEIY33LHZGmas/Ti+9HjdibhPfV4p2 n+mhbbVmU3u7bUVALqw5c13vM4iB3tYsDQd4gFG+WZVV4WzRY3OOIInNUSfwq53rUULB Dfa+9yhFNGbVm9jAMW4Zwhb8UZKQRWIoi13rBQcLeNh5pt+OKYyBAaNe8xEgZgd94yqj Gy/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=baP6qc0YYj+DmTYY1P4mAyPBjNnkQzpG/qxwTfH16NY=; b=pKvNJlfbztP7CcAXjypCwptx3vHXvTfMHrfnYAmDOIeIBBtgbghe1NfnMan1NLeuuX 8Xrgp0S97qtJOdd04Rq1Rj1qHbJmXlRFJiYXZe/Xw7qMVuDcljw4FBIfr2yuEMTeS97h Z4zk76AeMr0RdVAwUJdoepZ25ONfRFtbSzbNYRtt/BSepSn263Mwvkjo5yUqrAOViedz llgOFUa3I74xFQot9vJFl1Htx6D1vumQ0I6mspJ6k1qtZ+JniAdf9u0QSGEDaoo9lS8F C33EIbayvEItblBgRyNOjTiQX1Z2Ipa44Nz84jhARicdcwNUcUK5fV94Zlz7WlpNuaI6 b17A== X-Gm-Message-State: AOAM533Ub0zZMqBLRXxQbBgBK2L9EVXX27ZRN19rPA2fVGBijnss5So6 zlse3HGWLioVeBGIKy4GaAc= X-Received: by 2002:a17:902:7d8d:b029:d3:95b9:68ed with SMTP id a13-20020a1709027d8db02900d395b968edmr6433338plm.28.1602143739775; Thu, 08 Oct 2020 00:55:39 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.61]) by smtp.gmail.com with ESMTPSA id k206sm6777106pfd.126.2020.10.08.00.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 00:55:39 -0700 (PDT) From: yulei.kernel@gmail.com X-Google-Original-From: yuleixzhang@tencent.com To: akpm@linux-foundation.org, naoya.horiguchi@nec.com, viro@zeniv.linux.org.uk, pbonzini@redhat.com Cc: linux-fsdevel@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, xiaoguangrong.eric@gmail.com, kernellwp@gmail.com, lihaiwei.kernel@gmail.com, Yulei Zhang , Chen Zhuo Subject: [PATCH 26/35] mm, dmem: introduce pud_special() Date: Thu, 8 Oct 2020 15:54:16 +0800 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yulei Zhang pud_special() will check both _PAGE_SPECIAL and _PAGE_DMEM bit as pmd_special() does. Signed-off-by: Chen Zhuo Signed-off-by: Yulei Zhang --- arch/x86/include/asm/pgtable.h | 13 +++++++++++++ include/linux/pgtable.h | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index e29601cad384..313fb4fd6645 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -282,6 +282,12 @@ static inline int pmd_special(pmd_t pmd) return (pmd_val(pmd) & (_PAGE_SPECIAL | _PAGE_DMEM)) == (_PAGE_SPECIAL | _PAGE_DMEM); } + +static inline int pud_special(pud_t pud) +{ + return (pud_val(pud) & (_PAGE_SPECIAL | _PAGE_DMEM)) == + (_PAGE_SPECIAL | _PAGE_DMEM); +} #endif #ifdef CONFIG_ARCH_HAS_PTE_DEVMAP @@ -517,6 +523,13 @@ static inline pud_t pud_mkdirty(pud_t pud) return pud_set_flags(pud, _PAGE_DIRTY | _PAGE_SOFT_DIRTY); } +#ifdef CONFIG_ARCH_HAS_PTE_DMEM +static inline pud_t pud_mkdmem(pud_t pud) +{ + return pud_set_flags(pud, _PAGE_SPECIAL | _PAGE_DMEM); +} +#endif + static inline pud_t pud_mkdevmap(pud_t pud) { return pud_set_flags(pud, _PAGE_DEVMAP); diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 1fe8546c0a7c..50f27d61f5cd 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1139,6 +1139,16 @@ static inline int pmd_special(pmd_t pmd) { return 0; } + +static inline pud_t pud_mkdmem(pud_t pud) +{ + return pud; +} + +static inline int pud_special(pud_t pud) +{ + return 0; +} #endif #ifndef pmd_read_atomic -- 2.28.0