[Qemu-devel] [RFC 5/6] linux-user: fix 64bit versions of sparc and mips

Carlo Marcelo Arenas Belón posted 6 patches 8 years, 4 months ago
[Qemu-devel] [RFC 5/6] linux-user: fix 64bit versions of sparc and mips
Posted by Carlo Marcelo Arenas Belón 8 years, 4 months ago
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 linux-user/mips64/sockbits.h  | 1 +
 linux-user/socket.h           | 4 ++--
 linux-user/sparc64/sockbits.h | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)
 create mode 100644 linux-user/mips64/sockbits.h
 create mode 100644 linux-user/sparc64/sockbits.h

diff --git a/linux-user/mips64/sockbits.h b/linux-user/mips64/sockbits.h
new file mode 100644
index 0000000000..e6b6d31ac9
--- /dev/null
+++ b/linux-user/mips64/sockbits.h
@@ -0,0 +1 @@
+#include "../mips/sockbits.h"
diff --git a/linux-user/socket.h b/linux-user/socket.h
index dfa692286b..6fd486c6b1 100644
--- a/linux-user/socket.h
+++ b/linux-user/socket.h
@@ -1,10 +1,10 @@
-#if defined(TARGET_MIPS)
+#if defined(TARGET_MIPS) || defined(TARGET_MIPS64)
 #include "mips/sockbits.h"
 #elif defined(TARGET_ALPHA)
 #include "alpha/sockbits.h"
 #elif defined(TARGET_HPPA)
 #include "hppa/sockbits.h"
-#elif defined(TARGET_SPARC)
+#elif defined(TARGET_SPARC) || defined(TARGET_SPARC64)
 #include "sparc/sockbits.h"
 #else
 
diff --git a/linux-user/sparc64/sockbits.h b/linux-user/sparc64/sockbits.h
new file mode 100644
index 0000000000..658899e4d3
--- /dev/null
+++ b/linux-user/sparc64/sockbits.h
@@ -0,0 +1 @@
+#include "../sparc/sockbits.h"
-- 
2.14.1


Re: [Qemu-devel] [RFC 5/6] linux-user: fix 64bit versions of sparc and mips
Posted by Laurent Vivier 8 years, 4 months ago
Le 22/09/2017 à 16:02, Carlo Marcelo Arenas Belón a écrit :
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  linux-user/mips64/sockbits.h  | 1 +
>  linux-user/socket.h           | 4 ++--
>  linux-user/sparc64/sockbits.h | 1 +

Who includes the two new files?

Moreover TARGET_MIPS/TARGET_SPARC (base arch) are always defined when
TARGET_MIPS64/TARGET_SPARC64 (target arch) are defined.

So I think this patch is useless.

Thanks,
Laurent

>  3 files changed, 4 insertions(+), 2 deletions(-)
>  create mode 100644 linux-user/mips64/sockbits.h
>  create mode 100644 linux-user/sparc64/sockbits.h
> 
> diff --git a/linux-user/mips64/sockbits.h b/linux-user/mips64/sockbits.h
> new file mode 100644
> index 0000000000..e6b6d31ac9
> --- /dev/null
> +++ b/linux-user/mips64/sockbits.h
> @@ -0,0 +1 @@
> +#include "../mips/sockbits.h"
> diff --git a/linux-user/socket.h b/linux-user/socket.h
> index dfa692286b..6fd486c6b1 100644
> --- a/linux-user/socket.h
> +++ b/linux-user/socket.h
> @@ -1,10 +1,10 @@
> -#if defined(TARGET_MIPS)
> +#if defined(TARGET_MIPS) || defined(TARGET_MIPS64)
>  #include "mips/sockbits.h"
>  #elif defined(TARGET_ALPHA)
>  #include "alpha/sockbits.h"
>  #elif defined(TARGET_HPPA)
>  #include "hppa/sockbits.h"
> -#elif defined(TARGET_SPARC)
> +#elif defined(TARGET_SPARC) || defined(TARGET_SPARC64)
>  #include "sparc/sockbits.h"
>  #else
>  
> diff --git a/linux-user/sparc64/sockbits.h b/linux-user/sparc64/sockbits.h
> new file mode 100644
> index 0000000000..658899e4d3
> --- /dev/null
> +++ b/linux-user/sparc64/sockbits.h
> @@ -0,0 +1 @@
> +#include "../sparc/sockbits.h"
> 


Re: [Qemu-devel] [RFC 5/6] linux-user: fix 64bit versions of sparc and mips
Posted by Carlo Arenas 8 years, 4 months ago
On Fri, Sep 22, 2017 at 10:01 AM, Laurent Vivier <laurent@vivier.eu> wrote:

> Le 22/09/2017 à 16:02, Carlo Marcelo Arenas Belón a écrit :
> > Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> > ---
> >  linux-user/mips64/sockbits.h  | 1 +
> >  linux-user/socket.h           | 4 ++--
> >  linux-user/sparc64/sockbits.h | 1 +
>
> Who includes the two new files?
>

No one yet, but hopefully will make clearer to anyone looking later for
arch specific values that they were indeed equivalent to their non 64bit
versions.

It also mimics what termbits.h is doing and so might allow in the future to
drop the common socket.h for an arch specific one, which will be easier to
maintain and keep in sync with the linux kernel.


> Moreover TARGET_MIPS/TARGET_SPARC (base arch) are always defined when
> TARGET_MIPS64/TARGET_SPARC64 (target arch) are defined.
>
> So I think this patch is useless.
>

ok, glad to know I was wrong about those architectures being broken, still
suspect s390x is though, but don't want to address this in this series,
like I didn't want to include the bigger refactoring explained above.

I am curious also over users of those architectures and their suggestions,
which is why I sent this series as an RFC; is there a better forum for that
somewhere else?

Carlo