From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA806D1038E for ; Fri, 25 Oct 2024 02:32:05 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4XZRd01mDTz2xY0; Fri, 25 Oct 2024 13:32:04 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2404:9400:2221:ea00::3" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1729823524; cv=none; b=es8ohsZTI6covSmH2qOPkRVV27VkO8h8VJvDtZ1eRulHvKMxupFgckAxRc/Ch2sBibsrRq4M3pXVtsN814RhGmQDtGi1o0tIqK9sS1Bu80fp06J1Ekxv6mqad9Uke0/TetmP5bVmtdlSWPFNA0MH+CdKlSelxazBLhiMHEyBOWFn+f207xyv9CKfNyFS7ewcS1w2P1pTy/Hy7SYkhxQLBdIlgt1fZhOEHRIlgzJilNGMn31H5XEKjFwfhKl22nKbpZjN6/3JlhX/hjcp7w678sJQY+bEl2BKnzDpx5a8MNnXkawBxgqxfVcXqKEXmB+LS+guBLNawgIghN0D35dX4g== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1729823524; c=relaxed/relaxed; bh=DLqU6vLdekjlRZZCwD9gnIJ2B6/IvBjWioyusl6prfI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=IfbtNI0r3I9lhYHXmbgZVYzCXvj+ZAv5QfSZXpUCu3FRC3ayViMHe30eoY4qJnsOpY586vRvZzW9DLf5VjjXbwTRyx438mPnj5OamN1E6V2qw6je/OZ1faT060V2y/mqei5YLQTMjMJlOXC1raLCcXnY8T71SZjR4vXvvIW/PNqzdnZTQnTaKQjacjkChEeqCipdXZ4KwQWQ72qAnjtDCIICTU+cyWkHIgWIo7WvHrTN9xUvIyVrqyfKunZBGwb/io+/c1oay4Wa/iSXrHvvs1A1HJN6jOqmJnXkYc173CvGO6mwgMXrpJkwmFeGkQEoPq6/yGoTODQ3+KjL8+nv6Q== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=qwZfTYwt; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=qwZfTYwt; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4XZRcx164bz2xXL for ; Fri, 25 Oct 2024 13:32:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1729823519; bh=DLqU6vLdekjlRZZCwD9gnIJ2B6/IvBjWioyusl6prfI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=qwZfTYwt5+TDD7JV1w1VeSXVFG4at6tB2CJKZfLFDHiuL+8Tj/HdLd3uvgNl2lUjb qNdvLa+SjqmKhoN/dZwYs5ioQ2nbPg7CAm07MX6k/f8e+tfKYJJnZ2+72P9HvFpw3Z l1vY6FuN0zooFJdb24eKQ1OpGUI1DspLYEnqMrGjTFR1JrHtV0gAsOIveR6maiCxQh DssoSvCHTOdb/SkSscMzA2YlyfnX8HFR5jU69Q2GV98bQVQuYhUAedqrA+yGtWfy7I rdZaNIuG95vmcEHAjVKbB+QYR2xqpFZdifpMZuSloLYs4i2GFegjHmUrsVy3e5yZHj uRV4nKHCoMZ2A== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.ozlabs.org (Postfix) with ESMTPSA id 4XZRcv1wQGz4wb1; Fri, 25 Oct 2024 13:31:59 +1100 (AEDT) From: Michael Ellerman To: Mukesh Kumar Chaurasiya Cc: npiggin@gmail.com, christophe.leroy@csgroup.eu, naveen@kernel.org, maddy@linux.ibm.com, peterx@redhat.com, groug@kaod.org, sshegde@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/xmon: symbol lookup length fixed In-Reply-To: References: <20241023212225.1306609-2-mchauras@linux.ibm.com> <878que2u2i.fsf@mail.lhotse> Date: Fri, 25 Oct 2024 13:32:00 +1100 Message-ID: <87a5eskj4v.fsf@mail.lhotse> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Mukesh Kumar Chaurasiya writes: > On Thu, Oct 24, 2024 at 10:42:12AM +0530, Mukesh Kumar Chaurasiya wrote: >> On Thu, Oct 24, 2024 at 12:00:53PM +1100, Michael Ellerman wrote: >> > Mukesh Kumar Chaurasiya writes: >> > > Currently xmon cannot lookup symbol beyond 64 characters in some cases. >> > >> > Can you mention which commands? It looks like it's "ls" and "lp". >> Sure. >> > >> > > Fix this by using KSYM_NAME_LEN instead of fixed 64 characters. >> > > >> > > Signed-off-by: Mukesh Kumar Chaurasiya >> > > --- >> > > arch/powerpc/xmon/xmon.c | 6 +++--- >> > > 1 file changed, 3 insertions(+), 3 deletions(-) >> > > >> > > diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c >> > > index e6cddbb2305f..22b8b5cc4df0 100644 >> > > --- a/arch/powerpc/xmon/xmon.c >> > > +++ b/arch/powerpc/xmon/xmon.c >> > > @@ -3662,7 +3662,7 @@ symbol_lookup(void) >> > > int type = inchar(); >> > > unsigned long addr, cpu; >> > > void __percpu *ptr = NULL; >> > > - static char tmp[64]; >> > > + static char tmp[KSYM_NAME_LEN]; >> > >> > I think you could use the existing tmpstr buffer. >> > >> > It is global so it's a little hard to track down all the users, but I >> > think it's only used briefly in get_function_bounds(), >> > xmon_print_symbol() and scanhex(). ie. none of the uses persist across >> > function calls. >> > >> > We don't want to have two 512 byte static arrays lying around if we can >> > get by with one. >> > >> > cheers >> Sure. > For now i don't think so we can get by with only one. There is a lookup being > done when the scanhex is using the tmpstr for another lookup. Yeah I see it, when handling `lp `. That's a bit annoying because for that command the CPU number is only meant to be a number, it never makes sense to do a $symbol lookup there. But I agree with the way the code is structured it's best not to reuse tmpstr there. cheers