xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xensource.com
Cc: Haitao Shan <haitao.shan@intel.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH 2 of 2]  vpmu:  Add the BTS extension
Date: Wed, 15 Feb 2012 11:18:53 +0100	[thread overview]
Message-ID: <2372545.AjeFrRLSs5@amur> (raw)
In-Reply-To: <4F3A82C60200007800072EC5@nat28.tlf.novell.com>

Am Dienstag 14 Februar 2012, 14:50:30 schrieb Jan Beulich:
> >>> On 14.02.12 at 15:30, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> > Am Dienstag 14 Februar 2012, 13:27:08 schrieb Jan Beulich:
> >> Plus enforcing the buffer requirements to avoid CPU deadlock
> >> (contiguous present pages, alignment). Failure to do so can hang the
> >> CPU, and hence would represent a DoS vulnerability.
> > 
> > I'm not sure what you mean here. Are you speaking about the DS buffer?
> > If yes, this is no problem, because the DS buffer addressm must be a domU
> > virtual address. The processor only writes data into the buffer, if the
> > domU is running so in the worst case the domU gets triggered a page fault
> > or what I testet a triple fault occurs and the domU gets rebootet.
> 
> This certainly can be CPU model dependent, but on raw hardware
> I know that not meeting the buffer constraints can hang (not triple
> fault, perhaps a live lock) a CPU. Therefore, unless you can prove
> this is impossible when running in VMX non-root, you will have to add
> provisions for this (and this was the major reason keeping me from
> trying to add DS support a year or two ago). At the very minimum
> the whole functionality would otherwise need to be disabled by
> default, and when enabled a prominent warning be issued (along
> the lines of that of sync_console).

Of course I can't prove anything.
While I experimented with this I couldn't find any statement in the cpu specs
about this buffer stuff and what the cpu does with wrong addresses. I found
that writing a non canonical address into the MSR_IA32_DS_AREA leads to a
general protection fault in the hypervisor. This was the cause for the check of
is_canonical_address(msr_content).
But with this check I tried different addresses, also wrong addresses within
the buffer and the hypervisor didn't crash anymore but the domU always failed
with the:
hvm.c:1141:d10 Triple fault on VCPU0 - invoking HVM system reset.
But of course there may be other critical pathes.

Currently we have the vpmu boot flag. So by default this is disabled.
The question is, should the BTS suff get an own flag or should we change the
vpmu flag to a string with multiple meanings? If the warning should be printed
only for the BTS stuff then an own BTS flag is needed.

Dietmar.


-- 
Company details: http://ts.fujitsu.com/imprint.html

  reply	other threads:[~2012-02-15 10:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13 13:01 [PATCH 2 of 2] vpmu: Add the BTS extension Dietmar Hahn
2012-02-14 11:51 ` Jan Beulich
2012-02-14 12:59   ` Dietmar Hahn
2012-02-14 13:27     ` Jan Beulich
2012-02-14 14:30       ` Dietmar Hahn
2012-02-14 14:50         ` Jan Beulich
2012-02-15 10:18           ` Dietmar Hahn [this message]
2012-02-15 10:29             ` Jan Beulich

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=2372545.AjeFrRLSs5@amur \
    --to=dietmar.hahn@ts.fujitsu.com \
    --cc=JBeulich@suse.com \
    --cc=haitao.shan@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).