From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B9724315E for ; Thu, 2 Jan 2025 12:13:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735820014; cv=none; b=j0douwSSTCzpJOlmq/LZbkyBd0kp9I85xOSObMR1q5Rz/qSKyZCLcRI3tkGmjuwjsGCEE0EObnwlSMLw3BzDZJNZZJlVh8ZMqNZhHyUBxSrE1ZSPFbjTIpDoAKqTXOX+us1blrShg8Dqe9j9Fck3bgqq2qC/37cVQmeahRq+0OA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735820014; c=relaxed/simple; bh=SqmEsrQfS8m6dFaoeyGpz5uM5hbk5n0/gH9Ua4s0DXA=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qczb3nFKg0g1/IO65TBINYjEKMgpqZDmU16Ad6Yl0dTIZ7WIJXhD4uhr/TVyG/znCId16ztWCBWHuZeQvGoywFSkY0rdmD5inkaTC8MTPIFsi0b56ESkqjvO9USnxsx1/g6syIOQSZVwS4K5l1o3n/cj0WtRB6OryJqDd/o6sZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4YP5934jj7z6K9h1; Thu, 2 Jan 2025 20:09:11 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 44DFF140AB8; Thu, 2 Jan 2025 20:13:30 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 2 Jan 2025 13:13:29 +0100 Date: Thu, 2 Jan 2025 12:13:27 +0000 From: Jonathan Cameron To: Will Deacon CC: Yang Shi , , , , , , , , , , , Subject: Re: [RFC PATCH 0/3] arm64: support FEAT_BBM level 2 and large block mapping when rodata=full Message-ID: <20250102121327.00004490@huawei.com> In-Reply-To: <20241210113151.GC14735@willie-the-truck> References: <20241118181711.962576-1-yang@os.amperecomputing.com> <20241210113151.GC14735@willie-the-truck> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To frapeml500008.china.huawei.com (7.182.85.71) On Tue, 10 Dec 2024 11:31:52 +0000 Will Deacon wrote: > On Mon, Nov 18, 2024 at 10:16:07AM -0800, Yang Shi wrote: > > > > When rodata=full kernel linear mapping is mapped by PTE due to arm's > > break-before-make rule. > > > > This resulted in a couple of problems: > > - performance degradation > > - more TLB pressure > > - memory waste for kernel page table > > > > There are some workarounds to mitigate the problems, for example, using > > rodata=on, but this compromises the security measurement. > > > > With FEAT_BBM level 2 support, splitting large block page table to > > smaller ones doesn't need to make the page table entry invalid anymore. > > This allows kernel split large block mapping on the fly. > > I think you can still get TLB conflict aborts in this case, so this > doesn't work. Hopefully the architecture can strengthen this in the > future to give you what you need. > > Will > Hi All, Given we have two threads on this topic, replying here as well... Huawei has implementations that support BBML2, and might report TLB conflict abort after changing block size directly until an appropriate TLB invalidation instruction completes and this Implementation Choice is architecturally compliant. I'm not trying to restrict potential solutions, but just making the point that we will be interested in solutions that handle the conflict abort. Jonathan