public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Dong, Eddie" <eddie.dong@intel.com>
Cc: Avi Kivity <avi@redhat.com>, Sheng Yang <sheng@linux.intel.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Joerg Roedel <joerg.roedel@amd.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH v3] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices
Date: Mon, 28 Jun 2010 10:45:22 +0200	[thread overview]
Message-ID: <4C286122.1080407@siemens.com> (raw)
In-Reply-To: <1A42CE6F5F474C41B63392A5F80372B21F5DDF45@shsmsx501.ccr.corp.intel.com>

Dong, Eddie wrote:
> Avi Kivity wrote:
>> On 06/28/2010 10:30 AM, Dong, Eddie wrote:
>>>> Several milliseconds of non-responsiveness may not be acceptable for
>>>> some applications.  So I think queue_work_on() and a clflush loop is
>>>> better than an IPI and wbinvd.
>>>>
>>>>
>>> Probably we should make it configurable. For RT usage models, we do
>>> care about responsiveness more than performance, but for typical
>>> server useg model, we'd better focus on performance in this issue.
>>> WBINVD may perform much much better than CLFLUSH, and a mallicious
>>> guest repeatedly issuing wbinvd may greatly impact the system
>>> performance.     
>>>
>> I'm not even sure clflush can work.  I thought you could loop on just
>> the cache size, but it appears you'll need to loop over the entire
>> guest address space, which could take ages.
> 
> If RT usage model comes into reality, we may have to do in this way though pay with huge overhead :)
> Is there any RT customers here?

Yes, I know of a few (RT host + The Typical non-RT guest).

One case already has to deal with wbinvd because it runs on older HW
without trapping support. The issue is mitigated here by CPU isolation.
But shared caches remain problematic, also with this new approach here
(wbinvd not only flushes KVM's memory...).

> 
>> So I guess we'll have to settle for wbinvd, just avoiding it when the
>> hardware allows us to.
> 
> Yes, for now I agree we can just use wbinvd to emulate wbinvd :)

Having a switch even for the case the guest may have a potential need
would be useful. Maybe controllable by user space, maybe something like
emulate / skip / skip+report.

There might be guests issuing wbinvd from drivers of devices that aren't
passed through (I'm thinking of graphic adapters) while they don't for
the passed-through ones. In that case, ignoring should be fine.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

      reply	other threads:[~2010-06-28  8:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28  3:36 [PATCH v3] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices Sheng Yang
2010-06-28  3:56 ` Avi Kivity
2010-06-28  6:42   ` Sheng Yang
2010-06-28  6:56     ` Avi Kivity
2010-06-28  6:56       ` Sheng Yang
2010-06-28  7:08         ` Avi Kivity
2010-06-28  7:41           ` Sheng Yang
2010-06-28  8:07             ` Avi Kivity
2010-06-28  8:42               ` [PATCH v4] " Sheng Yang
2010-06-28  9:27                 ` Avi Kivity
2010-06-28  9:31                   ` Gleb Natapov
2010-06-28  9:35                     ` Avi Kivity
2010-06-29  3:16                       ` [PATCH v5] " Sheng Yang
2010-06-29  9:39                         ` Avi Kivity
2010-06-29 10:32                           ` Jan Kiszka
2010-06-29 10:42                             ` Avi Kivity
2010-06-29 12:32                               ` Roedel, Joerg
2010-06-29 12:37                                 ` Avi Kivity
2010-06-29 10:14                         ` Roedel, Joerg
2010-06-29 10:44                           ` Avi Kivity
2010-06-29 12:28                             ` Roedel, Joerg
2010-06-29 12:35                               ` Avi Kivity
2010-06-29 13:34                                 ` Roedel, Joerg
2010-06-29 13:25                         ` Marcelo Tosatti
2010-06-29 13:28                           ` Avi Kivity
2010-06-29 13:35                             ` Marcelo Tosatti
2010-06-29 13:50                               ` Avi Kivity
2010-06-29 14:31                                 ` Marcelo Tosatti
2010-06-28  7:30       ` [PATCH v3] " Dong, Eddie
2010-06-28  8:04         ` Avi Kivity
2010-06-28  8:16           ` Dong, Eddie
2010-06-28  8:45             ` Jan Kiszka [this message]

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=4C286122.1080407@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=sheng@linux.intel.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