public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: Andrew Stubbs <ams@codesourcery.com>
Cc: "libc-ports@sourceware.org" <libc-ports@sourceware.org>
Subject: Re: [PATCH] PAGE_SIZE definition for MIPS XLP
Date: Tue, 19 Nov 2013 03:28:00 -0000	[thread overview]
Message-ID: <CA+=Sn1nSOoXDFzmCbBEREJiQCxg_GoPXf6QNBS5UFRmQMVng8A@mail.gmail.com> (raw)
In-Reply-To: <528A0813.10005@codesourcery.com>

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

On Mon, Nov 18, 2013 at 4:29 AM, Andrew Stubbs <ams@codesourcery.com> wrote:
> MIPS' sys/user.h currently has a constant definition for PAGE_SIZE, and the
> other related settings. This is not appropriate for XLP (and other MIPS?)
> where the actual page size is a kernel configuration option.

The whole Octeon series of MIPS64 processors also supports other
PAGE_SIZEs.  Also the generic MIPS glibc should support other page
sizes too.

>
> Apart from the general principle of not having incorrect definitions, the
> actual problem that needs to be solved is in
> sysdeps/unix/sysv/linux/ifaddrs.c in which PAGE_SIZE is used by preference
> as an optimization. Most of the other possible use cases prefer to call
> __getpagesize or use sysconf, and so are unaffected.
>
> Clearly, keeping the constant definition is desirable on at least some MIPS
> variants, in order to keep the optimization, but not for XLP.

No it is not desirable if you want a generic glibc which works on all MIPS64.

>
> The attached patch makes the definition conditional, rather than removing it
> completely. It's not clear to me whether the HOST_* definitions are
> similarly affected, but other platforms that do not define PAGE_SIZE also
> choose not to define those, so I've extended the ifndef similarly.
>
> I this OK to commit? Should it be solved a different way?

I think my attached patch is better way of fixing this issue which
just deletes them rather than special casing them.

Thanks,
Andrew Pinski

>
> Testcase tst-limits does check PAGE_SIZE matches, if defined, but not in
> this case because that test case does not include sys/user.h. Should I
> create a new test case for this, or include that header in the existing
> test?
>
> Thanks
>
> Andrew

[-- Attachment #2: removepagesize.diff.txt --]
[-- Type: text/plain, Size: 1019 bytes --]

commit 20364b09f52a6cb93188752b825b65fbad82e4d7
Author: Andrew Pinski <apinski@cavium.com>
Date:   Wed Jul 11 19:28:58 2012 -0700

    [PATCH 12/19] 2012-07-11  Andrew Pinski  <apinski@cavium.com>
    
    	Bug #2964
    	* ports/sysdeps/unix/sysv/linux/mips/sys/user.h (PAGE_SHIFT): Delete.
    	(PAGE_SIZE): Delete.
    	(PAGE_MASK): Delete.
    	(NBPG): Delete.
    	(HOST_STACK_END_ADDR): Delete.

diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/user.h b/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
index 950cad7..6e83b80 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
@@ -206,13 +206,8 @@ struct user {
 
 #endif
 
-#define PAGE_SHIFT		12
-#define PAGE_SIZE		(1UL << PAGE_SHIFT)
-#define PAGE_MASK		(~(PAGE_SIZE-1))
-#define NBPG			PAGE_SIZE
 #define UPAGES			1
 #define HOST_TEXT_START_ADDR	(u.start_code)
 #define HOST_DATA_START_ADDR	(u.start_data)
-#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
 
 #endif	/* _SYS_USER_H */

  parent reply	other threads:[~2013-11-19  2:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 12:51 Andrew Stubbs
2013-11-18 13:42 ` Andreas Schwab
2013-11-19 20:56   ` Maciej W. Rozycki
2013-11-18 13:45 ` Joseph S. Myers
2013-11-18 18:21 ` Joseph S. Myers
2013-11-19  3:28 ` Andrew Pinski [this message]
2013-11-19 14:57   ` Joseph S. Myers
2013-11-19 20:19     ` Andrew Stubbs
2013-11-20 19:57   ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+=Sn1nSOoXDFzmCbBEREJiQCxg_GoPXf6QNBS5UFRmQMVng8A@mail.gmail.com' \
    --to=pinskia@gmail.com \
    --cc=ams@codesourcery.com \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).