From nobody Fri Dec 19 15:49:22 2025 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; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1745580278; cv=none; d=zohomail.com; s=zohoarc; b=I8qHl9q1Bqx3XpPgmmbP0CcVLO+AEzhe+4P3AUdha+CaDLmGvLKLfu7yFiFJy6sJ5h9ANgysT2VXL8VpSUNstV8EvWytWzltTtFVeYu3zYolGk8dDeQo6R5UQRNdGvpEccMDaSi2vFu8Qr6R3m3Ae6v2yvGF8dJyrpxZsEEuQnU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745580278; h=Content-Type: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=vhEPjQ0dQZYRoJ0ktNBv9zT4/PmoHcrhpTUaXmh36R0=; b=I8ojzzfRTLdTVyk/Ik2lHOBInbuX9XUfJh9/OoOKYYLIbyJ5GtGUEeNps4XCe0xHtIPU3JEDgvdGk3gIjKy9JEK7E/MeDAG5jtUYEpZ4AIPCZyRAL7aoDy2KswVEnUz9CDF+uektAgPLrWQGQKJ/aFWxWIaiCEM4S1O6aij0Q/Y= 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1745580278176832.7630161028821; Fri, 25 Apr 2025 04:24:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.967686.1357417 (Exim 4.92) (envelope-from ) id 1u8HAN-0001B2-F8; Fri, 25 Apr 2025 11:24:23 +0000 Received: by outflank-mailman (output) from mailman id 967686.1357417; Fri, 25 Apr 2025 11:24:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u8HAN-0001Av-BV; Fri, 25 Apr 2025 11:24:23 +0000 Received: by outflank-mailman (input) for mailman id 967686; Fri, 25 Apr 2025 11:24:21 +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 1u8HAL-0001A7-RY for xen-devel@lists.xenproject.org; Fri, 25 Apr 2025 11:24:21 +0000 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [2a00:1450:4864:20::32b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d552c605-21c7-11f0-9eb3-5ba50f476ded; Fri, 25 Apr 2025 13:24:21 +0200 (CEST) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43d04ea9d9aso9815905e9.3 for ; Fri, 25 Apr 2025 04:24:21 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-440a531072csm21743005e9.18.2025.04.25.04.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Apr 2025 04:24:19 -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: d552c605-21c7-11f0-9eb3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1745580260; x=1746185060; 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=vhEPjQ0dQZYRoJ0ktNBv9zT4/PmoHcrhpTUaXmh36R0=; b=msKsHHLCuIPuOcLK0js/Oo3rRTXzPeCz1k4mfc6WiJIvSnxi17LuplZ7WZmPrJ6/Y4 wNeJszfR7T1cPWb12PfSIdNEtBllkI80cntKWQ9T+6eb63Gh82gven9WULf1ThaydCrn b+GeBbytuXGeDi6pbqwk47dPOfMPBKvTs7hG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745580260; x=1746185060; 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=vhEPjQ0dQZYRoJ0ktNBv9zT4/PmoHcrhpTUaXmh36R0=; b=Oo3IxHPhqEK+pYbPgy0lQnBJQJF9fyNqh6eO8QRwSd04+kT9mwAYw/5mN/nCv8DBjM Ymiamrt1/Yip8m3GtWDdQJC6AlrXtMVkqyHujAJP33JUkc9Lpum18IqmxO2Rp/+43j4a gFxFPXZmMgEorCFsXG+/kMskM8Y3bQPNHw3CS9OQmVStQxjAy+WqdlBMwH+g5WsZQRi3 9bQG0uRvebZP1xeu7s96YAtsF1dLqyUZ4xdxn/bi73uQqXxlKgxWa9w3qaRHVPWnaMmW KplzGbNWUO/ewnUpsEmVEqjwUrrKW55m8aFoVYaLrLMOxAQp6SwPrPPkvnoSMyAwL56F lnGw== X-Gm-Message-State: AOJu0YzqQCJl3q73IWj6DnutafEO/9MR+OdVfgdQVwDnFnv8TY3oDtRB bcviUzv0ViBwxqTCFWo8/nK749GctGUgQEoGLFvo3SO07/wsOmpyuGrrMKHPaCnYKrnuODEUw6m U X-Gm-Gg: ASbGnctwXwVzxdev0OBJ5Ss5ZfgySCBBPd85czMwmpThZR95opQcpsjFABKhoUPvahx vyUZJr5h9OZE2x8E6DIcjRA3vWx0tdeFBEr88POxFlhu5qmy6fkvanSIsYu734g9XUqcxjTeUFg 14z6O/bHQV8toAdHZCTT7P1OWjkoEN1Tz8xnNb0v9th+EX+g6vIXPV+gyXRM6a2DyFUF8XiFqLg OWMq/iFkJ+1U3igKiv0IAb7azlahAbk6CDUT91D+4tqLdF3dJ/U9Ks02YPZPwNY0mI6hSak7tMK lvUUmLVGqeWMsFPDyLSLipxSadsoO9k97jr1uMN/jFvKNRQaBXbrb0V3DOqIIKcCbJDUMyzHZqK SRXZLSo019sPYgA== X-Google-Smtp-Source: AGHT+IGb33P6iew2x/LwHCVVSD/WMU6Rnd/sjM/clhLo2nrZj8J0Qdu+u/nUx/p6WnCLGVbN07MdsQ== X-Received: by 2002:a05:600c:c88:b0:43d:10c:2f60 with SMTP id 5b1f17b1804b1-440a669c41bmr14772985e9.24.1745580260269; Fri, 25 Apr 2025 04:24:20 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH v5 1/3] xen/mm: Introduce mm-types.h Date: Fri, 25 Apr 2025 12:24:13 +0100 Message-Id: <20250425112415.245585-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250425112415.245585-1-andrew.cooper3@citrix.com> References: <20250425112415.245585-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1745580279344019000 The type used for pagetable attributes/permissions is currently unsigned in= t, but needs to become architecture dependent as PPC needs unsigned long. Introduce mm-types.h to house pte_attr_t. Given the new toolchain baseline, we can use __has_include() now to remove = the need for boilerplate on most architectures. Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio __has_include() was one of the justifications for the new toolchain baselin= e, and is included in https://gitlab.com/xen-project/xen/-/issues/201 --- xen/include/xen/mm-types.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 xen/include/xen/mm-types.h diff --git a/xen/include/xen/mm-types.h b/xen/include/xen/mm-types.h new file mode 100644 index 000000000000..19f692e9aaa4 --- /dev/null +++ b/xen/include/xen/mm-types.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef XEN_MM_TYPES_H +#define XEN_MM_TYPES_H + +/* + * Types used to abstract away architecture-specific details in the memory + * management code. + * + * Architectures need only provide their own asm/mm-types.h if they want to + * override the defaults given here. + */ +#if __has_include() +# include +#else /* !__has_include() */ + +typedef unsigned int pte_attr_t; + +#endif /* !__has_include() */ +#endif /* XEN_MM_TYPES_H */ --=20 2.39.5 From nobody Fri Dec 19 15:49:22 2025 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; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1745580281; cv=none; d=zohomail.com; s=zohoarc; b=g1FhNEuKUDIi5evEVVVtMb0Qk7PP1xPJE8SLDtm2NaNDFurKdmo4RLSVXxyM9OTMCwf3Pu++wxzlzuxy3dKbiLqRixW6Mm9NJXTrISsQyQlAyxihdEoZeMOYOf9ImGyn1WZ22bvaBX7m35vPufNvRJfXbg/OVNeQWw2sQ0weKPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745580281; h=Content-Type: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=tA9Gz9qx65Gsb4o9nkP44u7yRdCQbYGW4dzg5Ro9QOc=; b=F10PnryXnUSlEAD8C5BNuHjhysKrTqLQIPWOVAqsh7KxxZtKYnG395s8yXM/uwkAetHV2XD1Yvn9h895+LY5hTLMGTGKik8liT54v78iRSH1abRye+zEhH8Z2DHM96y2Tfk4IPWjgp6wT+pb5ag0p4YH96jnm0DmzYAsRzpHeKU= 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1745580281887524.8699183691556; Fri, 25 Apr 2025 04:24:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.967688.1357427 (Exim 4.92) (envelope-from ) id 1u8HAN-0001J9-Tj; Fri, 25 Apr 2025 11:24:23 +0000 Received: by outflank-mailman (output) from mailman id 967688.1357427; Fri, 25 Apr 2025 11:24:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u8HAN-0001Fq-P9; Fri, 25 Apr 2025 11:24:23 +0000 Received: by outflank-mailman (input) for mailman id 967688; Fri, 25 Apr 2025 11:24:22 +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 1u8HAM-0001A7-H3 for xen-devel@lists.xenproject.org; Fri, 25 Apr 2025 11:24:22 +0000 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [2a00:1450:4864:20::32d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d5e2c304-21c7-11f0-9eb3-5ba50f476ded; Fri, 25 Apr 2025 13:24:22 +0200 (CEST) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43d07ca6a80so9160225e9.1 for ; Fri, 25 Apr 2025 04:24:22 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-440a531072csm21743005e9.18.2025.04.25.04.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Apr 2025 04:24:20 -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: d5e2c304-21c7-11f0-9eb3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1745580261; x=1746185061; 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=tA9Gz9qx65Gsb4o9nkP44u7yRdCQbYGW4dzg5Ro9QOc=; b=hTGkb16h/AG58ahGdz6eV+zoOCx0XrTxRXEoktwph0u4ijQmB8LxaJg0G6R1npX1gb so+STfuANX8jn2HChMHeSksT7/rwFgekLwBtFnIR51OkvZpEw9RXNc3TdyaPHpW/eFI0 sChiRwYB631ZJbrRbb3BczUFPox0QZK5F+m8E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745580261; x=1746185061; 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=tA9Gz9qx65Gsb4o9nkP44u7yRdCQbYGW4dzg5Ro9QOc=; b=fqG19tZzcDZ/StJDPYBaQtLZDSa3gL9X0OgQbBKnCSGBCvs1rkM2Osw7xtnXJAAnkI 7RmAc2W7nJfgAi/Mof9dKRNgsIpYojCuzquORx7Vw163RuhqwxcZ7pMhcvxkfmV9j7bC xDsZIRlZFTKoTKlAzExwt9xvAQQGP3YR5obxvqz8USbaUgJ1IgCeNCUN6aUvfQHIEQ5r ZfO3kuNnuIjsPKjIplmiTCOUWU4k4Wz5MJ/3XHDlSX92OAnZyyIZmaMnxzJWxTNXGkEG WzT6TSy/oHwDn7arRLxewQdOTFhbhH8CtBREjRNQOKxxHnY7CVUPAGk0v9jE0PZIisU3 Howg== X-Gm-Message-State: AOJu0YwYNz+3Lzx3Nx/YgSqUMCYjsBjcxMMa5pfxK9J1UhHZuie5WIsR JrHdXa1CLmXyR5v7LUT3k1ErvYtC60VLfow1ghjv4bPrF6cXDtxlWYe+b3+S6yhnhsTRI/IPahb g X-Gm-Gg: ASbGnct5IrxP2ZluDu6erlrcTKHsQJxGw9yu6Ebx0DUm62Zp/BnrzQtTxo6IpM7NjIs rJQ0abimqkHEDdxzFcNfjCH0GOFbV3SG/JZGXTQGHQ7uvl/E5UYAnX4hj3FMjEGf5vlC59NB+2k LCmcDk42ojitKUlS1BmsYBYxTa8JXhATdTOXcOo9XC/tOPDS1DfiN0LtzLHntDEAMRkBgF4LwpO fLJ2GFcv5SIPkZKHTKUfKDH5Woe3csJ07LXmDKwe5J/HJI1n4cnsI8rAThvusf5xvEZ3BBGzvbV RmI1NksTUcGkSOpBdQXEfSw8zuFM0FdYGvQL3S4UILloFVuDjKZZpovWFuDf6JDtfXEySC51rhs WbNx1OpO33gq6qA== X-Google-Smtp-Source: AGHT+IE7qq6rdVvEodnYNzVwFetkoOzSbmHdfaMaKLgbHb7zJLjUw4/w1tYTLRr64nlFDst4kpg2fw== X-Received: by 2002:a05:600c:a00c:b0:43c:fae1:5151 with SMTP id 5b1f17b1804b1-440a6698465mr15908595e9.25.1745580261176; Fri, 25 Apr 2025 04:24:21 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Shawn Anastasio , Andrew Cooper , Oleksii Kurochko , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel Subject: [PATCH v5 2/3] xen/mm: Switch some APIs over to pte_attr_t Date: Fri, 25 Apr 2025 12:24:14 +0100 Message-Id: <20250425112415.245585-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250425112415.245585-1-andrew.cooper3@citrix.com> References: <20250425112415.245585-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1745580284758019100 From: Shawn Anastasio Several APIs take an architecture-dependent set of flags in an unsigned int, but this needs to be a wider type to support PPC. The new type pte_attr_t has been introduced for this purpose, so switch to = it in map_pages_to_xen(), __vmap() and modify_xen_mappings{,_lite}(). No functional change. Suggested-by: Andrew Cooper Signed-off-by: Shawn Anastasio Signed-off-by: Andrew Cooper Reviewed-by: Oleksii Kurochko Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/arch/arm/mmu/pt.c | 4 ++-- xen/arch/ppc/mm-radix.c | 2 +- xen/arch/riscv/pt.c | 2 +- xen/arch/x86/mm.c | 6 +++--- xen/common/efi/boot.c | 4 ++-- xen/common/vmap.c | 2 +- xen/include/xen/mm.h | 7 ++++--- xen/include/xen/vmap.h | 3 ++- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c index 11cb1c66dac8..4726e713efd3 100644 --- a/xen/arch/arm/mmu/pt.c +++ b/xen/arch/arm/mmu/pt.c @@ -696,7 +696,7 @@ static int xen_pt_update(unsigned long virt, int map_pages_to_xen(unsigned long virt, mfn_t mfn, unsigned long nr_mfns, - unsigned int flags) + pte_attr_t flags) { return xen_pt_update(virt, mfn, nr_mfns, flags); } @@ -714,7 +714,7 @@ int destroy_xen_mappings(unsigned long s, unsigned long= e) return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0); } =20 -int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf) +int modify_xen_mappings(unsigned long s, unsigned long e, pte_attr_t nf) { ASSERT(IS_ALIGNED(s, PAGE_SIZE)); ASSERT(IS_ALIGNED(e, PAGE_SIZE)); diff --git a/xen/arch/ppc/mm-radix.c b/xen/arch/ppc/mm-radix.c index 9a00ae416af0..d5385ec9dd4b 100644 --- a/xen/arch/ppc/mm-radix.c +++ b/xen/arch/ppc/mm-radix.c @@ -265,7 +265,7 @@ int destroy_xen_mappings(unsigned long s, unsigned long= e) int map_pages_to_xen(unsigned long virt, mfn_t mfn, unsigned long nr_mfns, - unsigned int flags) + pte_attr_t flags) { BUG_ON("unimplemented"); } diff --git a/xen/arch/riscv/pt.c b/xen/arch/riscv/pt.c index 857619d48df1..918b1b91abde 100644 --- a/xen/arch/riscv/pt.c +++ b/xen/arch/riscv/pt.c @@ -504,7 +504,7 @@ static int pt_update(vaddr_t virt, mfn_t mfn, int map_pages_to_xen(unsigned long virt, mfn_t mfn, unsigned long nr_mfns, - unsigned int flags) + pte_attr_t flags) { /* * Ensure that flags has PTE_VALID bit as map_pages_to_xen() is suppos= ed diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 1cf236516789..0e6c766be4aa 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5442,7 +5442,7 @@ int map_pages_to_xen( unsigned long virt, mfn_t mfn, unsigned long nr_mfns, - unsigned int flags) + pte_attr_t flags) { bool locking =3D system_state > SYS_STATE_boot; l3_pgentry_t *pl3e =3D NULL, ol3e; @@ -5860,7 +5860,7 @@ int __init populate_pt_range(unsigned long virt, unsi= gned long nr_mfns) * * It is an error to call with present flags over an unpopulated range. */ -int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf) +int modify_xen_mappings(unsigned long s, unsigned long e, pte_attr_t nf) { bool locking =3D system_state > SYS_STATE_boot; l3_pgentry_t *pl3e =3D NULL; @@ -6156,7 +6156,7 @@ int destroy_xen_mappings(unsigned long s, unsigned lo= ng e) * the non-inclusive boundary will be updated. */ void init_or_livepatch modify_xen_mappings_lite( - unsigned long s, unsigned long e, unsigned int nf) + unsigned long s, unsigned long e, pte_attr_t nf) { unsigned long v =3D s, fm, flags; =20 diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 143b5681ba92..e39fbc3529c4 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1676,7 +1676,7 @@ void __init efi_init_memory(void) struct rt_extra { struct rt_extra *next; unsigned long smfn, emfn; - unsigned int prot; + pte_attr_t prot; } *extra, *extra_head =3D NULL; =20 free_ebmalloc_unused_mem(); @@ -1691,7 +1691,7 @@ void __init efi_init_memory(void) EFI_MEMORY_DESCRIPTOR *desc =3D efi_memmap + i; u64 len =3D desc->NumberOfPages << EFI_PAGE_SHIFT; unsigned long smfn, emfn; - unsigned int prot =3D PAGE_HYPERVISOR_RWX; + pte_attr_t prot =3D PAGE_HYPERVISOR_RWX; paddr_t mem_base; unsigned long mem_npages; =20 diff --git a/xen/common/vmap.c b/xen/common/vmap.c index 47225fecc067..d6991421f3f7 100644 --- a/xen/common/vmap.c +++ b/xen/common/vmap.c @@ -222,7 +222,7 @@ static void vm_free(const void *va) } =20 void *__vmap(const mfn_t *mfn, unsigned int granularity, - unsigned int nr, unsigned int align, unsigned int flags, + unsigned int nr, unsigned int align, pte_attr_t flags, enum vmap_region type) { void *va =3D vm_alloc(nr * granularity, align, type); diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index ae1c48a61545..e89942b87d1e 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -113,11 +114,11 @@ int map_pages_to_xen( unsigned long virt, mfn_t mfn, unsigned long nr_mfns, - unsigned int flags); + pte_attr_t flags); /* Alter the permissions of a range of Xen virtual address space. */ -int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf); +int modify_xen_mappings(unsigned long s, unsigned long e, pte_attr_t nf); void modify_xen_mappings_lite(unsigned long s, unsigned long e, - unsigned int nf); + pte_attr_t nf); int destroy_xen_mappings(unsigned long s, unsigned long e); /* Retrieve the MFN mapped by VA in Xen virtual address space. */ mfn_t xen_map_to_mfn(unsigned long va); diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h index 26c831757a11..327a2597826d 100644 --- a/xen/include/xen/vmap.h +++ b/xen/include/xen/vmap.h @@ -9,6 +9,7 @@ #define __XEN_VMAP_H__ =20 #include +#include #include =20 /* Identifiers for the linear ranges tracked by vmap */ @@ -57,7 +58,7 @@ void vm_init_type(enum vmap_region type, void *start, voi= d *end); * @return Pointer to the mapped area on success; NULL otherwise. */ void *__vmap(const mfn_t *mfn, unsigned int granularity, unsigned int nr, - unsigned int align, unsigned int flags, enum vmap_region type= ); + unsigned int align, pte_attr_t flags, enum vmap_region type); =20 /* * Map an array of pages contiguously into the VMAP_DEFAULT vmap region --=20 2.39.5 From nobody Fri Dec 19 15:49:22 2025 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; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1745580278; cv=none; d=zohomail.com; s=zohoarc; b=B7NVGeuRfom4xM37tIJF5tTtEFQ/sVuSb09LHbrLa2635iB/L96AYajd6PLSTuuDA3EG1feKCBI0pWKX6tCSxb0iiAMTFDR3U8U51RtnG5vrqC4gF5dID+4Qa/Ef7TB9MyLjYmXt4Rs3cMwrYzxckBO/itnlUFDv8R4eojerR3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745580278; h=Content-Type: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=v36HYmxQutvat5+vkDgo13dmyUzLDnP9Gcli+3xTA18=; b=WOdndxRHZV46fFqpvw+vxG8i42rJz14/N8BeYDHKisZX8srFzczT/m2G6YrmEkE7CQrnSn2zXoyHtanJBCDNKaJJDVY12V2ZirXDyzG/uNF74skAoi+Z8snA1IIXQwsQsBLJkU9bDiY7NfT0yUB49ACl2B/N3aPzYVafeBLlU00= 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1745580278128154.53370740554124; Fri, 25 Apr 2025 04:24:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.967689.1357448 (Exim 4.92) (envelope-from ) id 1u8HAP-0001r8-7J; Fri, 25 Apr 2025 11:24:25 +0000 Received: by outflank-mailman (output) from mailman id 967689.1357448; Fri, 25 Apr 2025 11:24:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u8HAP-0001qR-2S; Fri, 25 Apr 2025 11:24:25 +0000 Received: by outflank-mailman (input) for mailman id 967689; Fri, 25 Apr 2025 11:24:24 +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 1u8HAN-0001A7-Qn for xen-devel@lists.xenproject.org; Fri, 25 Apr 2025 11:24:23 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d6b2928f-21c7-11f0-9eb3-5ba50f476ded; Fri, 25 Apr 2025 13:24:23 +0200 (CEST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43d2d952eb1so15049285e9.1 for ; Fri, 25 Apr 2025 04:24:23 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-440a531072csm21743005e9.18.2025.04.25.04.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Apr 2025 04:24:21 -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: d6b2928f-21c7-11f0-9eb3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1745580263; x=1746185063; 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=v36HYmxQutvat5+vkDgo13dmyUzLDnP9Gcli+3xTA18=; b=mrx6vv2b/kS660y42GT0Z23ISsNlZxk1PLoYK84p04IqBn1eGu7mirUpBaxFvR6ZJz HFR69Eg2sxWgbEPYO8TOgxVUjXlYv3MUCXcJx7PmSVVYcZkvzDq5uQe8Fk7M3hubYp10 w3cdUVVFkqVMKuy53D2wcadKn8YELVP7b//As= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745580263; x=1746185063; 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=v36HYmxQutvat5+vkDgo13dmyUzLDnP9Gcli+3xTA18=; b=SYhlGdwDP/OXqzrjRIh2n6MFq8ZYmCTKrtb/lM6vhEAqrKI20mLQ48fzp3csoJZfeS RELxo8v8f9lbsxhzXXFpYYSyR+3p2vSzbpfSOz2CMr0mUeWq3ktWeILpWtnplasTThRn LpF6GdAmw0HD/tr3EoeKjd45fO+Wa6hxBQ08G7Ans812IXdA3kA1Sc311SA8/3b4dGo6 IDad+bWtvBTeiE+vHB6CE5Ky3LktAeHN5qyNs7A8kTp7dZcSZc/t4iPXJUpz/4MUNlLQ dK+BYDCjkcRxSTSIaWuCs8S7jmmu5uli1mihwsOh6E9pjaXcDuPW9pVTEWuVsrnbhpJk r3XQ== X-Gm-Message-State: AOJu0YwXgqStn7fbtoqX7FMaNnxx836boEEHMgqEWnTcrVcTCKhVOX/u mioNT1YfFF3rxcgZST+zB9zB3h/zSqMAcIiLTB092/uoACyjrenKa6kGx+kmFAw2/kPMMMFhI9x q X-Gm-Gg: ASbGncvUfNnuBUq3RVemGRs9nBGRBZMf3VBRpMBVT/jhjFEom9ond37hJaCERoreENP V5lQlniMmie1OV+afOVbkQrghz1sFBMa8jy1pW36VO+qlIpGia4TBSna/pmw09sdzvpVyP127J3 mpqal4fL5KYnZyXVOS81Kq3FqQWXer3BYf2O4zSEWR5q+hV1RJI0z/IzOnjWxqhO6NfVAuj5V4G OK9P8b3cOFx4vL5QUVrj6WkqkkV4ovtz/zTYOb70eVojSHQMJiMaEn2IZYPwnQEfBAoTztFhL+h JOk1hHZvRt0WnT3PzdRLop4FjNzbRmG69VApA6i6zn/RvF8u7hOBkkQZOcymjgsIjtJey1W6EiI yWKeUEIixNofVGA== X-Google-Smtp-Source: AGHT+IHRAPyNcrOaqj+bbzurrRKNdUBK3cc5md8L0wzSjrPO3xVS+zDe1HZyI4mdv4p/xbr8sHyvnw== X-Received: by 2002:a05:600c:1d9f:b0:43c:fceb:91a with SMTP id 5b1f17b1804b1-440a65e6dc3mr16451745e9.11.1745580262651; Fri, 25 Apr 2025 04:24:22 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Shawn Anastasio , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel , Oleksii Kurochko Subject: [PATCH v5 3/3] ppc/mm: Introduce mm-types.h Date: Fri, 25 Apr 2025 12:24:15 +0100 Message-Id: <20250425112415.245585-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250425112415.245585-1-andrew.cooper3@citrix.com> References: <20250425112415.245585-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1745580280671019100 From: Shawn Anastasio Signed-off-by: Shawn Anastasio --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio Possibly not for taking on it's own (might be better with the PPC implemenation of map_pages_to_xen()). Nevertheless, this patch alone now does trip: diff --git a/xen/common/vmap.c b/xen/common/vmap.c index d6991421f3f7..9552806dba39 100644 --- a/xen/common/vmap.c +++ b/xen/common/vmap.c @@ -228,6 +228,8 @@ void *__vmap(const mfn_t *mfn, unsigned int granulari= ty, void *va =3D vm_alloc(nr * granularity, align, type); unsigned long cur =3D (unsigned long)va; + BUILD_BUG_ON(sizeof(pte_attr_t) !=3D 4); + for ( ; va && nr--; ++mfn, cur +=3D PAGE_SIZE * granularity ) { if ( map_pages_to_xen(cur, *mfn, granularity, flags) ) in PPC builds only. --- xen/arch/ppc/include/asm/mm-types.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 xen/arch/ppc/include/asm/mm-types.h diff --git a/xen/arch/ppc/include/asm/mm-types.h b/xen/arch/ppc/include/asm= /mm-types.h new file mode 100644 index 000000000000..06a3af1c6eda --- /dev/null +++ b/xen/arch/ppc/include/asm/mm-types.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef PPC_MM_TYPES_H +#define PPC_MM_TYPES_H + +typedef unsigned long pte_attr_t; + +#endif /* PPC_MM_TYPES_H */ --=20 2.39.5