Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8E9BC83013 for ; Wed, 2 Jul 2025 08:49:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1030759.1404417 (Exim 4.92) (envelope-from ) id 1uWt9y-0007Hb-Oc; Wed, 02 Jul 2025 08:49:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1030759.1404417; Wed, 02 Jul 2025 08:49:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uWt9y-0007HU-MA; Wed, 02 Jul 2025 08:49:42 +0000 Received: by outflank-mailman (input) for mailman id 1030759; Wed, 02 Jul 2025 08:49:41 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uWt9x-0007HO-MB for xen-devel@lists.xenproject.org; Wed, 02 Jul 2025 08:49:41 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1uWt9t-00EdPi-36; Wed, 02 Jul 2025 08:49:37 +0000 Received: from [2a02:8012:3a1:0:694b:6608:aaf6:1a4c] by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uWt9t-007YQm-2X; Wed, 02 Jul 2025 08:49:37 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=Too/8UX3KW51uZVYN9hVg15Wdekzf5qs+pwsbTpZ2aQ=; b=l57t6ynnrWTgXZs1CZxj7Tn+x0 Wa+5CTWd7qbfZ/s53V6cxdEJzolaHSOnlbHfzspRygoTLdPMoH7FwyXgxEB4jgU5AbBMXmS5tO2Fr UZVQCH779jduT96y9EMzia3P5Z39VVnSRWK8OhDxzwqt3l/EfpD8tY1Y3JIeN49B4cpA=; Message-ID: <400e3acb-99b7-4ece-9cc2-4ec435d3ebf9@xen.org> Date: Wed, 2 Jul 2025 09:49:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/8] pdx: introduce a new compression algorithm To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "Orzel, Michal" Cc: Stefano Stabellini , Jan Beulich , xen-devel@lists.xenproject.org, Andrew Cooper , Anthony PERARD , Bertrand Marquis , Volodymyr Babchuk , Shawn Anastasio , Alistair Francis , Bob Eshleman , Connor Davis , Oleksii Kurochko , Community Manager References: <20250620111130.29057-1-roger.pau@citrix.com> <1507b441-dd3c-4a24-beda-0d1d3143faf9@suse.com> <0807cdba-b0bb-42a7-a18d-407ab818709a@amd.com> Content-Language: en-US From: Julien Grall In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Roger, On 02/07/2025 09:26, Roger Pau Monné wrote: > On Wed, Jul 02, 2025 at 09:52:45AM +0200, Orzel, Michal wrote: >> We have a few issues on Arm. First, we don't check whether direct map is big >> enough provided max_pdx that we don't set at all. Second, we don't really use >> PDX grouping (can be also used without compression). My patch (that Stefano >> attached previously) fixes the second issue (Allejandro will take it over to >> come up with common solution). > > You probably can handle those as different issues, as PDX grouping is > completely disjoint from PDX compression. It might be helpful if > we could split the PDX grouping into a separate file from the PDX > compression. > > One weirdness I've noticed with ARM is the addition of start offsets > to the existing PDX compression, by using directmap_base_pdx, > directmap_mfn_start, directmap_base_pdx &c. I'm not sure whether this will > interfere with the PDX compression, but it looks like a bodge. This > should be part of the generic PDX compression implementation, not an > extra added on a per-arch basis. They were introduced right at the beginning of the ARM port because we have quite a few platforms where the memory doesn't start at 0 and there was still a fairly large hole between two banks. IIRC until this series we would have been able to handle the hole but not the offset. This is can be handled in common, then I would be happy with that. > > FWIW, PDX offset translation should already compress any gaps from 0 > to the first RAM range, and hence this won't be needed (in fact it > would just make ARM translations slower by doing an extra unneeded > operation). My recommendation would be to move this initial offset > compression inside the PDX mask translation. > >> For the first issue, we need to know max_page (at >> the moment we calculate it in setup_mm() at the very end but we could do it in >> init_pdx() to know it ahead of setting direct map) and PDX offset (on x86 there >> is no offset). I also think that on Arm we should just panic if direct map is >> too small. > > Hm, that's up to the ARM folks, but my opinion is that you should > simply ignore memory above the threshold. Panicking should IMO be a > last resort option when there's no way to workaround the issue. This is following the other pattern within the Arm port. We want to fail early with a clear error rather than booting an half broken system. Cheers, -- Julien Grall