lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160706104753.74daeaa2@mschwide>
Date:	Wed, 6 Jul 2016 10:47:53 +0200
From:	Martin Schwidefsky <schwidefsky@...ibm.com>
To:	"Hillf Danton" <hillf.zj@...baba-inc.com>
Cc:	"'linux-kernel'" <linux-kernel@...r.kernel.org>,
	<linux-mm@...ck.org>
Subject: Re: [PATCH 2/2] s390/mm: use ipte range to invalidate multiple page
 table entries

On Wed, 06 Jul 2016 14:42:16 +0800
"Hillf Danton" <hillf.zj@...baba-inc.com> wrote:

> > > >
> > > > +void ptep_invalidate_range(struct mm_struct *mm, unsigned long start,
> > > > +			   unsigned long end, pte_t *ptep)
> > > > +{
> > > > +	unsigned long nr;
> > > > +
> > > > +	if (!MACHINE_HAS_IPTE_RANGE || mm_has_pgste(mm))
> > > > +		return;
> > > > +	preempt_disable();
> > > > +	nr = (end - start) >> PAGE_SHIFT;
> > > > +	/* If the flush is likely to be local skip the ipte range */
> > > > +	if (nr && !cpumask_equal(mm_cpumask(mm),
> > > > +				 cpumask_of(smp_processor_id())))
> > >
> > > s/smp/raw_smp/ to avoid adding schedule entry with page table
> > > lock held?
> > 
> > There can not be a schedule entry with either the page table lock held
> > or the preempt_disable() a few lines above.
> > 
> Yes, Sir.
> 
> > > > +		__ptep_ipte_range(start, nr - 1, ptep);
> > > > +	preempt_enable();
> 
> Then would you please, Sir, take a look at another case where
> preempt is enabled?

You are still a bit cryptic, are you trying to tell me that your hint is
about trying to avoid the preempt_enable() call? 

The reason why I added the preempt_disable()/preempt_enable() pair to
ptep_invalidate_range is that I recently got bitten by a preempt problem
in the ptep_xchg_lazy() function which is used for ptep_get_and_clear().
Now ptep_get_and_clear() is used in vunmap_pte_range() which is called
while preemption is allowed.

To keep things symmetrical it seems sensible to explicitely disable
preemption on all ptep_xxx code paths with cpu mask checks, no?

-- 
blue skies,
   Martin.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