All of lore.kernel.org
 help / color / mirror / Atom feed
From: 'Roman Kagan' <rkagan@virtuozzo.com>
To: Pavel Fedin <p.fedin@samsung.com>
Cc: 'Peter Hornyack' <peterhornyack@google.com>,
	'Paolo Bonzini' <pbonzini@redhat.com>,
	'kvm list' <kvm@vger.kernel.org>,
	'Gleb Natapov' <gleb@kernel.org>,
	'Joerg Roedel' <joro@8bytes.org>,
	'Andrey Smetanin' <asmetanin@virtuozzo.com>,
	"'Denis V. Lunev'" <den@openvz.org>
Subject: Re: [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.
Date: Tue, 22 Dec 2015 15:01:07 +0300	[thread overview]
Message-ID: <20151222120106.GJ11808@rkaganb.sw.ru> (raw)
In-Reply-To: <003701d13c89$c2d5e980$4881bc80$@samsung.com>

On Tue, Dec 22, 2015 at 10:24:13AM +0300, Pavel Fedin wrote:
> > +On the return path into kvm, user space should set handled to
> > +KVM_EXIT_MSR_HANDLED if it successfully handled the MSR access. Otherwise,
> > +handled should be set to KVM_EXIT_MSR_UNHANDLED, which will cause a general
> > +protection fault to be injected into the vcpu. If an error occurs during the
> > +return into kvm, the vcpu will not be run and another exit will be generated
> > +with type set to KVM_EXIT_MSR_COMPLETION_FAILED.
> > +
> > +If exit_reason is KVM_EXIT_MSR_AFTER_WRITE, then the vcpu has executed a wrmsr
> > +instruction which is handled by kvm but which user space may need to be
> > +notified about. index and data are set as described above; the value of type
> > +depends on the MSR that was written. handled is ignored on reentry into kvm.
> 
> 1. Is there any real need to distinguish between KVM_EXIT_MSR_WRITE and KVM_EXIT_MSR_AFTER_WRITE ? IMHO from userland's point of view these are the same.

Indeed.  Perhaps the kernel can set .handled to true to let userspace
know it already took care of it, instead of introducing yet another
exit_reason.  The field would need to be marked in/out, then.

Roman.

  reply	other threads:[~2015-12-22 12:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 18:46 [RFC PATCH 0/5] KVM: x86: exit to user space on unhandled MSR accesses Peter Hornyack
2015-08-18 18:46 ` [RFC PATCH 1/5] KVM: x86: refactor vmx rdmsr/wrmsr completion into new functions Peter Hornyack
2015-08-18 18:46 ` [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability Peter Hornyack
2015-12-18 21:25   ` Paolo Bonzini
2015-12-18 23:56     ` Peter Hornyack
2015-12-21 18:58     ` Peter Hornyack
2015-12-22  7:24       ` Pavel Fedin
2015-12-22 12:01         ` 'Roman Kagan' [this message]
2015-12-22 12:51           ` Pavel Fedin
2015-12-22 14:09             ` 'Roman Kagan'
2015-12-23  7:47               ` Pavel Fedin
2016-01-12  3:21         ` Peter Hornyack
2015-08-18 18:46 ` [RFC PATCH 3/5] KVM: x86: add msr_exits_supported to kvm_x86_ops Peter Hornyack
2015-08-24 23:15   ` Bandan Das
2015-08-18 18:46 ` [RFC PATCH 4/5] KVM: x86: enable unhandled MSR exits for vmx Peter Hornyack
2015-08-24 23:14   ` Bandan Das
2015-08-18 18:46 ` [RFC PATCH 5/5] KVM: x86: add trace events for unhandled MSR exits Peter Hornyack
2015-08-19 21:43 ` [RFC PATCH 0/5] KVM: x86: exit to user space on unhandled MSR accesses Bandan Das
2015-08-20 19:40   ` Peter Hornyack
2015-08-24 23:21     ` Bandan Das

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=20151222120106.GJ11808@rkaganb.sw.ru \
    --to=rkagan@virtuozzo.com \
    --cc=asmetanin@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=gleb@kernel.org \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=p.fedin@samsung.com \
    --cc=pbonzini@redhat.com \
    --cc=peterhornyack@google.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 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.