All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ralf Baechle <ralf@linux-mips.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] s390: Add pmd_mknotpresent()
Date: Mon, 29 Oct 2012 12:30:06 +0100	[thread overview]
Message-ID: <20121029123006.5eae86ea@mschwide> (raw)
In-Reply-To: <20121029110519.GA22569@gmail.com>

On Mon, 29 Oct 2012 12:05:19 +0100
Ingo Molnar <mingo@kernel.org> wrote:

> 
> * Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:
> 
> > On Sun, 28 Oct 2012 14:10:14 +0100
> > Ingo Molnar <mingo@kernel.org> wrote:
> > 
> > > 
> > > There's a related problem on s390: other THP implementations 
> > > have pmd_mknotpresent() while s390 not, resulting in:
> > > 
> > >   mm/huge_memory.c:1543:2: error: implicit declaration of function 'pmd_mknotpresent'
> > > 
> > > The (untested!) patch below adds the s390 version of this 
> > > method.
> > > 
> > > Gerald, Martin, did I get the S390 details right?
> > 
> > This won't work I'm afraid. S390 uses invalid bits which need 
> > to be set to make an entry not present. Just setting the 
> > _SEGMENT_ENTRY_INV bit is not good enough either, there is 
> > _HPAGE_TYPE_NONE to consider. The patch to fix this for 
> > pmd_none & pmd_present just got added to the s390 tree on 
> > kernel.org:
> >
> > https://git.kernel.org/?p=linux/kernel/git/s390/linux.git;a=shortlog;h=refs/heads/fixes
> > 
> > Now, if pmd_mknotpresent is supposed to make the entry invalid 
> > so that pmd_present will return false the function needs to do 
> > two things, 1) set the _SEGMENT_ENTRY_INV bit, and 2) clear 
> > the _SEGMENT_ENTRY_RO bit.
> 
> Would be nice if you could send me your suggested 
> pmd_mknotpresent().
> 
> (Writing it into the email would be enough, I can turn it into a 
> patch - but a patch would be welcome as well.)

This would look like the following, the patch should apply to all recent
kernel version.
--
Subject: [PATCH] s390,mm: add pmd_mknotpresent

Fix the following build problem in huge_memory:

mm/huge_memory.c:1543:2: error: implicit declaration of function 'pmd_mknotpresent'

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---
 arch/s390/include/asm/pgtable.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 335b601..4a84431 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -1326,6 +1326,13 @@ static inline pmd_t pmd_mkyoung(pmd_t pmd)
 	return pmd;
 }
 
+static inline pmd_t pmd_mknotpresent(pmd_t pmd)
+{
+	pmd_val(pmd) |= _SEGMENT_ENTRY_INV;
+	pmd_val(pmd) &= ~_SEGMENT_ENTRY_RO;
+	return pmd;
+}
+
 #define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
 static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
 					    unsigned long address, pmd_t *pmdp)
-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


  reply	other threads:[~2012-10-29 11:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  6:22 linux-next: build failure after merge of the final tree (tip/s390 trees related) Stephen Rothwell
2012-10-18 14:51 ` Ralf Baechle
2012-10-19  2:56   ` Stephen Rothwell
2012-10-19 21:48   ` Ingo Molnar
2012-10-20  1:07   ` [tip:numa/core] MIPS/thp: Add pmd_pgprot() implementation tip-bot for Ralf Baechle
2012-10-20  1:08   ` [tip:numa/core] MIPS/thp: Fix update_mmu_cache() cache call tip-bot for Ingo Molnar
2012-10-18 15:02 ` linux-next: build failure after merge of the final tree (tip/s390 trees related) Ralf Baechle
2012-10-19 21:52   ` Peter Zijlstra
2012-10-19 22:36     ` Ingo Molnar
2012-10-19 22:39     ` Ingo Molnar
2012-10-20  2:31       ` Stephen Rothwell
2012-10-18 16:26 ` Gerald Schaefer
2012-10-19  2:57   ` Stephen Rothwell
2012-10-19 21:37   ` Ingo Molnar
2012-10-20  1:06   ` [tip:numa/core] s390/thp: implement pmd_pgprot() for s390 tip-bot for Gerald Schaefer
2012-10-28 13:10   ` [PATCH] s390: Add pmd_mknotpresent() Ingo Molnar
2012-10-28 17:16     ` [tip:numa/core] sched, numa, mm, s390/thp: " tip-bot for Ingo Molnar
2012-10-29  7:49     ` [PATCH] s390: " Martin Schwidefsky
2012-10-29 11:05       ` Ingo Molnar
2012-10-29 11:30         ` Martin Schwidefsky [this message]
2012-10-29 14:00     ` Gerald Schaefer
2012-10-30  7:25       ` Ingo Molnar
2012-10-18 18:29 ` linux-next: build failure after merge of the final tree (tip/s390 trees related) Ingo Molnar
2012-10-19  3:07   ` Stephen Rothwell
2012-10-19 22:43     ` Ingo Molnar
2012-10-20  2:32       ` Stephen Rothwell

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=20121029123006.5eae86ea@mschwide \
    --to=schwidefsky@de.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ralf@linux-mips.org \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    /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 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.