From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 190C121CC4A for ; Tue, 10 Jun 2025 08:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749544355; cv=none; b=PXq+zjGUt1r/QCNF4RaXjSlnW5KrwkeNZ1vY+bDG4xrWE86/wlYEA3VuWP6Pl98WSgVcXI+v6JNJNFyO75RybHNuA5o5U6tWUbOTCMhiMyVfft0kf8dOZzmKbbB55fnlbRWeytp7jMrpiUPOiJFA+vhVKNnzbW4xnCB4H4EzkRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749544355; c=relaxed/simple; bh=l8Y4r9MGAhL+1QYrflRZpR2G0HHOcBdF6gCSjvgujs4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Hi52Q5VM6TWt/bqpFBZ2qOOR1xiG/+u3/EqQgHhRUBqpm39wfguE/vB9I6uSpV6bLdiwrKxqRX5Ui7I9Z/3RE2Eq2TrR378X83FUTuBUgjEecjMym6zAA00DEqB5e0uv9E9909tR6ngED6//7DMHuQ5xMhrpfgq+xdcIgcF14M0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=nov2F1o5; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="nov2F1o5" Date: Tue, 10 Jun 2025 10:32:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1749544339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bXQheftAQ39YV+WhThrh+6a/P9QjNT7PuajEJay5IMQ=; b=nov2F1o5ZiG7xNJ6c3T5U9DOAfnyHrDeZWVGyGim4Z4GlUXYZH1tIzM8XmIOs41c3rT6p2 ivX9zAWa+0QOk9oMGkI9JztqKAdg7+3QFVQddmdDiuvyztJ0WQwpyMoj/l02V3tPJno1HE kl3IlyvNigy8lG2VFF+ReKB0cRuC2bo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Andrew Jones To: Jesse Taube Cc: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, Atish Patra , Palmer Dabbelt , =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Himanshu Chauhan , Anup Patel , Charlie Jenkins Subject: Re: [PATCH v4] riscv: sbi: Add SBI Debug Triggers Extension tests Message-ID: <20250610-c3dda7f117f889a8da55b092@orel> References: <20250606194503.2857119-1-jesse@rivosinc.com> Precedence: bulk X-Mailing-List: kvm@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: <20250606194503.2857119-1-jesse@rivosinc.com> X-Migadu-Flow: FLOW_OUT On Fri, Jun 06, 2025 at 12:45:03PM -0700, Jesse Taube wrote: > Add tests for the DBTR SBI extension. > > Signed-off-by: Jesse Taube > --- > V1 -> V2: > - Call report_prefix_pop before returning > - Disable compressed instructions in exec_call, update related comment > - Remove extra "| 1" in dbtr_test_load > - Remove extra newlines > - Remove extra tabs in check_exec > - Remove typedefs from enums > - Return when dbtr_install_trigger fails > - s/avalible/available/g > - s/unistall/uninstall/g > V2 -> V3: > - Change SBI_DBTR_SHMEM_INVALID_ADDR to -1UL > - Move all dbtr functions to sbi-dbtr.c > - Move INSN_LEN to processor.h > - Update include list > - Use C-style comments > V3 -> V4: > - Include libcflat.h > - Remove #define SBI_DBTR_SHMEM_INVALID_ADDR > --- > lib/riscv/asm/sbi.h | 1 + > riscv/Makefile | 1 + > riscv/sbi-dbtr.c | 811 ++++++++++++++++++++++++++++++++++++++++++++ > riscv/sbi-tests.h | 1 + > riscv/sbi.c | 1 + > 5 files changed, 815 insertions(+) > create mode 100644 riscv/sbi-dbtr.c > > diff --git a/lib/riscv/asm/sbi.h b/lib/riscv/asm/sbi.h > index a5738a5c..78fd6e2a 100644 > --- a/lib/riscv/asm/sbi.h > +++ b/lib/riscv/asm/sbi.h > @@ -51,6 +51,7 @@ enum sbi_ext_id { > SBI_EXT_SUSP = 0x53555350, > SBI_EXT_FWFT = 0x46574654, > SBI_EXT_SSE = 0x535345, > + SBI_EXT_DBTR = 0x44425452, > }; > > enum sbi_ext_base_fid { > diff --git a/riscv/Makefile b/riscv/Makefile > index 11e68eae..55c7ac93 100644 > --- a/riscv/Makefile > +++ b/riscv/Makefile > @@ -20,6 +20,7 @@ all: $(tests) > $(TEST_DIR)/sbi-deps += $(TEST_DIR)/sbi-asm.o > $(TEST_DIR)/sbi-deps += $(TEST_DIR)/sbi-fwft.o > $(TEST_DIR)/sbi-deps += $(TEST_DIR)/sbi-sse.o > +$(TEST_DIR)/sbi-deps += $(TEST_DIR)/sbi-dbtr.o > > all_deps += $($(TEST_DIR)/sbi-deps) > > diff --git a/riscv/sbi-dbtr.c b/riscv/sbi-dbtr.c > new file mode 100644 > index 00000000..b254f84e > --- /dev/null > +++ b/riscv/sbi-dbtr.c > @@ -0,0 +1,811 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * SBI DBTR testsuite > + * > + * Copyright (C) 2025, Rivos Inc., Jesse Taube > + */ > + > +#include > +#include > +#include > +#include > + > +#include "sbi-tests.h" The includes should have the asm/ headers grouped separately below the non-asm, and we typically use alphabetic order because of OCD issues, except for libcflat.h, which typically comes first, since it's a mess of stuff, and the idea is to order from most general to most specific. So, #include #include #include #include #include "sbi-tests.h" But don't respin for just this change. I'm still hoping we'll get more reviews of the tests wrt the spec (which I haven't yet done). If we don't get anymore reviews in a week or so then I'll find some time for it. Thanks, drew