From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4860933436A for ; Wed, 7 Jan 2026 16:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767803400; cv=none; b=eAoL7oP3X+1sCiLesZ2KywYSzrW97lIrYv8XGbH9/m9QWgwaN5Ly4YNBm9xvoD1+RljFy9CiIc/1o2ki6VXJTo+ibgNmSxfWbbPLDQ3ZU8vW1yfiEMB5RI7yzIZ7vtPKNEjYWp8juYhmSSOj7Okh9sy3aiJMfxto484ebbdZRdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767803400; c=relaxed/simple; bh=8QHeTQ1XWPXrXIuaoG9PXPBKmQw6B9CxYPEzAKre7JY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aOxDvyC5xa3q5qTrZvuRWyneekNbnF4CoVbQhx8piWD99blPvfKQnaZYoWdR/C7SgoxujDiFdt1oH18bELGRZHl6OXzIfrqfqPGeW37wcfS1WKmreQXG7+pEHjGffrLdGEwdGcA15RA5vei8oi8NhdbZWANwHE2HLdsylmynYCM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=osyx.tech; spf=fail smtp.mailfrom=osyx.tech; dkim=pass (2048-bit key) header.d=osyx-tech.20230601.gappssmtp.com header.i=@osyx-tech.20230601.gappssmtp.com header.b=Y4gUTC3M; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=osyx.tech Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=osyx.tech Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=osyx-tech.20230601.gappssmtp.com header.i=@osyx-tech.20230601.gappssmtp.com header.b="Y4gUTC3M" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-430f3ef2d37so1953026f8f.3 for ; Wed, 07 Jan 2026 08:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osyx-tech.20230601.gappssmtp.com; s=20230601; t=1767803383; x=1768408183; darn=vger.kernel.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=TGfMB1SwaAERf8A9+EJZzOGOMSv16YGZ4dbapv2DrTs=; b=Y4gUTC3MrooR8TXD8YTfru1jOcy5sBzZqUID9YizdinrPnvWdW2Y0efLIz9oqPq6Vp 1Q4j52k8fKwxnx0gOoHiyGhtxI4R9FGFfiB/kr0T60iqlCWfWw6JqIRAp75VM0PDFtq6 brCvvjqJuu7tTydsje8NLHxYlcU2A6P8JhYcT4KAAd9asEqTWtY7Bid9Bgrvw2Mbdzn9 NNYCui/Zg/cogop/y66l1QmIIxNJZIiwjAtX+JR/Ph5TvaI0c87ZiEj5Lw6Cli1wGbGS 3vXFefAMxI1k20ak/yt457w8DRBr1rlmtv5GnzoQYsbjAxISyl38OKmYDft4GOs54lsj Z3Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767803383; x=1768408183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TGfMB1SwaAERf8A9+EJZzOGOMSv16YGZ4dbapv2DrTs=; b=rHHkJNS24d2sDfXdikvggZQlxc+stLXrHHy4oppkKYel0t5PwDsH56fTfW6gcpJfVD 6+i8eT3ShdxjM2cQ6+ynJhLEDNaJ9Ftf/LFXtq3auORP3V456rgJVsKh2UQ1JHGpTbe4 w6dBtANU8FmN34veH/U11v/JSeztEYJSEUh4KNjmgAcVPfjUdN+K/uy5mkIUP/HBC0d3 PniWor7fFE4faYJWEe4IGYVVtDGwhjd/tAdtYRtS1vFl0rBQAvAMiI++SH4hEAIm+ijW DFSMLweKxQMIR5a4h44kdySeaRl+IcliNkbzLP10jV8jNrap1RFR7diTggoRPGL/Y9qz XMqg== X-Forwarded-Encrypted: i=1; AJvYcCVAW/IzRwT77K0bnkGqioQ2lc0d56NlL1zgATOArgd0JiCVDsIiRPVR4BbEc8uNWgOE2uttiSokSgFm@vger.kernel.org X-Gm-Message-State: AOJu0YwV8hIVJHUYUv2jZHM4k5WsskVkXk2wOL3J9i+WvMj2j4DmIcRp 7bvYBioXaOlpxJGaB97T6alqZlR1J7nsUFC2Z8QC0HyaBSzHd3DliYdnavXnArWW6XT7 X-Gm-Gg: AY/fxX6lvEOtS0P1KGlQT3qu7stehgz4bbV8J5vJi22cxenw/eTk1YnMB5HlS88l4nk Va1cDbJYU16Vi/CNCaN+zyN911mLkpqM0mENeiCapLMM9pA7jruQ4gvY3IayDwJsxLZgnnINUaz WAoKf4sfyjpBIjQk1/vMvVIK2mkv1cYvBNbKLNpMPzHzI2bvvcGt4rdzd29PZgQqoAtC4vcd3qb AeEmogPtLG06Da/uCE3jR5SiNCHxbccD6moEDDDgKDO+DWW8YwaF3g2ySM4XimrBT7NPvtGRbMb GuElAS6cUowYdik59/AmyRBp5LYfXjgb4yJZTmk9E3zQSLo/zk2PFtd9+S1Y37btf2+CrNldMK6 3VkS+ejFbfX21WTGjnrXjuKu1QmhCQAUBOi0uJycO+BPqUyzI9Dpa4vvZ4gXR/ogM4ZzhaCNdiY zRzvSImuwBQfbWeXBpaA== X-Google-Smtp-Source: AGHT+IHYX8ERrMEjplERjC6ixgzkBNgkXhYStxw+rahyUBYDlRtMCSfk+AGXhNnNExJ8kz9EYuCSDQ== X-Received: by 2002:adf:f4c9:0:b0:431:907:f324 with SMTP id ffacd0b85a97d-432c38d2312mr3237384f8f.61.1767803383134; Wed, 07 Jan 2026 08:29:43 -0800 (PST) Received: from jp-linux.Home ([2001:8a0:f59c:a900:4a3c:13be:a1c0:7b9f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bd5ff0b2sm11117030f8f.42.2026.01.07.08.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 08:29:42 -0800 (PST) From: joaopeixoto@osyx.tech To: linux-kernel@vger.kernel.org Cc: ajd@linux.ibm.com, alex@ghiti.fr, aou@eecs.berkeley.edu, bagasdotme@gmail.com, catalin.marinas@arm.com, conor+dt@kernel.org, corbet@lwn.net, dan.j.williams@intel.com, davidmcerdeira@osyx.tech, devicetree@vger.kernel.org, dev@kael-k.io, gregkh@linuxfoundation.org, haren@linux.ibm.com, heiko@sntech.de, joaopeixoto@osyx.tech, jose@osyx.tech, kever.yang@rock-chips.com, krzk+dt@kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, maddy@linux.ibm.com, mani@kernel.org, nathan@kernel.org, neil.armstrong@linaro.org, palmer@dabbelt.com, pjw@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, robh@kernel.org, will@kernel.org Subject: [PATCH 5/6] virt: bao: Move BAO_IPCSHMEM_HYPERCALL_ID to common header Date: Wed, 7 Jan 2026 16:28:28 +0000 Message-ID: <20260107162829.416885-6-joaopeixoto@osyx.tech> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260107162829.416885-1-joaopeixoto@osyx.tech> References: <20251224135217.25350-1-joaopeixoto@osyx.tech> <20260107162829.416885-1-joaopeixoto@osyx.tech> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: João Peixoto Move the IPC shared-memory hypercall ID from architecture-specific headers into include/linux/bao.h. Signed-off-by: João Peixoto --- arch/arm/include/asm/bao.h | 5 ++--- arch/arm64/include/asm/bao.h | 5 ++--- arch/riscv/include/asm/bao.h | 7 +++---- drivers/virt/bao/ipcshmem/ipcshmem.c | 5 +---- include/linux/bao.h | 3 +++ 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/arch/arm/include/asm/bao.h b/arch/arm/include/asm/bao.h index 5ece9ecb1455..7d13591fe669 100644 --- a/arch/arm/include/asm/bao.h +++ b/arch/arm/include/asm/bao.h @@ -16,14 +16,13 @@ #include #include -static inline unsigned long bao_ipcshmem_hypercall(unsigned long hypercall_id, - unsigned long ipcshmem_id) +static inline unsigned long bao_ipcshmem_hypercall(unsigned long ipcshmem_id) { struct arm_smccc_res res; arm_smccc_hvc(ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_32, ARM_SMCCC_OWNER_VENDOR_HYP, - hypercall_id), + BAO_IPCSHMEM_HYPERCALL_ID), ipcshmem_id, 0, 0, 0, 0, 0, 0, &res); return res.a0; diff --git a/arch/arm64/include/asm/bao.h b/arch/arm64/include/asm/bao.h index c7b7ec60c042..409f4058d56e 100644 --- a/arch/arm64/include/asm/bao.h +++ b/arch/arm64/include/asm/bao.h @@ -16,14 +16,13 @@ #include #include -static inline unsigned long bao_ipcshmem_hypercall(unsigned long hypercall_id, - unsigned long ipcshmem_id) +static inline unsigned long bao_ipcshmem_hypercall(unsigned long ipcshmem_id) { struct arm_smccc_res res; arm_smccc_hvc(ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_64, ARM_SMCCC_OWNER_VENDOR_HYP, - hypercall_id), + BAO_IPCSHMEM_HYPERCALL_ID), ipcshmem_id, 0, 0, 0, 0, 0, 0, &res); return res.a0; diff --git a/arch/riscv/include/asm/bao.h b/arch/riscv/include/asm/bao.h index f04e6cd33fa9..d168aba7d8ec 100644 --- a/arch/riscv/include/asm/bao.h +++ b/arch/riscv/include/asm/bao.h @@ -18,13 +18,12 @@ #define BAO_SBI_EXT_ID 0x08000ba0 -static inline unsigned long bao_ipcshmem_hypercall(unsigned long hypercall_id, - unsigned long ipcshmem_id) +static inline unsigned long bao_ipcshmem_hypercall(unsigned long ipcshmem_id) { struct sbiret ret; - ret = sbi_ecall(BAO_SBI_EXT_ID, hypercall_id, ipcshmem_id, 0, 0, 0, 0, - 0); + ret = sbi_ecall(BAO_SBI_EXT_ID, BAO_IPCSHMEM_HYPERCALL_ID, ipcshmem_id, + 0, 0, 0, 0, 0); return ret.error; } diff --git a/drivers/virt/bao/ipcshmem/ipcshmem.c b/drivers/virt/bao/ipcshmem/ipcshmem.c index f3892d41248c..593e89cb76bd 100644 --- a/drivers/virt/bao/ipcshmem/ipcshmem.c +++ b/drivers/virt/bao/ipcshmem/ipcshmem.c @@ -14,9 +14,6 @@ #define BAO_IPCSHMEM_NAME_LEN 16 -/* IPC through shared-memory hypercall ID */ -#define BAO_IPCSHMEM_HYPERCALL_ID 0x1 - struct bao_ipcshmem { struct miscdevice miscdev; int id; @@ -90,7 +87,7 @@ static ssize_t bao_ipcshmem_write(struct file *filp, const char __user *buf, *ppos += count; /* Notify Bao hypervisor */ - bao_ipcshmem_hypercall(BAO_IPCSHMEM_HYPERCALL_ID, bao->id); + bao_ipcshmem_hypercall(bao->id); return count; } diff --git a/include/linux/bao.h b/include/linux/bao.h index 5b06d2a17d21..b29830374788 100644 --- a/include/linux/bao.h +++ b/include/linux/bao.h @@ -15,6 +15,9 @@ #include +/* IPC through shared-memory hypercall ID */ +#define BAO_IPCSHMEM_HYPERCALL_ID 0x1 + /* Remote I/O Hypercall ID */ #define BAO_REMIO_HYPERCALL_ID 0x2 -- 2.43.0