Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2685919ybv; Fri, 21 Feb 2020 21:24:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzNo9mwi4TNdEbAbeR4DttSL9Oc3MWeLcM6Bo7QtT6EZQK+qSHwuFdPYFgnViRHOMC4STvx X-Received: by 2002:a54:4f14:: with SMTP id e20mr4844311oiy.84.1582349058579; Fri, 21 Feb 2020 21:24:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582349058; cv=none; d=google.com; s=arc-20160816; b=Nuqx16D/3DDC4LRZK0exRWyf3HjqZjWEW6tptOFZwjvAPi2G5I+1JsAyTrx9aXMTpj a3eZ1RT0rAFr2EepNT1ktN1SAiQSSA0omk69EAeAIU60+G9ULKKpqbYabjd3map13Q3E R/FMOar7tt2nLz2NBCUD7+S9LnwiqFI4bqIptDwppvDgACFQOREOnO9xDLdLmVfo5WH7 TudWVM15DsPb+j7h8hs9j9jGtFI4kQJPDbMQY0D0TmZFuBo2in3Gs7ZMeF1aiWXSbz9U Vudx1rPg9txpAPRBEgXyfd985iNMcCLBuU5jTMJpDqhLirDW19EvqfM/BkS0XedXzD3t WNCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:cc:message-id:subject:date :mime-version:from:content-transfer-encoding:dkim-signature; bh=IBBznMQ3bpiql9lX29jMw8rTRB5UTkasssHzmZ7+M1c=; b=UEimvITtcaGzvF2OqzpksN3Mmm5QQi2LKWPKrL5ifD24wj/7+aTjs1WT5hiehwrzjm V+zQ36KMXn9tcYIdx0pBZHkqIykijOFIsDT/8+HBa5kS3rmM7yHv68hLg+6YvInWYNFj mcqusTEhKLA0TdxlI0Y3X3hVx44ehdfAHIO8bkrDcqxwVBk9oIpsEeOSSbP23x0HFQNT 3VqapYJBtMkzzUjJIH6oot2tafkD0dPdf3N4sSTEOkbqFWhPlulCk3pFvFtsbn4KzG4s fDNGs6lHl/e/cBHajQiEpn/tC6dxPyTTuGYMzcGPzPwldnSQJYWDezuwHoj0lcifaDuT p4UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=LrZLayjP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10si1983845oia.232.2020.02.21.21.24.05; Fri, 21 Feb 2020 21:24:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=LrZLayjP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726151AbgBVFXr (ORCPT + 99 others); Sat, 22 Feb 2020 00:23:47 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43707 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgBVFXr (ORCPT ); Sat, 22 Feb 2020 00:23:47 -0500 Received: by mail-qk1-f193.google.com with SMTP id p7so3955294qkh.10 for ; Fri, 21 Feb 2020 21:23:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:date:subject:message-id :cc:to; bh=IBBznMQ3bpiql9lX29jMw8rTRB5UTkasssHzmZ7+M1c=; b=LrZLayjPzm6EQLYSudY/2Rq4gWifOId4PQrAAT2F3r3h4NRgVvIhbC9wOx7dlx1Tyk WYPz/nHQ3vkybT2k2xkip3nUM4f72z609ZgHuowVvxaTzPOYtt/rzDEr2NC84AIv8CXR U0opX2VzCXA/HJ/qpCXLc9V2nv5DRytdGovTfs1rZAEOs7Y6qmGvGpAdfto34hIsA8Ra pkfe+e2+ciVrJ92OSsP2KnSO+hNJDpQYdRs7y3RPJ+SbfCtXmkkIIvCahCwn6T2Unqfv bBKdNSO98xMr8l4tnMagKiMmWhHFfKIKh6j29waM9bi1stIdadM5rNWv1myS2PUTOZqY FLTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version:date :subject:message-id:cc:to; bh=IBBznMQ3bpiql9lX29jMw8rTRB5UTkasssHzmZ7+M1c=; b=RocLhQrvIgIDtM95DdG7qdNG1lG2N+aYzhLy1KWu+DF8hdF7Djc3L9gaGn/iqmF5O1 coxuU8MK3b+uJHj2AexrmoTdi6PfKYgr9utsvUNryUyrpfRqejqoJyqoGdXIjWwejKSA DpjLY+qhr3SGVlzgV3IlC9czXMLbxXYAn9O81iEdoiQ+hpLpi1Q2zqOqIBO4JvvrheE5 A7h/zxDVfMLtMaQm/reSGkNRFuEdg64poBAQytUi6/TNrDt5Ohab7fUnBo40Qqzsq/J/ 6YTrN0ZOue8I56RlDwqSUtrf0QSl8zxFwlVMfEB23qbmnqh/9qUiOC5RjNvi40DFiF0S yVXQ== X-Gm-Message-State: APjAAAUE6JCI0+DITJ5MZZa8p8Se38MRcaOmdGpWJPIl5DoAvXEIUfYN rwWlpkvXTJ6RgfyNB9AagNfopg== X-Received: by 2002:a37:bc06:: with SMTP id m6mr21225596qkf.383.1582349026611; Fri, 21 Feb 2020 21:23:46 -0800 (PST) Received: from [192.168.1.183] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id j30sm2612022qki.96.2020.02.21.21.23.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Feb 2020 21:23:46 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Date: Sat, 22 Feb 2020 00:23:44 -0500 Subject: Re: [PATCH v2] mm/hugetlb: fix a addressing exception caused by huge_pte_offset() Message-Id: Cc: akpm@linux-foundation.org, mike.kravetz@oracle.com, kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org, arei.gonglei@huawei.com, weidong.huang@huawei.com, weifuqiang@huawei.com, kvm@vger.kernel.org, linux-mm@kvack.org, Matthew Wilcox , Sean Christopherson , stable@vger.kernel.org To: "Longpeng(Mike)" X-Mailer: iPhone Mail (17D50) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Feb 21, 2020, at 10:34 PM, Longpeng(Mike) wrote:= >=20 > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index dd8737a..90daf37 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -4910,28 +4910,30 @@ pte_t *huge_pte_offset(struct mm_struct *mm, > { > pgd_t *pgd; > p4d_t *p4d; > - pud_t *pud; > - pmd_t *pmd; > + pud_t *pud, pud_entry; > + pmd_t *pmd, pmd_entry; >=20 > pgd =3D pgd_offset(mm, addr); > - if (!pgd_present(*pgd)) > + if (!pgd_present(READ_ONCE(*pgd))) > return NULL; > p4d =3D p4d_offset(pgd, addr); > - if (!p4d_present(*p4d)) > + if (!p4d_present(READ_ONCE(*p4d))) > return NULL; What=E2=80=99s the point of READ_ONCE() on those two places?=