All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 6/7] drm/i915/fbc: move from crtc_state->enable_fbc to plane_state->enable_fbc
From: Ville Syrjälä @ 2016-11-14 20:26 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: intel-gfx
In-Reply-To: <1478897399.19391.61.camel@intel.com>

On Fri, Nov 11, 2016 at 06:49:59PM -0200, Paulo Zanoni wrote:
> Em Sex, 2016-11-11 às 22:24 +0200, Ville Syrjälä escreveu:
> > On Fri, Nov 11, 2016 at 05:57:28PM -0200, Paulo Zanoni wrote:
> > > 
> > > Em Sex, 2016-11-11 às 21:13 +0200, Ville Syrjälä escreveu:
> > > > 
> > > > On Fri, Nov 11, 2016 at 05:01:54PM -0200, Paulo Zanoni wrote:
> > > > > 
> > > > > 
> > > > > Em Sex, 2016-11-11 às 20:51 +0200, Ville Syrjälä escreveu:
> > > > > > 
> > > > > > 
> > > > > > On Fri, Nov 11, 2016 at 02:57:40PM -0200, Paulo Zanoni wrote:
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > Ville pointed out that intel_fbc_choose_crtc() is iterating
> > > > > > > over
> > > > > > > all
> > > > > > > planes instead of just the primary planes. There are no
> > > > > > > real
> > > > > > > consequences of this problem for HSW+, and for the other
> > > > > > > platforms
> > > > > > > it
> > > > > > > just means that in some obscure multi-screen cases we'll
> > > > > > > keep
> > > > > > > FBC
> > > > > > > disabled when we could have enabled it. Still, iterating
> > > > > > > over
> > > > > > > all
> > > > > > > planes doesn't seem to be the best thing to do.
> > > > > > > 
> > > > > > > My initial idea was to just add a check for plane->type and
> > > > > > > be
> > > > > > > done,
> > > > > > > but then I realized that in commits not involving the
> > > > > > > primary
> > > > > > > plane
> > > > > > > we
> > > > > > > would reset crtc_state->enable_fbc back to false even when
> > > > > > > FBC
> > > > > > > is
> > > > > > > enabled. That also wouldn't result in a bug due to the way
> > > > > > > the
> > > > > > > enable_fbc variable is checked, but, still, our code can be
> > > > > > > better
> > > > > > > than this.
> > > > > > > 
> > > > > > > So I went for the solution that involves tracking
> > > > > > > enable_fbc in
> > > > > > > the
> > > > > > > primary plane state instead of the CRTC state. This way, if
> > > > > > > a
> > > > > > > commit
> > > > > > > doesn't involve the primary plane for the CRTC we won't be
> > > > > > > resetting
> > > > > > > enable_fbc back to false, so the variable will always
> > > > > > > reflect
> > > > > > > the
> > > > > > > reality. And this change also makes more sense since FBC is
> > > > > > > actually
> > > > > > > tied to the single plane and not the full pipe. As a bonus,
> > > > > > > we
> > > > > > > only
> > > > > > > iterate over the CRTCs instead of iterating over all
> > > > > > > planes.
> > > > > > > 
> > > > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > > > Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > > > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > > > > > > ---
> > > > > > >  drivers/gpu/drm/i915/intel_drv.h |  4 ++--
> > > > > > >  drivers/gpu/drm/i915/intel_fbc.c | 36 +++++++++++++++++++-
> > > > > > > ----
> > > > > > > ----
> > > > > > > --------
> > > > > > >  2 files changed, 21 insertions(+), 19 deletions(-)
> > > > > > > 
> > > > > > > diff --git a/drivers/gpu/drm/i915/intel_drv.h
> > > > > > > b/drivers/gpu/drm/i915/intel_drv.h
> > > > > > > index 003afb8..025cb74 100644
> > > > > > > --- a/drivers/gpu/drm/i915/intel_drv.h
> > > > > > > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > > > > > > @@ -403,6 +403,8 @@ struct intel_plane_state {
> > > > > > >  	int scaler_id;
> > > > > > >  
> > > > > > >  	struct drm_intel_sprite_colorkey ckey;
> > > > > > > +
> > > > > > > +	bool enable_fbc;
> > > > > > >  };
> > > > > > >  
> > > > > > >  struct intel_initial_plane_config {
> > > > > > > @@ -648,8 +650,6 @@ struct intel_crtc_state {
> > > > > > >  
> > > > > > >  	bool ips_enabled;
> > > > > > >  
> > > > > > > -	bool enable_fbc;
> > > > > > > -
> > > > > > >  	bool double_wide;
> > > > > > >  
> > > > > > >  	bool dp_encoder_is_mst;
> > > > > > > diff --git a/drivers/gpu/drm/i915/intel_fbc.c
> > > > > > > b/drivers/gpu/drm/i915/intel_fbc.c
> > > > > > > index b095175..fc4ac57 100644
> > > > > > > --- a/drivers/gpu/drm/i915/intel_fbc.c
> > > > > > > +++ b/drivers/gpu/drm/i915/intel_fbc.c
> > > > > > > @@ -1055,16 +1055,17 @@ void intel_fbc_choose_crtc(struct
> > > > > > > drm_i915_private *dev_priv,
> > > > > > >  			   struct drm_atomic_state *state)
> > > > > > >  {
> > > > > > >  	struct intel_fbc *fbc = &dev_priv->fbc;
> > > > > > > -	struct drm_plane *plane;
> > > > > > > -	struct drm_plane_state *plane_state;
> > > > > > > +	struct drm_crtc *crtc;
> > > > > > > +	struct drm_crtc_state *crtc_state;
> > > > > > >  	bool crtc_chosen = false;
> > > > > > >  	int i;
> > > > > > >  
> > > > > > >  	mutex_lock(&fbc->lock);
> > > > > > >  
> > > > > > > -	/* Does this atomic commit involve the CRTC
> > > > > > > currently
> > > > > > > tied
> > > > > > > to FBC? */
> > > > > > > +	/* Does this atomic commit involve the plane
> > > > > > > currently
> > > > > > > tied to FBC? */
> > > > > > >  	if (fbc->crtc &&
> > > > > > > -	    !drm_atomic_get_existing_crtc_state(state,
> > > > > > > &fbc-
> > > > > > > > 
> > > > > > > > crtc-
> > > > > > > > 
> > > > > > > > base))
> > > > > > > +	    !drm_atomic_get_existing_plane_state(state,
> > > > > > > +						 fbc-
> > > > > > > >crtc-
> > > > > > > > 
> > > > > > > > 
> > > > > > > > base.primary))
> > > > > > >  		goto out;
> > > > > > >  
> > > > > > >  	if (!intel_fbc_can_enable(dev_priv))
> > > > > > > @@ -1074,25 +1075,26 @@ void intel_fbc_choose_crtc(struct
> > > > > > > drm_i915_private *dev_priv,
> > > > > > >  	 * plane. We could go for fancier schemes such as
> > > > > > > checking
> > > > > > > the plane
> > > > > > >  	 * size, but this would just affect the few
> > > > > > > platforms
> > > > > > > that
> > > > > > > don't tie FBC
> > > > > > >  	 * to pipe or plane A. */
> > > > > > > -	for_each_plane_in_state(state, plane, plane_state,
> > > > > > > i)
> > > > > > > {
> > > > > > > -		struct intel_plane_state
> > > > > > > *intel_plane_state =
> > > > > > > -			to_intel_plane_state(plane_state);
> > > > > > > -		struct intel_crtc_state *intel_crtc_state;
> > > > > > > -		struct intel_crtc *crtc =
> > > > > > > to_intel_crtc(plane_state->crtc);
> > > > > > > +	for_each_crtc_in_state(state, crtc, crtc_state, i)
> > > > > > > {
> > > > > > > +		struct intel_plane_state *plane_state =
> > > > > > > to_intel_plane_state(
> > > > > > > +			drm_atomic_get_existing_plane_stat
> > > > > > > e(st
> > > > > > > ate,
> > > > > > > +							  
> > > > > > >   cr
> > > > > > > tc-
> > > > > > > > 
> > > > > > > > 
> > > > > > > > primary));
> > > > > > > +		struct intel_crtc *intel_crtc =
> > > > > > > to_intel_crtc(crtc);
> > > > > > >  
> > > > > > > -		if (!intel_plane_state->base.visible)
> > > > > > > +		if (!plane_state)
> > > > > > >  			continue;
> > > > > > >  
> > > > > > > -		if (fbc_on_pipe_a_only(dev_priv) && crtc-
> > > > > > > >pipe 
> > > > > > > !=
> > > > > > > PIPE_A)
> > > > > > > +		if (!plane_state->base.visible)
> > > > > > >  			continue;
> > > > > > >  
> > > > > > > -		if (fbc_on_plane_a_only(dev_priv) && crtc-
> > > > > > > > 
> > > > > > > > plane
> > > > > > > != PLANE_A)
> > > > > > > +		if (fbc_on_pipe_a_only(dev_priv) &&
> > > > > > > intel_crtc-
> > > > > > > > 
> > > > > > > > 
> > > > > > > > pipe != PIPE_A)
> > > > > > >  			continue;
> > > > > > >  
> > > > > > > -		intel_crtc_state = to_intel_crtc_state(
> > > > > > > -			drm_atomic_get_existing_crtc_state
> > > > > > > (sta
> > > > > > > te,
> > > > > > > &crtc->base));
> > > > > > > +		if (fbc_on_plane_a_only(dev_priv) &&
> > > > > > > +		    intel_crtc->plane != PLANE_A)
> > > > > > > +			continue;
> > > > > > >  
> > > > > > > -		intel_crtc_state->enable_fbc = true;
> > > > > > > +		plane_state->enable_fbc = true;
> > > > > > 
> > > > > > So looking at this whole thing, I can't see anything that
> > > > > > would
> > > > > > prevent
> > > > > > enable_fbc being true for multiple primary planes at the same
> > > > > > time
> > > > > > Well, apart from the whole "we enable it only for platforms
> > > > > > that
> > > > > > can
> > > > > > only do
> > > > > > pipe A" thing.
> > > > > > 
> > > > > > So what happens in that case? FBC just ends up getting
> > > > > > enabling
> > > > > > on
> > > > > > one of the pipes based on the order intel_fbc_enable() gets
> > > > > > called,
> > > > > > or something?
> > > > > 
> > > > > The first check of intel_fbc_choose_crtc() is supposed to
> > > > > prevent
> > > > > this
> > > > > case: if fbc->crtc->primary is not included in the commit we
> > > > > just
> > > > > return without selecting any plane.
> > > > 
> > > > The fbc->crtc thing only works if intel_fbc_enable() was already
> > > > called
> > > > for some crtc. But what it it wasn't?
> > > > 
> > > > > 
> > > > > 
> > > > > Otherwise, we only pick one CRTC
> > > > > due to the "break;" statement after setting plane_state-
> > > > > >enable_fbc 
> > > > > to
> > > > > true.
> > > > 
> > > > Only one per atomic operation. But what if there are several
> > > > happening
> > > > in parallel on different crtcs?
> > > 
> > > I see your point now. Yeah, we'll end up with
> > > plane_state.enable_fbc=true for two different planes. Later, the
> > > first
> > > one to call intel_fbc_enable() will win, and the others will be
> > > ignored, so we'll indeed end up with plane states having
> > > enable_fbc=true but FBC not enabled by them. Not a real bug, I
> > > would
> > > still like to avoid this confusion.
> > > 
> > > The simplest solution I can think would be to just
> > > s/plane_state.enable_fbc/plane_state.can_enable_fbc/ and just let
> > > the
> > > first one to call intel_fbc_enable() win... And then, if we ever
> > > decide
> > > to enable FBC on the older platforms, we can choose to maybe
> > > implement
> > > a better method
> > 
> > Maybe something like "fbc_score"? ;)
> 
> The design of the current function was supposed to allow Ville to
> implement his fbc_score in case he wanted. But this certainly didn't
> take into account multiple parallel commits: it would only work if
> multiple CRTCs were included in the same commit (as you just pointed
> today).
> 
> But then: if we're having separate parallel commits, when would we be
> able to loop through the scores to only actually enable FBC on the best
> score? 
> 
> For example, if we do two parallel atomic_check()s and end with
> plane_a_score=1 and plane_b_score=2, then later we do A's commit() and
> call intel_fbc_enable() for it, how do we conclude that we shouldn't
> enable FBC for plane A? We're not even sure if plane B is going to
> actually commit the plane state it calculated (maybe it was
> check_only).
> 
> And then, if we decide to only compute everything during commit()
> instead of check(), we'll just also end up enabling FBC for plane A
> since A's commit() will run first and we'll have no idea that B's
> commit is incoming.
> 
> The only option would be to disable FBC for plane A and enable for
> plane B during B's commit. But I'm not looking forward to implement
> this right now.

All the enable/disable should be totally async and so you should be
able to kick them off from anywhere. All the state, including the scores,
would be protected by the fbc mutex. I had a vblank worker type of
thing for this purpose in my patches.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* Re: [PATCH v2] mm, thb: propagation of conditional compilation in khugepaged.c
From: Kirill A. Shutemov @ 2016-11-14 20:27 UTC (permalink / raw)
  To: Jérémy Lefaure; +Cc: Andrew Morton, Kirill A. Shutemov, linux-mm
In-Reply-To: <20161114201208.11474-1-jeremy.lefaure@lse.epita.fr>

On Mon, Nov 14, 2016 at 03:12:08PM -0500, Jeremy Lefaure wrote:
> Commit b46e756f5e47 ("thp: extract khugepaged from mm/huge_memory.c")
> moved code from huge_memory.c to khugepaged.c. Some of this code should
> be compiled only when CONFIG_SYSFS is enabled but the condition around
> this code was not moved into khugepaged.c. The result is a compilation
> error when CONFIG_SYSFS is disabled:
> 
> mm/built-in.o: In function `khugepaged_defrag_store':
> khugepaged.c:(.text+0x2d095): undefined reference to
> `single_hugepage_flag_store'
> mm/built-in.o: In function `khugepaged_defrag_show':
> khugepaged.c:(.text+0x2d0ab): undefined reference to
> `single_hugepage_flag_show'
> 
> This commit adds the #ifdef CONFIG_SYSFS around the code related to
> sysfs.
> 
> Signed-off-by: Jeremy Lefaure <jeremy.lefaure@lse.epita.fr>
> ---
> After having discuted with Hillf, I changed the subject to replace "thb" by
> "mm, thb". I also rewrote the subject.

s/thb/thp/

-- 
 Kirill A. Shutemov

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [PATCH 1/4] selinux: Minor cleanups
From: Paul Moore @ 2016-11-14 20:28 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: Stephen Smalley, Eric Paris, selinux
In-Reply-To: <1478812710-17190-2-git-send-email-agruenba@redhat.com>

On Thu, Nov 10, 2016 at 4:18 PM, Andreas Gruenbacher
<agruenba@redhat.com> wrote:
> Fix the comment for function __inode_security_revalidate, which returns
> an integer.
>
> Use the LABEL_* constants consistently for isec->initialized.
>
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> ---
>  security/selinux/hooks.c     | 3 ++-
>  security/selinux/selinuxfs.c | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)

Applied, thanks.

> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 09fd610..b98ab2a 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -237,6 +237,7 @@ static int inode_alloc_security(struct inode *inode)
>         isec->sid = SECINITSID_UNLABELED;
>         isec->sclass = SECCLASS_FILE;
>         isec->task_sid = sid;
> +       isec->initialized = LABEL_INVALID;
>         inode->i_security = isec;
>
>         return 0;
> @@ -247,7 +248,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
>  /*
>   * Try reloading inode security labels that have been marked as invalid.  The
>   * @may_sleep parameter indicates when sleeping and thus reloading labels is
> - * allowed; when set to false, returns ERR_PTR(-ECHILD) when the label is
> + * allowed; when set to false, returns -ECHILD when the label is
>   * invalid.  The @opt_dentry parameter should be set to a dentry of the inode;
>   * when no dentry is available, set it to NULL instead.
>   */
> diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
> index 72c145d..50fca20 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -1301,7 +1301,7 @@ static int sel_make_bools(void)
>                         goto out;
>
>                 isec->sid = sid;
> -               isec->initialized = 1;
> +               isec->initialized = LABEL_INITIALIZED;
>                 inode->i_fop = &sel_bool_ops;
>                 inode->i_ino = i|SEL_BOOL_INO_OFFSET;
>                 d_add(dentry, inode);
> @@ -1834,7 +1834,7 @@ static int sel_fill_super(struct super_block *sb, void *data, int silent)
>         isec = (struct inode_security_struct *)inode->i_security;
>         isec->sid = SECINITSID_DEVNULL;
>         isec->sclass = SECCLASS_CHR_FILE;
> -       isec->initialized = 1;
> +       isec->initialized = LABEL_INITIALIZED;
>
>         init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3));
>         d_add(dentry, inode);
> --
> 2.7.4
>



-- 
paul moore
www.paul-moore.com

^ permalink raw reply

* Re: Debugging Ethernet issues
From: Mason @ 2016-11-14 20:27 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Sebastian Frias, Andrew Lunn, netdev, Mans Rullgard,
	Sergei Shtylyov, Tom Lendacky, Zach Brown, Shaohui Xie, Tim Beale,
	Brian Hill, Vince Bridgers, Balakumaran Kannan, David S. Miller,
	Kirill Kapranov
In-Reply-To: <2187db98-dc5a-7a3c-7965-7ccbeffc0fa1@gmail.com>

On 14/11/2016 19:20, Florian Fainelli wrote:

> On 11/14/2016 09:59 AM, Sebastian Frias wrote:
>
>> Could you confirm that Mason's patch is correct and/or that it does not
>> has negative side-effects?
> 
> The patch is not correct nor incorrect per-se, it changes the default
> policy of having pause frames advertised by default to not having them
> advertised by default. This influences both your Ethernet MAC and the
> link partner in that the result is either flow control is enabled
> (before) or it is not (with the patch). There must be something amiss if
> you see packet loss or some kind of problem like that with an early
> exchange such as DHCP. Flow control tend to kick in under higher packet
> rates (at least, that's what you expect).

Did you note that, without the change under discussion (i.e. with
the eth driver as it is upstream), when the board is connected to
a 100 Mbps switch, then *nothing* works *systematically (no ping,
no DHCP; are there other relevant low-level network tools?).

Also, maybe this comment was lost in my own noise:

If I manually set the link up, then down, then run udhcpc
=> then nothing works, as if something is wedged somewhere
(a kernel thread gets borked by a race condition?)

Could not advertising pause frames result in making such a
race condition impossible? (I don't really believe in a race,
due to the 100% nature of the problem.)

>> Right now we know that Mason's patch makes this work, but we do not understand
>> why nor its implications.
> 
> You need to understand why, right now, the way this problem is
> presented, you came up with a workaround, not with the root cause or the
> solution. What does your link partner (switch?) reports, that is, what
> is the ethtool output when you have a link up from your nb8800 adapter?

Isn't that what ethtool -a eth0 prints?
How do I get the link partner information?
Just ethtool eth0?

Regards.

^ permalink raw reply

* [PATCH RFC] ARM: dts: add support for Turris Omnia
From: Andrew Lunn @ 2016-11-14 20:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161114201640.rr32iyjf5a53v33t@perseus.defre.kleine-koenig.org>

> 
> +               i2c at 7 {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +                       reg = <7>;
> +
> +                       pcawan: gpio at 71 {
> +                               compatible = "nxp,pca9538";
> +                               reg = <0x71>;
> +
> +                               pinctrl-names = "default";
> +                               pinctrl-0 = <&pcawan_pins>;
> +
> +                               interrupt-parent = <&gpio1>;
> +                               interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
> +
> +                               gpio-controller;
> +                               #gpio-cells = <2>;
> +
> +                               interrupt-controller;
> +                               #interrupt-cells = <2>;
> +                       };
> +               };
> 
> The interrupt-controller part doesn't seem to work though, at least
> 
> +               interrupt-parent = <&pcawan>;
> +               interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
> 
> in the phy node gives an error.

Interrupts don't seem to work very well with the nxp,pca9538. Which
is probably why it is disabled by default.

   Andrew

^ permalink raw reply

* Re: [PATCH RFC] ARM: dts: add support for Turris Omnia
From: Andrew Lunn @ 2016-11-14 20:28 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: tomas.hlavacek-x+rMaJPWets, Mark Rutland, marex-ynQEQJNshbs,
	Jason Cooper, Martin Strba??ka, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Gregory Clement,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Sebastian Hesselbarth
In-Reply-To: <20161114201640.rr32iyjf5a53v33t-jgopVnDzZD+b0XQX99//ntPVjbGH4+40kFgPdswSElo@public.gmane.org>

> 
> +               i2c@7 {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +                       reg = <7>;
> +
> +                       pcawan: gpio@71 {
> +                               compatible = "nxp,pca9538";
> +                               reg = <0x71>;
> +
> +                               pinctrl-names = "default";
> +                               pinctrl-0 = <&pcawan_pins>;
> +
> +                               interrupt-parent = <&gpio1>;
> +                               interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
> +
> +                               gpio-controller;
> +                               #gpio-cells = <2>;
> +
> +                               interrupt-controller;
> +                               #interrupt-cells = <2>;
> +                       };
> +               };
> 
> The interrupt-controller part doesn't seem to work though, at least
> 
> +               interrupt-parent = <&pcawan>;
> +               interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
> 
> in the phy node gives an error.

Interrupts don't seem to work very well with the nxp,pca9538. Which
is probably why it is disabled by default.

   Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: corrupt leaf, slot offset bad
From: Kai Krakow @ 2016-11-14 20:28 UTC (permalink / raw)
  To: linux-btrfs
In-Reply-To: <20161011140949.GA5284@localhost.localdomain>

Am Tue, 11 Oct 2016 07:09:49 -0700
schrieb Liu Bo <bo.li.liu@oracle.com>:

> On Tue, Oct 11, 2016 at 02:48:09PM +0200, David Sterba wrote:
> > Hi,
> > 
> > looks like a lot of random bitflips.
> > 
> > On Mon, Oct 10, 2016 at 11:50:14PM +0200, aron@aron.ws wrote:  
> > > item 109 has a few strange chars in its name (and it's
> > > truncated): 1-x86_64.pkg.tar.xz 0x62 0x14 0x0a 0x0a
> > > 
> > > 	item 105 key (261 DIR_ITEM 54556048) itemoff 11723
> > > itemsize 72 location key (606286 INODE_ITEM 0) type FILE
> > > 		namelen 42 datalen 0 name:
> > > python2-gobject-3.20.1-1-x86_64.pkg.tar.xz item 106 key (261
> > > DIR_ITEM 56363628) itemoff 11660 itemsize 63 location key (894298
> > > INODE_ITEM 0) type FILE namelen 33 datalen 0 name:
> > > unrar-1:5.4.5-1-x86_64.pkg.tar.xz item 107 key (261 DIR_ITEM
> > > 66963651) itemoff 11600 itemsize 60 location key (1178 INODE_ITEM
> > > 0) type FILE namelen 30 datalen 0 name:
> > > glibc-2.23-5-x86_64.pkg.tar.xz item 108 key (261 DIR_ITEM
> > > 68561395) itemoff 11532 itemsize 68 location key (660578
> > > INODE_ITEM 0) type FILE namelen 38 datalen 0 name:
> > > squashfs-tools-4.3-4-x86_64.pkg.tar.xz item 109 key (261 DIR_ITEM
> > > 76859450) itemoff 11483 itemsize 65 location key (2397184
> > > UNKNOWN.0 7091317839824617472) type 45 namelen 13102 datalen
> > > 13358 name: 1-x86_64.pkg.tar.xzb\x14  
> > 
> > namelen must be smaller than 255, but the number itself does not
> > look like a bitflip (0x332e), the name looks like a fragment of.
> > 
> > The location key is random garbage, likely an overwritten memory,
> > 7091317839824617472 == 0x62696c0100230000 contains ascii 'bil', the
> > key type is unknown but should be INODE_ITEM.
> >   
> > > 		data
> > > 	item 110 key (261 DIR_ITEM 9799832789237604651) itemoff
> > > 11405 itemsize 62
> > > 		location key (388547 INODE_ITEM 0) type FILE
> > > 		namelen 32 datalen 0 name:
> > > intltool-0.51.0-1-any.pkg.tar.xz item 111 key (261 DIR_ITEM
> > > 81211850) itemoff 11344 itemsize 131133  
> > 
> > itemsize 131133 == 0x2003d is a clear bitflip, 0x3d == 61,
> > corresponds to the expected item size.
> > 
> > There's possibly other random bitflips in the keys or other
> > structures. It's hard to estimate the damage and thus the scope of
> > restorable data.  
> 
> It makes sense since this's a ssd we may have only one copy for
> metadata.
> 
> Thanks,
> 
> -liubo

>From this point of view it doesn't make sense to store only one copy of
meta data on SSD... The bit flip probably happened in RAM when taking
the other garbage into account, so dup meta data could have helped here.

If the SSD firmware would collapse duplicate meta data into single
blobs, that's perfectly fine. If the dup meta data arrives with bits
flipped, it won't be deduplicated. So this is fine, too.

BTW: I cannot believe that SSD firmwares really do the quite expensive
job of deduplication other than maybe internal compression. Maybe there
are some drives out there but most won't deduplicate. It's just too
little gain for too much complexity. So I personally would always
switch on duplicate meta data even for SSD. It shouldn't add to wear
leveling too much if you do the usual SSD optimization anyways (like
noatime).

PS: I suggest doing an extensive memtest86 before trying any repairs on
this system... Are you probably mixing different model DIMMs in dual
channel slots? Most of the times I've seen bitflips, this was the
culprit...

-- 
Regards,
Kai

Replies to list-only preferred.



^ permalink raw reply

* [PATCH v2] tile: handle __ro_after_init like parisc does
From: Chris Metcalf @ 2016-11-14 20:29 UTC (permalink / raw)
  To: Heiko Carstens, Kees Cook, Martin Schwidefsky, linux-kernel; +Cc: Chris Metcalf
In-Reply-To: <20161108071543.GA3528@osiris>

The tile architecture already marks RO_DATA as read-only in
the kernel, so grouping RO_AFTER_INIT_DATA with RO_DATA, as is
done by default, means the kernel faults in init when it tries
to write to RO_AFTER_INIT_DATA.  For now, just arrange that
__ro_after_init is handled like __write_once, i.e. __read_mostly.

Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
---
 arch/tile/include/asm/cache.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/tile/include/asm/cache.h b/arch/tile/include/asm/cache.h
index 6160761d5f61..4810e48dbbbf 100644
--- a/arch/tile/include/asm/cache.h
+++ b/arch/tile/include/asm/cache.h
@@ -61,4 +61,7 @@
  */
 #define __write_once __read_mostly
 
+/* __ro_after_init is the generic name for the tile arch __write_once. */
+#define __ro_after_init __read_mostly
+
 #endif /* _ASM_TILE_CACHE_H */
-- 
2.7.2

^ permalink raw reply related

* Re: How can OSD udev rules race with lvm at boot time ?
From: Ruben Kerkhof @ 2016-11-14 20:29 UTC (permalink / raw)
  To: Loic Dachary; +Cc: Ceph Development
In-Reply-To: <29b296db-034b-f91d-b7fe-b3f3f86a1df1@dachary.org>

On Mon, Nov 14, 2016 at 11:26 AM, Loic Dachary <loic@dachary.org> wrote:
> Hi,

Hi Loic,

I really appreciate you looking into this. While as a workaround for
this issue I stopped using LVM on my Ceph nodes, I'd like to go back
to LVM eventually.
>
> It looks like OSD udev rules race with LVM at boot time. In a nutshell, if /var/lib/ceph is on a LVM volume different from /, udev may fire events trying to start OSDs before the LVM volume is mounted and fail. This problem has been reported a few times over the past months and I believe it is real.

Just thinking out loud, but does udev make any guarantees at all about
filesystems being available (and writable) when udev rules run?

> I don't think there is any safeguard preventing such a race and it makes sense to me that it can happen sometimes. I'd like to reproduce it reliably to assert this is the reason why it happens. And, more importantly, to figure out a fix and verify it works. So far all my attemps have failed: the OSD comes back up every time. The details about this issue are at http://tracker.ceph.com/issues/17889
>
> If someone has ideas about how to handle this, it would be most welcome :-)

I'm trying to follow how osds are activated since this has been a
mystery for me so far.
Please bear with my, but this is how I understand it works:

- the ceph udev rules call ceph-disk trigger when udev detects a
device / partition suitable for ceph based on GPT uuids.
- ceph-disk trigger restarts an instantiated service, let's say
ceph-disk@/dev/sda.service. (properly escaped). This is asynchronous.
- ceph-disk.service calls ceph-disk trigger --sync /dev/sda
- ceph-disk trigger --sync /dev/sda calls ceph-disk activate /dev/sda

Now the first thing ceph-disk/main.py does (always) is mkdir
/var/lib/ceph, and take a file lock on
/var/lib/ceph/tmp/ceph-disk.prepare.lock and
/var/lib/ceph/tmp/ceph-disk.activate.lock.
Unless I'm mistaken this doesn't actually seem to be needed in the
ceph-disk trigger case.
Then we could add a RequiresMountsFor=/var/lib/ceph to
ceph-disk.service and be done with it.

As for how to reproduce the issue, one thought that comes to mind is
if you're testing this in a vm, perhaps you could put and I/O cap on
the disks, and this will improve your change of invoking the race.
>
> Cheers
>
> --
> Loïc Dachary, Artisan Logiciel Libre

Kind regards,

Ruben Kerkhof

^ permalink raw reply

* Re: [PATCH] tracing: ignore FTRACE_FL_DISABLED while walking dyn_ftrace records
From: Alexei Starovoitov @ 2016-11-14 20:30 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Alexei Starovoitov, Dave Jones, Martin KaFai Lau, linux-kernel,
	kernel-team
In-Reply-To: <20161114142428.1091961b@gandalf.local.home>

On Mon, Nov 14, 2016 at 02:24:28PM -0500, Steven Rostedt wrote:
> On Mon, 7 Nov 2016 15:14:20 -0800
> Alexei Starovoitov <ast@fb.com> wrote:
> 
> > ftrace_shutdown() checks for sanity of ftrace records
> > and if dyn_ftrace->flags is not zero, it will warn.
> > It can happen that 'flags' are set to FTRACE_FL_DISABLED at this point,
> > since some module was loaded, but before ftrace_module_enable()
> > cleared the flags for this module.
> > 
> > In other words the module.c is doing:
> > ftrace_module_init(mod); // calls ftrace_update_code() that sets flags=FTRACE_FL_DISABLED
> > ... // here ftrace_shutdown() is called that warns, since
> > err = prepare_coming_module(mod); // didn't have a chance to clear FTRACE_FL_DISABLED
> > 
> > Fix it by ignoring disabled records.
> > It's similar to what __ftrace_hash_rec_update() is already doing.
> > 
> 
> Alexei,
> 
> Do you have a clear reproducer of this bug?

Nope. No reproducer. It's very rare. Only stack trace that I posted earlier.
Since it kills ftrace everything that depends on it later spews a ton
of other warnings. So it's an important fix.

^ permalink raw reply

* Re: [PATCH V4] xen/arm: domain_build: allocate lowmem for dom0 as much as possible
From: Julien Grall @ 2016-11-14 20:30 UTC (permalink / raw)
  To: Andrii Anisov, Stefano Stabellini; +Cc: Peng Fan, Peng Fan, wei.liu2, xen-devel
In-Reply-To: <CAC1WxdiM51AVzkSuqQW92WFw=cDCRm2AzQQjyNSddxnPaEqMpg@mail.gmail.com>

Hi Andrii,

On 14/11/2016 03:11, Andrii Anisov wrote:
>> There are many reasons: for example because you want Dom0 to be Linux
>> and the storage driver domain to be FreeBSD. Or because you want the
>> network driver domain to be QNX.
> What we estimate now is a thin Dom0 without any drivers running with
> ramdisk. All drivers would be moved to a special guest domain.

You may want to give a look what has been done on x86 with the 
"Dedicated hardware domain".

Another solution, is rather than moving the devices in a separate 
domain, you move the toolstack. The latter may cause less trouble on 
platform without SMMU.

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply

* Help with LED subsystem maintainance
From: Pavel Machek @ 2016-11-14 20:31 UTC (permalink / raw)
  To: j.anaszewski, jacek.anaszewski, linux-leds, kernel list

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

Hi!

Would it make sense to list me as a co-maintainer for the LED
subsystem?

I'd leave patch collection / git tree maintenance to you, but I guess
I can help with design, locking, etc...

Thanks and best regards,
								Pavel

Signed-off-by: Pavel Machek <pavel@ucw.cz>

diff --git a/MAINTAINERS b/MAINTAINERS
index 01bff8e..d2934e7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6884,6 +6884,7 @@ F:	drivers/scsi/53c700*
 LED SUBSYSTEM
 M:	Richard Purdie <rpurdie@rpsys.net>
 M:	Jacek Anaszewski <j.anaszewski@samsung.com>
+M:	Pavel Machek <pavel@ucw.cz>
 L:	linux-leds@vger.kernel.org
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
 S:	Maintained




-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

^ permalink raw reply related

* Re: [kernel-hardening] Re: [RFC v4 PATCH 00/13] HARDENED_ATOMIC
From: Kees Cook @ 2016-11-14 20:31 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Will Deacon, Greg KH, David Windsor,
	kernel-hardening@lists.openwall.com, Elena Reshetova,
	Arnd Bergmann, Thomas Gleixner, Ingo Molnar, H. Peter Anvin
In-Reply-To: <20161111201704.GQ3117@twins.programming.kicks-ass.net>

On Fri, Nov 11, 2016 at 12:17 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, Nov 11, 2016 at 10:04:42AM -0800, Kees Cook wrote:
>
>> I'm totally open about how to get there, but things can't just be opt-in.
>
> There really is no alternative.

I realize you feel that way, but if we can find a way to squeeze
mistakes down to impossible or very small, that has a strong effect on
the future of avoiding exploitation of these kinds of things.

> refcount_t; should only have: inc, inc_not_zero, dec_and_test

Sounds good. Two questions remain:

- how to deal with existing refcounting atomic_t users that want _add and _sub?
- keeping this fast enough that it can be used even in very sensitive
places (net, fs, etc).

> stats_t; should only have: add,sub

Seems right, though why not inc/dec? And shouldn't it have a _read of some kind?

Keeping the implementation details of refcount_t and stats_t opaque to
the users should discourage misuse...

> atomic_t; has:
>
>         {add,inc,sub,dec} + {and,or,xor,notand}
>
>         {add,inc,sub,dec}_return * {,relaxed,release,acquire}
>
>         (fetch_{add,inc,sub,dec} + {and,or,xor,notand}) * {,relaxed,release,acquire}
>
>         {sub,add,inc,dec}_and_test
>
>         {cmpxchg,xchg}
>
>         add_unless,inc_not_zero,{inc,dec}_unless_negative,dec_if_positive
>
> That is so much more than either refcount_t or stats_t should have, and
> the whole wrap/nowrap thing only matters to part of the ops.
>
> Like said, atomic_cmpxchg_wrap() is utter crap, that's a function name
> that doesn't make sense, and you guys should have realized that the
> moment you typed it.
>
> Its fantasy to think you can 'implement' atomic_t with refcount_t or
> anything else. You're chasing unicorns.

So, here's another suggestion on how to avoid this being opt-in: we
change atomic_t's name along with adding refcount_t and stats_t. We
need some way to distinguish "true" atomic users from the refcount_t
and stats_t, without needing to hope we can educate future driver
writers. Then, after transition to refcount_t, stats_t, and
bikeshed_atomic_t, we can catch misuse by having a CONFIG that forces
new/remaining atomic_t into refcount_t (which will blow up the build
if a driver uses anything besides inc, inc_not_zero, dec_and_test,
etc).

Regardless, adding refcount_t and stats_t will already make the audit
work of finding misused atomic_t SO much better, so since this is a
precondition to any other crazier ideas, it looks like we can all
agree on doing those pieces first.

-Kees

-- 
Kees Cook
Nexus Security

^ permalink raw reply

* Re: [PATCH kvm-unit-tests v2 08/17] pci: provide pci_scan_bars()
From: Peter Xu @ 2016-11-14 20:33 UTC (permalink / raw)
  To: Andrew Jones; +Cc: kvm, rkrcmar, agordeev, jan.kiszka, pbonzini
In-Reply-To: <20161110192419.ex77s7inrmejmt7r@hawk.localdomain>

On Thu, Nov 10, 2016 at 08:24:19PM +0100, Andrew Jones wrote:

[...]

> > +void pci_scan_bars(struct pci_dev *dev)
> > +{
> > +	int i = 0;
> > +
> > +	for (i = 0; i < PCI_BAR_NUM; i++) {
> > +		if (!pci_bar_is_valid(dev, i))
> > +			continue;
> > +		dev->bar[i] = pci_bar_get_addr(dev, i);
> 
> What happens when you get_addr a 64-bit bar in the middle?
> Shouldn't we skip that?

Hmm yes... Do you like this?

---------8<----------

diff --git a/lib/pci.c b/lib/pci.c
index 0593699..2a58b30 100644
--- a/lib/pci.c
+++ b/lib/pci.c
@@ -230,11 +230,15 @@ void pci_print(void)

 void pci_scan_bars(struct pci_dev *dev)
 {
-       int i = 0;
+       int i;
+
+       memset(&dev->bar[0], 0, sizeof(dev->bar));

        for (i = 0; i < PCI_BAR_NUM; i++) {
                if (!pci_bar_is_valid(dev, i))
                        continue;
                dev->bar[i] = pci_bar_get_addr(dev, i);
+               if (pci_bar_is64(dev, i))
+                       i++;
        }
 }

--------->8----------

pci_bar_is64() is called twice per bar, but I think it's okay here
since it's during init and the whole scan is called only once for 6
bars.

Thanks,

-- peterx

^ permalink raw reply related

* [Buildroot] [git commit] config: bump linux kernel to 4.8.6 in synopsys defconfigs
From: Thomas Petazzoni @ 2016-11-14 20:34 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=dab808e6ae634e08040a96bd06ea4910fed93633
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

With this commit we update ARC defconfigs with the following:

  - "snps_axs101_defconfig", "snps_axs103_defconfig" and
    "snps_hs38_smp_vdk_defconfig":
     - bump linux kernel version to 4.8.6
     - set up host linux headers to 4.8

Signed-off-by: Vlad Zakharov <vzakhar@synopsys.com>
[Thomas: as reported by Alexey, this commit is in fact a bug fix: it
makes the defconfig work properly. Indeed, since the ARC compiler has
moved to gcc 6.x, the ABI has changed, and a Linux 4.8+ kernel is
needed for userspace to work on ARC.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 configs/snps_axs101_defconfig       | 6 +++---
 configs/snps_axs103_defconfig       | 6 +++---
 configs/snps_hs38_smp_vdk_defconfig | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/configs/snps_axs101_defconfig b/configs/snps_axs101_defconfig
index f272853..eea7a50 100644
--- a/configs/snps_axs101_defconfig
+++ b/configs/snps_axs101_defconfig
@@ -8,13 +8,13 @@ BR2_TARGET_ROOTFS_INITRAMFS=y
 BR2_SYSTEM_DHCP="eth0"
 BR2_ROOTFS_OVERLAY="board/synopsys/axs10x/fs-overlay"
 
-# Linux headers same as kernel, a 4.7 series
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_7=y
+# Linux headers same as kernel, a 4.8 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_8=y
 
 # Kernel
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.7"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.8.6"
 BR2_LINUX_KERNEL_DEFCONFIG="axs101"
 
 # Bootloader
diff --git a/configs/snps_axs103_defconfig b/configs/snps_axs103_defconfig
index 75596c9..08c55de 100644
--- a/configs/snps_axs103_defconfig
+++ b/configs/snps_axs103_defconfig
@@ -9,13 +9,13 @@ BR2_TARGET_ROOTFS_INITRAMFS=y
 BR2_SYSTEM_DHCP="eth0"
 BR2_ROOTFS_OVERLAY="board/synopsys/axs10x/fs-overlay"
 
-# Linux headers same as kernel, a 4.7 series
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_7=y
+# Linux headers same as kernel, a 4.8 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_8=y
 
 # Kernel
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.7"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.8.6"
 BR2_LINUX_KERNEL_DEFCONFIG="axs103_smp"
 
 # Bootloader
diff --git a/configs/snps_hs38_smp_vdk_defconfig b/configs/snps_hs38_smp_vdk_defconfig
index 32922f8..d4dcd1b 100644
--- a/configs/snps_hs38_smp_vdk_defconfig
+++ b/configs/snps_hs38_smp_vdk_defconfig
@@ -8,12 +8,12 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to the HS38 VDK Software Development Platform"
 BR2_ROOTFS_OVERLAY="board/synopsys/axs10x/fs-overlay"
 BR2_TARGET_ROOTFS_EXT2=y
 
-# Linux headers same as kernel, a 4.7 series
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_7=y
+# Linux headers same as kernel, a 4.8 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_8=y
 
 # Kernel
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.7"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.8.6"
 BR2_LINUX_KERNEL_DEFCONFIG="vdk_hs38_smp"
 BR2_LINUX_KERNEL_VMLINUX=y

^ permalink raw reply related

* [PATCH v3] mm, thp: propagation of conditional compilation in khugepaged.c
From: Jérémy Lefaure @ 2016-11-14 20:34 UTC (permalink / raw)
  To: Andrew Morton, Kirill A. Shutemov; +Cc: linux-mm, Jérémy Lefaure

Commit b46e756f5e47 ("thp: extract khugepaged from mm/huge_memory.c")
moved code from huge_memory.c to khugepaged.c. Some of this code should
be compiled only when CONFIG_SYSFS is enabled but the condition around
this code was not moved into khugepaged.c. The result is a compilation
error when CONFIG_SYSFS is disabled:

mm/built-in.o: In function `khugepaged_defrag_store':
khugepaged.c:(.text+0x2d095): undefined reference to
`single_hugepage_flag_store'
mm/built-in.o: In function `khugepaged_defrag_show':
khugepaged.c:(.text+0x2d0ab): undefined reference to
`single_hugepage_flag_show'

This commit adds the #ifdef CONFIG_SYSFS around the code related to
sysfs.

Signed-off-by: JA(C)rA(C)my Lefaure <jeremy.lefaure@lse.epita.fr>
---
Sorry for the typo in v2. Thank you Kirill.
I hope that everything is ok this time.

 mm/khugepaged.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 728d779..87e1a7ca 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -103,6 +103,7 @@ static struct khugepaged_scan khugepaged_scan = {
 	.mm_head = LIST_HEAD_INIT(khugepaged_scan.mm_head),
 };
 
+#ifdef CONFIG_SYSFS
 static ssize_t scan_sleep_millisecs_show(struct kobject *kobj,
 					 struct kobj_attribute *attr,
 					 char *buf)
@@ -295,6 +296,7 @@ struct attribute_group khugepaged_attr_group = {
 	.attrs = khugepaged_attr,
 	.name = "khugepaged",
 };
+#endif /* CONFIG_SYSFS */
 
 #define VM_NO_KHUGEPAGED (VM_SPECIAL | VM_HUGETLB)
 
-- 
2.10.2

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related

* Re: Possible to prevent dom0 accessing guest memory?
From: Andy Smith @ 2016-11-14 20:35 UTC (permalink / raw)
  To: xen-devel
In-Reply-To: <CAFLBxZY-pBVGYYTUxnyerf3kjh09UZuUG5C3uhbbTZRxk5Cajg@mail.gmail.com>

Hi George,

On Mon, Nov 14, 2016 at 05:09:01PM +0000, George Dunlap wrote:
> There is probably a way to configure Xen to make it possible to build
> domains while making a full dump-core difficult to implement even by a
> motivated attacker; but that would be quite a bit more work (and very
> bespoke to your own particular situation).

I think if it could be made extremely difficult for a compromised
dom0 to dump guest memory then that would be useful to a wide range
of Xen users, as compromise of general purpose Linux hosts (like
most people's dom0s) is pretty commonplace.

Though I was reminded off-list (thanks for that), that Intel SGX and
AMD SME include features which can protect guest memory from other
guests/host/dom0, so perhaps that is a more sensible direction to go
in.

Thanks,
Andy

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply

* [rtc-linux] [GIT PULL] RTC fixes for 4.9
From: Alexandre Belloni @ 2016-11-14 20:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: rtc-linux, linux-kernel

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

Hi Linus,

Here are a few driver fixes for 4.9. It has been calm for a while so I
don't expect more for this cycle.

The following changes since commit 1001354ca34179f3db924eb66672442a173147dc:

  Linux 4.9-rc1 (2016-10-15 12:17:50 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git tags/rtc-4.9-2

for you to fetch changes up to efce21fc43e00a76aee7b0a1eda73730ed2d5d3a:

  rtc: omap: prevent disabling of clock/module during suspend (2016-11-04 23:11:39 +0100)

----------------------------------------------------------------
RTC for 4.9 #2

Drivers:
 - asm9260: fix module autoload
 - cmos: fix crashes
 - omap: fix clock handling

----------------------------------------------------------------
Javier Martinez Canillas (1):
      rtc: asm9260: fix module autoload

LABBE Corentin (1):
      rtc: cmos: remove all __exit_p annotations

Lokesh Vutla (1):
      rtc: omap: Fix selecting external osc

Tero Kristo (1):
      rtc: omap: prevent disabling of clock/module during suspend

Ville Syrjälä (1):
      rtc: cmos: Don't enable interrupts in the middle of the interrupt handler

 drivers/rtc/rtc-asm9260.c |  1 +
 drivers/rtc/rtc-cmos.c    | 15 ++++++++-------
 drivers/rtc/rtc-omap.c    | 38 ++++++++++++++++++++++++++++++--------
 3 files changed, 39 insertions(+), 15 deletions(-)

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [RFC][PATCH 5/7] kref: Implement kref_put_lock()
From: Kees Cook @ 2016-11-14 20:35 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Greg KH, Will Deacon, Reshetova, Elena, Arnd Bergmann,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, David Windsor, LKML
In-Reply-To: <20161114174446.690415221@infradead.org>

On Mon, Nov 14, 2016 at 9:39 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> Because home-rolling your own is _awesome_, stop doing it. Provide
> kref_put_lock(), just like kref_put_mutex() but for a spinlock.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  include/linux/kref.h |   21 +++++++++++++++------
>  net/sunrpc/svcauth.c |   15 ++++++++++-----
>  2 files changed, 25 insertions(+), 11 deletions(-)
>
> --- a/include/linux/kref.h
> +++ b/include/linux/kref.h
> @@ -86,12 +86,21 @@ static inline int kref_put_mutex(struct
>                                  struct mutex *lock)
>  {
>         WARN_ON(release == NULL);

This WARN_ON makes sense, yes, though it seems like it should be deal
with differently. If it's NULL, we'll just Oops when we call release()
later... Seems like this should saturate the kref or something else
similar.

> -       if (unlikely(!atomic_add_unless(&kref->refcount, -1, 1))) {
> -               mutex_lock(lock);
> -               if (unlikely(!atomic_dec_and_test(&kref->refcount))) {
> -                       mutex_unlock(lock);
> -                       return 0;
> -               }
> +
> +       if (atomic_dec_and_mutex_lock(&kref->refcount, lock)) {
> +               release(kref);
> +               return 1;
> +       }
> +       return 0;
> +}
> +
> +static inline int kref_put_lock(struct kref *kref,
> +                               void (*release)(struct kref *kref),
> +                               spinlock_t *lock)
> +{
> +       WARN_ON(release == NULL);
> +
> +       if (atomic_dec_and_lock(&kref->refcount, lock)) {
>                 release(kref);
>                 return 1;
>         }
> --- a/net/sunrpc/svcauth.c
> +++ b/net/sunrpc/svcauth.c
> @@ -127,13 +127,18 @@ static struct hlist_head  auth_domain_tab
>  static spinlock_t      auth_domain_lock =
>         __SPIN_LOCK_UNLOCKED(auth_domain_lock);
>
> +static void auth_domain_release(struct kref *kref)
> +{
> +       struct auth_domain *dom = container_of(kref, struct auth_domain, ref);
> +
> +       hlist_del(&dom->hash);
> +       dom->flavour->domain_release(dom);
> +       spin_unlock(&auth_domain_lock);
> +}
> +
>  void auth_domain_put(struct auth_domain *dom)
>  {
> -       if (atomic_dec_and_lock(&dom->ref.refcount, &auth_domain_lock)) {
> -               hlist_del(&dom->hash);
> -               dom->flavour->domain_release(dom);
> -               spin_unlock(&auth_domain_lock);
> -       }
> +       kref_put_lock(&dom->ref, auth_domain_release, &auth_domain_lock);
>  }
>  EXPORT_SYMBOL_GPL(auth_domain_put);
>
>
>



-- 
Kees Cook
Nexus Security

^ permalink raw reply

* Re: [PATCH kvm-unit-tests v2 09/17] x86/vmexit: leverage pci_scan_bars()
From: Peter Xu @ 2016-11-14 20:35 UTC (permalink / raw)
  To: Andrew Jones; +Cc: kvm, rkrcmar, agordeev, jan.kiszka, pbonzini
In-Reply-To: <20161110192758.eqazpjk3243pttb5@hawk.localdomain>

On Thu, Nov 10, 2016 at 08:27:58PM +0100, Andrew Jones wrote:

[...]

> > @@ -389,17 +389,12 @@ int main(int ac, char **av)
> >  	ret = pci_find_dev(PCI_VENDOR_ID_REDHAT, PCI_DEVICE_ID_REDHAT_TEST);
> >  	if (ret != PCIDEVADDR_INVALID) {
> >  		pci_dev_init(&pcidev, ret);
> > -		for (i = 0; i < PCI_TESTDEV_NUM_BARS; i++) {
> > -			if (!pci_bar_is_valid(&pcidev, i)) {
> > -				continue;
> > -			}
> > -			if (pci_bar_is_memory(&pcidev, i)) {
> > -				membar = pci_bar_get_addr(&pcidev, i);
> > -				pci_test.memaddr = ioremap(membar, PAGE_SIZE);
> > -			} else {
> > -				pci_test.iobar = pci_bar_get_addr(&pcidev, i);
> > -			}
> > -		}
> > +		pci_scan_bars(&pcidev);
> > +		assert(pci_bar_is_memory(&pcidev, PCI_TESTDEV_BAR_MEM));
> > +		assert(!pci_bar_is_memory(&pcidev, PCI_TESTDEV_BAR_IO));
> > +		membar = pcidev.bar[PCI_TESTDEV_BAR_MEM];
> 
> nit: I'd drop 'membar' and just pass pcidev.bar to ioremap

Below printf() is using it as well. I kept it in case anyone is using
the below printf for any reason.

> 
> > +		pci_test.memaddr = ioremap(membar, PAGE_SIZE);
> > +		pci_test.iobar = pcidev.bar[PCI_TESTDEV_BAR_IO];
> >  		printf("pci-testdev at 0x%x membar %lx iobar %x\n",
> >  		       pcidev.bdf, membar, pci_test.iobar);
> >  	}
> > -- 
> > 2.7.4
> >

Thanks,

-- peterx

^ permalink raw reply

* [GIT PULL] RTC fixes for 4.9
From: Alexandre Belloni @ 2016-11-14 20:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: rtc-linux, linux-kernel

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

Hi Linus,

Here are a few driver fixes for 4.9. It has been calm for a while so I
don't expect more for this cycle.

The following changes since commit 1001354ca34179f3db924eb66672442a173147dc:

  Linux 4.9-rc1 (2016-10-15 12:17:50 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git tags/rtc-4.9-2

for you to fetch changes up to efce21fc43e00a76aee7b0a1eda73730ed2d5d3a:

  rtc: omap: prevent disabling of clock/module during suspend (2016-11-04 23:11:39 +0100)

----------------------------------------------------------------
RTC for 4.9 #2

Drivers:
 - asm9260: fix module autoload
 - cmos: fix crashes
 - omap: fix clock handling

----------------------------------------------------------------
Javier Martinez Canillas (1):
      rtc: asm9260: fix module autoload

LABBE Corentin (1):
      rtc: cmos: remove all __exit_p annotations

Lokesh Vutla (1):
      rtc: omap: Fix selecting external osc

Tero Kristo (1):
      rtc: omap: prevent disabling of clock/module during suspend

Ville Syrjälä (1):
      rtc: cmos: Don't enable interrupts in the middle of the interrupt handler

 drivers/rtc/rtc-asm9260.c |  1 +
 drivers/rtc/rtc-cmos.c    | 15 ++++++++-------
 drivers/rtc/rtc-omap.c    | 38 ++++++++++++++++++++++++++++++--------
 3 files changed, 39 insertions(+), 15 deletions(-)

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* [Buildroot] [git commit branch/next] lcms2: bump version to 2.8
From: Thomas Petazzoni @ 2016-11-14 20:36 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=4309b96f3a38a2ed40389612c28a47917595667b
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/next

For ChangeLog see [1].

[1] https://github.com/mm2/Little-CMS/blob/master/ChangeLog

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/lcms2/lcms2.hash | 7 +++----
 package/lcms2/lcms2.mk   | 4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/package/lcms2/lcms2.hash b/package/lcms2/lcms2.hash
index 908822f..1cf1017 100644
--- a/package/lcms2/lcms2.hash
+++ b/package/lcms2/lcms2.hash
@@ -1,5 +1,4 @@
-# From http://sourceforge.net/projects/lcms/files/lcms/2.7/
-sha1	625f0d74bad4a0f6f917120fd992437d26f754d2	lcms2-2.7.tar.gz
-md5	06c1626f625424a811fb4b5eb070839d		lcms2-2.7.tar.gz
+# From https://sourceforge.net/projects/lcms/files/lcms/2.8
+sha1 e9535ec4a572b8fc7a1c405c35e6f4dc97714197 lcms2-2.8.tar.gz
 # Locally computed:
-sha256	4524234ae7de185e6b6da5d31d6875085b2198bc63b1211f7dde6e2d197d6a53	lcms2-2.7.tar.gz
+sha256 66d02b229d2ea9474e62c2b6cd6720fde946155cd1d0d2bffdab829790a0fb22 lcms2-2.8.tar.gz
diff --git a/package/lcms2/lcms2.mk b/package/lcms2/lcms2.mk
index 265af29..8d0609e 100644
--- a/package/lcms2/lcms2.mk
+++ b/package/lcms2/lcms2.mk
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-LCMS2_VERSION = 2.7
-LCMS2_SITE = http://downloads.sourceforge.net/lcms/lcms
+LCMS2_VERSION = 2.8
+LCMS2_SITE = http://downloads.sourceforge.net/project/lcms/lcms/$(LCMS2_VERSION)
 LCMS2_LICENSE = MIT
 LCMS2_LICENSE_FILES = COPYING
 LCMS2_INSTALL_STAGING = YES

^ permalink raw reply related

* [Buildroot] [PATCH next v1] lcms2: bump version to 2.8
From: Thomas Petazzoni @ 2016-11-14 20:36 UTC (permalink / raw)
  To: buildroot
In-Reply-To: <1479154612-21070-1-git-send-email-ps.report@gmx.net>

Hello,

On Mon, 14 Nov 2016 21:16:52 +0100, Peter Seiderer wrote:
> For ChangeLog see [1].
> 
> [1] https://github.com/mm2/Little-CMS/blob/master/ChangeLog
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  package/lcms2/lcms2.hash | 7 +++----
>  package/lcms2/lcms2.mk   | 4 ++--
>  2 files changed, 5 insertions(+), 6 deletions(-)

Applied to next, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply

* [Buildroot] [git commit] configs/snps_axs*: bump U-Boot to 2016.11
From: Thomas Petazzoni @ 2016-11-14 20:37 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=c418476aa85e8158c3e309bb08c7bdf77665c70c
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

With this commit we upgrade U-Boot version to 2016.11 in
"snps_axs101_defconfig" and "snps_axs103_defconfig".

Important fixes: new version fixes U-Boot build for arc700.  Since
gcc-6.x "-marc700" option is no longer supported, "-mcpu=arc700"
should be used instead.

We haven't sent it before as we were waiting for U-Boot 2016.11
release.

Signed-off-by: Vlad Zakharov <vzakhar@synopsys.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 configs/snps_axs101_defconfig | 2 +-
 configs/snps_axs103_defconfig | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/snps_axs101_defconfig b/configs/snps_axs101_defconfig
index eea7a50..07564b4 100644
--- a/configs/snps_axs101_defconfig
+++ b/configs/snps_axs101_defconfig
@@ -21,6 +21,6 @@ BR2_LINUX_KERNEL_DEFCONFIG="axs101"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.07"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.11"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs101"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
diff --git a/configs/snps_axs103_defconfig b/configs/snps_axs103_defconfig
index 08c55de..d2a838e 100644
--- a/configs/snps_axs103_defconfig
+++ b/configs/snps_axs103_defconfig
@@ -22,6 +22,6 @@ BR2_LINUX_KERNEL_DEFCONFIG="axs103_smp"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.07"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.11"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs103"
 BR2_TARGET_UBOOT_NEEDS_DTC=y

^ permalink raw reply related

* [Buildroot] [PATCH v2] config: bump U-Boot to 2016.11 in synopsys defconfigs
From: Thomas Petazzoni @ 2016-11-14 20:38 UTC (permalink / raw)
  To: buildroot
In-Reply-To: <1479146820-46777-1-git-send-email-vzakhar@synopsys.com>

Hello,

On Mon, 14 Nov 2016 21:07:00 +0300, Vlad Zakharov wrote:
> With this commit we upgrade U-Boot version to 2016.11
> in "snps_axs101_defconfig" and "snps_axs103_defconfig".
> 
> Important fixes: new version fixes U-Boot build for arc700.
> Since gcc-6.x "-marc700" option is no longer supported,
> "-mcpu=arc700" should be used instead.
> 
> We haven't sent it before as we were waiting for U-Boot
> 2016.11 release.
> 
> Signed-off-by: Vlad Zakharov <vzakhar@synopsys.com>
> ---
> Changes v1..v2
>  - Replace 2016.11-rc3 release candidate with 2016.11 release version

Applied to master, after slightly tweaking the commit title. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply


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.