{"id":2223454,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2223454/?format=json","web_url":"http://patchwork.ozlabs.org/project/opensbi/patch/20260415110002.2610929-2-anup.patel@oss.qualcomm.com/","project":{"id":67,"url":"http://patchwork.ozlabs.org/api/1.2/projects/67/?format=json","name":"OpenSBI development","link_name":"opensbi","list_id":"opensbi.lists.infradead.org","list_email":"opensbi@lists.infradead.org","web_url":"https://github.com/riscv/opensbi","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":"https://github.com/riscv/opensbi/commit/{}"},"msgid":"<20260415110002.2610929-2-anup.patel@oss.qualcomm.com>","list_archive_url":null,"date":"2026-04-15T11:00:00","name":"[1/3] include: sbi: Add sbi_scratch_hartindex() macro","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"7d66fc08d95b755401a595be2f7367e2f38aa55e","submitter":{"id":92322,"url":"http://patchwork.ozlabs.org/api/1.2/people/92322/?format=json","name":"Anup Patel","email":"anup.patel@oss.qualcomm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/opensbi/patch/20260415110002.2610929-2-anup.patel@oss.qualcomm.com/mbox/","series":[{"id":499967,"url":"http://patchwork.ozlabs.org/api/1.2/series/499967/?format=json","web_url":"http://patchwork.ozlabs.org/project/opensbi/list/?series=499967","date":"2026-04-15T11:00:00","name":"Timer events for OpenSBI","version":1,"mbox":"http://patchwork.ozlabs.org/series/499967/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223454/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2223454/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=uSY8lsBl;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=nq9m+dP0;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fwdTd6GcJz1yHd\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 21:00:21 +1000 (AEST)","from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wCxyf-000000010Sq-1Ca1;\n\tWed, 15 Apr 2026 11:00:13 +0000","from mx0b-0031df01.pphosted.com ([205.220.180.131])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wCxyc-000000010SL-3fz6\n\tfor opensbi@lists.infradead.org;\n\tWed, 15 Apr 2026 11:00:12 +0000","from pps.filterd (m0279869.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63F9INhE1567113;\n\tWed, 15 Apr 2026 11:00:07 GMT","from apblrppmta01.qualcomm.com\n (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dj7wv0a65-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 15 Apr 2026 11:00:07 +0000 (GMT)","from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1])\n\tby APBLRPPMTA01.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id\n 63FB0383029581;\n\tWed, 15 Apr 2026 11:00:03 GMT","from pps.reinject (localhost [127.0.0.1])\n\tby APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 4dg5d11e7m-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 15 Apr 2026 11:00:03 +0000 (GMT)","from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com\n [127.0.0.1])\n\tby pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 63FB03IS029548;\n\tWed, 15 Apr 2026 11:00:03 GMT","from hu-devc-blr-u24-a.qualcomm.com (hu-anuppate-blr.qualcomm.com\n [10.131.36.165])\n\tby APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 63FB03HT029530\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 15 Apr 2026 11:00:03 +0000 (GMT)","by hu-devc-blr-u24-a.qualcomm.com (Postfix, from userid 486687)\n\tid D2FD321542; Wed, 15 Apr 2026 16:30:02 +0530 (+0530)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=L57wOndNs2h5DhOjl2q8GFKcei2ZI3elFjoQTlscpIw=; b=uSY8lsBl3/Ayb4\n\tog3QHiOJnA25V0e9KqYg37hV2YkhhE3oeOC5qHEozvBD+5I6LM1biENVrB1CMd5M0xgsgsGFl0ltN\n\t3E/GwkCm8FJRiCoIatrNoWToAv2Ed5KYO8mI61zH28klcyGZy+HluVv28gtXNU+Dev/uTReWEamGa\n\tuHebHI2LjiIFhMTIlhFN3rMMWe+sLjVJb5XT1Cog/5bJc/wK57H2/UW2fga9Cg82+TNe+0F+LhmL1\n\tjiQwfoFBhnGcRwqu2P3Ecwn8phrBnLednzBRInYyZ3t343ebUXD0Ie6qzYuldRuXZyFx8JgDd+mKb\n\tzmd0D6Ml51kvtW7ZJ9IA==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcc:content-transfer-encoding:date:from:in-reply-to:message-id\n\t:mime-version:references:subject:to; s=qcppdkim1; bh=Bs0IUSahtot\n\tIQAg/j+S+95SDWEMzb3uQiM1MQlBc+B0=; b=nq9m+dP0JSYeidjJ+kfpTJBQmHH\n\tlJA789OPIVNdOPBzmBSFfmHtJVU85zwyy3KmWF+9i18EcdTXb+Wi0qiGpgtvJlpg\n\t35YWl3EHv84VTAbMetW6smuF/Zb9a7leFYFGhTmAGmZJPtUu8rYXzlGbsG/J717S\n\txKax2vCt3akdKSWlylOrWtP857YjohoVbqcfFbby/R7k/zWsBQ5+ygqC8N4gfiPc\n\tLkv14SmgMh8rjKq8WsIVZI9Z2i2Hlnz1bMNYdD8joh+Xe45VwBMXBfz99saQGYeB\n\tWNokvWfSgoviYayzkGHu23xlG07f19pjC35Oyf5IpyfdO/rozjE1ifqVmwA=="],"From":"Anup Patel <anup.patel@oss.qualcomm.com>","To":"Atish Patra <atish.patra@linux.dev>","Cc":"Andrew Jones <andrew.jones@oss.qualcomm.com>,\n        Samuel Holland <samuel.holland@sifive.com>,\n        Anup Patel <anup@brainfault.org>, opensbi@lists.infradead.org,\n        Anup Patel <anup.patel@oss.qualcomm.com>","Subject":"[PATCH 1/3] include: sbi: Add sbi_scratch_hartindex() macro","Date":"Wed, 15 Apr 2026 16:30:00 +0530","Message-ID":"<20260415110002.2610929-2-anup.patel@oss.qualcomm.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20260415110002.2610929-1-anup.patel@oss.qualcomm.com>","References":"<20260415110002.2610929-1-anup.patel@oss.qualcomm.com>","MIME-Version":"1.0","X-QCInternal":["smtphost","smtphost"],"X-Proofpoint-GUID":"wEOLVIX9E15vEYAwHM0hHDKbqQrdpEOd","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDE1MDEwMSBTYWx0ZWRfXyLFZR+0W9YS5\n FdX0m7oApcoHa5zlbBsZRMr+LQcYAivJBEmwGZyei03PNLln0dXP1gVASlNKnWX0g62ko+DtRTU\n 2z/AzUj/opQDdiWsLfLCSCmXbt72Qe0V82i0Wp1h1b8H95hoptdBLiHHjJJPC1o3Tjt2oybKmvO\n oLa21r9oGe9IA0rJN6tgIHwaEi77X6Mi6xxp8IVwcz59l5FLzIMoQWTAm6GYl+xFLLc5IWkpYlC\n Qv5azXhovbylxH+5Hsa/E6TDUKjBPekJ81SpFDNOP7cveRaXkLMszFNwSsk0oCUgwXzbwb0FI7N\n xKWifosdFTZ2tLwXHXd/xy0DzzY7eF8qrOrb2BxOOUj53EI2553SAuiKI5QsIl/5fh6P/vUJYrA\n YsW8pgwtj/vwUPe3N3kxxuTNXfHwjJi8iqiHh0gzndUOWNFl6sHekcNDzLgbbvd9S46wmECFw6t\n VDAiDLUlSlq9ukeyh6w==","X-Authority-Analysis":"v=2.4 cv=GYgnWwXL c=1 sm=1 tr=0 ts=69df6fb7 cx=c_pps\n a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22\n a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=dKX0P6GNmAe_BcdMX9YA:9","X-Proofpoint-ORIG-GUID":"wEOLVIX9E15vEYAwHM0hHDKbqQrdpEOd","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-14_04,2026-04-13_04,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n impostorscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0\n clxscore=1015 priorityscore=1501 suspectscore=0 adultscore=0 bulkscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604150101","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20260415_040011_032267_7F4128D6 ","X-CRM114-Status":"GOOD (  10.78  )","X-Spam-Score":"-2.7 (--)","X-Spam-Report":"Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Add helper macro to extract hart index from scratch\n pointer.\n    This can be used to check whether scratch pointer belongs to a particular\n    hart or not. Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> ---\n   include/sbi/sbi_scratch.h | 6 ++++-- 1 file changed, 4 insertions(+),\n 2 deletions(-)    \n Content analysis details:   (-2.7 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/, low\n                             trust\n                             [205.220.180.131 listed in list.dnswl.org]\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                             [205.220.180.131 listed in\n sa-accredit.habeas.com]\n  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The\n                             query to Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                        [205.220.180.131 listed in\n sa-trusted.bondedsender.org]\n  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                           [205.220.180.131 listed in\n bl.score.senderscore.com]","X-BeenThere":"opensbi@lists.infradead.org","X-Mailman-Version":"2.1.34","Precedence":"list","List-Id":"<opensbi.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/opensbi/>","List-Post":"<mailto:opensbi@lists.infradead.org>","List-Help":"<mailto:opensbi-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"opensbi\" <opensbi-bounces@lists.infradead.org>","Errors-To":"opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"Add helper macro to extract hart index from scratch pointer. This\ncan be used to check whether scratch pointer belongs to a particular\nhart or not.\n\nSigned-off-by: Anup Patel <anup.patel@oss.qualcomm.com>\n---\n include/sbi/sbi_scratch.h | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)","diff":"diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h\nindex 58d54628..c12aa796 100644\n--- a/include/sbi/sbi_scratch.h\n+++ b/include/sbi/sbi_scratch.h\n@@ -166,9 +166,11 @@ do {\t\t\t\t\t\t\t\t\t\\\n \t\t\t\t\t= (__type)(__ptr);\t\t\\\n } while (0)\n \n+/** Get the hart index of a particular sbi_scratch */\n+#define sbi_scratch_hartindex(__scratch) ((__scratch)->hartindex)\n+\n /** Get the hart index of the current hart */\n-#define current_hartindex() \\\n-\t(sbi_scratch_thishart_ptr()->hartindex)\n+#define current_hartindex() sbi_scratch_hartindex(sbi_scratch_thishart_ptr())\n \n /** Number of harts managed by this OpenSBI instance */\n extern u32 sbi_scratch_hart_count;\n","prefixes":["1/3"]}