Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751440AbcCHUJ6 (ORCPT ); Tue, 8 Mar 2016 15:09:58 -0500 Received: from mail-by2on0082.outbound.protection.outlook.com ([207.46.100.82]:24000 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750919AbcCHUJu (ORCPT ); Tue, 8 Mar 2016 15:09:50 -0500 Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=caviumnetworks.com; Message-ID: <56DF3187.7010901@caviumnetworks.com> Date: Tue, 8 Mar 2016 12:09:43 -0800 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Laura Abbott , Linus Torvalds CC: David Daney , Will Deacon , , Catalin Marinas , Ard Biesheuvel , , David Daney Subject: Re: [PATCH] Revert "arm64: vmemmap: use virtual projection of linear region" References: <1457463792-6852-1-git-send-email-ddaney.cavm@gmail.com> <56DF274A.4070802@redhat.com> In-Reply-To: <56DF274A.4070802@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: SN1PR0701CA0049.namprd07.prod.outlook.com (25.163.126.17) To BN4PR07MB2131.namprd07.prod.outlook.com (25.164.63.13) X-MS-Office365-Filtering-Correlation-Id: 5c125eb6-84a5-4f3b-4522-08d3478d9926 X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2131;2:KeEEEuSUgs1svZqZXGmlQt8QxzwoggLqEI/9iTy6VEvkyKDkoIJyC3pUKE9tVodhdLn3HJVulCesSurZv3Vvw9yeGG8dFXoH38IIKMCMvbMqFmNuzd9siIfS8YGAKsmeb2m0vX/ZhCaQGt8Qip/ESRjsi48ADzdkt/EKKtiphwgPK0Iz9h+iVGX6gcLzDkBt;3:NzUNBfQzrrTohsKQ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61gFmqm3lwwWlAcDckNijamh1lWqTGDJUfrLcSbxHtE/YXBUGnUbpERqun8TpNSgnyLEVGLspYvgOxHeBImvY3DHGHLju0HsSjSBWvDeRko= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:BN4PR07MB2131;BCL:0;PCL:0;RULEID:;SRVR:BN4PR07MB2131; X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2131;4:7sObsyz5VBRShE2ulr/zFDOYUtVxojRgE0/20LR9SUeXpRUF8w8JVpCqO0wESeywgtz90YOwxcIQrf/qULxbOP7MaBg80g5jJ06IyVpSt66AzDuJ4Vv+TtUmZLaN6rOGXWSyxppe7ndLA1nVap/6NrR1jk/fFsZbBadSmaZf/tIoNYQEQ7zp5oNedxrq8xSbjMyh7bZ6ze+OdVFZo3awjiaThN0wy3nqNetvo3X+6HuD5fMr4+vTXRooNcdAMU9tPVrNsqm0er8vpDfdC4QJhazae0naWqc31fguAF4N/bJayCcPvREa6qlC1rHKjY7Bl2QjRKXPtNgTiPnNeV59GpxS3keo07nQeU8XnR/iPtmVu47Vw2y6d2bIh5gNTof7 X-Forefront-PRVS: 08756AC3C8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(479174004)(164054003)(377454003)(24454002)(36756003)(50986999)(586003)(76176999)(3846002)(1096002)(2906002)(54356999)(65816999)(4326007)(230700001)(42186005)(5001770100001)(64126003)(19580395003)(77096005)(189998001)(23746002)(50466002)(81166005)(6116002)(5004730100002)(66066001)(15975445007)(33656002)(59896002)(47776003)(53416004)(92566002)(65806001)(65956001)(2950100001)(4001350100001)(19580405001)(80316001)(5008740100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN4PR07MB2131;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BN4PR07MB2131;23:bIYFXMSkC4o9dtdK4fiVLun0uTvXxL2IT1udy?= =?Windows-1252?Q?cj4vfBYIqe0bHZ1tEpwbmFwoToHrFrxsRkT7aaY1+kphmwomedyeUjGX?= =?Windows-1252?Q?GnojUHRU9aVjSLknr0X1EivdJ+eFcxFWXIVzTWW1noA63SpBZfiElOpY?= =?Windows-1252?Q?8VJ1nqb4kCYLPx20H1/b5puPrO/fx82vKevrOFIM3qzhF6TXmqTxDnaw?= =?Windows-1252?Q?y0/wx10aYAdOVaQ0TgReFxXdK1+KJDVigtN/vKDIYDH8suG6PZTySfmo?= =?Windows-1252?Q?SviTg3UWoYBGI82sB+w1tgmIGyolj6uNil8TqpcpmCids35ypDadoNu0?= =?Windows-1252?Q?PxDwIfq/CiDIHQysJyEzsnY9tbksXnSJYCX/7AT96DGXwjtMUoQ9DirV?= =?Windows-1252?Q?+cawf0XPLHKBv6a3NhyMFO09qVAt1HZdKk8KcXCuAzR4yMXkQJUnxqQY?= =?Windows-1252?Q?Br/Al05Gravonuz79V+/5n+T1wMGT9oPVlabTNNjSwWGgkU+iMQM4Ger?= =?Windows-1252?Q?iMkQ9qRWWq0ulpQiY/b1PZDuvv1if4uBfanxhvyb/u40IO257/siHDcT?= =?Windows-1252?Q?+48B1y528NgLtSdPtC7lySVXG+kEamOiRh9hvXQtxO8kOOqnTsZFWXUM?= =?Windows-1252?Q?8nuWoM9TBg2lE7W3/2m3uogmMp8Et490Qi1m5C0uTCWtgj5m28VMH6Oj?= =?Windows-1252?Q?dApGAiz6Pam3LInus8xxcyqineTNSERl+ECDJmqUR+9LoWB+NWTuBu45?= =?Windows-1252?Q?GvRKNmJlwJgfeaWxfHmKHYHVXB9pRrkkljydYDHnV1dlp9xaMyIuKUxQ?= =?Windows-1252?Q?zdwCDdTFW6/SP9PjzJGnvkHmMhLrMG/fFVk3hJ3UST6MiPxfHGNbOBlV?= =?Windows-1252?Q?C6RsHuHXCpyt+zJStFDkUxxoUZLlKSPF3jY6zXuFKjGo515IqyMY35Xr?= =?Windows-1252?Q?4PtJm1NM+yCR0YJixprGG25/4p7mmY3RQtKfIt0y3DVfYadjpWdYIwm5?= =?Windows-1252?Q?gGFCrqvzKl9LQVsxPvaiaiC1OLUT5AI9FoTqU4pIXr/DJ3S3l9a84+AB?= =?Windows-1252?Q?GYOujf56eBxWceNRflGQlgnFOaqlg74RYVp9yPUL3yNvVMpmeK/hbnvd?= =?Windows-1252?Q?VNqKKzjyz0BHALKEA5fhII6+PQhIFTzePw3RIyYNHRUkqQafaIMZ/TVl?= =?Windows-1252?Q?dbF5azeBsRMzfudbdtv9A838uz9frs=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2131;5:bsts39SIyFvIocLQV5a1D9gvoJKlvGiN7fYXB3gWlKzFB8hjTKS0jEF0RmG7iMgPoMZfuT7lb4dE6SPRH4Z2vJr6lXqDbhoDgwToDzMYHjoo9xingR+eijOMbVKbRmxHwn2Um3Uy817ItV6oTAFv/A==;24:Vp6BSFaeFyDmhW2ZP1Zz9dy00H+yOrFfLKIu8W4czTZRSuU5mniPtfOBzt4ekExxfaQmxRCDCbbiNZSmnOASTUC2ee5MKN2OwuOnlmh0eWc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2016 20:09:46.6160 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2131 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2729 Lines: 81 On 03/08/2016 11:26 AM, Laura Abbott wrote: > On 03/08/2016 11:03 AM, David Daney wrote: >> From: David Daney >> >> This reverts commit dfd55ad85e4a7fbaa82df12467515ac3c81e8a3e. >> >> Commit dfd55ad85e4a ("arm64: vmemmap: use virtual projection of linear >> region") causes this failure on Cavium Thunder systems: >> [...] > > See http://article.gmane.org/gmane.linux.ports.arm.kernel/484866 for a > proposed fix. > Yes, that patch fixes it for me. I withdraw my patch to revert. Thanks, David Daney >> Signed-off-by: David Daney >> --- >> arch/arm64/include/asm/pgtable.h | 7 +++---- >> arch/arm64/mm/init.c | 4 ++-- >> 2 files changed, 5 insertions(+), 6 deletions(-) >> >> diff --git a/arch/arm64/include/asm/pgtable.h >> b/arch/arm64/include/asm/pgtable.h >> index f506086..bf464de 100644 >> --- a/arch/arm64/include/asm/pgtable.h >> +++ b/arch/arm64/include/asm/pgtable.h >> @@ -34,13 +34,13 @@ >> /* >> * VMALLOC and SPARSEMEM_VMEMMAP ranges. >> * >> - * VMEMAP_SIZE: allows the whole linear region to be covered by a >> struct page array >> + * VMEMAP_SIZE: allows the whole VA space to be covered by a struct >> page array >> * (rounded up to PUD_SIZE). >> * VMALLOC_START: beginning of the kernel VA space >> * VMALLOC_END: extends to the available space below vmmemmap, PCI >> I/O space, >> * fixed mappings and modules >> */ >> -#define VMEMMAP_SIZE ALIGN((1UL << (VA_BITS - PAGE_SHIFT - 1)) >> * sizeof(struct page), PUD_SIZE) >> +#define VMEMMAP_SIZE ALIGN((1UL << (VA_BITS - PAGE_SHIFT)) * >> sizeof(struct page), PUD_SIZE) >> >> #ifndef CONFIG_KASAN >> #define VMALLOC_START (VA_START) >> @@ -51,8 +51,7 @@ >> >> #define VMALLOC_END (PAGE_OFFSET - PUD_SIZE - VMEMMAP_SIZE - >> SZ_64K) >> >> -#define VMEMMAP_START (VMALLOC_END + SZ_64K) >> -#define vmemmap ((struct page *)VMEMMAP_START - >> (memstart_addr >> PAGE_SHIFT)) >> +#define vmemmap ((struct page *)(VMALLOC_END + SZ_64K)) >> >> #define FIRST_USER_ADDRESS 0UL >> >> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c >> index 7802f21..f3b061e 100644 >> --- a/arch/arm64/mm/init.c >> +++ b/arch/arm64/mm/init.c >> @@ -319,8 +319,8 @@ void __init mem_init(void) >> #endif >> MLG(VMALLOC_START, VMALLOC_END), >> #ifdef CONFIG_SPARSEMEM_VMEMMAP >> - MLG(VMEMMAP_START, >> - VMEMMAP_START + VMEMMAP_SIZE), >> + MLG((unsigned long)vmemmap, >> + (unsigned long)vmemmap + VMEMMAP_SIZE), >> MLM((unsigned long)virt_to_page(PAGE_OFFSET), >> (unsigned long)virt_to_page(high_memory)), >> #endif >> >