public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: Re: State of debug register emulation
Date: Fri, 02 May 2008 10:47:21 +0200	[thread overview]
Message-ID: <481AD519.8070107@siemens.com> (raw)
In-Reply-To: <4817AAE4.8020009@qumranet.com>

Avi Kivity wrote:
> Jan Kiszka wrote:
>> This still leaves me with the question how to handle the case when the
>> host sets and arms some debug registers to debug the guest and the
>> latter does the same to debug itself. Guest access will be trapped, OK,
>> but KVM will then have to decide which value should actually be
>> transfered into the registers. Hmm, does SVM virtualizes all debug
>> registers, leaving the real ones to the host?
>>   
> 
> There's no way this can work.  There are still only four debug
> registers, and the guest and host together can ask for eight different
> addresses.  It is theoretically doable by hiding all mappings to pages
> that are debug targets, but it would probably double the kvm code size.
> 
> A good short-term compomise is to abort if the guest starts using
> enabling a debug address register.  A better solution might be to place
> host debug addresses into unused guest debug registers, so that as long
> as nr_guest_debug + nr_host_debug <= 4, we can still proceed.

I tried the latter, but we cannot cleanly share DR7 between both users.
Thus I'm now going for a prioritized approach: debug register will stop
to have any effect for the guest as soon as the host starts to use them.
That's far simpler the implement and also easier to understand for the user.

A bit work remains, though, to clean up and enhance the DRx support in
KVM. And to test the changes (will contact you, Joerg, regarding SVM
tests). Stay tuned.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  reply	other threads:[~2008-05-02  8:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 13:07 State of debug register emulation Jan Kiszka
2008-04-29 14:40 ` Joerg Roedel
2008-04-29 16:09   ` Jan Kiszka
2008-04-29 23:10     ` Avi Kivity
2008-05-02  8:47       ` Jan Kiszka [this message]
2008-05-02  9:54         ` Avi Kivity

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=481AD519.8070107@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    /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