[PATCH] ARC: perf: map 'ijmptak' to generic 'branches' event

2018-12-17 Thread Eugeniy Paltsev
Map 'ijmptak' event (all jump instructions that are taken)
instead of 'ijmp' event (all jump and branch instructions)
to generic 'branches' event as taken jump is more interesting
metric for us due to the possible significantly greater
overhead of taken jumps.

'ijmptak' event is available on both ARCv1 and ARCv2.

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/include/asm/perf_event.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arc/include/asm/perf_event.h 
b/arch/arc/include/asm/perf_event.h
index 9185541035cc..6958545390f0 100644
--- a/arch/arc/include/asm/perf_event.h
+++ b/arch/arc/include/asm/perf_event.h
@@ -103,7 +103,8 @@ static const char * const arc_pmu_ev_hw_map[] = {
 
/* counts condition */
[PERF_COUNT_HW_INSTRUCTIONS] = "iall",
-   [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmp", /* Excludes ZOL jumps */
+   /* All jump instructions that are taken */
+   [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmptak",
[PERF_COUNT_ARC_BPOK] = "bpok",   /* NP-NT, PT-T, PNT-NT */
 #ifdef CONFIG_ISA_ARCV2
[PERF_COUNT_HW_BRANCH_MISSES] = "bpmp",
-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-17 Thread Christoph Hellwig
On Sat, Dec 15, 2018 at 12:14:29AM +1000, Greg Ungerer wrote:
> Yep, that is right. Certainly the MMU case is broken. Some noMMU cases work
> by virtue of the SoC only having an instruction cache (the older V2 cores).

Is there a good an easy case to detect if a core has a cache?  Either
runtime or in Kconfig?

> The MMU case is fixable, but I think it will mean changing away from
> the fall-back virtual:physical 1:1 mapping it uses for the kernel address
> space. So not completely trivial. Either that or a dedicated area of RAM
> for coherent allocations that we can mark as non-cachable via the really
> course grained and limited ACR registers - not really very appealing.

What about CF_PAGE_NOCACHE?  Reading arch/m68k/include/asm/mcf_pgtable.h
suggest this would cause an uncached mapping, in which case something
like this should work:


http://git.infradead.org/users/hch/misc.git/commitdiff/4b8711d436e8d56edbc5ca19aa2be639705bbfef

> The noMMU case in general is probably limited to something like that same
> type of dedicated RAM/ACR register mechamism.
>
> The most commonly used periperal with DMA is the FEC ethernet module,
> and it has some "special" (used very loosely) cache flushing for
> parts like the 532x family which probably makes it mostly work right.
> There is a PCI bus on the 54xx family of parts, and I know general
> ethernet cards on it (like e1000's) have problems I am sure are
> related to the fact that coherent memory allocations aren't.

If we really just care about FEC we can just switch it do use
DMA_ATTR_NON_CONSISTENT and do explicit cache flushing.  But as far
as I can tell FEC only uses DMA coherent allocations for the TSO
headers anyway, is TSO even used on this SOC?

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] posix/tst-getaddrinfo4: Consider EAI_NODATA as an expected result

2018-12-17 Thread Vineet Gupta
On 7/30/18 3:40 AM, Alexey Brodkin wrote:
> Some proxy DNS servers might not resolve IPv6 names to addresses.
> Instead they reply with NOERROR while passing no real data.
> That combination of NOERROR and EAI_NODATA happen because the DNS
> server has a recored for requested name (example.net in our case)
> but that record is not of  type which was requested.
> 
> That's what Wireshark sees in that case:
> -->8-
> Domain Name System (response)
>Transaction ID: 0x6e2e
>Flags: 0x8180 Standard query response, No error
>1...    = Response: Message is a response
>.000 0...   = Opcode: Standard query (0)
> .0..   = Authoritative: Server is not an authority for 
> domain
> ..0.   = Truncated: Message is not truncated
> ...1   = Recursion desired: Do query recursively
>  1...  = Recursion available: Server can do recursive 
> queries
>  .0..  = Z: reserved (0)
>  ..0.  = Answer authenticated: Answer/authority portion 
> was not authenticated by the server
>  ...0  = Non-authenticated data: Unacceptable
>    = Reply code: No error (0)
>Questions: 1
>Answer RRs: 0
>Authority RRs: 0
>Additional RRs: 0
>Queries
>example.net: type , class IN
>Name: example.net
>[Name Length: 11]
>[Label Count: 2]
>Type:  (IPv6 Address) (28)
>Class: IN (0x0001)
> -->8-
> 
> And that's what we see if Google DNS server (8.8.8.8) is used instead:
> -->8-
> Domain Name System (response)
>Transaction ID: 0x3cd4
>Flags: 0x8180 Standard query response, No error
>1...    = Response: Message is a response
>.000 0...   = Opcode: Standard query (0)
> .0..   = Authoritative: Server is not an authority for 
> domain
> ..0.   = Truncated: Message is not truncated
> ...1   = Recursion desired: Do query recursively
>  1...  = Recursion available: Server can do recursive 
> queries
>  .0..  = Z: reserved (0)
>  ..0.  = Answer authenticated: Answer/authority portion 
> was not authenticated by the server
>  ...0  = Non-authenticated data: Unacceptable
>    = Reply code: No error (0)
>Questions: 1
>Answer RRs: 1
>Authority RRs: 0
>Additional RRs: 0
>Queries
>example.net: type , class IN
>Name: example.net
>[Name Length: 11]
>[Label Count: 2]
>Type:  (IPv6 Address) (28)
>Class: IN (0x0001)
> Answers
>example.net: type , class IN, addr 2606:2800:220:1:248:1893:25c8:1946
> -->8-
> ---
>  posix/tst-getaddrinfo4.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/posix/tst-getaddrinfo4.c b/posix/tst-getaddrinfo4.c
> index dc9e423448af..0139dee777a1 100644
> --- a/posix/tst-getaddrinfo4.c
> +++ b/posix/tst-getaddrinfo4.c
> @@ -39,6 +39,7 @@ try (const char *service, int family, int flags)
>  case 0:
>  case EAI_AGAIN:
>  case EAI_NONAME:
> +case EAI_NODATA:
>printf ("SUCCESS getaddrinfo(service=%s, family=%d, flags=%d): %s: 
> %m\n",
>service ?: "NULL", family, flags, gai_strerror (res));
>return 0;
> 

Ping !

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH] testsuite fix: timezone: failing due to permissions in cross testing

2018-12-17 Thread Vineet Gupta
timezone test driver "zic" creates testdata directory wuth umask 755, so
only root owner/group has write permissions. However the buildroot
system created has sshd as default user, so sh fails to write to test
results in this folder. Work around by relaxing umask to 777

| /bin/sh: 
build/glibc-fa3b6cd5bdbc/build/timezone/testdata/America/New_York.test-result: 
Permission denied
| Makefile:96: recipe for target 
'build/glibc-fa3b6cd5bdbc/build/timezone/testdata/America/New_York' failed
| make[2]: *** 
[build/glibc-fa3b6cd5bdbc/build/timezone/testdata/America/New_York] Error 1
| make[2]: Leaving directory 'build/glibc-fa3b6cd5bdbc/timezone'
| Makefile:258: recipe for target 'timezone/xtests' failed

Signed-off-by: Vineet Gupta 
---
 timezone/zic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/timezone/zic.c b/timezone/zic.c
index cb1bf28bfbc8..b7a5b0f6c80c 100644
--- a/timezone/zic.c
+++ b/timezone/zic.c
@@ -39,7 +39,7 @@ typedef int_fast64_t  zic_t;
 #include 
 #endif
 #ifdef S_IRUSR
-#define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+#define MKDIR_UMASK 
(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH)
 #else
 #define MKDIR_UMASK 0755
 #endif
-- 
2.7.4


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH] testsuite fix: timezone: failing due to permissions in cross testing

2018-12-17 Thread Vineet Gupta
timezone test driver "zic" creates testdata directory wuth umask 755, so
only root owner/group has write permissions. However the buildroot
system created has sshd as default user, so sh fails to write to test
results in this folder. Work around by relaxing umask to 777

| /bin/sh: 
build/glibc-fa3b6cd5bdbc/build/timezone/testdata/America/New_York.test-result: 
Permission denied
| Makefile:96: recipe for target 
'build/glibc-fa3b6cd5bdbc/build/timezone/testdata/America/New_York' failed
| make[2]: *** 
[build/glibc-fa3b6cd5bdbc/build/timezone/testdata/America/New_York] Error 1
| make[2]: Leaving directory 'build/glibc-fa3b6cd5bdbc/timezone'
| Makefile:258: recipe for target 'timezone/xtests' failed

Signed-off-by: Vineet Gupta 
---
 timezone/zic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/timezone/zic.c b/timezone/zic.c
index cb1bf28bfbc8..b7a5b0f6c80c 100644
--- a/timezone/zic.c
+++ b/timezone/zic.c
@@ -39,7 +39,7 @@ typedef int_fast64_t  zic_t;
 #include 
 #endif
 #ifdef S_IRUSR
-#define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+#define MKDIR_UMASK 
(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH)
 #else
 #define MKDIR_UMASK 0755
 #endif
-- 
2.7.4


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] testsuite fix: timezone: failing due to permissions in cross testing

2018-12-17 Thread Paul Eggert




  #ifdef S_IRUSR
-#define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+#define MKDIR_UMASK 
(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH)
  #else
  #define MKDIR_UMASK 0755
  #endif


The zic.c code is taken from upstream, and I'm loath to change it 
everywhere simply because a glibc test driver isn't working somewhere, 
as I expect this would lead to security holes elsewhere. Intead, how 
about changing the test script to chmod the testdata directory after zic 
creates it, or to segregate the tzdata directory from the other test 
results?



___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] testsuite fix: timezone: failing due to permissions in cross testing

2018-12-17 Thread Vineet Gupta
On 12/17/18 3:17 PM, Paul Eggert wrote:
> 
>>   #ifdef S_IRUSR
>> -#define MKDIR_UMASK 
>> (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
>> +#define MKDIR_UMASK
>> (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH)
>>   #else
>>   #define MKDIR_UMASK 0755
>>   #endif
> 
> The zic.c code is taken from upstream, and I'm loath to change it everywhere
> simply because a glibc test driver isn't working somewhere, as I expect this 
> would
> lead to security holes elsewhere. Intead, how about changing the test script 
> to
> chmod the testdata directory after zic creates it, or to segregate the tzdata
> directory from the other test results?

OK, the idea here was to solicit ideas about how to go about addressing this. I
need to dig into the test harness to see how it can be addressed in the way you
suggest.

Thx,
-Vineet



___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH] testsuite fix: timezone: failing due to permissions in cross testing

2018-12-17 Thread Joseph Myers
On Mon, 17 Dec 2018, Vineet Gupta wrote:

> timezone test driver "zic" creates testdata directory wuth umask 755, so
> only root owner/group has write permissions. However the buildroot

root should not be involved in running tests at all; all tests should run 
as a normal user, the same one that owns the build directory, and thus all 
files and directories in the build directory should be owned by that user.  
(Some tests use user namespaces to test functionality that requires root, 
but that's root inside a namespace, not the real user root.)

So I think you need to explain more about your test configuration that 
results in permissions problems so we can tell if you have a valid test 
configuration at all.

-- 
Joseph S. Myers
jos...@codesourcery.com

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] testsuite fix: timezone: failing due to permissions in cross testing

2018-12-17 Thread Vineet Gupta
On 12/17/18 3:25 PM, Joseph Myers wrote:
> On Mon, 17 Dec 2018, Vineet Gupta wrote:
> 
>> timezone test driver "zic" creates testdata directory wuth umask 755, so
>> only root owner/group has write permissions. However the buildroot
> root should not be involved in running tests at all; all tests should run 
> as a normal user, the same one that owns the build directory, and thus all 
> files and directories in the build directory should be owned by that user.  
> (Some tests use user namespaces to test functionality that requires root, 
> but that's root inside a namespace, not the real user root.)
> 
> So I think you need to explain more about your test configuration that 
> results in permissions problems so we can tell if you have a valid test 
> configuration at all.

The setup is obviously is cross test, built using buildroot. The system is 
minimal
with root allowed w/o password to enable tests to run quickly.

On host I do the following which certainly involves root.

| make test-wrapper='/scripts/cross-test-ssh.sh
root@192.168.0.20' xcheck

So guess it needs to be sshd or some other user on target ?

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] testsuite fix: timezone: failing due to permissions in cross testing

2018-12-17 Thread Joseph Myers
On Mon, 17 Dec 2018, Vineet Gupta wrote:

> The setup is obviously is cross test, built using buildroot. The system is 
> minimal
> with root allowed w/o password to enable tests to run quickly.
> 
> On host I do the following which certainly involves root.
> 
> | make test-wrapper='/scripts/cross-test-ssh.sh
> root@192.168.0.20' xcheck
> 
> So guess it needs to be sshd or some other user on target ?

The user on target should be the same as the user on the system where you 
build glibc (you may need to create a corresponding user on the target).

-- 
Joseph S. Myers
jos...@codesourcery.com

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc