From nobody Mon Jan 8 14:39:18 2024 X-Original-To: freebsd-riscv@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7xXw1RPFz55w0q for ; Mon, 8 Jan 2024 14:39:44 +0000 (UTC) (envelope-from himanshu@thechauhan.dev) Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T7xXv1C7bz49Zv for ; Mon, 8 Jan 2024 14:39:43 +0000 (UTC) (envelope-from himanshu@thechauhan.dev) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=thechauhan.dev header.s=google header.b=AeeXDRFq; dmarc=none; spf=fail (mx1.freebsd.org: domain of himanshu@thechauhan.dev does not designate 2607:f8b0:4864:20::529 as permitted sender) smtp.mailfrom=himanshu@thechauhan.dev Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5cddfe0cb64so346803a12.0 for ; Mon, 08 Jan 2024 06:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thechauhan.dev; s=google; t=1704724781; x=1705329581; darn=freebsd.org; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=5xj+tEjkvNjzkfCthqkv4hhpkZA+q5Khnw16TiFcfYo=; b=AeeXDRFqOe/6PwtEc3nbgj6KBS0TYrDawrsc3+g7oy4BnrUa8KCVW91N8ySdFBrkl3 f5vDeVh2vVoKg9jMp9qM4SYk90L7Ippu40knPqIq5q8qvTERp4ckFQoppPwVZvXHvZiQ EVIXkOhQOJVEPs6T3yCkoJspmSQWqdC/5VW8bxRBMgloALoLLENfJEbCBeBDHk7kexTv UQFIP4TqCrplur561SfUjdLDip2M8bJ7C620CpAPRL1568jL+v6zwe6zb+h+Hc9bq19R eD+1Wn9hor4md3f7kn9AQit4vztIaY2jRf1dGjnLe9DD6QhIsFF4tYgrhlh/3GEVhMH1 QOzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704724781; x=1705329581; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5xj+tEjkvNjzkfCthqkv4hhpkZA+q5Khnw16TiFcfYo=; b=Y15ug6KH+EeEHZtpul9X8EkNITpNsyzsFFm7NxFn/jjfbcm9Ix4lLFrVIBLJcSLN5Z SFTTOQflluqGp1IjeNHnY0vKUVWOI3gdBpNgHMCacICuPw9Svww4Xk8NOTUPK3pWOVnW E6aUNMnSOA2ks9xqhQX0J08cX0TkAFujQXthAR65j5g+i0YT7hm6OmX+S0GXMlKhtp/r LUSgaL4NsXG136pWNKK5ncg4w2VHWvraBc6Ki+DbHvQEzyVF7O4CGRlGeskZBOl4Qr35 4Wm1jLcio0cdmF0jF4XftNARZdMemOIoNsgd/wlVpOZWJGH440CtyIQrR2zBQkBi0YNo f+iw== X-Gm-Message-State: AOJu0Yy8HIm9xVe1rZpS6htGsPWNufVhSmcO5b7axaOfDHfmLPXhUKk/ vRbvmGGMQLmnCnVrwvqVS/xEB3qIJSPAR5mMSpU4JF4BBA== X-Google-Smtp-Source: AGHT+IGpSTgbjw4QuGGKUYzA45XpYWGLdrlYymLr+wRXZoh3Yhz//alab4B80IkVMsvRc9xMZKAINA== X-Received: by 2002:a05:6a20:8712:b0:199:b889:31f6 with SMTP id e18-20020a056a20871200b00199b88931f6mr524086pzf.57.1704724781483; Mon, 08 Jan 2024 06:39:41 -0800 (PST) Received: from smtpclient.apple ([2405:201:d019:cbd3:5934:2059:3607:75a0]) by smtp.gmail.com with ESMTPSA id fi23-20020a056a00399700b006db05a51868sm366986pfb.99.2024.01.08.06.39.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2024 06:39:41 -0800 (PST) From: Himanshu Chauhan Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-riscv@freebsd.org X-BeenThere: freebsd-riscv@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Calling a function on other CPUs in an SMP machine Message-Id: <7A8DC6C8-9582-455C-B05D-9F24838A9070@thechauhan.dev> Date: Mon, 8 Jan 2024 20:09:18 +0530 Cc: freebsd-hackers@freebsd.org To: freebsd-riscv@freebsd.org X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Spamd-Bar: - X-Spamd-Result: default: False [-1.80 / 15.00]; R_SPF_FAIL(1.00)[-all]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[thechauhan.dev:s=google]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[thechauhan.dev]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-riscv@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::529:from]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-riscv@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[thechauhan.dev:+] X-Rspamd-Queue-Id: 4T7xXv1C7bz49Zv Hi all, What is the best way to call a function (like a per-cpu setup function = from a driver) on remote CPUs in an SMP machine? I looked at the different IPIs defined but there isn=E2=80=99t one that = does this. Could anyone please point me where else to look? Thanks Regards Himanshu From nobody Mon Jan 8 15:21:26 2024 X-Original-To: freebsd-riscv@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T7yTJ1tDlz563Tm for ; Mon, 8 Jan 2024 15:21:40 +0000 (UTC) (envelope-from bojan.novkovic@kset.org) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T7yTH41xTz4NQt for ; Mon, 8 Jan 2024 15:21:39 +0000 (UTC) (envelope-from bojan.novkovic@kset.org) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bojan.novkovic@kset.org designates 209.85.128.42 as permitted sender) smtp.mailfrom=bojan.novkovic@kset.org Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40d41555f9dso22475715e9.2 for ; Mon, 08 Jan 2024 07:21:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704727298; x=1705332098; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IX99DZ9IibJyo6gI6tJBfG2p86d+cUuLHbdSlD75uUM=; b=Tf8ibzmfas9X2gSD35aPit/EkqxqxyhT8YDD5woYnnprD45mdP/N/QNY3xCfdr+o1l 61l6P7Afu4S+wwtjCs6Z0MWNnE8fKaTvLmeqQa6/+SzWwIzmN7eUBy6/8sZeyHjrFKRL Z4A6sef8L5XvZ8rUSPQr0ZsZFiWtch3q+iisUsYn4nSGKuXVdy0b++27FYDBrjr4stbJ G6b4v7xv5XSmOlF9CxtRdUQ9McCMuW/KBk0yQZ/dvEgdz8pNVbbfzwnyfOVGMd+8gGIP draXuEAZn0QNvBjW0XbSKamnXgpGqDpksgp8vf3rAL/Q0vDNWVXPTOTsC5twy1tKciLE 6ZfQ== X-Gm-Message-State: AOJu0YyrN5FPnkNxIX/ZBUstFB+a+jphGPcNZXyvkartB4bnGEbpAn0v 9XtXPDJyFkcoUgYeVdrlMl0UQyNULpPiJIsAigkHuL3/q/b9fJpO X-Google-Smtp-Source: AGHT+IEkc8mqW83O0FtV6dPRynbEtu1rlRIoyptoqQn+teWWVZFBwBN4u0mHm4d2NFQ+4sXQCvullw== X-Received: by 2002:a7b:ce90:0:b0:40d:7fbe:e966 with SMTP id q16-20020a7bce90000000b0040d7fbee966mr2082305wmj.40.1704727297816; Mon, 08 Jan 2024 07:21:37 -0800 (PST) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com. [209.85.208.47]) by smtp.gmail.com with ESMTPSA id u7-20020a1709067d0700b00a26b057df46sm3979982ejo.126.2024.01.08.07.21.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jan 2024 07:21:37 -0800 (PST) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-555aa7fd668so2126718a12.0 for ; Mon, 08 Jan 2024 07:21:37 -0800 (PST) X-Received: by 2002:a50:ccd1:0:b0:557:2069:db87 with SMTP id b17-20020a50ccd1000000b005572069db87mr2090388edj.57.1704727297540; Mon, 08 Jan 2024 07:21:37 -0800 (PST) List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-riscv@freebsd.org X-BeenThere: freebsd-riscv@freebsd.org MIME-Version: 1.0 References: <7A8DC6C8-9582-455C-B05D-9F24838A9070@thechauhan.dev> <9992B290-04CA-485C-A79B-5CDFC8AA917D@fer.hr> In-Reply-To: <9992B290-04CA-485C-A79B-5CDFC8AA917D@fer.hr> From: =?UTF-8?Q?Bojan_Novkovi=C4=87?= Date: Mon, 8 Jan 2024 16:21:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Calling a function on other CPUs in an SMP machine To: himanshu@thechauhan.dev Cc: freebsd-riscv@freebsd.org Content-Type: multipart/alternative; boundary="0000000000000254be060e70c185" X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[bnovkov@freebsd.org,bojan.novkovic@kset.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.42:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCPT_COUNT_TWO(0.00)[2]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-riscv@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_NONE(0.00)[]; FROM_NEQ_ENVFROM(0.00)[bnovkov@freebsd.org,bojan.novkovic@kset.org]; ARC_NA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-riscv@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.42:from,209.85.208.47:received] X-Rspamd-Queue-Id: 4T7yTH41xTz4NQt --0000000000000254be060e70c185 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 8, 2024 at 3:49=E2=80=AFPM Himanshu Chauhan wrote: > What is the best way to call a function (like a per-cpu setup function fr= om a driver) on remote CPUs in an SMP machine? > > The 'smp_rendezvous{_cpu}' functions in 'sys/smp.h' are what you are looking for. They are not listed in the manpages, but you can find more information about them in 'kern/subr_smp.c'. Bojan --0000000000000254be060e70c185 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jan 8, 2024 at 3:49=E2=80=AFPM=C2= =A0Himanshu Chauhan <himanshu@thechauhan.dev> wrote:
What is the best way to call= a function (like a per-cpu setup function from a driver) on remote CPUs in= an SMP machine?
The 'smp_rendezvous{_= cpu}' functions in 'sys/smp.h' are what you are looking for.
They are not listed in the manpages, but you can find more inf= ormation about them in 'kern/subr_smp.c'.

