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 D28C810D14B3 for ; Mon, 30 Mar 2026 13:48:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1267666.1557114 (Exim 4.92) (envelope-from ) id 1w7Cyq-0007yz-L4; Mon, 30 Mar 2026 13:48:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1267666.1557114; Mon, 30 Mar 2026 13:48:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w7Cyq-0007ys-IX; Mon, 30 Mar 2026 13:48:36 +0000 Received: by outflank-mailman (input) for mailman id 1267666; Mon, 30 Mar 2026 13:48:35 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w7Cyp-0007ym-JV for xen-devel@lists.xenproject.org; Mon, 30 Mar 2026 13:48:35 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w7Cyo-00EYvL-S4 for xen-devel@lists.xenproject.org; Mon, 30 Mar 2026 15:48:34 +0200 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ca7f2c-e002-0a2a0a5209dd-0a2a4507b718-24 for ; Mon, 30 Mar 2026 15:48:34 +0200 Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.55.2) (envelope-from ) id 69ca7f32-fd74-0a2a45070019-d155dd2ac5e6-3 for ; Mon, 30 Mar 2026 15:48:34 +0200 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-43cfa33a983so845762f8f.1 for ; Mon, 30 Mar 2026 06:48:34 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43cf1db08e6sm29082874f8f.0.2026.03.30.06.48.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Mar 2026 06:48:33 -0700 (PDT) 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" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774878514; x=1775483314; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=ZqBgRGen6k/0ph3p5uFFTz07oq/YgG0W+10SwN62QdU=; b=TcFf4vCW7x1wip89zs10Ll/vwPs7wSh8olawEvwUW9dCIOB09BGJlAFhwFo4As2BgQ QcUUDBGC5EG4FA3k63lhAxryMu3SYnZyYZISlHCULBxE5AhUVXvfQIfinXhKS5NJsypq 3c72FwiX/bXbK0KUWzjs6CgdIqzFQ6RGPKid9Dogbra8BDpBwfaIQ2W+J9F9/oyLQTiZ zRvgTxplGqGnBF1n81wgpKaM+vn6/+PwLrWQhiE0xIGpFWbwGlcPlt2B6JBl09SZB19d IwajRofa/Q8c5eeXskUca93cBA4EtnDJATCDkXBM2+6/yj9+XtVuGZ5X8jOlu7fk4mBR shmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774878514; x=1775483314; h=content-transfer-encoding:in-reply-to:autocrypt: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; bh=ZqBgRGen6k/0ph3p5uFFTz07oq/YgG0W+10SwN62QdU=; b=Ij+7R2i705zpRWKSJPqYPLyq/cGGCQfouNoXetCXoNQpFseTVHQdCBBLXIO/hL4i09 ktAylNNQjF+8muyqzv6cZZ3s6a3F8iDYYtwKzSQMQBU+EpyiAQdgn6bYVwDh+Ii8FpM6 UiykrpW/OdNA1XrvOFokafNMgv/3zJ9pQ7xJW/Ef5xu1JY5/qj/iypLRfC1RLfpjce/V O3X5VDnvydD4EIH/6eHwNt/85PUO+qCbSZFjGCIdD4xlcMwucpt2LeIZUQoXEuk8VnKt ztwcLp1ikYy6B7KNsdL8XWRhFkxOqSQsl6S57U7iI7YA8Pw9ENjd03wJgLNDc4a6yfmU RUAQ== X-Forwarded-Encrypted: i=1; AJvYcCXOv7pCgCamVuoeUyAy5ztE7yU27ffmoqEreI0b/wqK4f8ZGomp41kcVWyV8aXTepzCA7IECuVolY4=@lists.xenproject.org X-Gm-Message-State: AOJu0YzLvjnI9Yk2AI45DMAiUVJIphVi83pzF0ymmrjsGzyLPuxFoflc OEnVK5+Cc2I1XtSG/vukiYL3UoAMaLmAJ1Rk/8raKDuO4UsckhXbedjxYHau87J2Wg== X-Gm-Gg: ATEYQzy9HdlkPLbgMQ9V3wCR2j9j2TacCpfLJwZBRXaMN1y4VmfMPQmLtnwTBjC/WL4 syWbSTLps7sj1v97RbC43r9dHMgnL44xw1lFhZr2yJntA3qztr1KJ3+1vZYLPRqvcj1wAcl2Zsg DW0xHEhtzDImJtC/RpEzbbOYpXB73B3a3l645PLMW/yKH7qKkB+9U51A76OohfzY2E4A5Tp/ZJN p3wJEf4TQqsXxlhZlS3QUYsLljUGgXTzivRoumuyGYnW7PBiBxwbUHk4eQDegKkuOk8XWvZLEbJ YHxCBOCniE2qxw86QPMFf7Nf4ZQPTO0wZlevdCF+cmdK2ji1V4pu9uCKCqHKIJkbY9o2zsMmfdv vOhWKPpZ2NA7HlAlvkNEMHBHm8AdxouJ8kM0Wa9qByJyJvbbSZt3ZCmZgc5zoOtfXLmGSnm115t 27QFBoGUMCBEolvhUZj4c9eDFi0bWWl9sW8YVF/pfUVo/JkhgAOFBFbT9/JJJvdOLG+gktK30gW qnnu5Y9Zo4/vws= X-Received: by 2002:a05:6000:200c:b0:43b:4f7d:e08b with SMTP id ffacd0b85a97d-43b9ea6213amr19903257f8f.36.1774878514070; Mon, 30 Mar 2026 06:48:34 -0700 (PDT) Message-ID: <8a0762de-493f-46f7-be8d-25949532e2fc@suse.com> Date: Mon, 30 Mar 2026 15:48:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/3] xen/arm: generalize per-page GFN storage beyond xenheap pages To: Penny Zheng Cc: ray.huang@amd.com, Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , xen-devel@lists.xenproject.org, alejandro.garciavallejo@amd.com References: <20260327075025.3008606-1-Penny.Zheng@amd.com> <20260327075025.3008606-2-Penny.Zheng@amd.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6U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1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <20260327075025.3008606-2-Penny.Zheng@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-ef75cf/1774878514-4D8B4303-6945BFB3/0/0 X-purgate-type: clean X-purgate-size: 1819 On 27.03.2026 08:50, Penny Zheng wrote: > As preparation for fixing mfn_to_gfn() on ARM, we extend the existing GFN > field in page_info's type_info to be usable for not only xenheap ones. > Another usage will be introduced later for stolen pages in memory exchaging. > > Introduce general-purpose page_get_gfn() and page_set_gfn() helpers > that read and write the GFN stored in type_info. The old > page_get_xenheap_gfn() and page_set_xenheap_gfn() are retained as thin > wrappers with their xenheap ASSERTs, so all current callers remain unchanged. Why was this GFN setting limited to Xenheap pages back at the time? Depending on the reasons, retaining the old accessors may or may not be a good idea. > Also introduce PGT_INVALID_GFN as the general sentinel, with > PGT_INVALID_XENHEAP_GFN aliased to it for backward compatibility. This I view as unnecessary, if not confusing. > --- a/xen/arch/arm/include/asm/mm.h > +++ b/xen/arch/arm/include/asm/mm.h > @@ -113,18 +113,21 @@ struct page_info > #define PGT_count_mask PG_mask(3, 3) > > /* > - * Stored in bits [28:0] (arm32) or [60:0] (arm64) GFN if page is xenheap page. > + * Stored in bits [28:0] (arm32) or [60:0] (arm64) GFN if page is xenheap page, > + * or stolen ones in memory exchanging. > */ Does the purpose really need limiting like this? If the field covered by PGT_gfn_* is uniformly available (see the question above), I don't see why a new constraint would need spelling out. If it's not uniformly available, then likely the description needs expanding as to when the new accessors are okay to use. If uniformly available, what may want spelling out is under what conditions one can expect the field to be properly set (until such time where it's set correctly on all guest-owned pages). Jan