Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1269420lqb; Thu, 18 Apr 2024 05:26:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwt2GmS7anouhdwqg3P2SFdwO6aIFm2C1rD0fcPFnTcny/Nze8mimcwH98P/42jHM4EQUzYU/DJVjuxbEz0e9UCnxkcaiU05R+fcWyFg== X-Google-Smtp-Source: AGHT+IEUh5JX69MHMYnS9dPWMpTtjTbZ6kSG0qluaFf/J/GX55fhd0bdS0xcqwfAJHz/dEnNSVMs X-Received: by 2002:a0c:ea34:0:b0:6a0:4180:26be with SMTP id t20-20020a0cea34000000b006a0418026bemr2390820qvp.7.1713443190614; Thu, 18 Apr 2024 05:26:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713443190; cv=pass; d=google.com; s=arc-20160816; b=WKh3MWQwloMIpyzqShDkjmGZkAmIaGiGQZTGP2gnh2LuHM80Zb4CdEqbo4FNLOwIBF O11yI33NBXWvxoXMFY9xgCKKfq6KwUUpGcrvWokweDIkVtWY1Z+ZOMNo+e61CvXfNG7h U2dIeWIAiwJ471isqNTjeKROi8gqUgNv3kyCghfe4ICPRX44RLvkdOJlnr+1V9Q4aiBZ kbpVEEaPexm2lZqdp4Bt5gBXuSpNt6DDm90m+tBtDBSAe5WR9INGIiLsC7Ak3eCf8e/E jIeAnu9DmqMTBCZOkDoCosMDzIDVAZfn8zwQ6lnKcPNssEajYNxkT009Dausxt/M6JLO w0+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=I/UmS13xtcMZDnEIpdmRzkPPXx3eO/KfzcsngCuc2tk=; fh=vb8Sp2aeyX1gQun1t2E/e3GXKvGnx9yEGC1kXw9I5e4=; b=so9i4ydW6r/3abw3CHP/sdHZb3tfh1wfLCUt/TCGhG7Sw1NpX/UD6QaXvZ7Y6z7CvG Cb+tdYUV4y9Uox6oq/o5/A8euqSvSIiQoj2IdhJ3ggfWol6LcLry1b8sjuoF4tieFFp6 yqO4xh2ajuBb3alAwRNOFpMgh5ha5BZ4QYKTpFsqWRyJIn0QQO/5M5y2T9trnrQ0hvi3 cVkKdGYxfbq+3ImmiMkIhMS7ny+4G2LL7aSYQPN4MmDbWtdbFxTFq/oh1XfmmV+6ZCpC 7f4SkxJ1AjTvHzetJcdQVji62rdNZYO80530ztPZJccNkztaPzvHaWHOGhtRCXjsn7hs cRcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=H4ps8HvI; arc=pass (i=1 spf=pass spfdomain=vrull.eu dkim=pass dkdomain=vrull.eu); spf=pass (google.com: domain of linux-kernel+bounces-150055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150055-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6-20020a0562140d4600b0069b19c7ec13si1357714qvr.100.2024.04.18.05.26.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:26:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=H4ps8HvI; arc=pass (i=1 spf=pass spfdomain=vrull.eu dkim=pass dkdomain=vrull.eu); spf=pass (google.com: domain of linux-kernel+bounces-150055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150055-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 588561C20B31 for ; Thu, 18 Apr 2024 12:26:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B01F615F405; Thu, 18 Apr 2024 12:26:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vrull.eu header.i=@vrull.eu header.b="H4ps8HvI" Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 718F715DBD6 for ; Thu, 18 Apr 2024 12:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713443185; cv=none; b=b9ZKaFyFP95Zuwb0F4wFwuphrvZ+MXvCdkcKHgs5V2c62tRhazhh7PYTAmuDy7F4zkQUHnU0Zc6E7fReW5bJ9fbNQS15+lhIlStbOQxNYTwcX6LUcBho9LUzlDH5YFrtRnt05hA9OxXyReTVbSbntRsGvln4SYFiH6KPHc8b9Z0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713443185; c=relaxed/simple; bh=8Sqp6mnN9+p83BJR/N5uCLmE2eq/TDMhfHYkKeqrloc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=p2PqDFmHkhyep/A5Rk4axl6hVWeMWrEjcuEhVO3feCncPHTQQ+Dm4qKtBn6n4nEe3JXVz0uUnKGFtJPvymWzvW8J9kROGI5hMwfjGF+YPV3f6l+4wVGnbxhIEOMfvyGKCDefwjNrnucKfN/EKa0GMsyBTUwhJV2g5dvSHx+bc8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=vrull.eu; spf=pass smtp.mailfrom=vrull.eu; dkim=pass (2048-bit key) header.d=vrull.eu header.i=@vrull.eu header.b=H4ps8HvI; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2a7e19c43faso616194a91.2 for ; Thu, 18 Apr 2024 05:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1713443184; x=1714047984; darn=vger.kernel.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=I/UmS13xtcMZDnEIpdmRzkPPXx3eO/KfzcsngCuc2tk=; b=H4ps8HvISpLZ36Qdg4EwdGgojWSYCz5a8fQFNke6GiY4bMHRxiK8h1P0Kx/gowo43f uQGuKJyFkeSzR/1iwfGYXbMGHJ+qBt7WrUV2IVIwGgQeFyzBjPD/k9Nc+QXzB5+d8P7o rhlB4NtiIJgM6F7Or8KJprQHDwJrs4mjE9cxjVRhNzRlVL/ap3iORwR+Cf5x0PA1mUZ4 fRVNwmo1nQkDDdsyOwKAvlkwwpwvUMB3q3Vxgsnn1KWLdkar9Yj6lInzVzVjnQ8VFSwy 2t5Yd+QBMzB3Fgz9tIMyhaMqoIBFG2uoTVw2P85VKwZDN7XOskND5+46Vvpu5Cr+BZHd xWgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713443184; x=1714047984; 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=I/UmS13xtcMZDnEIpdmRzkPPXx3eO/KfzcsngCuc2tk=; b=WT9jRSYmckyvu5XUk57CBWYsqvOCgAg3N04CeK3pDihetemBBc3fAcuXW8sqO5pSo8 IUcLInYBoLZonkovmZTbzFxvYVPsx1GhNo8IauDVShRmGkemM1i99TTGGwQe7+MrGxOg VR/o5eB7DJlPEx0/0EFf+19IfPw7MP0uMx0/2cFQlCBTWBoTWqStyI0m9gKj8O8Be9w0 KrAtE87cA9AH7SieFPp6r7vEC7Xoai75Gx/H/mL6nOabY5MaB3Urx90kYNhIz6j0rBde rxu04S4xD5V0BAkwnNU6AxDeNKBIMj2vB8uz/OwjksEMASM8YGuKcn5zWD9mQLwCpCUw OJHQ== X-Forwarded-Encrypted: i=1; AJvYcCUClcKc1NyMXXUPyNM4LCvoS9pA/QLAlMpgTeEKMhJ9JugA7zkTzyVrxrko1nm7A1o3vc+QnHduASvzrc6e/v5f2IOU0nsZoDq9WkTI X-Gm-Message-State: AOJu0YwPUnrZSa7NualPkWNojYqXUwwJCQmAzkYCqIZE/KGMSpkiSuki z/svlXmVGwkb2xgAswXdyz/TFFY1j7CY0asye+Oz8h52KjSaVGM5++aZ6MoAixGDbTOTh8R4ayw xGYe/pGMLTYyGxUAZspxPqrwizgtFl+weqgdCrw== X-Received: by 2002:a17:90a:a106:b0:2a5:2be6:3ff5 with SMTP id s6-20020a17090aa10600b002a52be63ff5mr2495695pjp.21.1713443183703; Thu, 18 Apr 2024 05:26:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240418114942.52770-1-luxu.kernel@bytedance.com> In-Reply-To: <20240418114942.52770-1-luxu.kernel@bytedance.com> From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Thu, 18 Apr 2024 14:26:12 +0200 Message-ID: Subject: Re: [RFC 0/2] riscv: Idle thread using Zawrs extension To: Xu Lu Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, andy.chiu@sifive.com, guoren@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, lihangjing@bytedance.com, dengliang.1214@bytedance.com, xieyongji@bytedance.com, chaiwen.cc@bytedance.com, Andrew Jones , Conor Dooley Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 18, 2024 at 1:50=E2=80=AFPM Xu Lu w= rote: > > This patch series introduces a new implementation of idle thread using > Zawrs extension. This overlaps with the following series: https://lore.kernel.org/all/20240315134009.580167-7-ajones@ventanamicro.c= om/ BR Christoph > > The Zawrs[0] extension introduces two new instructions named WRS.STO and > WRS.NTO in RISC-V. When software registers a reservation set using LR > instruction, a subsequent WRS.STO or WRS.NTO instruction will cause the > hart to stall in a low-power state until a store happens to the > reservation set or an interrupt becomes pending. The difference between > these two instructions is that WRS.STO will terminate stall after an > implementation-defined timeout while WRS.NTO won't. > > This patch series implements idle thread using WRS.NTO instruction. > Besides, we found there is no need to send a real IPI to wake up an idle > CPU. Instead, we write IPI information to the reservation set of an idle > CPU to wake it up and let it handle IPI quickly, without going through > tranditional interrupt handling routine. > > [0] https://github.com/riscv/riscv-zawrs/blob/main/zawrs.adoc > > Xu Lu (2): > riscv: process: Introduce idle thread using Zawrs extension > riscv: Use Zawrs to accelerate IPI to idle cpu > > arch/riscv/Kconfig | 24 +++++++ > arch/riscv/include/asm/cpuidle.h | 11 +--- > arch/riscv/include/asm/hwcap.h | 1 + > arch/riscv/include/asm/processor.h | 31 +++++++++ > arch/riscv/include/asm/smp.h | 14 ++++ > arch/riscv/kernel/cpu.c | 5 ++ > arch/riscv/kernel/cpufeature.c | 1 + > arch/riscv/kernel/process.c | 102 ++++++++++++++++++++++++++++- > arch/riscv/kernel/smp.c | 39 +++++++---- > 9 files changed, 205 insertions(+), 23 deletions(-) > > -- > 2.20.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv