All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED
@ 2008-12-11 19:12 Blue Swirl
  2008-12-11 19:33 ` Kirill A. Shutemov
  0 siblings, 1 reply; 7+ messages in thread
From: Blue Swirl @ 2008-12-11 19:12 UTC (permalink / raw)
  To: qemu-devel

Revision: 5979
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5979
Author:   blueswir1
Date:     2008-12-11 19:12:25 +0000 (Thu, 11 Dec 2008)

Log Message:
-----------
Fix compiling without MREMAP_FIXED

Modified Paths:
--------------
    trunk/linux-user/mmap.c

Modified: trunk/linux-user/mmap.c
===================================================================
--- trunk/linux-user/mmap.c	2008-12-11 17:30:50 UTC (rev 5978)
+++ trunk/linux-user/mmap.c	2008-12-11 19:12:25 UTC (rev 5979)
@@ -546,6 +546,7 @@
 
     mmap_lock();
 
+#if defined(MREMAP_FIXED)
     if (flags & MREMAP_FIXED)
         host_addr = mremap(g2h(old_addr), old_size, new_size,
                            flags, new_addr);
@@ -560,7 +561,9 @@
         } else
             host_addr = mremap(g2h(old_addr), old_size, new_size,
                                flags | MREMAP_FIXED, g2h(mmap_start));
-    } else {
+    } else
+#endif
+    {
         host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
         /* Check if address fits target address space */
         if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED
  2008-12-11 19:12 [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED Blue Swirl
@ 2008-12-11 19:33 ` Kirill A. Shutemov
  2008-12-12 13:37   ` Kirill A. Shutemov
  2008-12-12 16:27   ` Blue Swirl
  0 siblings, 2 replies; 7+ messages in thread
From: Kirill A. Shutemov @ 2008-12-11 19:33 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1497 bytes --]

