Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2294455ybf; Mon, 2 Mar 2020 05:55:49 -0800 (PST) X-Google-Smtp-Source: APXvYqzWdtt2QCKSxdytz0xRzly3HSvjthp0XfLeTW20gGXf7AA7N/WAZP8iwjlzJ/cuhMX9QSka X-Received: by 2002:aca:5403:: with SMTP id i3mr11813666oib.107.1583157349702; Mon, 02 Mar 2020 05:55:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583157349; cv=none; d=google.com; s=arc-20160816; b=aYuzaMlgx7YX16EyV7jMtItt3354psgLT1QDtB6/5JKxmgWLvkfgmdFOpUHH//CD13 hVNPtkzgNm2QuVFDVHGPIRh4PqMO9/ZUD4HD/+LJGzBXsbSR/2tqp8RHCfk6FG1xV92P DwkggxvGr6Icoe7H47vzvY1RENqg4pCw44ngEDiy4P4P/Mlhj9a7yUDdpknr6RAAP4vX FezIBrFlrAu2O/dr28j8mM9EHs9Wc4F+QFPzxduWvcsGEL2Rsq1g60DpwNNMorKUcavv ujraBEzIb01joictCE0hzNnBnFnC/6GmfqTZq1CtUwAluoSpV6V3qxRmaSBm5y1y1XI4 AR6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=0lvtPY/lJCDvl86aAQ4xxfPZB2B+06qAeAs6eEFhKZk=; b=W82FIUG1CMT05YewIY/C+nBKqm/ty2iPjjvIbrB75YthoZFNtn7Bnl2kUqE3Q1K3vt NO5U75nRdUwbR0t7mwoI9utmQQFnV7oZmlsKSb+8oWKikTFjM4QBxxzUnnCJhKpcUunS YwGQ9IbTFh0Se3CrllFs7emZhTyaqhIC105OYunGxSkv365Pf/w3KjMV1Fscp9Iok2yY HQxVEOVFhu5c4p9OmlRI5/NkYz6nHiRtJYPT8oLR3UPmNmxJuotI9A/lT/hBhHc3Kq73 lyfhCSSKLN9aCvd1SYVYHu+EA85L22pRi08drxjtu5fEeA2w7XwrrdsV1nGrPCHrSMfc 3SlA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 110si6509457otj.303.2020.03.02.05.55.37; Mon, 02 Mar 2020 05:55:49 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727384AbgCBNyz (ORCPT + 99 others); Mon, 2 Mar 2020 08:54:55 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53112 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727101AbgCBNyz (ORCPT ); Mon, 2 Mar 2020 08:54:55 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 022DpRn5138752 for ; Mon, 2 Mar 2020 08:54:53 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2yfhs3pm4q-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 02 Mar 2020 08:54:53 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 2 Mar 2020 13:54:50 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 2 Mar 2020 13:54:47 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 022Dskmq57475226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Mar 2020 13:54:46 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 37EC64C046; Mon, 2 Mar 2020 13:54:46 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1642B4C050; Mon, 2 Mar 2020 13:54:45 +0000 (GMT) Received: from linux.ibm.com (unknown [9.148.207.124]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 2 Mar 2020 13:54:44 +0000 (GMT) Date: Mon, 2 Mar 2020 15:54:43 +0200 From: Mike Rapoport To: Will Deacon Cc: Naresh Kamboju , anshuman.khandual@arm.com, catalin.marinas@arm.com, Linux-Next Mailing List , Linux Kernel Mailing List , Stephen Rothwell , Arnd Bergmann , lkft-triage@lists.linaro.org, Andrew Morton , suzuki.poulose@arm.com, Anders Roxell Subject: Re: Linux-next-20200302: arm64 build failed References: <20200302104726.GA7995@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200302104726.GA7995@willie-the-truck> X-TM-AS-GCONF: 00 x-cbid: 20030213-0020-0000-0000-000003AF9840 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20030213-0021-0000-0000-00002207C383 Message-Id: <20200302135443.GA24831@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-03-02_04:2020-03-02,2020-03-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 impostorscore=0 suspectscore=5 clxscore=1015 bulkscore=0 adultscore=0 mlxscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003020101 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 02, 2020 at 10:47:27AM +0000, Will Deacon wrote: > [+Anshuman and Catalin] > > On Mon, Mar 02, 2020 at 01:58:26PM +0530, Naresh Kamboju wrote: > > Linux-Next 20200302 arm64 build failed due to below errors, > > Suspecting patch causing this build break. > > > > 87d900aef3e2 arm/arm64: add support for folded p4d page tables > > > > Error log, > > ------------- > > arch/arm64/mm/mmu.c: In function 'unmap_hotplug_pud_range': > > include/linux/compiler.h:284:1: error: incompatible type for argument > > 1 of 'p4d_page_paddr' > > ({ \ > > ^ > > arch/arm64/include/asm/memory.h:270:45: note: in definition of macro > > '__phys_to_virt' > > #define __phys_to_virt(x) ((unsigned long)((x) - physvirt_offset)) > > ^ > > arch/arm64/include/asm/pgtable.h:629:42: note: in expansion of macro '__va' > > #define pud_offset(dir, addr) ((pud_t *)__va(pud_offset_phys((dir), (addr)))) > > ^~~~ > > include/linux/compiler.h:293:22: note: in expansion of macro '__READ_ONCE' > > #define READ_ONCE(x) __READ_ONCE(x, 1) > > ^~~~~~~~~~~ > > arch/arm64/include/asm/pgtable.h:628:52: note: in expansion of macro 'READ_ONCE' > > #define pud_offset_phys(dir, addr) (p4d_page_paddr(READ_ONCE(*(dir))) > > + pud_index(addr) * sizeof(pud_t)) > > ^~~~~~~~~ > > arch/arm64/include/asm/pgtable.h:629:47: note: in expansion of macro > > 'pud_offset_phys' > > #define pud_offset(dir, addr) ((pud_t *)__va(pud_offset_phys((dir), (addr)))) > > ^~~~~~~~~~~~~~~ > > arch/arm64/mm/mmu.c:827:10: note: in expansion of macro 'pud_offset' > > pudp = pud_offset(pgdp, addr); > > ^~~~~~~~~~ > > Looks like we need an implementation of unmap_hotplug_p4d_range() to > walk the dummy p4d level. Unfortunately, we don't have the folded p4d > patches in the arm64 tree so we'll either need a common branch or the > hotplug patches will need to be dropped for the moment. unmap_hotplug_p4d_range() is easy :) From c7a5d08ff51ca2057b6b0289c4423bdfd7643518 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Mon, 2 Mar 2020 15:53:17 +0200 Subject: [PATCH] arm64/mm: implement unmap_hotplug_p4d_range Signed-off-by: Mike Rapoport --- arch/arm64/mm/mmu.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 05ec8e5f1436..c76b11577558 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -840,6 +840,24 @@ static void unmap_hotplug_pud_range(pgd_t *pgdp, unsigned long addr, } while (addr = next, addr < end); } +static void unmap_hotplug_p4d_range(pgd_t *pgd, unsigned long addr, + unsigned long end, bool free_mapped) +{ + unsigned long next; + pgd_t *p4dp, p4d; + + do { + next = p4d_addr_end(addr, end); + p4dp = p4d_offset(pgd, addr); + p4d = READ_ONCE(*p4dp); + if (p4d_none(p4d)) + continue; + + WARN_ON(!p4d_present(p4d)); + unmap_hotplug_pud_range(p4dp, addr, next, free_mapped); + } while (addr = next, addr < end); +} + static void unmap_hotplug_range(unsigned long addr, unsigned long end, bool free_mapped) { @@ -854,7 +872,7 @@ static void unmap_hotplug_range(unsigned long addr, unsigned long end, continue; WARN_ON(!pgd_present(pgd)); - unmap_hotplug_pud_range(pgdp, addr, next, free_mapped); + unmap_hotplug_p4d_range(pgdp, addr, next, free_mapped); } while (addr = next, addr < end); } -- 2.21.1 > Will -- Sincerely yours, Mike.