Skip to contentSkip to conversation

Updates for ARC, LMBench

PATCH New Vineet Gupta 4 participants 16 messages May 10, 2021 – May 20, 2021 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

v3 cover Updates for ARC, LMBench

Hi,

There'a cosmetic fix for ARC to show the -mcpu in config. And there's a bunch of histtoric patches in out github repo to get LMBench running.

Changes since v2
- Added another LMBench fix (to lat_rpc)
- Added -mcpu for all ARC CPUs as suggested by Peter

Thx,
-Vineet

Vineet Gupta (4):
ARC: config: explicit'ify -mcpu for cpu selection
lmbench: memsize: increase delay for slow FPGAs
lmbench: emulate --prefix to avoid scattering binaries all over
lmbench: lat_rpc: fix stray pointer

 arch/Config.in.arc                            | 14 +++++-----
 ...c-to-prevent-memsize-from-timingout-.patch | 28 +++++++++++++++++++
 ...bage-pointer-for-lat_rpc-S-localhost.patch | 25 +++++++++++++++++
 package/lmbench/lmbench.mk                    |  9 +++++-
 4 files changed, 68 insertions(+), 8 deletions(-)
 create mode 100644 package/lmbench/0003-TOO_LONG-100-usec-to-prevent-memsize-from-timingout-.patch
 create mode 100644 package/lmbench/0004-Fix-garbage-pointer-for-lat_rpc-S-localhost.patch
Signature · 1 line
2.25.1
#1 lore raw

PATCH v3 1/4 ARC: config: explicit'ify -mcpu for cpu selection

This helps with distinguishing the cpu at the time of config selection

---
 arch/Config.in.arc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/Config.in.arc +7 -7
index f7a6d920b50d..c9a695000f2c 100644
@@ -6,20 +6,20 @@ choice
 	    Specific CPU to use
 
 config BR2_arc750d
-	bool "ARC 750D"
+	bool "ARC 750D (-mcpu=arc700)"
 
 config BR2_arc770d
-	bool "ARC 770D"
+	bool "ARC 770D (-mcpu=arc700)"
 
 config BR2_archs38
-	bool "ARC HS38"
+	bool "ARC HS38 (-mcpu=archs)"
 	help
 	  Generic ARC HS capable of running Linux, i.e. with MMU,
 	  caches and 32-bit multiplier. Also it corresponds to the
 	  default configuration in older GNU toolchain versions.
 
 config BR2_archs38_64mpy
-	bool "ARC HS38 with 64-bit mpy"
+	bool "ARC HS38 with 64-bit mpy (-mcpu=hs38)"
 	help
 	  Fully featured ARC HS capable of running Linux, i.e. with
 	  MMU, caches and 64-bit multiplier.
@@ -28,7 +28,7 @@ config BR2_archs38_64mpy
 	  for use this one.
 
 config BR2_archs38_full
-	bool "ARC HS38 with Quad MAC & FPU"
+	bool "ARC HS38 with Quad MAC & FPU (-mcpu=hs38_linux)"
 	help
 	  Fully featured ARC HS with additional support for
 	   - Dual- and quad multiply and MC oprations
@@ -38,12 +38,12 @@ config BR2_archs38_full
 	  ARChitect.
 
 config BR2_archs4x_rel31
-	bool "ARC HS48 rel 31"
+	bool "ARC HS48 rel 31  (-mcpu=hs4x_rel31)"
 	help
 	   Build for HS48 release 3.1
 
 config BR2_archs4x
-	bool "ARC HS48"
+	bool "ARC HS48 (-mcpu=hs4x)"
 	help
 	   Latest release of HS48 processor
 	   - Dual and Quad multiply and MAC operations
Signature · 1 line
2.25.1
#2 lore raw

PATCH v3 1/4 ARC: config: explicit'ify -mcpu for cpu selection

Vineet, All,

On 2021-05-10 11:00 -0700, Vineet Gupta via buildroot spake thusly:

Quoted 12 lines

This helps with distinguishing the cpu at the time of config selection

---
 arch/Config.in.arc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/Config.in.arc +0 -0
index f7a6d920b50d..c9a695000f2c 100644

arch/Config.in.arc choice · line 9

