From: Paolo Bonzini <pbonzini@redhat.com>
To: "Nakajima, Jun" <jun.nakajima@intel.com>,
Steve Rutherford <srutherford@google.com>
Cc: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
"srutherford@intel.com" <srutherford@intel.com>,
"Gudimetla, Giridhar Kumar" <giridhar.kumar.gudimetla@intel.com>
Subject: Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted
Date: Thu, 3 Sep 2015 09:38:53 +0200 [thread overview]
Message-ID: <55E7F90D.9000107@redhat.com> (raw)
In-Reply-To: <CAL54oT3Tv4gx5Ph3wuwba89k2PYGz=cV9ZG8P6uZpw6JxS0oaw@mail.gmail.com>
On 03/09/2015 07:18, Nakajima, Jun wrote:
> On Wed, Sep 2, 2015 at 3:38 PM, Steve Rutherford <srutherford@google.com> wrote:
>> On Thu, Aug 13, 2015 at 09:31:48AM +0200, Paolo Bonzini wrote:
>> Pinging this thread.
>>
>> Should I put together a patch to make split irqchip work properly with the old TMR behavior?
>
> Yes, please.
>
> Intel® 64 and IA-32 Architectures Software Developer’s Manual:
>
> 24.11.4 Software Access to Related Structures
>
> In addition to data in the VMCS region itself, VMX non-root operation
> can be controlled by data structures that are
> referenced by pointers in a VMCS (for example, the I/O bitmaps).
The SDM does not list these data structures however. It also does not
say that, whenever a page is pointed to by the VMCS, *the whole page*
counts as a control data structure.
In http://article.gmane.org/gmane.linux.kernel/2011131 I explained my
reading of the manual and why the vTMR is IMO not part of the control
data structures. In a nutshell, the vISR, vIRR, vTPR, vPPR etc. are
control data structures, but the other fields look to me like they are
just data. Jun, can you find anything wrong in the reasoning?
Next week I'll write test cases for it, which are worthwhile anyway. In
the meanwhile, if Steve wants to prepare a patch that injects level
interrupts (those that have to set the vTMR to 1) while the VCPU is not
running, that would also work great for me as I was going to look into
that anyway.
Paolo
While
> the pointers to these data structures are
> parts of the VMCS, the data structures themselves are not. They are
> not accessible using VMREAD and VMWRITE
> but by ordinary memory writes.
> Software should ensure that each such data structure is modified only
> when no logical processor with a current
> VMCS that references it is in VMX non-root operation. Doing otherwise
> may lead to unpredictable behavior
> (including behaviors identified in Section 24.11.1)
>
>
> 29.6 POSTED-INTERRUPT PROCESSING
> ...
> Use of the posted-interrupt descriptor differs from that of other data
> structures that are referenced by pointers in
> a VMCS. There is a general requirement that software ensure that each
> such data structure is modified only when
> no logical processor with a current VMCS that references it is in VMX
> non-root operation. That requirement does
> not apply to the posted-interrupt descriptor. There is a requirement,
> however, that such modifications be done
> using locked read-modify-write instructions.
>
>
>>
>>>
>>>
>>> On 13/08/2015 08:35, Zhang, Yang Z wrote:
>>>>> You may be right. It is safe if no future hardware plans to use
>>>>> it. Let me check with our hardware team to see whether it will be
>>>>> used or not in future.
>>>>
>>>> After checking with Jun, there is no guarantee that the guest running
>>>> on another CPU will operate properly if hypervisor modify the vTMR
>>>> from another CPU. So the hypervisor should not to do it.
>>>
>>> I guess I can cause a vmexit on level-triggered interrupts, it's not a
>>> big deal, but no weasel words, please.
>>>
>>> What's going to break, and where is it documented?
>>>
>>> Paolo
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
next prev parent reply other threads:[~2015-09-03 7:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 13:37 [PATCH 0/2] KVM: x86: limit interactions between IOAPIC and LAPIC Paolo Bonzini
2015-07-29 13:37 ` [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted Paolo Bonzini
2015-07-30 3:39 ` Steve Rutherford
2015-07-30 23:26 ` Zhang, Yang Z
2015-07-31 2:49 ` Steve Rutherford
2015-07-31 7:57 ` Paolo Bonzini
2015-08-03 2:44 ` Zhang, Yang Z
2015-07-31 8:01 ` Paolo Bonzini
2015-08-03 2:37 ` Zhang, Yang Z
2015-08-03 8:10 ` Paolo Bonzini
2015-08-03 10:23 ` Zhang, Yang Z
2015-08-03 10:55 ` Paolo Bonzini
2015-08-04 0:46 ` Zhang, Yang Z
2015-08-04 6:59 ` Paolo Bonzini
2015-08-04 7:21 ` Zhang, Yang Z
2015-08-13 6:35 ` Zhang, Yang Z
2015-08-13 7:31 ` Paolo Bonzini
2015-09-02 22:38 ` Steve Rutherford
2015-09-03 5:18 ` Nakajima, Jun
2015-09-03 7:38 ` Paolo Bonzini [this message]
2015-07-29 13:37 ` [PATCH 2/2] KVM: x86: store IOAPIC-handled vectors in each VCPU Paolo Bonzini
2015-07-30 3:55 ` Steve Rutherford
2015-07-30 7:19 ` Paolo Bonzini
2015-07-29 20:00 ` [PATCH 0/2] KVM: x86: limit interactions between IOAPIC and LAPIC Alex Williamson
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=55E7F90D.9000107@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=giridhar.kumar.gudimetla@intel.com \
--cc=jun.nakajima@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=srutherford@google.com \
--cc=srutherford@intel.com \
--cc=yang.z.zhang@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