From nobody Sat Nov 23 13:59:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1729849905; cv=none; d=zohomail.com; s=zohoarc; b=V/TP4MtDIKj4PvJlCwQGPzYuHmVu4wndxWnNtoIwwZKM9w/pDHJex0kbOaV04x7VMw3kDJRAKXnpzUVXRvaViKQF44GkjWVxb2seE9fpQxdE1yYYYXayxiWG9N5lwTc6vDn3ZCbaDiZlwbMuo4R9bJjNpaIXYX2VuKDZxyAPgMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729849905; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+ToXNTbIaUJzIwxTCo6A+h1xsfFwkQlv3v3omXflCTA=; b=ekIpSe7lUsp9BA4LEuOaDi9KL0TJgOFMfdGQHT2muwVsZTCu4RUfOnOgmoxhaVyK5BhcmqaWs5qyl+uC0YQkpx/fpn3Ok7cHMaZ/tuis/r2OmcmrbcE0kouyO1tubZtIy2Hz6rP06ae8oAwg87kRwaE5dprsKCsasKpW9+cgOWg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1729849905781257.74267661210513; Fri, 25 Oct 2024 02:51:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.825714.1240090 (Exim 4.92) (envelope-from ) id 1t4GyF-00005w-Nm; Fri, 25 Oct 2024 09:51:03 +0000 Received: by outflank-mailman (output) from mailman id 825714.1240090; Fri, 25 Oct 2024 09:51:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t4GyF-00005W-IC; Fri, 25 Oct 2024 09:51:03 +0000 Received: by outflank-mailman (input) for mailman id 825714; Fri, 25 Oct 2024 09:51:01 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t4GyD-0005WM-Fw for xen-devel@lists.xenproject.org; Fri, 25 Oct 2024 09:51:01 +0000 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [2a00:1450:4864:20::52e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a4454743-92b6-11ef-a0bf-8be0dac302b0; Fri, 25 Oct 2024 11:51:01 +0200 (CEST) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5c96b2a10e1so2717593a12.2 for ; Fri, 25 Oct 2024 02:51:01 -0700 (PDT) Received: from carlo-ubuntu.home (dynamic-adsl-94-34-131-227.clienti.tiscali.it. [94.34.131.227]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cbb629e17dsm446938a12.34.2024.10.25.02.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 02:50:58 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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" X-Inumbo-ID: a4454743-92b6-11ef-a0bf-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=minervasys-tech.20230601.gappssmtp.com; s=20230601; t=1729849860; x=1730454660; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+ToXNTbIaUJzIwxTCo6A+h1xsfFwkQlv3v3omXflCTA=; b=tS1aVwmeCiGEp9AydUAN4Fkeqwo88Fm7NBz3EGHao149kaSLUJbDzM6abxhEB1C8oo vn13ZmbKfB9tiUTR9UsFc8BCoWQq36UXyMNd6Oc3o/QTATeFDCGyMm9P9SyLxeUYs4w5 dPM/qkFXMwL5gNBFev/8/CdgjTBwckY0Nrn3cDPFFy98Fkt8HX2uy94IgyjHldgax/nq i7MnI4W04gyjiy9GRhgCJmkcWK6knlLy4qGKNdEONDcSrl2IUaPM6WZIDpPKjgGwWCC4 joqj5xEXHebvXizC4udIpn/nPLgOv0SxOnplub6EseWPlAQQ00Tzxe/Cws+kDVSgQnPt mR1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729849860; x=1730454660; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+ToXNTbIaUJzIwxTCo6A+h1xsfFwkQlv3v3omXflCTA=; b=TWEkcc8P9JmfJ+eUJxXf7hGlYJ6oY9NFSY69Z0QJNqajUJoIY9zu11z83XGVP6X6uC 94LpUIwjUQQKwJF/kCy4PZLM8efNySfduATkY1+ywkGfPuPbYyCs/FN+IKv72cZRHOFZ eHXCuH+otMtVCEr7ZrC9dApRC6noJTxwlrbN1OWFsHXUQ6J+epIVTKFkeR76mzp7GL5z +X/cPqZdPXY5Gdow3i5ZLuPp1Tq5MHaqYj9RqvxmV6dWdjkRKxaRUC6R9LkQcqdtjnDk hMKwWOnp0LjMEFugu6Tc0IWTlb3nmH+br8LFe3LaQD0rxwwX+TWOrpQC4kxCAabb5LXw y8aQ== X-Gm-Message-State: AOJu0YwNNwMD7Wt8p0Q/+zjSIm40K7ypS+w+RkcsQ0RwjgL9NHWIXFpd n6evZCMZtNPbXcQfSgpmPM83JDNuIkkaIVPN/bqlWGxbx58h+1j51wS98WBhNknm07qZTqFpOL0 ko3E= X-Google-Smtp-Source: AGHT+IF28WcoBdGSRbtpHgskkYDgOiXbKRkaAukRB+pzaXLBSwK3hQ0jkJjBMRw4wbspjvXdMd3cVQ== X-Received: by 2002:a05:6402:2743:b0:5c9:863d:844a with SMTP id 4fb4d7f45d1cf-5cba245b13amr3632189a12.12.1729849860285; Fri, 25 Oct 2024 02:51:00 -0700 (PDT) From: Carlo Nonato To: xen-devel@lists.xenproject.org Cc: andrea.bastoni@minervasys.tech, Carlo Nonato , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [PATCH v9 10/13] xen/arm: use domain memory to allocate p2m page tables Date: Fri, 25 Oct 2024 11:50:11 +0200 Message-ID: <20241025095014.42376-11-carlo.nonato@minervasys.tech> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241025095014.42376-1-carlo.nonato@minervasys.tech> References: <20241025095014.42376-1-carlo.nonato@minervasys.tech> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @minervasys-tech.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1729849907884116600 Content-Type: text/plain; charset="utf-8" Cache colored domains can benefit from having p2m page tables allocated with the same coloring schema so that isolation can be achieved also for those kind of memory accesses. In order to do that, the domain struct is passed to the allocator and the MEMF_no_owner flag is used. This will be useful also when NUMA will be supported on Arm. Signed-off-by: Carlo Nonato Acked-by: Julien Grall --- v9: - no changes v8: - no changes v7: - no changes v6: - Carlo Nonato as the only signed-off-by v5: - new patch --- xen/arch/arm/mmu/p2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c index bfa312cc8a..28df6e5d03 100644 --- a/xen/arch/arm/mmu/p2m.c +++ b/xen/arch/arm/mmu/p2m.c @@ -32,7 +32,7 @@ static struct page_info *p2m_alloc_page(struct domain *d) */ if ( is_hardware_domain(d) ) { - pg =3D alloc_domheap_page(NULL, 0); + pg =3D alloc_domheap_page(d, MEMF_no_owner); if ( pg =3D=3D NULL ) printk(XENLOG_G_ERR "Failed to allocate P2M pages for hwdom.\n= "); } @@ -81,7 +81,7 @@ int p2m_set_allocation(struct domain *d, unsigned long pa= ges, bool *preempted) if ( d->arch.paging.p2m_total_pages < pages ) { /* Need to allocate more memory from domheap */ - pg =3D alloc_domheap_page(NULL, 0); + pg =3D alloc_domheap_page(d, MEMF_no_owner); if ( pg =3D=3D NULL ) { printk(XENLOG_ERR "Failed to allocate P2M pages.\n"); --=20 2.43.0