Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp867566lqh; Thu, 28 Mar 2024 21:45:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0AgcKSrf8dvLizXnQNmSI8FrqGuX+B0Eejo54FIWvRnC9GhWLToVywPi6GnIV+KXjD4wcL/gbb+J8MYNOHrnx8Kayn5G3zAkA1G9HBQ== X-Google-Smtp-Source: AGHT+IFToLpPvDSVp/2IUFu5+N4ygDYEtQpOgiYgQxvJUN/Wy/mC0um9M0Fulmrs2MT3FIgtJhzh X-Received: by 2002:a05:6a20:438a:b0:1a3:c883:69fe with SMTP id i10-20020a056a20438a00b001a3c88369femr1217588pzl.3.1711687554063; Thu, 28 Mar 2024 21:45:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711687554; cv=pass; d=google.com; s=arc-20160816; b=VYBTsce+ZC2DL6It88U3isnKyC0lfzJUg9Ms2ogfHmaJ/6d/UuINr54Zm4Ijuc7qqi veGH+4CCB/fbJ8vJ9Ob6wmAhvSQjQJDaxo0BfejdyTEjbS2WXyNRAKbTPwb0DZmuHw2G 3ecdEV+5fwjbI44ULBPUjuLab0btn2QMLFbbUlDOdCXLRcQ9Fehy1mPYhgfVfyGdwOEs xdHLA7efS1JhHv+o3hXto/10DsplgYAHIFvkQykOhoMr9gX7BJ9/f1+bo4+r6BHymuLW xtUERrI1mQfWl5Pop4EYcWymcZX+gm7/hImvfW/Whub9xPFvaIKKddNM7ICBblhLcS6B R78A== 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=3HlYvLaJr4l3bVtwLdV9ET8gn8bkDD3ErKtF/Cp9Ezk=; fh=ItPL7HUhUa9TP57Jo/CVJUJf0jgR9pSorxlmXTUNcOg=; b=lNndZf6bxmI7MAnfbPQXBdZc45tvOLf2hdzPhB/uCWh5Jx192s581MKT2DMVINMaHf UosdPpsTpdC4NRYwhGAx3fFFvMMBvnNim8Z+iXCtE5HZZ1TkuPv/ZKsoHHSpe9/XYOb/ LDAcECvpTn36RLHW7ksg5qeNqG2/xbSVwV33mM/s8zzV3C194nItaY7E+KSBeJaXe/jR ASsBo6Gp4uqxGO6FylllECPvYaXVpT2icSMEz3NrvIJmRxB6/E+STToCxQ3ZnCF0K0Ow obB5Bt6a4v7QT2Lw/kOnQbmrKt735D2nPyK4mXqArR29nYLdnNkllK+7JvVRd+ice5qn MMXA==; 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=u54K+nRe; 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-124119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124119-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y3-20020a17090322c300b001e0b3a4bb84si2910952plg.159.2024.03.28.21.45.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 21:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=u54K+nRe; 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-124119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124119-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4ECB128A714 for ; Fri, 29 Mar 2024 04:45:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 464A63B1AB; Fri, 29 Mar 2024 04:45:23 +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="u54K+nRe" Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 E8F963B79F for ; Fri, 29 Mar 2024 04:45:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711687522; cv=none; b=A7i3LExxEKRMQG1a72Muo7hdA1Hy0U+6NsJqc+g4n3gcfmj9SxxNgBMcVdeEgtPNG7JlpPOconmNS981P2gZfig6epHxbPS0VudSBCoJaAHnCOEM0VPv3TgNWpE8iA4x+Z+bB8ZY2zlvztMUHxo6nRo94Dxx5DoquHrK3spfg1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711687522; c=relaxed/simple; bh=h2y9fFmmx6EsZ6oLRRR8+V7ERys+JFhYFmzE85pUkAY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dAJgFk6uee0BjWfageZsGXfkWUpGQT+M04rKjAZLVWkG0vhWe1EQhTbSMFfAFz4DezudswB3SwosBaTLmBlDLNwdjxr4TIJbPRBMtDc0fhCdoUXqYrR5QVD40VkrnZYmNtW9RuJ0iJ552xIFZEzXCFa8+d28G9ihEAcEGK1zrCw= 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=u54K+nRe; arc=none smtp.client-ip=209.85.210.178 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-pf1-f178.google.com with SMTP id d2e1a72fcca58-6e88e4c8500so1391743b3a.2 for ; Thu, 28 Mar 2024 21:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1711687520; x=1712292320; 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=3HlYvLaJr4l3bVtwLdV9ET8gn8bkDD3ErKtF/Cp9Ezk=; b=u54K+nRelGXPc+EZDYA1XUL/GP9W6FTdzYJCXy3mGERcI9mNLXf8NR7A6NQdrT28Ud r0ML9kBaS6O2IvhZzlbBGn7npvuPxpl24zM9P139WQkOUJ89ygIZrswLB9w5ugk6NC1c j/+JG+s5qpaXHAm8H/qTUXxhdJF+YWxn+/pdqCV2MNkF6OxLBwOL0hrZiZv8KMaTf5jC sVC+pyHzdkjS2ZCTIp7o0FhCe4etlqglqSTAFoOACGwqjgtVHqlrtUxcjOXgbsejFHaR 2ebnUNuGx2hcT8XK6CGZepmrCJSuMtqc2ljMXZya4LUxBzv6xrJU72NNbuQh8moZaX/6 AiPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711687520; x=1712292320; 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=3HlYvLaJr4l3bVtwLdV9ET8gn8bkDD3ErKtF/Cp9Ezk=; b=hKh5t6BNbp1tn7Uu+8mE3xlidrZj623g+DXGpUa/8JB67JFCJcztHL9R9nFMkf7fcn cLNmKBLNtVRvAMeqBs/5/E99ZTNRaYSitw2PI2yklBerfG3HYen4SFvDtDm64zPOMxyg TWhqvhql3TBubVFbDCXLOhQR+bFX3PU3Lg5QKJPpURC+FZANeq0wmhVPJy4TZ97AjiVJ f84AzBRPt1mcevm5JSH/1iUCg0V9tV2e4FSWphBASPwLDg46t0FjH2Zu/On3igi+xfDs O9FUwcmUdojDFWionVQrr0ClHFs03WxcHHmYVtQ4kcRMQNU3dkEMgZJphEm8ameGBxCH n4qA== X-Forwarded-Encrypted: i=1; AJvYcCVXoTw/icLLpGIBJVXkXO1vrn1sBim8HWHwoZDs1wLmS6veDP+QkNPK38/PLTILelilHU0uDU08qyL2e8Ke8qEREYFJ7TZGJSpXcmcg X-Gm-Message-State: AOJu0YyWxQ28lIWJM7RTT2t4gdt5OHKcd4vcDqT9C7mQ1+NARIbWVz/w itFqUoxIPk/mGojW//09jAto1+YTpHVVUVavrh9fFDwzfiNgUiHhCGChyQmfEEM= X-Received: by 2002:a05:6a00:1c85:b0:6ea:c7bb:187b with SMTP id y5-20020a056a001c8500b006eac7bb187bmr1078563pfw.5.1711687520251; Thu, 28 Mar 2024 21:45:20 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 21:45:19 -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 02/27] riscv: define default value for envcfg Date: Thu, 28 Mar 2024 21:44:34 -0700 Message-Id: <20240329044459.3990638-3-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 Defines a base default value for envcfg per task. By default all tasks should have cache zeroing capability. Any future base capabilities that apply to all tasks can be turned on same way. Signed-off-by: Deepak Gupta --- arch/riscv/include/asm/csr.h | 2 ++ arch/riscv/kernel/process.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 2468c55933cd..bbd2207adb39 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h @@ -202,6 +202,8 @@ #define ENVCFG_CBIE_FLUSH _AC(0x1, UL) #define ENVCFG_CBIE_INV _AC(0x3, UL) #define ENVCFG_FIOM _AC(0x1, UL) +/* by default all threads should be able to zero cache */ +#define ENVCFG_BASE ENVCFG_CBZE /* Smstateen bits */ #define SMSTATEEN0_AIA_IMSIC_SHIFT 58 diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 92922dbd5b5c..9a85c9d4c902 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -152,6 +152,7 @@ void start_thread(struct pt_regs *regs, unsigned long pc, else regs->status |= SR_UXL_64; #endif + current->thread_info.envcfg = ENVCFG_BASE; } void flush_thread(void) -- 2.43.2