Quoted 5 lines
arch/Config.in.arc +1 -1
@@ -6,20 +6,20 @@ choice
 	    Specific CPU to use
 
 config BR2_arc750d
-	bool "ARC 750D"
+	bool "ARC 750D (-mcpu=arc700)"

We are not doing this for any other architecture.

Besides, if this ever has to change, that would be two places where we'd have to update the setting, and these prompts are just informative, so they are prone to be missed.

It always possible to get that vaue, anyway, with:

    $ make printvars VARS=BR2_GCC_TARGET_%
    BR2_GCC_TARGET_CPU="arc700"

Regards,
Yann E. MORIN.

Quoted 49 lines
arch/Config.in.arc +6 -6
 config BR2_arc770d
-	bool "ARC 770D"
+	bool "ARC 770D (-mcpu=arc700)"
 
 config BR2_archs38
-	bool "ARC HS38"
+	bool "ARC HS38 (-mcpu=archs)"
 	help
 	  Generic ARC HS capable of running Linux, i.e. with MMU,
 	  caches and 32-bit multiplier. Also it corresponds to the
 	  default configuration in older GNU toolchain versions.
 
 config BR2_archs38_64mpy
-	bool "ARC HS38 with 64-bit mpy"
+	bool "ARC HS38 with 64-bit mpy (-mcpu=hs38)"
 	help
 	  Fully featured ARC HS capable of running Linux, i.e. with
 	  MMU, caches and 64-bit multiplier.
@@ -28,7 +28,7 @@ config BR2_archs38_64mpy
 	  for use this one.
 
 config BR2_archs38_full
-	bool "ARC HS38 with Quad MAC & FPU"
+	bool "ARC HS38 with Quad MAC & FPU (-mcpu=hs38_linux)"
 	help
 	  Fully featured ARC HS with additional support for
 	   - Dual- and quad multiply and MC oprations
@@ -38,12 +38,12 @@ config BR2_archs38_full
 	  ARChitect.
 
 config BR2_archs4x_rel31
-	bool "ARC HS48 rel 31"
+	bool "ARC HS48 rel 31  (-mcpu=hs4x_rel31)"
 	help
 	   Build for HS48 release 3.1
 
 config BR2_archs4x
-	bool "ARC HS48"
+	bool "ARC HS48 (-mcpu=hs4x)"
 	help
 	   Latest release of HS48 processor
 	   - Dual and Quad multiply and MAC operations
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v2 2/3 lmbench: increase memsize delay for slow FPGAs

In reply to Vineet Gupta
---
 ...c-to-prevent-memsize-from-timingout-.patch | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/lmbench/0003-TOO_LONG-100-usec-to-prevent-memsize-from-timingout-.patch
package/lmbench/0003-TOO_LONG-100-usec-to-prevent-memsize-from-timingout-.patch new file +28 -0
new file mode 100644
index 000000000000..6c3e7370e11b
@@ -0,0 +1,28 @@
+From d85b61666aa2728f68b69d02bfb162c432df709f Mon Sep 17 00:00:00 2001
+From: vgupta <vgupta@4eed8e25-bc12-0410-818a-f70ee6866280>
+Date: Sat, 3 Mar 2012 10:02:24 +0000
+Subject: [PATCH] TOO_LONG 100 usec to prevent memsize from timingout @80Mhz
+
+git-svn-id: http://sjvm-subversion02.internal.synopsys.com/svn/OSS/ARC_Linux/tests/lmbench-3.0-a9 at 157318 4eed8e25-bc12-0410-818a-f70ee6866280
+
+Signed-off-by: Vineet Gupta <[email protected]>
+---
+ src/memsize.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/memsize.c b/src/memsize.c
+index eb25a0924872..b333cf8cbd32 100644
+--- a/src/memsize.c
++++ b/src/memsize.c
+@@ -15,7 +15,7 @@ char	*id = "$Id$\n";
+ #define	CHK(x)	if ((x) == -1) { perror("x"); exit(1); }
+ 
+ #ifndef	TOO_LONG
+-#define	TOO_LONG	10	/* usecs */
++#define	TOO_LONG	100	/* usecs */
+ #endif
+ 
+ int	alarm_triggered = 0;
+-- 
+2.25.1
+
Signature · 1 line
2.25.1
#4 lore raw

