From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 981993B3BE6 for ; Tue, 28 Jul 2026 05:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785216531; cv=none; b=AKNcBigGacUDySkOJI9ShiZ0LPuNJl4koG+rWSLnCCyGpspMJnwKgLcCn/9Kx4z1jeyK7marLu6b3TPBajopVCkU12V6Js8oyk+tpgxoSWV1QCix3vKBheO7I6LcPfnceGVwNXUgW3Xm078Xwk/SBoZe32XqtiYASNx1mHGZlE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785216531; c=relaxed/simple; bh=LgChT8o1bWlo/KaL3Em6vlBtvJb7E/TAxbTy82nNyio=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fktbQVLaIm/yWVzHRuHzHoaAgY8UdZrnbhcvF6zs1OnUjaznifClm/vBGE8y+7SzZfyzY/YHt7FLqtY4aaUmbMoCzbnrSHm1a0CnnXVpjk+yty2APOVT+DRP0FL0HIiv56/k9qeTq6n4TrR7Ym9ktre4N7C3O6zey7s1Dy4eG8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=monstr.eu; spf=none smtp.mailfrom=monstr.eu; dkim=pass (2048-bit key) header.d=monstr-eu.20251104.gappssmtp.com header.i=@monstr-eu.20251104.gappssmtp.com header.b=jxe+tG5/; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=monstr.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=monstr-eu.20251104.gappssmtp.com header.i=@monstr-eu.20251104.gappssmtp.com header.b="jxe+tG5/" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-69fe400c14aso3361784a12.2 for ; Mon, 27 Jul 2026 22:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20251104.gappssmtp.com; s=20251104; t=1785216525; x=1785821325; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6z+JBa24BIrT1YUYVC2RYk6YE+zWEJDDrARkH4qFrjk=; b=jxe+tG5/jXsBtwpBrOwmXwrjdbt5zPy3oC5t026hmjKlhHw5tJHRSNG/D2bvoBDQ9Y v/yRg3L7k81KSzjWNAXZ//xz8tjuJqrkZu7bYf3L6+p1GXjlv1tjJfs2INIvJkcTPrU4 UKxsU5dn3euNuMb5CwyuoR+lCkCHXqxvfDtsxk2PlfctHXiTzvuphH89LhGeObzwM4Ar 52EK23LLvjGZIDvx3vCiXF5HatkQ1ZPc5SfxCegj1witgRTxTQjpFCR4Sx8ioM23ctuN TCJaSqUifVvEfgl84XVWFBPHtSoruxJMO5Epq6j63W1EqLHBTbVpfA2tU1WM1EXwMvGt qjkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785216525; x=1785821325; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6z+JBa24BIrT1YUYVC2RYk6YE+zWEJDDrARkH4qFrjk=; b=VysKw9l3oubNdqwkLKoCcxTiXCbD8IiaIUpMIQNZSsdpwcBFORwJqK4r4m7NVFYM/M 04uYhq8jPP26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SMTP id 4fb4d7f45d1cf-6a034aa1102mr281462a12.39.1785216524865; Mon, 27 Jul 2026 22:28:44 -0700 (PDT) Received: from [10.254.183.223] ([149.199.62.131]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-69fb5946303sm3632868a12.27.2026.07.27.22.28.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jul 2026 22:28:43 -0700 (PDT) Message-ID: <7ec502cf-366c-4b7d-8f91-a30532ce2960@monstr.eu> Date: Tue, 28 Jul 2026 07:28:37 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] microblaze: restore the page alignment of swapper_pg_dir To: Ramin Moussavi , Guenter Roeck Cc: Mike Rapoport , Andrew Morton , linux-kernel@vger.kernel.org References: <20260727215823.1422701-1-ramin.moussavi@yacoub.de> Content-Language: en-US From: Michal Simek In-Reply-To: <20260727215823.1422701-1-ramin.moussavi@yacoub.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/27/26 23:58, Ramin Moussavi wrote: > microblaze handles TLB misses in software, and the handler builds the > address of the L1 entry by ORing the index into the page directory base > instead of adding it (hw_exception_handler.S): > > bsrli r5, r3, PGDIR_SHIFT - 2 > andi r5, r5, PAGE_SIZE - 4 > /* Assume pgdir aligned on 4K boundary, no need for > "andi r4,r4,0xfffff003" */ > or r4, r4, r5 > lwi r4, r4, 0 /* Get L1 entry */ > > The index is masked to the low 12 bits, so the OR only works if those bits > of the base are zero -- which is exactly the assumption the comment states > and the reason the masking of the base can be skipped. > > swapper_pg_dir had no alignment directive of its own. It was aligned > because it followed empty_zero_page in head.S, and that one carried the > .align 12: > > .section .data > .global empty_zero_page > .align 12 > empty_zero_page: > .space PAGE_SIZE > .global swapper_pg_dir > swapper_pg_dir: > .space PAGE_SIZE > > Commit 6215d9f4470f ("arch, mm: consolidate empty_zero_page") removed > empty_zero_page from head.S, and with it the .align 12 that -- despite > sitting next to empty_zero_page -- was what page aligned swapper_pg_dir. > Since then swapper_pg_dir lands wherever .data happens to put it, its low > bits are no longer zero, and every kernel TLB miss ORs the index into a > base with a nonzero offset. The resulting L1 lookups read the wrong > words, no valid translation is ever installed, and the kernel spins in > exceptions long before it can print anything. On qemu-system-microblazeel > (petalogix-s3adsp1800) the console stays completely silent at 100% CPU; > there is no oops and no guest error reported by qemu, which makes this > awkward to diagnose. > > Give swapper_pg_dir the alignment it requires, rather than relying on a > neighbour to provide it. > > microblaze has no noMMU variant left in mainline -- CONFIG_MMU is > def_bool y and mmu_defconfig is the only defconfig -- so this is not a > corner case: every mainline microblaze kernel since v7.1-rc1 fails to > boot, including the v7.1 release. > > v7.0: swapper_pg_dir = 0xc05fd000 (aligned) > v7.1-rc1: swapper_pg_dir = 0xc0603140 (offset 320) > v7.1-rc1 + this fix: swapper_pg_dir = 0xc0604000 (aligned) > next-20260726: swapper_pg_dir = 0xc0615140 (offset 320) > next-20260726 + this fix: swapper_pg_dir = 0xc0616000 (aligned) hm. This is the first time I get information about this regression. Guenter: I know you had Microblaze in your testing. Is it still running? Thanks, Michal