linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: kosaki.motohiro@jp.fujitsu.com, Hugh Dickins <hughd@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Paul Mundt <lethal@linux-sh.org>,
	Russell King <linux@arm.linux.org.uk>
Subject: Re: mm: convert vma->vm_flags to 64bit
Date: Mon, 18 Apr 2011 12:34:02 +0900 (JST)	[thread overview]
Message-ID: <20110418123422.9341.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <1303091139.28876.152.camel@pasglop>

Hi

> On Sun, 2011-04-17 at 17:26 -0700, Hugh Dickins wrote:
> > I am surprised that
> > #define VM_EXEC         0x00000004ULL
> > does not cause trouble for arch/arm/kernel/asm-offsets.c,
> > but you tried cross-building it which I never did.
> 
> It would probably cause trouble for a big endian ARM no ? In that case
> it should offset the load by 4.

I think you are talking two thing, VM_EXEC and offsetof(vm_flags).
Therefore I'd explain my code reading result of two.

1) VM_EXEC

arch/arm/kernel/asm-offsets.c
----------------------------------------------------------------
  DEFINE(VM_EXEC,               VM_EXEC);

kbuild.h
----------------------------------------------------------------
#define DEFINE(sym, val) \
        asm volatile("\n->" #sym " %0 " #val : : "i" (val))

In this case, gcc asm() statement recognize C suffix and then
we don't see compile and/or link-time error.

2) vm_flags

arch/arm/kernel/asm-offsets.c
----------------------------------------------------------------
  DEFINE(VMA_VM_FLAGS,          offsetof(struct vm_area_struct, vm_flags));

OK, this is risky. we have to see all of users of this.


arch/arm/mm/proc-macros.S
----------------------------------------------------------------
/*
 * vma_vm_flags - get vma->vm_flags
 */
        .macro  vma_vm_flags, rd, rn
        ldr     \rd, [\rn, #VMA_VM_FLAGS]
        .endm


VMA_VM_FLAGS is only used this macro. then, we only need to see
vma_vm_flags assembler macro.

Next, 

% grep ENDIAN arch/arm/configs/*
arch/arm/configs/ixp2000_defconfig:CONFIG_CPU_BIG_ENDIAN=y
arch/arm/configs/ixp23xx_defconfig:CONFIG_CPU_BIG_ENDIAN=y
arch/arm/configs/ixp4xx_defconfig:CONFIG_CPU_BIG_ENDIAN=y

We only need to care the three subarch.

-----------------------------------------------------------
config ARCH_IXP23XX
        bool "IXP23XX-based"
        depends on MMU
        select CPU_XSC3
        select PCI
        select ARCH_USES_GETTIMEOFFSET
        help
          Support for Intel's IXP23xx (XScale) family of processors.

config ARCH_IXP2000
        bool "IXP2400/2800-based"
        depends on MMU
        select CPU_XSCALE
        select PCI
        select ARCH_USES_GETTIMEOFFSET
        help
          Support for Intel's IXP2400/2800 (XScale) family of processors.

config ARCH_IXP4XX
        bool "IXP4xx-based"
        depends on MMU
        select CPU_XSCALE
        select GENERIC_GPIO
        select GENERIC_CLOCKEVENTS
        select HAVE_SCHED_CLOCK
        select MIGHT_HAVE_PCI
        select DMABOUNCE if PCI
        help
          Support for Intel's IXP4XX (XScale) family of processors.
-----------------------------------------------------------

and they are CONFIG_CPU_XSCALE or CONFIG_CPU_XSC3.

arch/arm/mm/Makefile
-----------------------------------------------------------
obj-$(CONFIG_CPU_XSCALE)        += proc-xscale.o
obj-$(CONFIG_CPU_XSC3)          += proc-xsc3.o

grep -c  vma_vm_flags arch/arm/mm/proc-{xscale,xsc3}.S
arch/arm/mm/proc-xscale.S:0
arch/arm/mm/proc-xsc3.S:0


Then, current big endian user aren't harm from this change.

Of course, I might take mistake. I'm not arm expert. please correct
me if I'm misunderstand.



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-04-18  3:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12  6:10 KOSAKI Motohiro
2011-04-12  6:33 ` Andrew Morton
2011-04-12  7:12   ` KOSAKI Motohiro
2011-04-12 11:06     ` Alexey Dobriyan
2011-04-12 11:11       ` Alexey Dobriyan
2011-04-12 22:07       ` Benjamin Herrenschmidt
2011-04-13  0:13         ` KOSAKI Motohiro
2011-04-13  6:44           ` Alexey Dobriyan
2011-04-13  7:00             ` Benjamin Herrenschmidt
2011-04-13  7:29               ` Russell King - ARM Linux
2011-04-13  8:56                 ` Benjamin Herrenschmidt
2011-04-13  8:34               ` KOSAKI Motohiro
2011-04-13  7:04             ` KOSAKI Motohiro
2011-04-12 23:41       ` KOSAKI Motohiro
2011-04-13  2:19         ` [PATCH 1/3] mm: add __nocast attribute to vm_flags KOSAKI Motohiro
2011-04-13  2:20           ` [PATCH 2/3] fremap: convert vm_flags to unsigned long long KOSAKI Motohiro
2011-04-13  2:21           ` [PATCH 3/3] procfs: " KOSAKI Motohiro
2011-04-12 20:30   ` mm: convert vma->vm_flags to 64bit Russell King - ARM Linux
2011-04-18  0:26 ` Hugh Dickins
2011-04-18  1:21   ` KOSAKI Motohiro
2011-04-18  1:45   ` Benjamin Herrenschmidt
2011-04-18  3:34     ` KOSAKI Motohiro [this message]
2011-11-10  4:09 ` Nai Xia
2011-11-10  4:49   ` David Rientjes
2011-11-11  8:52     ` Russell King - ARM Linux
2011-11-10 17:22   ` KOSAKI Motohiro
2011-11-10 21:12     ` Benjamin Herrenschmidt
2011-11-10 21:49       ` KOSAKI Motohiro
2011-11-11  8:42         ` Russell King - ARM Linux
2011-11-11  2:09       ` Hugh Dickins
2011-11-11  4:31         ` Benjamin Herrenschmidt
2011-11-11  8:38           ` Nai Xia

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=20110418123422.9341.A69D9226@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@arm.linux.org.uk \
    /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