From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 17692207DE7 for ; Wed, 15 Jan 2025 09:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934996; cv=none; b=obdSQEPbTbrgFsm8WeL8NfJLG/Bx1Ry0MltTnwHX8coJuUNiMS1cD5ee0A7KeE8bJ0NBzZZSRqqdS2zYclrVjPoUTwUN7eGcO2TbeaRRPiZCTam4x5Lg60ImNIrEDuRiaKLGQyTKeBDcrpB9MwQ0/B8vuBl61dSirIHzWLHm6FI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934996; c=relaxed/simple; bh=L870qFo0KOkpZT6XBmlzKlVirLwOYgi92uROEl98Vuw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YGOQS/znKCxc6ZfmATye8aVw4fUyD0ja2JkK3cAoJFxkpduYraCFIR/jTmdB2nlBPVjhr4TVoRL2gcsWJbQuZnXLhMvJ7jvHouO4u8eY++HnLxPJb2tlSk9+jrKM8xfKC9Gn9KTN0ifE0FQ+siIa8sJ5EVuAkMdnKDivVsMmFaU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=fGrqq/xO; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="fGrqq/xO" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-386329da1d9so3313671f8f.1 for ; Wed, 15 Jan 2025 01:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1736934993; x=1737539793; 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=5Ke3Xx/wtgubyAhgh9gm7HdjX/OGZn6UodYiywkGpxs=; b=fGrqq/xOK23x9G8CxKhPRFtPpqC3LYoMwdQEC10E2OMSjm14W8+suQO+UVQjs1sK9h H8/lucJd4TNYPXH8kwrrOh5VUfNhf6GlUQ2b+aNQKR8LJ0KpBsbwFpsILxKBrdqGQ228 fYuviOqruvx4aPkDableuCf6iBvlg74aV72YER8EvDmUbM6M720tc1pvyuGycSCZmeKv ppwpU9x/41uX2DVaKMLWKzRUCRvGOKgOC/m7zU0ulXQcLv1y5lIJVC0FfX0be6CWUTGC +GdyjnpKmInvj3apu8PtiB/jdu3E59A2R3m/Gfdrljhufg5qNt+uYGlnTpjaBGuiRUxd aEpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736934993; x=1737539793; 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=5Ke3Xx/wtgubyAhgh9gm7HdjX/OGZn6UodYiywkGpxs=; b=jMXx9+lxLKMQfoAJ2g2tUBD0plOiJty+YDuL/5g1tm0jRoIFpW6J6xtMZFQkOfv70W Pe25I/xBDB5Arqu8muD1E86+fmerLqYVwgL3z1eHX2TPmPlnbS2QCUTSlB4PokvEK2bW +7/oFcNerQ087nPnp3+UAmvnMI34Vf4yi9Dj63olbQBN5KAZXSYSwIR70H8mG+kxYhgZ ApTMYaCGpu5TI1XzDE4cwgwwygxwZkFau189ByOvWeN6vbINTK4VuV7EcCa93SYVZn8P foMVNmWhGaccw7cUMgKFQFps8Qu7AtNWgnUQq28tPuJEyptJIDJmKu20JHR8ECYkPSJL ol0A== X-Forwarded-Encrypted: i=1; AJvYcCVE+4sagJx9lf/T/nttpPPn3wnw40k6HULSEfgcNU+CX6e3vTHIJ+l2oEiHhqGGkKYetJBnhclLoCM7HcE=@vger.kernel.org X-Gm-Message-State: AOJu0YyuYfXPUHOKTF0tUaEOYyXPKv/vqhfUrrYVM9JlLuFmhJNFJ1/E /Rsgxa5RK20jD4RwNcgZ15lzV8tLyXPlmsB8oIKN/bK8wLmLO4o9ONsBEWwvDUM= X-Gm-Gg: ASbGncuCr4kyOQZoD46zEtwNYbqBERmx7JGFFYSbicRAvYT5JB6rOSNlV3+qlSFv6V+ s2xFyO21lcXaQlDXnLb2D80LpiPimLCYxP9HzDRzBuY1kKmALbUU1zyqlD0Rsddrpr9BlEKwO/R awa98UM73SSnVyw+cCiJjuE1hlQe8hescgzwQdzDnGt+hMkVX1NcASfbDWbX61Zha2OFsY1vM04 5/WxjUBKc8DVPkEqg+OfcVkxpsixohfTRlGIEZg+m4VrXXlCmkG+BIWDrWQhRm3Mj+xtu1h/sNE 8tgQjYuWOx9zmuykcTpzYgRi2Ysb0m8oybILie6h5g== X-Google-Smtp-Source: AGHT+IENVizyrpTDaL6AXD65KcGWw+5Em2NxzXA8Eh98pJFESDPN89Pap+1V8u237LVHxYhDj/sKOA== X-Received: by 2002:a05:6000:184e:b0:385:f560:7911 with SMTP id ffacd0b85a97d-38a872c93e3mr25276895f8f.10.1736934993168; Wed, 15 Jan 2025 01:56:33 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c749989asm17783685e9.2.2025.01.15.01.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2025 01:56:31 -0800 (PST) Date: Wed, 15 Jan 2025 10:56:31 +0100 From: Andrew Jones To: Celeste Liu Cc: Oleg Nesterov , Paul Walmsley , Palmer Dabbelt , Eric Biederman , Kees Cook , Shuah Khan , Albert Ou , Alexandre Ghiti , "Dmitry V. Levin" , Andrea Bolognani , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Thomas Gleixner , Ron Economos , Charlie Jenkins , Quan Zhou , Felix Yan , Ruizhe Pan , Guo Ren , Yao Zi , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= Subject: Re: [PATCH v5 2/2] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access Message-ID: <20250115-9a1a8e824977f49770a5358e@orel> References: <20250115-riscv-new-regset-v5-0-d0e6ec031a23@coelacanthus.name> <20250115-riscv-new-regset-v5-2-d0e6ec031a23@coelacanthus.name> <20250115-28c95808502d43f84b3fe0a6@orel> <17dfb122-4ae3-477f-93a8-1748b819c59c@coelacanthus.name> 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: <17dfb122-4ae3-477f-93a8-1748b819c59c@coelacanthus.name> On Wed, Jan 15, 2025 at 05:41:57PM +0800, Celeste Liu wrote: > On 2025-01-15 17:14, Andrew Jones wrote: > > On Wed, Jan 15, 2025 at 04:24:59AM +0800, Celeste Liu wrote: ... > >> +#ifndef sizeof_field > >> +#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) > >> +#endif > >> +#ifndef offsetofend > >> +#define offsetofend(TYPE, MEMBER) \ > >> + (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER)) > >> +#endif > > > > I think this is the sixth test to define these. We should copy > > include/linux/stddef.h into tools/include. We already have > > tools/include/uapi/linux/stddef.h with __struct_group and > > __DECLARE_FLEX_ARRAY, so I think it should just work. > > Agreed. But it may be better to be a separate patchset > so we can change those definition in different selftests > one pass. > I think a separate "copy stddef.h" patch could be in this series to avoid having to add the defines here. Then, another series can be sent with one patch for each conversion. That said, I'm OK with adding the defines for now and doing the conversion later. I just hope it will actually happen. Thanks, drew