summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-09-09 14:50:43 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-09-09 14:50:43 +0200
commitdd8ce9fc18f2ce5007883f0fc6885c41deafc1b7 (patch)
tree5efea6fc02aa6689566e0cab54c8d089467ce844
parente0a7ae85351de7ebc43af1fe5f04e650c6736201 (diff)
dissector: Don't re-initialize packet_types array
Both sparse and clang warn about the initializers overriding previous initialization of the packet_types array. Since every access of the packet_types array checks the value for NULL (the default value, since the array is static) and prints a "?" if it isNULL, we don't need the prior initialization with "?". Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--dissector.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/dissector.h b/dissector.h
index 8cb4234..01d1525 100644
--- a/dissector.h
+++ b/dissector.h
@@ -28,7 +28,6 @@
extern char *if_indextoname(unsigned ifindex, char *ifname);
static const char * const packet_types[256] = {
- [0 ... 255] = "?", /* Unknown */
[PACKET_HOST] = "<", /* Incoming */
[PACKET_BROADCAST] = "B", /* Broadcast */
[PACKET_MULTICAST] = "M", /* Multicast */
bindstack = mmap(NULL, BINDSTACK_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (bindstack == MAP_FAILED) { perror("mmap bindstack"); return 0; } printf("bindstack: %p\n", bindstack); run_bind_test(); printf("done\n"); return 0; } There are multiple ingredients for this: 1) PAGE_NONE is defined to _CACHE_CACHABLE_NONCOHERENT, which is CCA 3 on all platforms except SB1 where it's CCA 5. 2) _page_cachable_default must have bits set which are not set _CACHE_CACHABLE_NONCOHERENT. 3) Either the defective version of pte_modify for XPA or the standard version must be in used. However pte_modify for the 36 bit address space support is no affected. In that case additional bits in the final CCA mode may generate an invalid value for the CCA field. On the R10000 system where this was tracked down for example a CCA 7 has been observed, which is Uncached Accelerated. Fixed by: 1) Using the proper CCA mode for PAGE_NONE just like for all the other PAGE_* pte/pmd bits. 2) Fix the two affected variants of pte_modify. Further code inspection also shows the same issue to exist in pmd_modify which would affect huge page systems. Issue in pte_modify tracked down by Alastair Bridgewater, PAGE_NONE and pmd_modify issue found by me. The history of this goes back beyond Linus' git history. Chris Dearman's commit 351336929ccf222ae38ff0cb7a8dd5fd5c6236a0 ("[MIPS] Allow setting of the cache attribute at run time.") missed the opportunity to fix this but it was originally introduced in lmo commit d523832cf12007b3242e50bb77d0c9e63e0b6518 ("Missing from last commit.") and 32cc38229ac7538f2346918a09e75413e8861f87 ("New configuration option CONFIG_MIPS_UNCACHED.") Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Reported-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Diffstat (limited to 'Documentation')