PATCH v3 2/4 lmbench: memsize: increase delay for slow FPGAs

In reply to Vineet Gupta

otherwise memsize bails out and erroneously reports 1 MB

NOK
----

| />/lmbench/bin/arc/memsize 16
|
| 1

OK
---

| />/lmbench/bin/arc/memsize 16
| 2MB OK3MB OK4MB OK5MB OK6MB OK7MB OK8MB OK9MB OK10MB OK11MB OK12MB OK13MB OK14MB OK15MB OK16MB OK
| 16
---
 ...c-to-prevent-memsize-from-timingout-.patch | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/lmbench/0003-TOO_LONG-100-usec-to-prevent-memsize-from-timingout-.patch
package/lmbench/0003-TOO_LONG-100-usec-to-prevent-memsize-from-timingout-.patch new file +28 -0
new file mode 100644
index 000000000000..6c3e7370e11b
@@ -0,0 +1,28 @@
+From d85b61666aa2728f68b69d02bfb162c432df709f Mon Sep 17 00:00:00 2001
+From: vgupta <vgupta@4eed8e25-bc12-0410-818a-f70ee6866280>
+Date: Sat, 3 Mar 2012 10:02:24 +0000
+Subject: [PATCH] TOO_LONG 100 usec to prevent memsize from timingout @80Mhz
+
+git-svn-id: http://sjvm-subversion02.internal.synopsys.com/svn/OSS/ARC_Linux/tests/lmbench-3.0-a9 at 157318 4eed8e25-bc12-0410-818a-f70ee6866280
+
+Signed-off-by: Vineet Gupta <[email protected]>
+---
+ src/memsize.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/memsize.c b/src/memsize.c
+index eb25a0924872..b333cf8cbd32 100644
+--- a/src/memsize.c
++++ b/src/memsize.c
+@@ -15,7 +15,7 @@ char	*id = "$Id$\n";
+ #define	CHK(x)	if ((x) == -1) { perror("x"); exit(1); }
+ 
+ #ifndef	TOO_LONG
+-#define	TOO_LONG	10	/* usecs */
++#define	TOO_LONG	100	/* usecs */
+ #endif
+ 
+ int	alarm_triggered = 0;
+-- 
+2.25.1
+
Signature · 1 line
2.25.1
#5 lore raw

PATCH v3 2/4 lmbench: memsize: increase delay for slow FPGAs

Vineet, All,

On 2021-05-10 11:00 -0700, Vineet Gupta via buildroot spake thusly:

Quoted 10 lines

otherwise memsize bails out and erroneously reports 1 MB

NOK
----

| />/lmbench/bin/arc/memsize 16
|
| 1

OK
---

This triple-dash line is the usual git marker to end the actual commit log, so everything below was dropped when applying the patch with git-am. I've fixed that, and applied to master, thanks.

However, I wonder how relevant lmbench is nowadays. Indeed, there has been zero activity on lmbench source code since June 2009, almost 12 years ago now...

Regards,
Yann E. MORIN.

Quoted 51 lines
| />/lmbench/bin/arc/memsize 16
| 2MB OK3MB OK4MB OK5MB OK6MB OK7MB OK8MB OK9MB OK10MB OK11MB OK12MB OK13MB OK14MB OK15MB OK16MB OK
| 16
---
 ...c-to-prevent-memsize-from-timingout-.patch | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/lmbench/0003-TOO_LONG-100-usec-to-prevent-memsize-from-timingout-.patch
package/lmbench/0003-TOO_LONG-100-usec-to-prevent-memsize-from-timingout-.patch new file +28 -0
new file mode 100644
index 000000000000..6c3e7370e11b
@@ -0,0 +1,28 @@
+From d85b61666aa2728f68b69d02bfb162c432df709f Mon Sep 17 00:00:00 2001
+From: vgupta <vgupta@4eed8e25-bc12-0410-818a-f70ee6866280>
+Date: Sat, 3 Mar 2012 10:02:24 +0000
+Subject: [PATCH] TOO_LONG 100 usec to prevent memsize from timingout @80Mhz
+
+git-svn-id: http://sjvm-subversion02.internal.synopsys.com/svn/OSS/ARC_Linux/tests/lmbench-3.0-a9 at 157318 4eed8e25-bc12-0410-818a-f70ee6866280
+
+Signed-off-by: Vineet Gupta <[email protected]>
+---
+ src/memsize.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/memsize.c b/src/memsize.c
+index eb25a0924872..b333cf8cbd32 100644
+--- a/src/memsize.c
++++ b/src/memsize.c
+@@ -15,7 +15,7 @@ char	*id = "$Id$\n";
+ #define	CHK(x)	if ((x) == -1) { perror("x"); exit(1); }
+ 
+ #ifndef	TOO_LONG
+-#define	TOO_LONG	10	/* usecs */
++#define	TOO_LONG	100	/* usecs */
+ #endif
+ 
+ int	alarm_triggered = 0;
+-- 
+2.25.1
+
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH v3 2/4 lmbench: memsize: increase delay for slow FPGAs

Hi Yann,

Quoted 6 lines · Yann E. MORIN
Quoted 3 lines

OK
---

This triple-dash line is the usual git marker to end the actual commit log, so everything below was dropped when applying the patch with git-am. I've fixed that, and applied to master, thanks.

Yep I'm aware of that and sorry - there's no easy way to "underline" stuff in a patch :-)

Quoted 3 lines

However, I wonder how relevant lmbench is nowadays. Indeed, there has been zero activity on lmbench source code since June 2009, almost 12 years ago now...

Depends on who you ask. I think it is still relevant for embedded platforms.? Especially when doing new CPU and/or ISA bringup - former we tend to do regularly at Synopsys it gives you a great "snapshot" of performance of 2 systems: old and new. And this is true starting from fork/shell latency to memory latency and bandwidth tests which are still pretty smart for something written so long ago.

Thx for merging the patches.

-Vineet

#7 lore raw

PATCH v3 2/4 lmbench: memsize: increase delay for slow FPGAs

vineet, All,

On 2021-05-17 21:53 +0000, Vineet Gupta spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 6 lines
Quoted 3 lines

OK
---

This triple-dash line is the usual git marker to end the actual commit log, so everything below was dropped when applying the patch with git-am. I've fixed that, and applied to master, thanks.

Yep I'm aware of that and sorry - there's no easy way to "underline" stuff in a patch :-)

Oh yes, there _is_. ;-)

Quoted 9 lines
Quoted 3 lines

However, I wonder how relevant lmbench is nowadays. Indeed, there has been zero activity on lmbench source code since June 2009, almost 12 years ago now...

Depends on who you ask. I think it is still relevant for embedded platforms.? Especially when doing new CPU and/or ISA bringup - former we tend to do regularly at Synopsys it gives you a great "snapshot" of performance of 2 systems: old and new. And this is true starting from fork/shell latency to memory latency and bandwidth tests which are still pretty smart for something written so long ago.

Ah, yes, that makes sense, indeed.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH v3 2/4 lmbench: memsize: increase delay for slow FPGAs

In reply to Vineet Gupta
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vineet" == Vineet Gupta via buildroot <[email protected]> writes:

otherwise memsize bails out and erroneously reports 1 MB NOK
----

| />/lmbench/bin/arc/memsize 16
|
| 1
Quoted 7 lines

OK
---

| />/lmbench/bin/arc/memsize 16
| 2MB OK3MB OK4MB OK5MB OK6MB OK7MB OK8MB OK9MB OK10MB OK11MB OK12MB OK13MB OK14MB OK15MB OK16MB OK
| 16

Committed to 2021.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw

PATCH v3 3/4 lmbench: emulate --prefix to avoid scattering binaries all over

In reply to Vineet Gupta

- moves all lmbench binaries to <target>/lmbench/bin/<ARCH>
- scripts copied to <target>/lmbench/scripts
- scripts/os overwritten to setup "OS" as expected by LMBench runtime scripts

---
 package/lmbench/lmbench.mk | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
package/lmbench/lmbench.mk +8 -1
index 2f3b19b5f820..ed075d20dafe 100644
@@ -36,7 +36,14 @@ define LMBENCH_BUILD_CMDS
 endef
 
 define LMBENCH_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) CFLAGS="$(TARGET_CFLAGS)" OS=$(ARCH) CC="$(TARGET_CC)" BASE=$(TARGET_DIR)/usr -C $(@D)/src install
