Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1574579pxb; Mon, 8 Mar 2021 00:32:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEpqDDzb6N9WqEF7pcFoV0CdRSzpCROwVoPh6BvWU3W4jqiBSh88WeBPagDIAhbqxyWd7j X-Received: by 2002:a50:8a90:: with SMTP id j16mr20523665edj.334.1615192342553; Mon, 08 Mar 2021 00:32:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615192342; cv=none; d=google.com; s=arc-20160816; b=nFZr0vT5zU5VSHA6eiD3iP/tUFcNY9ritKNJYjVixIXig5aACOKegJBtvUNDqFxFI2 csFqd3gXQHFa16fB9Jv6MSbIpukPViUKoKgt3tDlFEAlkiIWi9luA48YtSz2iVDLcZ8j 5YDisf1u8Dk57ICZ6nfZ0i30rtRmFmbanzFMKEvsmf8HH5gdKXH83wcIRKj0a6jy7fVL 5kpvSxPuGTmH7B/Y9zFV2tB+7Ls3dWMHOOpoQ6FuX14d4KbtYF46IrMMj0hoAP8e7aHB 5o2UWYlgQazSnOO5U6MWxZBXjC7ptVZzxy7nNKPcDCKmdLrXUbYWSBXnZOxtUqBvsoKD OrRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=FTltMTvjEx/jWErR8hLRP3F1j+KU44zapyyQFdPxlDM=; b=ehdZHBQRfgBKT1TiLNPM/AodDJWEP0nk05lXT/Wp5t9Sy2tZvHrHDSAnSMWcDb9svM MkIeJc2mzESNYP9EyGfHuUhG32xHerSBZwKfaHBC59dlcTb8t+d7LYR+nxUO7kw45GAV NHZB7x28eKeguTo/ysDWjXOcTkdXruu1kU2CsvU5m2/VaI80dlUDyWsQ/64dWUwNSMoT MUJunDBZDhe4CCzV9ScqMN1pATeWIHoqiTnRsWBgT+uLPxbrZEAmfDpetnWNK60JPkKr a46FGdJ6kZJsR9FI+Ir9knjTD+nWOhDrUMfE8nGjbStE5dK5Q0KITR4YAH68aMifKBKk GqvA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si6351573ejy.131.2021.03.08.00.32.00; Mon, 08 Mar 2021 00:32:22 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231312AbhCGW1X (ORCPT + 99 others); Sun, 7 Mar 2021 17:27:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231127AbhCGW1Q (ORCPT ); Sun, 7 Mar 2021 17:27:16 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 246E1C06174A; Sun, 7 Mar 2021 14:27:16 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id C3DD792009C; Sun, 7 Mar 2021 23:27:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id B7ACC92009B; Sun, 7 Mar 2021 23:27:14 +0100 (CET) Date: Sun, 7 Mar 2021 23:27:14 +0100 (CET) From: "Maciej W. Rozycki" To: Serge Semin cc: Thomas Bogendoerfer , Serge Semin , Mike Rapoport , Andrew Morton , Roman Gushchin , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Kamal Dasu Subject: Re: [PATCH v2] MIPS: kernel: Reserve exception base early to prevent corruption In-Reply-To: <20210307214740.blgsti6mr546bm43@mobilestation> Message-ID: References: <20210306082910.3472-1-tsbogend@alpha.franken.de> <20210307200612.6ftvptnj4txaf2uy@mobilestation> <20210307212001.GA7835@alpha.franken.de> <20210307214740.blgsti6mr546bm43@mobilestation> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Mar 2021, Serge Semin wrote: > > some of them are not R2 (SB1), others are. So best bet would be to > > simply reserve the first 0x1000 bytes for every CPU and special handling > > for the BMIPS case. Does this cover all cases ? > > I can't say for sure whether it will cover all the cases/platforms. I > visually analysed all the > board_{nmi_handler,ejtag_handler,ebase,cache_error}_setup callbacks > implementation in MIPS arch to create the list above. Exception vectors or > some other stuff can be setup in some other platform-specific manner. But at > least reserving a memory below PAGE_SIZE would get the situation partly back > to before the memory below the kernel stopped being reserved. Hopefully > one page will be enough for the platforms, which relied on that rule. The > rest or them sooner or later will manifest itself as it has happened with > Broadcom. I think reserving up to 64KiB might be a bit excessive on one hand while having the size of the reservation depend on configured PAGE_SIZE could be too unpredictable on the other. I think 4KiB is a good compromise and I'd leave anything else for platform maintainers to sort out. Maciej