All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Qiaowei Ren <qiaowei.ren@intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/3] x86, mpx: hook #BR exception handler to allocate bound tables
Date: Wed, 12 Feb 2014 12:19:27 -0800	[thread overview]
Message-ID: <52FBD74F.7050203@mit.edu> (raw)
In-Reply-To: <1392230186-16130-3-git-send-email-qiaowei.ren@intel.com>

On 02/12/2014 10:36 AM, Qiaowei Ren wrote:
> An access to an invalid bound directory entry will cause a #BR
> exception. This patch hook #BR exception handler to allocate
> one bound table and bind it with that buond directory entry.
> 
> This will avoid the need of forwarding the #BR exception
> to the user space when bound directory has invalid entry.
> 
> Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
> ---
> +void do_mpx_bt_fault(struct xsave_struct *xsave_buf)
> +{
> +	unsigned long status;
> +	unsigned long bd_entry, bd_base;
> +	unsigned long bd_size = 1UL << (MPX_L1_BITS+MPX_L1_SHIFT);
> +
> +	bd_base = xsave_buf->bndcsr.cfg_reg_u & MPX_BNDCFG_ADDR_MASK;
> +	status = xsave_buf->bndcsr.status_reg;
> +
> +	bd_entry = status & MPX_BNDSTA_ADDR_MASK;
> +	if ((bd_entry >= bd_base) && (bd_entry < bd_base + bd_size))
> +		allocate_bt(bd_entry);
> +}

This still just loops on failure, right?

--Andy

  reply	other threads:[~2014-02-12 20:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 18:36 [PATCH v4 0/3] Intel MPX support Qiaowei Ren
2014-02-12 18:36 ` [PATCH v4 1/3] x86, mpx: add documentation on Intel MPX Qiaowei Ren
2014-02-12 18:36 ` [PATCH v4 2/3] x86, mpx: hook #BR exception handler to allocate bound tables Qiaowei Ren
2014-02-12 20:19   ` Andy Lutomirski [this message]
2014-02-21  2:44     ` Ren Qiaowei
2014-02-26 19:00       ` Andy Lutomirski
2014-02-12 18:36 ` [PATCH v4 3/3] x86, mpx: extend siginfo structure to include bound violation information Qiaowei Ren

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=52FBD74F.7050203@mit.edu \
    --to=luto@amacapital.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=qiaowei.ren@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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.