= Bojan
--0000000000000254be060e70c185-- From nobody Mon Jan 8 18:52:24 2024 X-Original-To: freebsd-riscv@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T838k1HFkz56R0W for ; Mon, 8 Jan 2024 18:52:38 +0000 (UTC) (envelope-from himanshu@thechauhan.dev) Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T838j5LmPz4G1Z for ; Mon, 8 Jan 2024 18:52:37 +0000 (UTC) (envelope-from himanshu@thechauhan.dev) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-28beb1d946fso1922522a91.0 for ; Mon, 08 Jan 2024 10:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thechauhan.dev; s=google; t=1704739956; x=1705344756; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=K1YAGTHWFN0FJRV5Z3XZcmoRlST6MuciKESggMZjnNw=; b=fqehgdeW0rPxPpwF5zvc64jJfwMQBW3beBPZ+5Sue+X+gP8G2KEg8y4CFDM2rcXaPR RRfx1HOE1nSYcZ5D0rLuT6OgzQxMDO6UnDhLc3jVwz4u6iDAdXr8Z34WYD0Monr9QV1m KxHgN4zYOeyCXE9213F3w5R/hzlboE1ZVC3GCk5BFbB2L5pAeNzsDvPTUigR0WfieInl 0kcvtSqXRqQ+dsNfESnW/CglgzqR7mSZWIK9awhSIBhbbQoSpQ4e1LYOAjIvcGh6RfTk Vv2/86vvyccrk1Qtl9uAj2ZQoayGhPNyKvTKPnnwApm0V/xdeHCiRtaUNuW+j4VQagpf GRkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704739956; x=1705344756; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K1YAGTHWFN0FJRV5Z3XZcmoRlST6MuciKESggMZjnNw=; b=ZmPqSMOg0tiVChdPbI3DDVsOogOpXOPkzh19kOI4uq95Ch8VulnE2bVlNBiyrWSb2C j+jOverE+k0JlrROyK32QBAvBMqwBQlZk4UT+AgUtw97ihQb4uFDmzLbUZtWs/sWgbS+ szLzt3cDBLWdz9N2JwiiAglSm3bsSWYH6f21FpB3ZXKqnGbTBeL/zJDacmki37B378k+ QcYxGExtsGrH3bZGD2GRotXrXX5lXrXP3pHDRMbYdbZTw58p17GGXT239ro9q0O235qK nsslrQ0HjT+72wx6bPO92dtWp9kyF8ycHSKlcbIsSVzJNSsyWh91iLPxptsMrZCQQ+Ok aZmw== X-Gm-Message-State: AOJu0YxHiO32gxAuHp/389PbQbi16M9Z4/NcR1lBbZiYkmCBCRKnWxkM 97/t0ktKDosTNdCA7/g9EMmBSkI6hUMFtWYoFkmPnS5QQkNf X-Google-Smtp-Source: AGHT+IFjqq3z8vPVeRGa7su+7Z1ZblIOJf5pqcND6mOidrc2qK33czMRDRqH3+jYsrCQE4HP9HbzxmSWygp5LYeVO84= X-Received: by 2002:a17:90b:e96:b0:28d:5078:636a with SMTP id fv22-20020a17090b0e9600b0028d5078636amr1312759pjb.46.1704739955930; Mon, 08 Jan 2024 10:52:35 -0800 (PST) List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-riscv@freebsd.org X-BeenThere: freebsd-riscv@freebsd.org MIME-Version: 1.0 References: <7A8DC6C8-9582-455C-B05D-9F24838A9070@thechauhan.dev> <9992B290-04CA-485C-A79B-5CDFC8AA917D@fer.hr> In-Reply-To: From: Himanshu Chauhan Date: Tue, 9 Jan 2024 00:22:24 +0530 Message-ID: Subject: Re: Calling a function on other CPUs in an SMP machine To: =?UTF-8?Q?Bojan_Novkovi=C4=87?= Cc: freebsd-riscv@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4T838j5LmPz4G1Z X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Thanks! That's exactly what I was looking for. Regards Himanshu On Mon, 8 Jan 2024 at 20:51, Bojan Novkovi=C4=87 wrot= e: > > On Mon, Jan 8, 2024 at 3:49=E2=80=AFPM Himanshu Chauhan wrote: >> >> What is the best way to call a function (like a per-cpu setup function f= rom a driver) on remote CPUs in an SMP machine? > > The 'smp_rendezvous{_cpu}' functions in 'sys/smp.h' are what you are look= ing for. > They are not listed in the manpages, but you can find more information ab= out them in 'kern/subr_smp.c'. > > Bojan