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--