Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1693741 > unrolled thread
| Started by | Aleksandar Markovic <aleksandar.markovic@rt-rk.com> |
|---|---|
| First post | 2017-07-21 16:20 +0200 |
| Last post | 2017-07-21 16:30 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v3 00/16] MIPS: Miscellaneous fixes related to Android Mips emulator Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-07-21 16:20 +0200
[PATCH v3 07/16] MIPS: math-emu: <MAX|MIN>.<D|S>: Fix cases of both inputs negative Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-07-21 16:20 +0200
Re: [PATCH v3 07/16] MIPS: math-emu: <MAX|MIN>.<D|S>: Fix cases of both inputs negative James Hogan <james.hogan@imgtec.com> - 2017-07-21 17:20 +0200
[PATCH v3 04/16] MIPS: VDSO: Fix clobber lists in fallback code paths Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-07-21 16:20 +0200
Re: [PATCH v3 04/16] MIPS: VDSO: Fix clobber lists in fallback code paths James Hogan <james.hogan@imgtec.com> - 2017-07-21 16:30 +0200
| From | Aleksandar Markovic <aleksandar.markovic@rt-rk.com> |
|---|---|
| Date | 2017-07-21 16:20 +0200 |
| Subject | [PATCH v3 00/16] MIPS: Miscellaneous fixes related to Android Mips emulator |
| Message-ID | <u5GWB-5Tl-3@gated-at.bofh.it> |
From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
v2->v3:
- added a patch that fixes clobber lists in vdso fallback cases
- added 6 patches related to MIN/MINA/MAX/MAXA issues
- added 6 patches related to MADDF/MSUBDF issues
- enhanced logic and comments in patch on multitouch
- fixed a number of minor spelling and format mistakes in code
comments and commit messages
- several patches removed since they got integrated into the tree
- order of patches changed to better reflect similarity
- rebased to the latest kernel code
v1->v2:
- the patch on PREF usage in memcpy dropped as not needed
- updated recipient lists using get_maintainer.pl
- rebased to the latest kernel code
This series contains an assortment of changes necessary for proper
operation of Android emulator for Mips. However, we think that wider
kernel community may benefit from them too.
Aleksandar Markovic (10):
MIPS: math-emu: <MAX|MAXA|MIN|MINA>.<D|S>: Fix quiet NaN propagation
MIPS: math-emu: <MAX|MAXA|MIN|MINA>.<D|S>: Fix cases of both inputs
zero
MIPS: math-emu: <MAX|MIN>.<D|S>: Fix cases of both inputs negative
MIPS: math-emu: <MAXA|MINA>.<D|S>: Fix cases of input values with
opposite signs
MIPS: math-emu: <MAXA|MINA>.<D|S>: Fix cases of both infinite inputs
MIPS: math-emu: MINA.<D|S>: Fix some cases of infinity and zero inputs
MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix NaN propagation
MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix some cases of infinite inputs
MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix some cases of zero inputs
MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Clean up maddf_flags enumeration
Douglas Leung (2):
MIPS: math-emu: <MADDF|MSUBF>.S: Fix accuracy (32-bit case)
MIPS: math-emu: <MADDF|MSUBF>.D: Fix accuracy (64-bit case)
Goran Ferenc (1):
MIPS: VDSO: Fix clobber lists in fallback code paths
Lingfeng Yang (1):
input: goldfish: Fix multitouch event handling
Miodrag Dinic (2):
tty: goldfish: Use streaming DMA for r/w operations on Ranchu
platforms
tty: goldfish: Implement support for kernel 'earlycon' parameter
arch/mips/math-emu/dp_fmax.c | 61 +++++---
arch/mips/math-emu/dp_fmin.c | 63 +++++---
arch/mips/math-emu/dp_maddf.c | 237 +++++++++++++++++++------------
arch/mips/math-emu/ieee754int.h | 4 +
arch/mips/math-emu/ieee754sp.h | 4 +
arch/mips/math-emu/sp_fmax.c | 61 +++++---
arch/mips/math-emu/sp_fmin.c | 62 +++++---
arch/mips/math-emu/sp_maddf.c | 221 +++++++++++++---------------
arch/mips/vdso/gettimeofday.c | 6 +-
drivers/input/keyboard/goldfish_events.c | 35 ++++-
drivers/tty/Kconfig | 3 +
drivers/tty/goldfish.c | 145 +++++++++++++++++--
12 files changed, 596 insertions(+), 306 deletions(-)
--
2.7.4
[toc] | [next] | [standalone]
| From | Aleksandar Markovic <aleksandar.markovic@rt-rk.com> |
|---|---|
| Date | 2017-07-21 16:20 +0200 |
| Subject | [PATCH v3 07/16] MIPS: math-emu: <MAX|MIN>.<D|S>: Fix cases of both inputs negative |
| Message-ID | <u5GWD-5Tl-51@gated-at.bofh.it> |
| In reply to | #1693741 |
From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Fix the value returned by <MAX|MIN>.<D|S>, if both inputs are negative
normal fp numbers. The previous logic did not take into account that
if both inputs have the same sign, there should be separate treatment
of the cases when both inputs are negative and when both inputs are
positive.
The relevant example:
MAX.S fd,fs,ft:
If fs contains -5, and ft contains -7, fd is going to contain -5
(without this patch, it used to contain -7).
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
---
arch/mips/math-emu/dp_fmax.c | 33 +++++++++++++++++++++++++--------
arch/mips/math-emu/dp_fmin.c | 33 +++++++++++++++++++++++++--------
arch/mips/math-emu/sp_fmax.c | 33 +++++++++++++++++++++++++--------
arch/mips/math-emu/sp_fmin.c | 32 +++++++++++++++++++++++++-------
4 files changed, 100 insertions(+), 31 deletions(-)
diff --git a/arch/mips/math-emu/dp_fmax.c b/arch/mips/math-emu/dp_fmax.c
index 9517572..a0175cc 100644
--- a/arch/mips/math-emu/dp_fmax.c
+++ b/arch/mips/math-emu/dp_fmax.c
@@ -106,16 +106,33 @@ union ieee754dp ieee754dp_fmax(union ieee754dp x, union ieee754dp y)
else if (xs < ys)
return x;
- /* Compare exponent */
- if (xe > ye)
- return x;
- else if (xe < ye)
- return y;
+ /* Signs of inputs are the same, let's compare exponents */
+ if (xs == 0) {
+ /* Inputs are both positive */
+ if (xe > ye)
+ return x;
+ else if (xe < ye)
+ return y;
+ } else {
+ /* Inputs are both negative */
+ if (xe > ye)
+ return y;
+ else if (xe < ye)
+ return x;
+ }
- /* Compare mantissa */
- if (xm <= ym)
+ /* Signs and exponents of inputs are the same, let's compare mantissas */
+ if (xs == 0) {
+ /* Inputs are both positive, with equal exponents */
+ if (xm <= ym)
+ return y;
+ return x;
+ } else {
+ /* Inputs are both negative, with equal exponents */
+ if (xm <= ym)
+ return x;
return y;
- return x;
+ }
}
union ieee754dp ieee754dp_fmaxa(union ieee754dp x, union ieee754dp y)
diff --git a/arch/mips/math-emu/dp_fmin.c b/arch/mips/math-emu/dp_fmin.c
index 7069320..074a858 100644
--- a/arch/mips/math-emu/dp_fmin.c
+++ b/arch/mips/math-emu/dp_fmin.c
@@ -106,16 +106,33 @@ union ieee754dp ieee754dp_fmin(union ieee754dp x, union ieee754dp y)
else if (xs < ys)
return y;
- /* Compare exponent */
- if (xe > ye)
- return y;
- else if (xe < ye)
- return x;
+ /* Signs of inputs are the same, let's compare exponents */
+ if (xs == 0) {
+ /* Inputs are both positive */
+ if (xe > ye)
+ return y;
+ else if (xe < ye)
+ return x;
+ } else {
+ /* Inputs are both negative */
+ if (xe > ye)
+ return x;
+ else if (xe < ye)
+ return y;
+ }
- /* Compare mantissa */
- if (xm <= ym)
+ /* Signs and exponents of inputs are the same, let's compare mantissas */
+ if (xs == 0) {
+ /* Inputs are both positive, with equal exponents */
+ if (xm <= ym)
+ return x;
+ return y;
+ } else {
+ /* Inputs are both negative, with equal exponents */
+ if (xm <= ym)
+ return y;
return x;
- return y;
+ }
}
union ieee754dp ieee754dp_fmina(union ieee754dp x, union ieee754dp y)
diff --git a/arch/mips/math-emu/sp_fmax.c b/arch/mips/math-emu/sp_fmax.c
index d72111a..15825db 100644
--- a/arch/mips/math-emu/sp_fmax.c
+++ b/arch/mips/math-emu/sp_fmax.c
@@ -106,16 +106,33 @@ union ieee754sp ieee754sp_fmax(union ieee754sp x, union ieee754sp y)
else if (xs < ys)
return x;
- /* Compare exponent */
- if (xe > ye)
- return x;
- else if (xe < ye)
- return y;
+ /* Signs of inputs are the same, let's compare exponents */
+ if (xs == 0) {
+ /* Inputs are both positive */
+ if (xe > ye)
+ return x;
+ else if (xe < ye)
+ return y;
+ } else {
+ /* Inputs are both negative */
+ if (xe > ye)
+ return y;
+ else if (xe < ye)
+ return x;
+ }
- /* Compare mantissa */
- if (xm <= ym)
+ /* Signs and exponents of inputs are the same, let's compare mantissas */
+ if (xs == 0) {
+ /* Inputs are both positive, with equal exponents */
+ if (xm <= ym)
+ return y;
+ return x;
+ } else {
+ /* Inputs are both negative, with equal exponents */
+ if (xm <= ym)
+ return x;
return y;
- return x;
+ }
}
union ieee754sp ieee754sp_fmaxa(union ieee754sp x, union ieee754sp y)
diff --git a/arch/mips/math-emu/sp_fmin.c b/arch/mips/math-emu/sp_fmin.c
index 61ff9c6..f1418f7 100644
--- a/arch/mips/math-emu/sp_fmin.c
+++ b/arch/mips/math-emu/sp_fmin.c
@@ -106,16 +106,34 @@ union ieee754sp ieee754sp_fmin(union ieee754sp x, union ieee754sp y)
else if (xs < ys)
return y;
- /* Compare exponent */
- if (xe > ye)
+ /* Signs of inputs are the same, let's compare exponents */
+ if (xs == 0) {
+ /* Inputs are both positive */
+ if (xe > ye)
+ return y;
+ else if (xe < ye)
+ return x;
+ } else {
+ /* Inputs are both negative */
+ if (xe > ye)
+ return x;
+ else if (xe < ye)
+ return y;
+ }
+
+ /* Signs and exponents of inputs are the same, let's compare mantissas */
+ if (xs == 0) {
+ /* Inputs are both positive, with equal exponents */
+ if (xm <= ym)
+ return x;
return y;
- else if (xe < ye)
+ } else {
+ /* Inputs are both negative, with equal exponents */
+ if (xm <= ym)
+ return y;
return x;
+ }
- /* Compare mantissa */
- if (xm <= ym)
- return x;
- return y;
}
union ieee754sp ieee754sp_fmina(union ieee754sp x, union ieee754sp y)
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | James Hogan <james.hogan@imgtec.com> |
|---|---|
| Date | 2017-07-21 17:20 +0200 |
| Subject | Re: [PATCH v3 07/16] MIPS: math-emu: <MAX|MIN>.<D|S>: Fix cases of both inputs negative |
| Message-ID | <u5HSG-6sw-9@gated-at.bofh.it> |
| In reply to | #1693742 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Jul 21, 2017 at 04:09:05PM +0200, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
>
> Fix the value returned by <MAX|MIN>.<D|S>, if both inputs are negative
> normal fp numbers. The previous logic did not take into account that
> if both inputs have the same sign, there should be separate treatment
> of the cases when both inputs are negative and when both inputs are
> positive.
>
> The relevant example:
>
> MAX.S fd,fs,ft:
> If fs contains -5, and ft contains -7, fd is going to contain -5
> (without this patch, it used to contain -7).
ouch!
>
same fixes/stable comment as for previous min/max patches
> Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
> Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cheers
James
> ---
> arch/mips/math-emu/dp_fmax.c | 33 +++++++++++++++++++++++++--------
> arch/mips/math-emu/dp_fmin.c | 33 +++++++++++++++++++++++++--------
> arch/mips/math-emu/sp_fmax.c | 33 +++++++++++++++++++++++++--------
> arch/mips/math-emu/sp_fmin.c | 32 +++++++++++++++++++++++++-------
> 4 files changed, 100 insertions(+), 31 deletions(-)
>
> diff --git a/arch/mips/math-emu/dp_fmax.c b/arch/mips/math-emu/dp_fmax.c
> index 9517572..a0175cc 100644
> --- a/arch/mips/math-emu/dp_fmax.c
> +++ b/arch/mips/math-emu/dp_fmax.c
> @@ -106,16 +106,33 @@ union ieee754dp ieee754dp_fmax(union ieee754dp x, union ieee754dp y)
> else if (xs < ys)
> return x;
>
> - /* Compare exponent */
> - if (xe > ye)
> - return x;
> - else if (xe < ye)
> - return y;
> + /* Signs of inputs are the same, let's compare exponents */
> + if (xs == 0) {
> + /* Inputs are both positive */
> + if (xe > ye)
> + return x;
> + else if (xe < ye)
> + return y;
> + } else {
> + /* Inputs are both negative */
> + if (xe > ye)
> + return y;
> + else if (xe < ye)
> + return x;
> + }
>
> - /* Compare mantissa */
> - if (xm <= ym)
> + /* Signs and exponents of inputs are the same, let's compare mantissas */
> + if (xs == 0) {
> + /* Inputs are both positive, with equal exponents */
> + if (xm <= ym)
> + return y;
> + return x;
> + } else {
> + /* Inputs are both negative, with equal exponents */
> + if (xm <= ym)
> + return x;
> return y;
> - return x;
> + }
> }
>
> union ieee754dp ieee754dp_fmaxa(union ieee754dp x, union ieee754dp y)
> diff --git a/arch/mips/math-emu/dp_fmin.c b/arch/mips/math-emu/dp_fmin.c
> index 7069320..074a858 100644
> --- a/arch/mips/math-emu/dp_fmin.c
> +++ b/arch/mips/math-emu/dp_fmin.c
> @@ -106,16 +106,33 @@ union ieee754dp ieee754dp_fmin(union ieee754dp x, union ieee754dp y)
> else if (xs < ys)
> return y;
>
> - /* Compare exponent */
> - if (xe > ye)
> - return y;
> - else if (xe < ye)
> - return x;
> + /* Signs of inputs are the same, let's compare exponents */
> + if (xs == 0) {
> + /* Inputs are both positive */
> + if (xe > ye)
> + return y;
> + else if (xe < ye)
> + return x;
> + } else {
> + /* Inputs are both negative */
> + if (xe > ye)
> + return x;
> + else if (xe < ye)
> + return y;
> + }
>
> - /* Compare mantissa */
> - if (xm <= ym)
> + /* Signs and exponents of inputs are the same, let's compare mantissas */
> + if (xs == 0) {
> + /* Inputs are both positive, with equal exponents */
> + if (xm <= ym)
> + return x;
> + return y;
> + } else {
> + /* Inputs are both negative, with equal exponents */
> + if (xm <= ym)
> + return y;
> return x;
> - return y;
> + }
> }
>
> union ieee754dp ieee754dp_fmina(union ieee754dp x, union ieee754dp y)
> diff --git a/arch/mips/math-emu/sp_fmax.c b/arch/mips/math-emu/sp_fmax.c
> index d72111a..15825db 100644
> --- a/arch/mips/math-emu/sp_fmax.c
> +++ b/arch/mips/math-emu/sp_fmax.c
> @@ -106,16 +106,33 @@ union ieee754sp ieee754sp_fmax(union ieee754sp x, union ieee754sp y)
> else if (xs < ys)
> return x;
>
> - /* Compare exponent */
> - if (xe > ye)
> - return x;
> - else if (xe < ye)
> - return y;
> + /* Signs of inputs are the same, let's compare exponents */
> + if (xs == 0) {
> + /* Inputs are both positive */
> + if (xe > ye)
> + return x;
> + else if (xe < ye)
> + return y;
> + } else {
> + /* Inputs are both negative */
> + if (xe > ye)
> + return y;
> + else if (xe < ye)
> + return x;
> + }
>
> - /* Compare mantissa */
> - if (xm <= ym)
> + /* Signs and exponents of inputs are the same, let's compare mantissas */
> + if (xs == 0) {
> + /* Inputs are both positive, with equal exponents */
> + if (xm <= ym)
> + return y;
> + return x;
> + } else {
> + /* Inputs are both negative, with equal exponents */
> + if (xm <= ym)
> + return x;
> return y;
> - return x;
> + }
> }
>
> union ieee754sp ieee754sp_fmaxa(union ieee754sp x, union ieee754sp y)
> diff --git a/arch/mips/math-emu/sp_fmin.c b/arch/mips/math-emu/sp_fmin.c
> index 61ff9c6..f1418f7 100644
> --- a/arch/mips/math-emu/sp_fmin.c
> +++ b/arch/mips/math-emu/sp_fmin.c
> @@ -106,16 +106,34 @@ union ieee754sp ieee754sp_fmin(union ieee754sp x, union ieee754sp y)
> else if (xs < ys)
> return y;
>
> - /* Compare exponent */
> - if (xe > ye)
> + /* Signs of inputs are the same, let's compare exponents */
> + if (xs == 0) {
> + /* Inputs are both positive */
> + if (xe > ye)
> + return y;
> + else if (xe < ye)
> + return x;
> + } else {
> + /* Inputs are both negative */
> + if (xe > ye)
> + return x;
> + else if (xe < ye)
> + return y;
> + }
> +
> + /* Signs and exponents of inputs are the same, let's compare mantissas */
> + if (xs == 0) {
> + /* Inputs are both positive, with equal exponents */
> + if (xm <= ym)
> + return x;
> return y;
> - else if (xe < ye)
> + } else {
> + /* Inputs are both negative, with equal exponents */
> + if (xm <= ym)
> + return y;
> return x;
> + }
>
> - /* Compare mantissa */
> - if (xm <= ym)
> - return x;
> - return y;
> }
>
> union ieee754sp ieee754sp_fmina(union ieee754sp x, union ieee754sp y)
> --
> 2.7.4
>
[toc] | [prev] | [next] | [standalone]
| From | Aleksandar Markovic <aleksandar.markovic@rt-rk.com> |
|---|---|
| Date | 2017-07-21 16:20 +0200 |
| Subject | [PATCH v3 04/16] MIPS: VDSO: Fix clobber lists in fallback code paths |
| Message-ID | <u5GWD-5Tl-57@gated-at.bofh.it> |
| In reply to | #1693741 |
From: Goran Ferenc <goran.ferenc@imgtec.com> Extend clobber lists to include all GP registers. Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com> Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com> --- arch/mips/vdso/gettimeofday.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/mips/vdso/gettimeofday.c b/arch/mips/vdso/gettimeofday.c index 974276e..e2690d7 100644 --- a/arch/mips/vdso/gettimeofday.c +++ b/arch/mips/vdso/gettimeofday.c @@ -35,7 +35,8 @@ static __always_inline long gettimeofday_fallback(struct timeval *_tv, " syscall\n" : "=r" (ret), "=r" (error) : "r" (tv), "r" (tz), "r" (nr) - : "memory"); + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); return error ? -ret : ret; } @@ -55,7 +56,8 @@ static __always_inline long clock_gettime_fallback(clockid_t _clkid, " syscall\n" : "=r" (ret), "=r" (error) : "r" (clkid), "r" (ts), "r" (nr) - : "memory"); + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", + "$14", "$15", "$24", "$25", "hi", "lo", "memory"); return error ? -ret : ret; } -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | James Hogan <james.hogan@imgtec.com> |
|---|---|
| Date | 2017-07-21 16:30 +0200 |
| Subject | Re: [PATCH v3 04/16] MIPS: VDSO: Fix clobber lists in fallback code paths |
| Message-ID | <u5H6h-5Wt-3@gated-at.bofh.it> |
| In reply to | #1693745 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Jul 21, 2017 at 04:09:02PM +0200, Aleksandar Markovic wrote:
> From: Goran Ferenc <goran.ferenc@imgtec.com>
>
> Extend clobber lists to include all GP registers.
>
Consider adding:
Fixes: 0b523a85e134 ("MIPS: VDSO: Add implementation of gettimeofday() fallback")
> Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
> Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cheers
James
> ---
> arch/mips/vdso/gettimeofday.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/vdso/gettimeofday.c b/arch/mips/vdso/gettimeofday.c
> index 974276e..e2690d7 100644
> --- a/arch/mips/vdso/gettimeofday.c
> +++ b/arch/mips/vdso/gettimeofday.c
> @@ -35,7 +35,8 @@ static __always_inline long gettimeofday_fallback(struct timeval *_tv,
> " syscall\n"
> : "=r" (ret), "=r" (error)
> : "r" (tv), "r" (tz), "r" (nr)
> - : "memory");
> + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
> + "$14", "$15", "$24", "$25", "hi", "lo", "memory");
>
> return error ? -ret : ret;
> }
> @@ -55,7 +56,8 @@ static __always_inline long clock_gettime_fallback(clockid_t _clkid,
> " syscall\n"
> : "=r" (ret), "=r" (error)
> : "r" (clkid), "r" (ts), "r" (nr)
> - : "memory");
> + : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
> + "$14", "$15", "$24", "$25", "hi", "lo", "memory");
>
> return error ? -ret : ret;
> }
> --
> 2.7.4
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web