From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anup Patel Date: Wed, 6 Mar 2019 03:55:04 +0000 Subject: [U-Boot] [PATCH v2 1/9] riscv: add infrastructure for calling functions on other harts In-Reply-To: <20190305225331.1353-2-lukas.auer@aisec.fraunhofer.de> References: <20190305225331.1353-1-lukas.auer@aisec.fraunhofer.de> <20190305225331.1353-2-lukas.auer@aisec.fraunhofer.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > -----Original Message----- > From: Lukas Auer > Sent: Wednesday, March 6, 2019 4:23 AM > To: u-boot at lists.denx.de > Cc: Atish Patra ; Anup Patel > ; Bin Meng ; Andreas > Schwab ; Palmer Dabbelt ; > Alexander Graf ; Lukas Auer > ; Anup Patel ; Rick > Chen > Subject: [PATCH v2 1/9] riscv: add infrastructure for calling functions on other > harts > > Harts on RISC-V boot independently, U-Boot is responsible for managing > them. Functions are called on other harts with smp_call_function(), which > sends inter-processor interrupts (IPIs) to all other available harts. Available > harts are those marked as available in the device tree and present in the > available_harts mask stored in global data. The available_harts mask is used > to register all harts that have entered U-Boot. Functions are specified with > their address and two function arguments (argument 2 and 3). The first > function argument is always the hart ID of the hart calling the function. On > the other harts, the IPI interrupt handler handle_ipi() must be called on > software interrupts to handle the request and call the specified function. > > Functions are stored in the ipi_data data structure. Every hart has its own > data structure in global data. While this is not required at the moment (all > harts are expected to boot Linux), this does allow future expansion, where > other harts may be used for monitoring or other tasks. > > Signed-off-by: Lukas Auer > --- > > Changes in v2: > - Remove unneeded quotes from NR_CPUS Kconfig entry > - Move memory barrier from send_ipi_many() to handle_ipi() > - Add check in send_ipi_many so that IPIs are only sent to available harts as > indicated by the available_harts mask Reviewed-by: Anup Patel Regards, Anup