Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1237318

Re: [PATCH 05/25] x86, pkey: add PKRU xsave fields and data structure(s)

Path csiph.com!eternal-september.org!feeder.eternal-september.org!weretis.net!feeder1.news.weretis.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod
From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH 05/25] x86, pkey: add PKRU xsave fields and data structure(s)
Date Thu, 01 Oct 2015 14:00:03 +0200
Message-ID <qeKGL-383-25@gated-at.bofh.it> (permalink)
References <qdM7T-59-3@gated-at.bofh.it> <qdMhz-gH-5@gated-at.bofh.it>
X-Original-To Dave Hansen <dave@sr71.net>
User-Agent Alpine 2.11 (DEB 23 2013-08-11)
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII
X-Linutronix-Spam-Score -1.0
X-Linutronix-Spam-Level -
X-Linutronix-Spam-Status No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 45
Organization linux.* mail to news gateway
X-Original-Cc borntraeger@de.ibm.com, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, dave.hansen@linux.intel.com
X-Original-Date Thu, 1 Oct 2015 13:50:24 +0200 (CEST)
X-Original-Message-ID <alpine.DEB.2.11.1510011303420.4500@nanos>
X-Original-References <20150928191817.035A64E2@viggo.jf.intel.com> <20150928191819.925D0BD3@viggo.jf.intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1237318

Show key headers only | View raw


On Mon, 28 Sep 2015, Dave Hansen wrote:
> +/*
> + * State component 9: 32-bit PKRU register.
> + */
> +struct pkru {
> +	u32 pkru;
> +} __packed;
> +
> +struct pkru_state {
> +	union {
> +		struct pkru		pkru;
> +		u8			pad_to_8_bytes[8];
> +	};

Why do you need two structs?

    struct pkru_state {
    	   u32 pkru;
	   u32 pad;
    }

should be sufficient. So instead of

       xsave.pkru_state.pkru.pkru

you get the more obvious

       xsave.pkru_state.pkru

Hmm?

Thanks,

	tglx



      

       
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 05/25] x86, pkey: add PKRU xsave fields and data structure(s) Dave Hansen <dave@sr71.net> - 2015-09-28 21:30 +0200
  Re: [PATCH 05/25] x86, pkey: add PKRU xsave fields and data  structure(s) Thomas Gleixner <tglx@linutronix.de> - 2015-10-01 14:00 +0200
    Re: [PATCH 05/25] x86, pkey: add PKRU xsave fields and data  structure(s) Dave Hansen <dave@sr71.net> - 2015-10-01 19:20 +0200

csiph-web