Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp619817rdb; Thu, 1 Feb 2024 20:55:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFR2c6t2fI9VfU1i/Ij+hD9IjYq9luJLRdhUONUcL0Yo/NOEF/GB+Sb+VzpUWZjRvwdCd35 X-Received: by 2002:a17:902:e808:b0:1d8:ac08:3cb7 with SMTP id u8-20020a170902e80800b001d8ac083cb7mr5113693plg.33.1706849718727; Thu, 01 Feb 2024 20:55:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706849718; cv=pass; d=google.com; s=arc-20160816; b=NQgJn3ePkeEBfjjDUMhOrDSaT8ytk2mEuvZQa+PMliiOBJ7+4lqQHXOMH7TR9U0XJd HOVJlrimTU/V2DGhBbh0xo1luWGtL0HqR3gARhcB8aW/ETuYkgMjmv5mZ6vHiJYCqgUW vTHv97NiDGWqkvQHtd7H4ucGGH7C7EJZ6gLEqo8Fk3RKmNnPMDCHsY1VICOof1/xDk6U jGZXlu2Y2LvKY83y7i1AnfGbl0Hxbp4uFBMJ6+8n2AO5xOd0K8tIfI2aabZQjGvuyKgb DJ7pSyWC8eNiZDDtqNj6+nzrQI2GnWLjF+CwPi3EoHtzhb5IVXyO9rUmPX2aDs3lpR93 1mzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ELOUzOOhC9OHyQkXGZvP+NJh1VjcNaclpZjQdZoL1A0=; fh=6Cw/eXafWWw/0CB8sC6+Y4y9CQdSmn0/yVWbyCb03lY=; b=wti3iHa1U3j3cza/Z4xqpWLymaqpolT5RyRwwzaoiNQ53d6fDIMQ+D5K0KgCs74AZX TIbxpoJyWamu1ZfKetTSzD2bFxMXNcWZ4iPV1gbLDRSbV+fzIciEu+070s05HG4J61e3 MsV/6VQXj7WK+AILOoVsBK8xgHXaTcj7Rfmqn+r6yLpyOtBGVNHWl6xXFoiabQ/wsukp nycd8WbO+MUvq3wZdv/f/3uaZxqKOP6lWnlqdun5B1qUURIDRquXPrz6DrT7waHUkDgT D+e3+41yIoodV5PJReCo+YO2e+KweNY3hR4mE+JnEc2ZKzDeyQt9zYnSL3oveHZ2q/LY 5AEw==; 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=0rgjYIYO; 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-49203-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49203-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVKHx0vF7QkLl53oBfITYh3Swhq5D4kF416dADjGwbRuqW6HQPvL1mgdj9aIWYvqmJoQffYXrMbxTOb1LX4P1Drr8GMQTcCO89cbdPLiw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id iy5-20020a170903130500b001d93b748a55si1045731plb.25.2024.02.01.20.55.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 20:55:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49203-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=0rgjYIYO; 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-49203-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49203-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 661E829009A for ; Fri, 2 Feb 2024 04:55:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AC51F9E2; Fri, 2 Feb 2024 04:55:14 +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="0rgjYIYO" Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (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 494DBF9C1 for ; Fri, 2 Feb 2024 04:55:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706849713; cv=none; b=iHBGD3lMGKkRRqMFJzN9tzOGnpnnmkRNpVV6apTQAMX4qNM2nc4KikTiIzrJ50qAYewuXQu0/giy+OGHAJa+9g+rC3fJ0CMoXwZb0+Uvbb+EFFH+kG84L+m7IAaPlltRuJ7JVM46PDqYhCHyaW5anUVYEc5t8EsbjF2ClU0D35o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706849713; c=relaxed/simple; bh=7imjS2FoGObcyVs1TM+uIHz410qo+QrRZakHKZ02XOQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I67+/cDC8PXXFeRXDNCsXMqUxvd3Y2i3ugVePXT3NNi4KfAL6+Z/oCzgzRRFSspG+2Ufd4sEPNJzJ8yUCVEtIMp0m5XjHV4OP2ZsEEEuyYLPjEBTniTUtd6qC+toPpRrQnSMbImk+j7/inWy8VbJoQTeMf+bIROByudKXExs/Ms= 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=0rgjYIYO; arc=none smtp.client-ip=209.85.167.182 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-oi1-f182.google.com with SMTP id 5614622812f47-3be48947186so890218b6e.3 for ; Thu, 01 Feb 2024 20:55:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706849710; x=1707454510; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ELOUzOOhC9OHyQkXGZvP+NJh1VjcNaclpZjQdZoL1A0=; b=0rgjYIYOiDNWbgJZlX36YLVhaAKmnnmxQecmD4tGCItz6KTFjNy9FHLtUm+CX7A50g XpKNj1FZ09IHtUJjzeVNJBredpZmdB3m4b8zE3IZxjAULsmgAgsjjUv97czHWFRNZZmm NEC7SfjWDDnL2WmpWzVUHyAUectg3iAnEUjDBs5yotjn5YUn/g4kSmagVR26+2ut0bwL 5N4/nyjMW7Npvw9DWPEs2udnKj3sAnamStn2VusQExmZKzAJWgzSlQ9ZhFZ8fwGCqlCK IqRy4b8tpGbeZf3WlQX+/Zq4+yjIxwy8czi4wMc+VWGfgqyiroREuIXX+WIf7npav2aX b2PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706849710; x=1707454510; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ELOUzOOhC9OHyQkXGZvP+NJh1VjcNaclpZjQdZoL1A0=; b=fxcFZV7/+bmmxg9SvzrUf8+YPhrXqNjSfvyzLt0ZX3ti2hq2jyDrjHkMpy9l5NdDQ5 am3MsE+2V+SeldCFQjQdn2FOYyq8BwXAkIOZITvhHcAnkt9kNvjWOomOdbuPwjPSU3mG SUhgXI0o0HBi637cizA24iojp0dFaOCkntHijtToRSSTNn4Dlm8ShEKKUStEJ+hW+nh1 E9qfFnbSCbQUDRhbbEpXeabBruByiBdy7T4ZmMe+Cil/aKc/ghPw1TAfQ5a95s9kiUDQ WS7tdP8TDwRzJp/biNP83qOR+o0sT6o5uOyQ2+ImWtBxr8uhollWB4X6GF+tKMhUtPgc OD6w== X-Gm-Message-State: AOJu0YzLofCwG/PYera0gnBS5EFTplpiLso/tlR5Seek/hD13tKGtOx9 iYqXZbYcCsAofM85upsEH6cdAmZsfsnoziqaDSVTokI/jc+AKihnhG0yUIEflOE= X-Received: by 2002:a05:6808:15a4:b0:3bf:bc6b:ffe2 with SMTP id t36-20020a05680815a400b003bfbc6bffe2mr1626440oiw.38.1706849710167; Thu, 01 Feb 2024 20:55:10 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXaIf8VPRQDhUIzj9+k0XKjsZEiQYNzBqS4trMRWGdzWHRfcc5fnSubNMHCLB+ryltPFubGHu/4zhzI9lj4QStL/fLyHWw6PrWOsa6ex5MyDoZ/mIFU8HIo6AC33CxXKahoaWNJTpytH1PApkRRMjt1wOqnvCOwIQq9g6DIabmrLG4ZKljwS7lvit5Hb9M36Bgwj4Nb/Rty7QvZ+5PX1nTCdMb0Ia8VOdaEomzdshXyYwriOTp4y6rujYkM+6TlbnZ+8Z6XyT+uGp9PfzLEn9Zt7aTcRQ== Received: from ghost ([2601:647:5700:6860:e95e:e3b9:1925:927a]) by smtp.gmail.com with ESMTPSA id j24-20020a62b618000000b006dd850bbd21sm617636pff.36.2024.02.01.20.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 20:55:09 -0800 (PST) Date: Thu, 1 Feb 2024 20:55:06 -0800 From: Charlie Jenkins To: Elliot Berman Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang , Evan Green , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] riscv: Disable misaligned access probe when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS Message-ID: References: <20240201-disable_misaligned_probe_config-v2-0-77c368bed7b2@rivosinc.com> <20240201-disable_misaligned_probe_config-v2-2-77c368bed7b2@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 01, 2024 at 08:31:10PM -0800, Elliot Berman wrote: > Hi Charlie, > > On Thu, Feb 01, 2024 at 03:30:46PM -0800, Charlie Jenkins wrote: > > When CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is selected, the cpus can be > > set to have fast misaligned access without needing to probe. > > > > Signed-off-by: Charlie Jenkins > > --- > > arch/riscv/Kconfig | 1 + > > arch/riscv/include/asm/cpufeature.h | 7 + > > arch/riscv/include/asm/misaligned_access_speed.h | 29 +++ > > arch/riscv/kernel/Makefile | 3 + > > arch/riscv/kernel/cpufeature.c | 255 ---------------------- > > arch/riscv/kernel/misaligned_access_speed.c | 265 +++++++++++++++++++++++ > > arch/riscv/kernel/sys_hwprobe.c | 4 + > > 7 files changed, 309 insertions(+), 255 deletions(-) > > > > diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile > > index f71910718053..8be7f17da9ab 100644 > > --- a/arch/riscv/kernel/Makefile > > +++ b/arch/riscv/kernel/Makefile > > @@ -62,6 +62,9 @@ obj-y += tests/ > > obj-$(CONFIG_MMU) += vdso.o vdso/ > > > > obj-$(CONFIG_RISCV_MISALIGNED) += traps_misaligned.o > > +ifneq ($(RISCV_EFFICIENT_UNALIGNED_ACCESS), y) > > Should this be CONFIG_RISCV_EFFICIENT_UNALIGNED_ACCESS ? Oh thank you Elliot! Yes it is. I was going back and forth on whether I wanted this to be CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS or CONFIG_RISCV_EFFICIENT_UNALIGNED_ACCESS and I must have mistyped when I was changing it. I settled on CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS everywhere else so this should also use that instead. These two configs are effectively the same since the only way to select CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is by selecting CONFIG_RISCV_EFFICIENT_UNALIGNED_ACCESS. - Charlie > > > +obj-y += misaligned_access_speed.o > > +endif > > obj-$(CONFIG_FPU) += fpu.o > > obj-$(CONFIG_RISCV_ISA_V) += vector.o > > obj-$(CONFIG_RISCV_ISA_V) += kernel_mode_vector.o