On Thu, Dec 11, 2008 at 07:12:26PM +0000, Blue Swirl wrote:
> Revision: 5979
>           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5979
> Author:   blueswir1
> Date:     2008-12-11 19:12:25 +0000 (Thu, 11 Dec 2008)
> 
> Log Message:
> -----------
> Fix compiling without MREMAP_FIXED
> 
> Modified Paths:
> --------------
>     trunk/linux-user/mmap.c
> 
> Modified: trunk/linux-user/mmap.c
> ===================================================================
> --- trunk/linux-user/mmap.c	2008-12-11 17:30:50 UTC (rev 5978)
> +++ trunk/linux-user/mmap.c	2008-12-11 19:12:25 UTC (rev 5979)
> @@ -546,6 +546,7 @@
>  
>      mmap_lock();
>  
> +#if defined(MREMAP_FIXED)
>      if (flags & MREMAP_FIXED)
>          host_addr = mremap(g2h(old_addr), old_size, new_size,
>                             flags, new_addr);
> @@ -560,7 +561,9 @@
>          } else
>              host_addr = mremap(g2h(old_addr), old_size, new_size,
>                                 flags | MREMAP_FIXED, g2h(mmap_start));
> -    } else {
> +    } else
> +#endif
> +    {
>          host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
>          /* Check if address fits target address space */
>          if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {

I've posted patch that fix building for glibc < 2.4. Please apply my
patch instead of it.
-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.org/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED
  2008-12-11 19:33 ` Kirill A. Shutemov
@ 2008-12-12 13:37   ` Kirill A. Shutemov
  2008-12-12 16:27   ` Blue Swirl
  1 sibling, 0 replies; 7+ messages in thread
From: Kirill A. Shutemov @ 2008-12-12 13:37 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]

On Thu, Dec 11, 2008 at 09:33:49PM +0200, Kirill A. Shutemov wrote:
> On Thu, Dec 11, 2008 at 07:12:26PM +0000, Blue Swirl wrote:
> > Revision: 5979
> >           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5979
> > Author:   blueswir1
> > Date:     2008-12-11 19:12:25 +0000 (Thu, 11 Dec 2008)
> > 
> > Log Message:
> > -----------
> > Fix compiling without MREMAP_FIXED
> > 
> > Modified Paths:
> > --------------
> >     trunk/linux-user/mmap.c
> > 
> > Modified: trunk/linux-user/mmap.c
> > ===================================================================
> > --- trunk/linux-user/mmap.c	2008-12-11 17:30:50 UTC (rev 5978)
> > +++ trunk/linux-user/mmap.c	2008-12-11 19:12:25 UTC (rev 5979)
> > @@ -546,6 +546,7 @@
> >  
> >      mmap_lock();
> >  
> > +#if defined(MREMAP_FIXED)
> >      if (flags & MREMAP_FIXED)
> >          host_addr = mremap(g2h(old_addr), old_size, new_size,
> >                             flags, new_addr);
> > @@ -560,7 +561,9 @@
> >          } else
> >              host_addr = mremap(g2h(old_addr), old_size, new_size,
> >                                 flags | MREMAP_FIXED, g2h(mmap_start));
> > -    } else {
> > +    } else
> > +#endif
> > +    {
> >          host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
> >          /* Check if address fits target address space */
> >          if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {
> 
> I've posted patch that fix building for glibc < 2.4. Please apply my
> patch instead of it.

ping.

-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.org/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED
  2008-12-11 19:33 ` Kirill A. Shutemov
  2008-12-12 13:37   ` Kirill A. Shutemov
@ 2008-12-12 16:27   ` Blue Swirl
  2008-12-12 19:11     ` Kirill A. Shutemov
  1 sibling, 1 reply; 7+ messages in thread
From: Blue Swirl @ 2008-12-12 16:27 UTC (permalink / raw)
  To: qemu-devel

On 12/11/08, Kirill A. Shutemov <kirill@shutemov.name> wrote:
> On Thu, Dec 11, 2008 at 07:12:26PM +0000, Blue Swirl wrote:
>  > Revision: 5979
>  >           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5979
>  > Author:   blueswir1
>  > Date:     2008-12-11 19:12:25 +0000 (Thu, 11 Dec 2008)
>  >
>  > Log Message:
>  > -----------
>  > Fix compiling without MREMAP_FIXED
>  >
>  > Modified Paths:
>  > --------------
>  >     trunk/linux-user/mmap.c
>  >
>  > Modified: trunk/linux-user/mmap.c
>  > ===================================================================
>  > --- trunk/linux-user/mmap.c   2008-12-11 17:30:50 UTC (rev 5978)
>  > +++ trunk/linux-user/mmap.c   2008-12-11 19:12:25 UTC (rev 5979)
>  > @@ -546,6 +546,7 @@
>  >
>  >      mmap_lock();
>  >
>  > +#if defined(MREMAP_FIXED)
>  >      if (flags & MREMAP_FIXED)
>  >          host_addr = mremap(g2h(old_addr), old_size, new_size,
>  >                             flags, new_addr);
>  > @@ -560,7 +561,9 @@
>  >          } else
>  >              host_addr = mremap(g2h(old_addr), old_size, new_size,
>  >                                 flags | MREMAP_FIXED, g2h(mmap_start));
>  > -    } else {
>  > +    } else
>  > +#endif
>  > +    {
>  >          host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
>  >          /* Check if address fits target address space */
>  >          if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {
>
>
> I've posted patch that fix building for glibc < 2.4. Please apply my
>  patch instead of it.

Your fix depends on linux headers, is that safe?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED
  2008-12-12 16:27   ` Blue Swirl
@ 2008-12-12 19:11     ` Kirill A. Shutemov
  2008-12-14 17:43       ` Kirill A. Shutemov
  0 siblings, 1 reply; 7+ messages in thread
From: Kirill A. Shutemov @ 2008-12-12 19:11 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1917 bytes --]

On Fri, Dec 12, 2008 at 06:27:23PM +0200, Blue Swirl wrote:
> On 12/11/08, Kirill A. Shutemov <kirill@shutemov.name> wrote:
> > On Thu, Dec 11, 2008 at 07:12:26PM +0000, Blue Swirl wrote:
> >  > Revision: 5979
> >  >           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5979
> >  > Author:   blueswir1
> >  > Date:     2008-12-11 19:12:25 +0000 (Thu, 11 Dec 2008)
> >  >
> >  > Log Message:
> >  > -----------
> >  > Fix compiling without MREMAP_FIXED
> >  >
> >  > Modified Paths:
> >  > --------------
> >  >     trunk/linux-user/mmap.c
> >  >
> >  > Modified: trunk/linux-user/mmap.c
> >  > ===================================================================
> >  > --- trunk/linux-user/mmap.c   2008-12-11 17:30:50 UTC (rev 5978)
> >  > +++ trunk/linux-user/mmap.c   2008-12-11 19:12:25 UTC (rev 5979)
> >  > @@ -546,6 +546,7 @@
> >  >
> >  >      mmap_lock();
> >  >
> >  > +#if defined(MREMAP_FIXED)
> >  >      if (flags & MREMAP_FIXED)
> >  >          host_addr = mremap(g2h(old_addr), old_size, new_size,
> >  >                             flags, new_addr);
> >  > @@ -560,7 +561,9 @@
> >  >          } else
> >  >              host_addr = mremap(g2h(old_addr), old_size, new_size,
> >  >                                 flags | MREMAP_FIXED, g2h(mmap_start));
> >  > -    } else {
> >  > +    } else
> >  > +#endif
> >  > +    {
> >  >          host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
> >  >          /* Check if address fits target address space */
> >  >          if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {
> >
> >
> > I've posted patch that fix building for glibc < 2.4. Please apply my
> >  patch instead of it.
> 
> Your fix depends on linux headers, is that safe?

Why not? glibc also depends on it.

-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.org/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED
  2008-12-12 19:11     ` Kirill A. Shutemov
@ 2008-12-14 17:43       ` Kirill A. Shutemov
  2008-12-15 18:06         ` Blue Swirl
  0 siblings, 1 reply; 7+ messages in thread
From: Kirill A. Shutemov @ 2008-12-14 17:43 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2113 bytes --]

On Fri, Dec 12, 2008 at 09:11:19PM +0200, Kirill A. Shutemov wrote:
> On Fri, Dec 12, 2008 at 06:27:23PM +0200, Blue Swirl wrote:
> > On 12/11/08, Kirill A. Shutemov <kirill@shutemov.name> wrote:
> > > On Thu, Dec 11, 2008 at 07:12:26PM +0000, Blue Swirl wrote:
> > >  > Revision: 5979
> > >  >           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5979
> > >  > Author:   blueswir1
> > >  > Date:     2008-12-11 19:12:25 +0000 (Thu, 11 Dec 2008)
> > >  >
> > >  > Log Message:
> > >  > -----------
> > >  > Fix compiling without MREMAP_FIXED
> > >  >
> > >  > Modified Paths:
> > >  > --------------
> > >  >     trunk/linux-user/mmap.c
> > >  >
> > >  > Modified: trunk/linux-user/mmap.c
> > >  > ===================================================================
> > >  > --- trunk/linux-user/mmap.c   2008-12-11 17:30:50 UTC (rev 5978)
> > >  > +++ trunk/linux-user/mmap.c   2008-12-11 19:12:25 UTC (rev 5979)
> > >  > @@ -546,6 +546,7 @@
> > >  >
> > >  >      mmap_lock();
> > >  >
> > >  > +#if defined(MREMAP_FIXED)
> > >  >      if (flags & MREMAP_FIXED)
> > >  >          host_addr = mremap(g2h(old_addr), old_size, new_size,
> > >  >                             flags, new_addr);
> > >  > @@ -560,7 +561,9 @@
> > >  >          } else
> > >  >              host_addr = mremap(g2h(old_addr), old_size, new_size,
> > >  >                                 flags | MREMAP_FIXED, g2h(mmap_start));
> > >  > -    } else {
> > >  > +    } else
> > >  > +#endif
> > >  > +    {
> > >  >          host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
> > >  >          /* Check if address fits target address space */
> > >  >          if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {
> > >
> > >
> > > I've posted patch that fix building for glibc < 2.4. Please apply my
> > >  patch instead of it.
> > 
> > Your fix depends on linux headers, is that safe?
> 
> Why not? glibc also depends on it.

Blue, please commit my patch.

-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.org/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED
  2008-12-14 17:43       ` Kirill A. Shutemov
@ 2008-12-15 18:06         ` Blue Swirl
  0 siblings, 0 replies; 7+ messages in thread
From: Blue Swirl @ 2008-12-15 18:06 UTC (permalink / raw)
  To: qemu-devel

On 12/14/08, Kirill A. Shutemov <kirill@shutemov.name> wrote:
> On Fri, Dec 12, 2008 at 09:11:19PM +0200, Kirill A. Shutemov wrote:
>  > On Fri, Dec 12, 2008 at 06:27:23PM +0200, Blue Swirl wrote:
>  > > On 12/11/08, Kirill A. Shutemov <kirill@shutemov.name> wrote:
>  > > > On Thu, Dec 11, 2008 at 07:12:26PM +0000, Blue Swirl wrote:
>  > > >  > Revision: 5979
>  > > >  >           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5979
>  > > >  > Author:   blueswir1
>  > > >  > Date:     2008-12-11 19:12:25 +0000 (Thu, 11 Dec 2008)
>  > > >  >
>  > > >  > Log Message:
>  > > >  > -----------
>  > > >  > Fix compiling without MREMAP_FIXED
>  > > >  >
>  > > >  > Modified Paths:
>  > > >  > --------------
>  > > >  >     trunk/linux-user/mmap.c
>  > > >  >
>  > > >  > Modified: trunk/linux-user/mmap.c
>  > > >  > ===================================================================
>  > > >  > --- trunk/linux-user/mmap.c   2008-12-11 17:30:50 UTC (rev 5978)
>  > > >  > +++ trunk/linux-user/mmap.c   2008-12-11 19:12:25 UTC (rev 5979)
>  > > >  > @@ -546,6 +546,7 @@
>  > > >  >
>  > > >  >      mmap_lock();
>  > > >  >
>  > > >  > +#if defined(MREMAP_FIXED)
>  > > >  >      if (flags & MREMAP_FIXED)
>  > > >  >          host_addr = mremap(g2h(old_addr), old_size, new_size,
>  > > >  >                             flags, new_addr);
>  > > >  > @@ -560,7 +561,9 @@
>  > > >  >          } else
>  > > >  >              host_addr = mremap(g2h(old_addr), old_size, new_size,
>  > > >  >                                 flags | MREMAP_FIXED, g2h(mmap_start));
>  > > >  > -    } else {
>  > > >  > +    } else
>  > > >  > +#endif
>  > > >  > +    {
>  > > >  >          host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
>  > > >  >          /* Check if address fits target address space */
>  > > >  >          if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {
>  > > >
>  > > >
>  > > > I've posted patch that fix building for glibc < 2.4. Please apply my
>  > > >  patch instead of it.
>  > >
>  > > Your fix depends on linux headers, is that safe?
>  >
>  > Why not? glibc also depends on it.
>
>
> Blue, please commit my patch.

I committed a fix, but I had to use syscall also for mremap a few
lines above. Let's hope no distros remove linux/mmap.h or
linux/unistd.h.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-12-15 18:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-11 19:12 [Qemu-devel] [5979] Fix compiling without MREMAP_FIXED Blue Swirl
2008-12-11 19:33 ` Kirill A. Shutemov
2008-12-12 13:37   ` Kirill A. Shutemov
2008-12-12 16:27   ` Blue Swirl
2008-12-12 19:11     ` Kirill A. Shutemov
2008-12-14 17:43       ` Kirill A. Shutemov
2008-12-15 18:06         ` Blue Swirl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.