xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Konrad Wilk <konrad.wilk@oracle.com>,
	linux-acpi@vger.kernel.org, x86@kernel.org,
	xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	lenb@kernel.org
Subject: RE: [Xen-devel] Is: axe read_tscp pvops call. Was: Re: [RFC] ACPI S3 and Xen (suprisingly small\!).
Date: Thu, 18 Oct 2012 08:56:40 -0700 (PDT)	[thread overview]
Message-ID: <dd8748de-4715-499a-8c7e-745af37fa6c4@default> (raw)
In-Reply-To: <50802030.8070107@zytor.com>

> From: H. Peter Anvin [mailto:hpa@zytor.com]
> Subject: Re: [Xen-devel] Is: axe read_tscp pvops call. Was: Re: [RFC] ACPI S3 and Xen (suprisingly
> small\!).
> 
> On 10/18/2012 08:22 AM, Dan Magenheimer wrote:
> >
> > It's a bit more complicated than that.  The problem is that if
> > any patch is ever submitted to the kernel that uses the rdtscp
> > instruction *in kernel space* in some clever way, the resultant
> > kernel may not behave as expected (depending on how the instruction
> > is used) on a 32-bit[1] PV kernel running on Xen, up to and including
> > the possibility of data corruption.
> >
> > I don't know how one would implement it, but it's like a
> > BUILD_BUG_ON is needed if any kernel developer uses rdtscp
> > (one that never gets invoked by vdso code), that prints:
> >
> > "WARNING: Please do not use this instruction in the kernel
> > without notifying the Xen maintainer as there is a possibility
> > it may behave unpredictably in some Xen environments.
> > See Documentation/.../xen_pv_limitations for detail."
> >
> > The other virtualization-unsafe instructions may have similar
> > problems.
> >
> 
> Good frakking God.  This is the sort of things that makes me think that
> Xen PV should just be thrown out of the kernel once and for all.

I agree the whole idea of paravirtualization is a hack, but it
is a hack to workaround some poor architectural design decisions
many years ago by Intel processor designers who should have known
better.  Go yell at them.

Worse, the rdtscp instruction was a poor design decision by
AMD processor designers to hack around tsc skew problems.
Go yell at them too.

And both Intel and AMD chose to perpetuate the problem
with a complicated VT/SVM implementation that will never
perform as well as native.  At least they tried ;-)
 
> Do you notice that the document you just claimed doesn't even exist at
> this point, never mind being somehow enforced?  In other word, there is
> ABSOLUTELY NO WAY a mainline kernel developer can have any idea what
> amount of violence Xen does to the architecture that it is parasiting on.

Of course I know it doesn't exist.  I probably should have
noted that in my email.  But it should exist because else
subtle issues like this will get lost in the mist of time.
And I have no clue how to enforce it (though some BUILD_BUG_ON
might help).

Like so many other things in the kernel (and computing in general),
paravirtualization is a tradeoff of maintainability for kernel/software
developers vs significant performance improvement for (a large
number of) users.  That tradeoff is above my pay grade.  But
it does provide job security.

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

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 13:49 [RFC] ACPI S3 and Xen (suprisingly small\!) Konrad Rzeszutek Wilk
2012-10-17 13:49 ` [PATCH 1/4] x86/wakeup/sleep: Check whether the TSS GDT descriptor is empty before using it Konrad Rzeszutek Wilk
2012-10-18  0:03   ` H. Peter Anvin
2012-10-18 14:47     ` Konrad Rzeszutek Wilk
2012-10-18 15:01       ` H. Peter Anvin
2013-01-17 14:41     ` Konrad Rzeszutek Wilk
2012-10-17 13:49 ` [PATCH 2/4] xen/lowlevel: Implement pvop call for load_idt (sidt) Konrad Rzeszutek Wilk
2012-10-17 23:51   ` H. Peter Anvin
2012-10-18 14:45     ` Konrad Rzeszutek Wilk
2012-10-18 15:02       ` H. Peter Anvin
2013-01-17 14:36     ` Konrad Rzeszutek Wilk
2012-10-17 13:49 ` [PATCH 3/4] xen/lowlevel: Implement pvop call for store_gdt (gidt) Konrad Rzeszutek Wilk
2012-10-17 13:49 ` [PATCH 4/4] xen/acpi: Prep saved_context cr3 values Konrad Rzeszutek Wilk
2013-01-17 14:48   ` Konrad Rzeszutek Wilk
2012-10-17 16:03 ` [RFC] ACPI S3 and Xen (suprisingly small\!) H. Peter Anvin
2012-10-17 16:10   ` Is: axe read_tscp pvops call. Was: " Konrad Rzeszutek Wilk
2012-10-17 16:39     ` Konrad Rzeszutek Wilk
2012-10-17 16:54       ` H. Peter Anvin
2012-10-17 16:50     ` H. Peter Anvin
2012-10-17 16:54       ` Konrad Rzeszutek Wilk
2012-10-17 17:35         ` H. Peter Anvin
2012-10-18 15:22           ` [Xen-devel] " Dan Magenheimer
2012-10-18 15:28             ` H. Peter Anvin
2012-10-18 15:56               ` Dan Magenheimer [this message]
2012-10-18 16:17                 ` Borislav Petkov
2012-10-18 16:44                   ` Stefano Stabellini
2012-10-18 17:04                     ` H. Peter Anvin
2012-10-18 16:37                 ` H. Peter Anvin
2012-10-19 15:48                   ` Is: Xen architecture document. Was: " Konrad Rzeszutek Wilk
2012-10-19 17:45                     ` H. Peter Anvin
2012-10-18 16:31         ` David Vrabel
2012-10-18 17:42           ` Konrad Rzeszutek Wilk
2012-10-18 18:02             ` David Vrabel
2012-10-17 17:46 ` Ben Guthro
2012-10-17 17:43   ` Konrad Rzeszutek Wilk
2012-10-17 18:00     ` Ben Guthro
2012-10-19 18:49       ` Konrad Rzeszutek Wilk
2012-10-20  1:23         ` Ben Guthro

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=dd8748de-4715-499a-8c7e-745af37fa6c4@default \
    --to=dan.magenheimer@oracle.com \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    --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).