+	mkdir -p $(TARGET_DIR)/lmbench/tmp
+	mkdir -p $(TARGET_DIR)/lmbench/scripts
+	$(TARGET_MAKE_ENV) $(MAKE) CFLAGS="$(TARGET_CFLAGS)" OS=$(ARCH) CC="$(TARGET_CC)" BASE=$(TARGET_DIR)/lmbench/tmp -C $(@D)/src install
+	mkdir -p $(TARGET_DIR)/lmbench/bin/$(ARCH)
+	mv $(TARGET_DIR)/lmbench/tmp/bin/* $(TARGET_DIR)/lmbench/bin/$(ARCH)
+	rm -rf $(TARGET_DIR)/lmbench/tmp/
+	cp -rfd $(@D)/scripts/ $(TARGET_DIR)/lmbench/.
+	echo "echo ${ARCH}" >  $(TARGET_DIR)/lmbench/scripts/os
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.25.1
#10 lore raw

PATCH v3 3/4 lmbench: emulate --prefix to avoid scattering binaries all over

Quoted 5 lines · On Mon, 10 May 2021 11:00:48 -0700 Vineet Gupta via buildroot…

- moves all lmbench binaries to <target>/lmbench/bin/<ARCH>
- scripts copied to <target>/lmbench/scripts
- scripts/os overwritten to setup "OS" as expected by LMBench runtime scripts

Where are lmbench binaries currently installed? Because /lmbench/ looks really really odd as an installation location.

Thomas

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#11 lore raw

PATCH v3 3/4 lmbench: emulate --prefix to avoid scattering binaries all over

Quoted 10 lines · Thomas Petazzoni
Quoted 5 lines · On Mon, 10 May 2021 11:00:48 -0700 Vineet Gupta via buildroot…

- moves all lmbench binaries to <target>/lmbench/bin/<ARCH>
- scripts copied to <target>/lmbench/scripts
- scripts/os overwritten to setup "OS" as expected by LMBench runtime scripts

Where are lmbench binaries currently installed? Because /lmbench/ looks really really odd as an installation location.

They are currently scattered over in /usr/sbin I think. Indeed /lmbench is non LSB etc, but it is one stop shop if one wanted to remove everything lmbench specific from target rootfs.
I guess one could do /usr/sbin/lmbench/{bin,scripts}

-Vineet

#12 lore raw

PATCH v3 3/4 lmbench: emulate --prefix to avoid scattering binaries all over

Vineet, All,

On 2021-05-10 20:22 +0000, Vineet Gupta via buildroot spake thusly:

Quoted 8 lines · Thomas Petazzoni
Quoted 7 lines
Quoted 4 lines · On Mon, 10 May 2021 11:00:48 -0700 Vineet Gupta via buildroot…

- moves all lmbench binaries to <target>/lmbench/bin/<ARCH>
- scripts copied to <target>/lmbench/scripts
- scripts/os overwritten to setup "OS" as expected by LMBench runtime scripts

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Where are lmbench binaries currently installed? Because /lmbench/ looks really really odd as an installation location.

They are currently scattered over in /usr/sbin I think.

    $ cat output/cat build/lmbench-3.0-a9/.files-list.txt
    lmbench,./usr/bin/bw_file_rd
    lmbench,./usr/bin/bw_mem
    lmbench,./usr/bin/bw_mmap_rd
    [...]
    lmbench,./usr/bin/stream
    lmbench,./usr/bin/timing_o
    lmbench,./usr/bin/tlb
    lmbench,./usr/lib/libmbench.a

That is, everything is in /usr/bin, except for the static library (which gets trimmed away during tsarget-finalize anyway) which is in /usr/lib/.

And apart from the tools and the static library, nothing else is installed, not even a header, so the the static library is only private to lmbench anyway.

Quoted 3 lines

Indeed /lmbench is non LSB etc, but it is one stop shop if one wanted to remove everything lmbench specific from target rootfs.
I guess one could do /usr/sbin/lmbench/{bin,scripts}

But why would you want to enable lmbench, and remove it from target?

So, for me, there is no reason for this patch: lmbench already installs everything in standard locations, and if one does not want lmbench tools on the target, just do not enable the lmbench package to begin with.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#13 lore raw

PATCH v3 4/4 lmbench: lat_rpc: fix stray pointer

In reply to Vineet Gupta
| # ./lat_rpc -S localhost
| potentially unexpected fatal signal 11.
| Path: /lmbench/bin/arc64/lat_rpc
| CPU: 0 PID: 62 Comm: lat_rpc Not tainted 5.6.0-00224-g8e1b159f529e #39
| Invalid Read @ 0x00000001 by insn @ 0x2011f110
|   @off 0x6c110 in [/lib/libc-2.32.so]  VMA: 0x200b3000 to 0x201b8000
| ECR: 0x00050100 EFA: 0x00000001 ERET: 0x2011f110
| STAT32: 0x80081082 [IE U     ]   BTA: 0x2011b87c
|  SP: 0x5fffefe8  FP: 0x00000000 BLK: 0x20103242
| r00: 0x00000001 r01: 0x00000002 r02: 0x00000001
| r03: 0x20101eb0 r04: 0x00000001 r05: 0x00000001
| r06: 0x00000000 r07: 0x00000000 r08: 0x00000001
| r09: 0x2019d8b0 r10: 0x20039fc4 r11: 0x5ffff0f0
| r12: 0x2019d6d0 r13: 0x2019d748 r14: 0x5ffff588
| r15: 0x00000000 r16: 0x00000000 r17: 0x5ffff708
| r18: 0x20039fc0 r19: 0xffffffff r20: 0x201ba010
| r21: 0x00000000 r22: 0x00000000 r23: 0x20039fc0
| r24: 0x00000bd0 r25: 0x00000073

Segmentation fault

---
 ...bage-pointer-for-lat_rpc-S-localhost.patch | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 package/lmbench/0004-Fix-garbage-pointer-for-lat_rpc-S-localhost.patch
package/lmbench/0004-Fix-garbage-pointer-for-lat_rpc-S-localhost.patch new file +25 -0
new file mode 100644
index 000000000000..619ec3861463
@@ -0,0 +1,25 @@
+From 3830453a06269912d2772fe8c31bae44f27bb131 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <[email protected]>
+Date: Fri, 8 May 2015 11:35:58 +0530
+Subject: [PATCH] Fix garbage pointer for lat_rpc -S localhost
+
+Signed-off-by: Vineet Gupta <[email protected]>
+---
+ src/lat_rpc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lat_rpc.c b/src/lat_rpc.c
+index 9c021926d761..ff4380ff38f3 100644
+--- a/src/lat_rpc.c
++++ b/src/lat_rpc.c
+@@ -101,6 +101,7 @@ main(int ac, char **av)
+ 	char	*usage = "-s\n OR [-p <tcp|udp>] [-P parallel] [-W <warmup>] [-N <repetitions>] serverhost\n OR -S serverhost\n";
+ 
+ 	state.msize = 1;
++	state.server = NULL;
+ 
+ 	while (( c = getopt(ac, av, "sS:m:p:P:W:N:")) != EOF) {
+ 		switch(c) {
+-- 
+2.25.1
+
Signature · 1 line
2.25.1
#14 lore raw

PATCH v3 4/4 lmbench: lat_rpc: fix stray pointer

Vineet, All,

On 2021-05-10 11:00 -0700, Vineet Gupta via buildroot spake thusly:

Quoted 18 lines
| # ./lat_rpc -S localhost
| potentially unexpected fatal signal 11.
| Path: /lmbench/bin/arc64/lat_rpc
| CPU: 0 PID: 62 Comm: lat_rpc Not tainted 5.6.0-00224-g8e1b159f529e #39
| Invalid Read @ 0x00000001 by insn @ 0x2011f110
|   @off 0x6c110 in [/lib/libc-2.32.so]  VMA: 0x200b3000 to 0x201b8000
| ECR: 0x00050100 EFA: 0x00000001 ERET: 0x2011f110
| STAT32: 0x80081082 [IE U     ]   BTA: 0x2011b87c
|  SP: 0x5fffefe8  FP: 0x00000000 BLK: 0x20103242
| r00: 0x00000001 r01: 0x00000002 r02: 0x00000001
| r03: 0x20101eb0 r04: 0x00000001 r05: 0x00000001
| r06: 0x00000000 r07: 0x00000000 r08: 0x00000001
| r09: 0x2019d8b0 r10: 0x20039fc4 r11: 0x5ffff0f0
| r12: 0x2019d6d0 r13: 0x2019d748 r14: 0x5ffff588
| r15: 0x00000000 r16: 0x00000000 r17: 0x5ffff708
| r18: 0x20039fc0 r19: 0xffffffff r20: 0x201ba010
| r21: 0x00000000 r22: 0x00000000 r23: 0x20039fc0
| r24: 0x00000bd0 r25: 0x00000073
Quoted 3 lines

Segmentation fault

Applied to master, thanks.

I was going to suggest sending those patches upstream to lmbench, but.... It's dead, Jim.

Regards,
Yann E. MORIN.

Quoted 43 lines
---
 ...bage-pointer-for-lat_rpc-S-localhost.patch | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 package/lmbench/0004-Fix-garbage-pointer-for-lat_rpc-S-localhost.patch
package/lmbench/0004-Fix-garbage-pointer-for-lat_rpc-S-localhost.patch new file +25 -0
new file mode 100644
index 000000000000..619ec3861463
@@ -0,0 +1,25 @@
+From 3830453a06269912d2772fe8c31bae44f27bb131 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <[email protected]>
+Date: Fri, 8 May 2015 11:35:58 +0530
+Subject: [PATCH] Fix garbage pointer for lat_rpc -S localhost
+
+Signed-off-by: Vineet Gupta <[email protected]>
+---
+ src/lat_rpc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lat_rpc.c b/src/lat_rpc.c
+index 9c021926d761..ff4380ff38f3 100644
+--- a/src/lat_rpc.c
++++ b/src/lat_rpc.c
+@@ -101,6 +101,7 @@ main(int ac, char **av)
+ 	char	*usage = "-s\n OR [-p <tcp|udp>] [-P parallel] [-W <warmup>] [-N <repetitions>] serverhost\n OR -S serverhost\n";
+ 
+ 	state.msize = 1;
++	state.server = NULL;
+ 
+ 	while (( c = getopt(ac, av, "sS:m:p:P:W:N:")) != EOF) {
+ 		switch(c) {
+-- 
+2.25.1
+
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#15 lore raw

PATCH v3 4/4 lmbench: lat_rpc: fix stray pointer

In reply to Vineet Gupta
Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vineet" == Vineet Gupta via buildroot <[email protected]> writes:

| # ./lat_rpc -S localhost
| potentially unexpected fatal signal 11.
| Path: /lmbench/bin/arc64/lat_rpc
| CPU: 0 PID: 62 Comm: lat_rpc Not tainted 5.6.0-00224-g8e1b159f529e #39
| Invalid Read @ 0x00000001 by insn @ 0x2011f110
|   @off 0x6c110 in [/lib/libc-2.32.so]  VMA: 0x200b3000 to 0x201b8000
| ECR: 0x00050100 EFA: 0x00000001 ERET: 0x2011f110
| STAT32: 0x80081082 [IE U     ]   BTA: 0x2011b87c
|  SP: 0x5fffefe8  FP: 0x00000000 BLK: 0x20103242
| r00: 0x00000001 r01: 0x00000002 r02: 0x00000001
| r03: 0x20101eb0 r04: 0x00000001 r05: 0x00000001
| r06: 0x00000000 r07: 0x00000000 r08: 0x00000001
| r09: 0x2019d8b0 r10: 0x20039fc4 r11: 0x5ffff0f0
| r12: 0x2019d6d0 r13: 0x2019d748 r14: 0x5ffff588
| r15: 0x00000000 r16: 0x00000000 r17: 0x5ffff708
| r18: 0x20039fc0 r19: 0xffffffff r20: 0x201ba010
| r21: 0x00000000 r22: 0x00000000 r23: 0x20039fc0
| r24: 0x00000bd0 r25: 0x00000073
Quoted 3 lines

Segmentation fault

Committed to 2021.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard