在 2016年04月20日 02:45, George Spelvin 写道:
Add generic odd parity functions, adapted from
"https://graphics.stanford.edu/~seander/bithacks.html#ParityParallel;
Given a PARITY_MAGIC of 0x6996, this is even parity, not odd.
(Which it should be; an XOR of all bits is the "natural" form.)
From
在 2016年04月20日 02:45, George Spelvin 写道:
Add generic odd parity functions, adapted from
"https://graphics.stanford.edu/~seander/bithacks.html#ParityParallel;
Given a PARITY_MAGIC of 0x6996, this is even parity, not odd.
(Which it should be; an XOR of all bits is the "natural" form.)
From
在 2016年04月06日 18:37, One Thousand Gnomes 写道:
Even that would still be wrong for the smaller parity values. The CPU
supports 8bit parity directly going back to the 8086 so the
implementation for 8bit and I think 16bit is still wrong.
Alan
I don't know where the errors. X86 is new to me.
The
在 2016年04月06日 18:37, One Thousand Gnomes 写道:
Even that would still be wrong for the smaller parity values. The CPU
supports 8bit parity directly going back to the 8086 so the
implementation for 8bit and I think 16bit is still wrong.
Alan
I don't know where the errors. X86 is new to me.
The
在 2016年04月08日 10:18, Boris Brezillon 写道:
On Fri, 8 Apr 2016 09:51:04 +0800
Zeng Zhaoxiu <zhaoxiu.z...@gmail.com> wrote:
在 2016年04月08日 08:18, Boris Brezillon 写道:
Hi Zeng,
On Fri, 8 Apr 2016 00:48:17 +0800
zengzhao...@163.com wrote:
From: Zeng Zhaoxiu <zhaoxiu.z...@
在 2016年04月08日 10:18, Boris Brezillon 写道:
On Fri, 8 Apr 2016 09:51:04 +0800
Zeng Zhaoxiu wrote:
在 2016年04月08日 08:18, Boris Brezillon 写道:
Hi Zeng,
On Fri, 8 Apr 2016 00:48:17 +0800
zengzhao...@163.com wrote:
From: Zeng Zhaoxiu
If there is only one bit difference in the ECC, the function
在 2016年04月08日 08:18, Boris Brezillon 写道:
Hi Zeng,
On Fri, 8 Apr 2016 00:48:17 +0800
zengzhao...@163.com wrote:
From: Zeng Zhaoxiu <zhaoxiu.z...@gmail.com>
If there is only one bit difference in the ECC, the function should return 1.
The result of "diff0 & ~(1<<
在 2016年04月08日 08:18, Boris Brezillon 写道:
Hi Zeng,
On Fri, 8 Apr 2016 00:48:17 +0800
zengzhao...@163.com wrote:
From: Zeng Zhaoxiu
If there is only one bit difference in the ECC, the function should return 1.
The result of "diff0 & ~(1<
Missing Signed-off-by here.
---
driv
在 2016年04月06日 18:53, Borislav Petkov 写道:
On Wed, Apr 06, 2016 at 11:37:37AM +0100, One Thousand Gnomes wrote:
Even that would still be wrong for the smaller parity values. The CPU
supports 8bit parity directly going back to the 8086 so the
implementation for 8bit and I think 16bit is still
在 2016年04月07日 03:45, Andi Kleen 写道:
zengzhao...@163.com writes:
From: Zhaoxiu Zeng
Use alternatives, lifted from arch_hweight
Is there actually anything performance critical in the kernel that uses
parity?
FWIW the arch hweight custom calling convention is a problem
在 2016年04月06日 18:53, Borislav Petkov 写道:
On Wed, Apr 06, 2016 at 11:37:37AM +0100, One Thousand Gnomes wrote:
Even that would still be wrong for the smaller parity values. The CPU
supports 8bit parity directly going back to the 8086 so the
implementation for 8bit and I think 16bit is still
在 2016年04月07日 03:45, Andi Kleen 写道:
zengzhao...@163.com writes:
From: Zhaoxiu Zeng
Use alternatives, lifted from arch_hweight
Is there actually anything performance critical in the kernel that uses
parity?
FWIW the arch hweight custom calling convention is a problem for LTO
because it
在 2016年04月07日 02:44, Sam Ravnborg 写道:
Hi Zeng.
Use runtime patching for sparc64, lifted from hweight
No errors found in patch - but a few comments.
In general patch looks good.
Thanks. Sparc, powerpc, and x86 are all new to me.
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -47,6 +47,24 @@
在 2016年04月06日 21:27, Chris Metcalf 写道:
On 4/6/2016 5:08 AM, zengzhao...@163.com wrote:
From: Zhaoxiu Zeng
Signed-off-by: Zhaoxiu Zeng
---
arch/tile/include/asm/bitops.h | 26 ++
1 file changed, 26 insertions(+)
Since
在 2016年04月07日 02:44, Sam Ravnborg 写道:
Hi Zeng.
Use runtime patching for sparc64, lifted from hweight
No errors found in patch - but a few comments.
In general patch looks good.
Thanks. Sparc, powerpc, and x86 are all new to me.
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -47,6 +47,24 @@
在 2016年04月06日 21:27, Chris Metcalf 写道:
On 4/6/2016 5:08 AM, zengzhao...@163.com wrote:
From: Zhaoxiu Zeng
Signed-off-by: Zhaoxiu Zeng
---
arch/tile/include/asm/bitops.h | 26 ++
1 file changed, 26 insertions(+)
Since all the code you are adding here is
在 2016年04月06日 18:13, Borislav Petkov 写道:
On Wed, Apr 06, 2016 at 05:14:45PM +0800, zengzhao...@163.com wrote:
From: Zhaoxiu Zeng
Use alternatives, lifted from arch_hweight
Signed-off-by: Zhaoxiu Zeng
---
arch/x86/include/asm/arch_hweight.h |
在 2016年04月06日 18:13, Borislav Petkov 写道:
On Wed, Apr 06, 2016 at 05:14:45PM +0800, zengzhao...@163.com wrote:
From: Zhaoxiu Zeng
Use alternatives, lifted from arch_hweight
Signed-off-by: Zhaoxiu Zeng
---
arch/x86/include/asm/arch_hweight.h | 5 ++
arch/x86/include/asm/arch_parity.h |
在 2016年04月06日 03:04, Sam Ravnborg 写道:
On Tue, Apr 05, 2016 at 10:06:21AM +0800, Zeng Zhaoxiu wrote:
From: Zhaoxiu Zeng <zhaoxiu.z...@gmail.com>
These patches provide generic and architecture-specific odd parity
calculations.
Hi Zeng.
Can you please fix your mail script.
I see only 1/30
在 2016年04月06日 03:04, Sam Ravnborg 写道:
On Tue, Apr 05, 2016 at 10:06:21AM +0800, Zeng Zhaoxiu wrote:
From: Zhaoxiu Zeng
These patches provide generic and architecture-specific odd parity
calculations.
Hi Zeng.
Can you please fix your mail script.
I see only 1/30 (sent to linux-arch
From: Zhaoxiu Zeng
Use the generic version
---
arch/arc/include/asm/bitops.h | 1 +
arch/arm/include/asm/bitops.h | 1 +
arch/arm64/include/asm/bitops.h| 1 +
arch/avr32/include/asm/bitops.h| 1 +
arch/c6x/include/asm/bitops.h | 1 +
From: Zhaoxiu Zeng
Use the generic version
---
arch/arc/include/asm/bitops.h | 1 +
arch/arm/include/asm/bitops.h | 1 +
arch/arm64/include/asm/bitops.h| 1 +
arch/avr32/include/asm/bitops.h| 1 +
arch/c6x/include/asm/bitops.h | 1 +
arch/cris/include/asm/bitops.h |
From: Zhaoxiu Zeng
These patches provide generic and architecture-specific odd parity
calculations.
I did not use GCC's __builtin_parity* functions, based on the following
reasons:
1. I don't know where to identify which version of GCC from the beginning
From: Zhaoxiu Zeng
These patches provide generic and architecture-specific odd parity
calculations.
I did not use GCC's __builtin_parity* functions, based on the following
reasons:
1. I don't know where to identify which version of GCC from the beginning
supported __builtin_parity
在 2016年03月28日 14:51, Sam Ravnborg 写道:
diff --git a/include/asm-generic/bitops/arch_parity.h
b/include/asm-generic/bitops/arch_parity.h
new file mode 100644
index 000..cddc555
--- /dev/null
+++ b/include/asm-generic/bitops/arch_parity.h
@@ -0,0 +1,39 @@
+#ifndef
在 2016年03月28日 14:51, Sam Ravnborg 写道:
diff --git a/include/asm-generic/bitops/arch_parity.h
b/include/asm-generic/bitops/arch_parity.h
new file mode 100644
index 000..cddc555
--- /dev/null
+++ b/include/asm-generic/bitops/arch_parity.h
@@ -0,0 +1,39 @@
+#ifndef
在 2016年03月29日 01:25, David Daney 写道:
On 03/26/2016 11:06 PM, zhaoxiu.zeng wrote:
From: Zeng Zhaoxiu <zhaoxiu.z...@gmail.com>
There is nothing MIPS specific here. Why not put it in asm-generic or
some similar place where it can be shared by all architectures?
Also, are yo
在 2016年03月29日 01:25, David Daney 写道:
On 03/26/2016 11:06 PM, zhaoxiu.zeng wrote:
From: Zeng Zhaoxiu
There is nothing MIPS specific here. Why not put it in asm-generic or
some similar place where it can be shared by all architectures?
Also, are you sure __builtin_popcount
在 2016年03月28日 10:43, David Miller 写道:
From: "zhaoxiu.zeng"
Date: Sun, 27 Mar 2016 14:43:10 +0800
+
+/*
+ * parityN: returns the parity of a N-bit word,
+ * i.e. the number of 1-bits in x modulo 2.
+ */
+
+#define __arch_parity4(w) (__arch_hweight8((w) & 0xf) & 1)
在 2016年03月28日 10:43, David Miller 写道:
From: "zhaoxiu.zeng"
Date: Sun, 27 Mar 2016 14:43:10 +0800
+
+/*
+ * parityN: returns the parity of a N-bit word,
+ * i.e. the number of 1-bits in x modulo 2.
+ */
+
+#define __arch_parity4(w) (__arch_hweight8((w) & 0xf) & 1)
+#define
OK, I will do the V2 patches soon.
In addition, the best is to provide asm version parity functions for
powerpc, sparc, and x86.
在 2016年03月28日 01:56, Sam Ravnborg 写道:
Any particular reason that you select one approach over the other
in the different cases?
No particular reason, just like the
OK, I will do the V2 patches soon.
In addition, the best is to provide asm version parity functions for
powerpc, sparc, and x86.
在 2016年03月28日 01:56, Sam Ravnborg 写道:
Any particular reason that you select one approach over the other
in the different cases?
No particular reason, just like the
On 2016年03月27日 21:38, zhaoxiu.zeng wrote:
On 2016/3/27 20:44, Sam Ravnborg wrote:
Hi Zeng.
Looking through the arch specific implementations of __arch_parity().
Some architectures uses #defines, other uses inline static functions.
Any particular reason that you select one approach over the
On 2016年03月27日 21:38, zhaoxiu.zeng wrote:
On 2016/3/27 20:44, Sam Ravnborg wrote:
Hi Zeng.
Looking through the arch specific implementations of __arch_parity().
Some architectures uses #defines, other uses inline static functions.
Any particular reason that you select one approach over the
If the result of adding the first set bit to the mask is power of 2,
the mask must be contiguous. "mask & -mask" can get the first set bit
of mask gracefully.
Signed-off-by: Zeng Zhaoxiu
---
net/mac80211/iface.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
di
If the result of adding the first set bit to the mask is power of 2,
the mask must be contiguous. "mask & -mask" can get the first set bit
of mask gracefully.
Signed-off-by: Zeng Zhaoxiu <zhaoxiu.z...@gmail.com>
---
net/mac80211/iface.c | 5 +++--
1 file changed, 3 insert
36 matches
Mail list logo