Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp868024lqh; Thu, 28 Mar 2024 21:47:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuuGe/zhVF0NmZhODMusmJYva7qJDFNJ8l4Y3OVrVHrSIFKpDrFN6jtIMjw25GdTeQoFPt9fxhsCOx2jTIsBW6Fd51DKM7VPLbIVk84Q== X-Google-Smtp-Source: AGHT+IGi9VEy4w2YPiYUEebhbm/V8a8lHrivbDmOFTKhYFbreId3N4C5XEQme3o4tcSkTbwKP9tI X-Received: by 2002:a05:6830:81:b0:6e6:a1a4:a312 with SMTP id a1-20020a056830008100b006e6a1a4a312mr1302857oto.38.1711687653452; Thu, 28 Mar 2024 21:47:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711687653; cv=pass; d=google.com; s=arc-20160816; b=M1UwJv1K8YwKoDFqBAumIo1RaDysmDN0lHx1xulS+SSqvvLCWWexecvM+jkkz2+1pN cKCfhX7qUFkNDPeG3NdnaGLvvM5R/JAUd6uFIxFfO7blCqIibjVCv7KNSEGe0yYO3HoN 2gThoaaong86e59VIJarNJyeO3A9axL8XULn8+358ukAnSoi3mSYvZcwbRzSV52d6zVC JpVQ9yhz63m+fcnVNd0DsWx6FKyY88/1HmOJqTLpo08TDDIOcy6jmxQ2YRIa1I9QcGWq vTp75zuplauVOhPN88Ump8cH/dFoRGUv/E720IHUkJ3fhUe7R+C68i0xuY/kkV8v5Zz8 2ATQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qng37K3M8eikqBpPaGOFEE/tLaKw4gdTCP/Sk21HmlA=; fh=vw9dr8MIKziOeQLWCPDorvaCrdVL8iYDYvk6PQlk67U=; b=hZ0C+jXtfTmb2R6ld9Y30MpIZyCk1NTzQ6jPO5wvSqOHueuhLXCXhkKZIK1rhTX3JA 4/EJH8IgYUCGqYnZco8zX14RoC0mXGQR/oc8Rb8aeN9M50trlbdFYrSzuPH4i0uiaCQ4 7xcRNvGr21JnqZeRUpaiyt5XkprE3z6MCwrIWjhZCB7aGcJmvfPGWgsBfjdCO+mQrIzG 8jMsufA8b7py+GMf6D9AtoeLdTMSyHYQTi1KFAq6x7cPCIgTEDxp9dX4x1ScdVKVk2Fy d8IWuUE9Zp3Lkk33BCGQhrxTUYPh0dSsK5+bmBOTsG/8+NmMh/k+uuC13H2SaVmB2t+e Z6eg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=PFSrz0GA; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-124120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124120-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m2-20020a638c02000000b005dd99dbfe0bsi3058078pgd.892.2024.03.28.21.47.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 21:47:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=PFSrz0GA; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-124120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124120-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9B9D1B21931 for ; Fri, 29 Mar 2024 04:46:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 356CE3B298; Fri, 29 Mar 2024 04:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="PFSrz0GA" Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (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 B524D3A268 for ; Fri, 29 Mar 2024 04:45:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711687557; cv=none; b=JtLwjJENgl1PNoxLtdDn8+BvrUFSUbyyfkzbkQgzNNkXjTj9GlpEGyz0Bz5bLGL6sDteRaJDf1jovbpgYFC6QizswqZ2UwDXr3R93ytIBGH5FnzH//oLLK7rl4BmE6Fgt1cvYRiEBQVviz88M7+5WT7hWgm+mvCirpRiQ7V89AU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711687557; c=relaxed/simple; bh=vRWXVEM9xb56Q7Mqdkjo9sVJAKe9N+KayoZj+4xiEu4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NFR9je8r6OqKatPf4uVzsSGNkhT4VkiAGdWIDTswB1ePUEg1+1yJsEDPCu/mq9onwdDw+cEjbMnELt46kTzOCIET5x5JHAznm00HZkGtTxHb1cgz1oX6QcVY4KW6nWULypTgc83P5GEPrJ4GlPqOl4BIs1t2CoiLY3u70Uo465E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=PFSrz0GA; arc=none smtp.client-ip=209.85.160.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-229cbc52318so930935fac.2 for ; Thu, 28 Mar 2024 21:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1711687555; x=1712292355; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qng37K3M8eikqBpPaGOFEE/tLaKw4gdTCP/Sk21HmlA=; b=PFSrz0GAlS1qzLSphEL23gAKOoeuyFLtO460hM2DUsZ1Wtj0OL/2SfltZz19LMce7g geeWgOmdboFMxPHDA+cDubL4AEycxll8vwv7FOt3eFPUfARBRZtBeBrKbc2QxFpnPzuf 5gBq9atL0zBkzdNOn6sEjiJ+PJ/nhwLjuYffRuefY7MkmVMAcCO0KQD2Wunf+8oQmR24 aQ0S6xhJwNKfI2lFRnwuDRxf6W1JnkrDj7m8SR5Za657/8cfFYfNBy3wtnIJ7IGx8ziD hUl9YERhTrhc+2dMglZO2kCrJOT4a7gtG+yBWQGPnI/irNLvZoqbVJLThXJFHy5fKU4l 3tZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711687555; x=1712292355; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qng37K3M8eikqBpPaGOFEE/tLaKw4gdTCP/Sk21HmlA=; b=N159oH90Hlms9vryLh5Jx7JJ/9Eex5UgpwKU1kF4kbva80eNgki9IMJNMXjCEyqQvd xTp3p3Bh0oFOGZDh/qnjEjKC5FXRLZSl7zBHu1POkfuQo43SRNBZ8yef0mTiYC3ULztU W4VRCp7DTzKgqWVV2sMbJaUWLJfSjCm54bc1nFXlNt0Oo3ByMSbimg6+g4gB6UoTvGCp A7TzCfv+rfgqh5k17wonbGUYB50Kv4FnuoLUqsyDEhOvr6z9MzNiMiWSIHu+VIsBXOss xuvFvFLfDJORq8a6wYM8p+y180Qo5ITuMaYdbnJ7QOwR5w1KHxijfnPE1fipoQmQvbB3 7xwQ== X-Forwarded-Encrypted: i=1; AJvYcCUX4Z3P4nOxGqi5MsyBEAZBmVHlggs4/qCVzigEvoL4slqZ52nvJos85G6KikwHLZ9q9Z6ksItTsN+s41QKUe4Ixr33Afn0LkdJi4iG X-Gm-Message-State: AOJu0YzyHm9+rdxleR9XQW1f6Ry0SBx1ZcasEviG5JShiZ3CS8M6Fvs4 YGCi4kdppiq3yazvWMskN3QS76sD839dWMd+bwvjbjy4fAPKn3lCr0qrN0bYvMk= X-Received: by 2002:a05:6871:4096:b0:229:9cb5:4fe3 with SMTP id kz22-20020a056871409600b002299cb54fe3mr1713256oab.14.1711687554880; Thu, 28 Mar 2024 21:45:54 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id i18-20020aa78b52000000b006ea7e972947sm2217120pfd.130.2024.03.28.21.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 21:45:54 -0700 (PDT) From: Deepak Gupta To: paul.walmsley@sifive.com, rick.p.edgecombe@intel.com, broonie@kernel.org, Szabolcs.Nagy@arm.com, kito.cheng@sifive.com, keescook@chromium.org, ajones@ventanamicro.com, conor.dooley@microchip.com, cleger@rivosinc.com, atishp@atishpatra.org, alex@ghiti.fr, bjorn@rivosinc.com, alexghiti@rivosinc.com, samuel.holland@sifive.com, palmer@sifive.com, conor@kernel.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: corbet@lwn.net, tech-j-ext@lists.risc-v.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, oleg@redhat.com, akpm@linux-foundation.org, arnd@arndb.de, ebiederm@xmission.com, Liam.Howlett@oracle.com, vbabka@suse.cz, lstoakes@gmail.com, shuah@kernel.org, brauner@kernel.org, debug@rivosinc.com, andy.chiu@sifive.com, jerry.shih@sifive.com, hankuan.chen@sifive.com, greentime.hu@sifive.com, evan@rivosinc.com, xiao.w.wang@intel.com, charlie@rivosinc.com, apatel@ventanamicro.com, mchitale@ventanamicro.com, dbarboza@ventanamicro.com, sameo@rivosinc.com, shikemeng@huaweicloud.com, willy@infradead.org, vincent.chen@sifive.com, guoren@kernel.org, samitolvanen@google.com, songshuaishuai@tinylab.org, gerg@kernel.org, heiko@sntech.de, bhe@redhat.com, jeeheng.sia@starfivetech.com, cyy@cyyself.name, maskray@google.com, ancientmodern4@gmail.com, mathis.salmen@matsal.de, cuiyunhui@bytedance.com, bgray@linux.ibm.com, mpe@ellerman.id.au, baruch@tkos.co.il, alx@kernel.org, david@redhat.com, catalin.marinas@arm.com, revest@chromium.org, josh@joshtriplett.org, shr@devkernel.io, deller@gmx.de, omosnace@redhat.com, ojeda@kernel.org, jhubbard@nvidia.com Subject: [PATCH v2 03/27] riscv/Kconfig: enable HAVE_EXIT_THREAD for riscv Date: Thu, 28 Mar 2024 21:44:35 -0700 Message-Id: <20240329044459.3990638-4-debug@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240329044459.3990638-1-debug@rivosinc.com> References: <20240329044459.3990638-1-debug@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit riscv will need an implementation for exit_thread to clean up shadow stack when thread exits. If current thread had shadow stack enabled, shadow stack is allocated by default for any new thread. Signed-off-by: Deepak Gupta --- arch/riscv/Kconfig | 1 + arch/riscv/kernel/process.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index e3142ce531a0..7e0b2bcc388f 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -149,6 +149,7 @@ config RISCV select HAVE_SAMPLE_FTRACE_DIRECT_MULTI select HAVE_STACKPROTECTOR select HAVE_SYSCALL_TRACEPOINTS + select HAVE_EXIT_THREAD select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU select IRQ_DOMAIN select IRQ_FORCED_THREADING diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 9a85c9d4c902..d864eef5a10d 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -195,6 +195,11 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) return 0; } +void exit_thread(struct task_struct *tsk) +{ + return; +} + int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) { unsigned long clone_flags = args->flags; -- 2.43.2