diff mbox

[RFC,16/20] x86/vlapic: Don't try to accept 8259 interrupt if !has_vpic()

Message ID 1459905949-10358-17-git-send-email-boris.ostrovsky@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boris Ostrovsky April 6, 2016, 1:25 a.m. UTC
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/vlapic.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jan Beulich June 3, 2016, 4:14 p.m. UTC | #1
>>> On 06.04.16 at 03:25, <boris.ostrovsky@oracle.com> wrote:
> --- a/xen/arch/x86/hvm/vlapic.c
> +++ b/xen/arch/x86/hvm/vlapic.c
> @@ -1133,6 +1133,9 @@ void vlapic_adjust_i8259_target(struct domain *d)
>  {
>      struct vcpu *v;
>  
> +    if ( !has_vpic(d) )
> +       return;

Considering the title of the patch (which doesn't match the function
you alter) - wouldn't this better go into __vlapic_accept_pic_intr()?
It missing here I have more problems to see any harm than from it
missing there. (Arguably _also_ putting it here then would have the
benefit of avoiding a for_each_vcpu() loop.)

In any event this looks like a relatively independent change.

Jan
Boris Ostrovsky June 3, 2016, 5:50 p.m. UTC | #2
On 06/03/2016 12:14 PM, Jan Beulich wrote:
>>>> On 06.04.16 at 03:25, <boris.ostrovsky@oracle.com> wrote:
>> --- a/xen/arch/x86/hvm/vlapic.c
>> +++ b/xen/arch/x86/hvm/vlapic.c
>> @@ -1133,6 +1133,9 @@ void vlapic_adjust_i8259_target(struct domain *d)
>>  {
>>      struct vcpu *v;
>>  
>> +    if ( !has_vpic(d) )
>> +       return;
> Considering the title of the patch (which doesn't match the function
> you alter) - wouldn't this better go into __vlapic_accept_pic_intr()?
> It missing here I have more problems to see any harm than from it
> missing there. (Arguably _also_ putting it here then would have the
> benefit of avoiding a for_each_vcpu() loop.)

One of the reasons I put it here was exactly to avoid this loop. It also
(implicitly) prevented us from going down to
pt_adjust_global_vcpu_target(). In addition, we wouldn't need to check
for IOAPIC presence.

I guess I should add has_vpic(), has_vpit() and has_ioapic() in all
these places.

> In any event this looks like a relatively independent change.

Right. Once ACPI became available to the  PVHv2 guest I immediately
tripped here (because the guest started seeing APIC). So in principle I
can submit this as standalone patch.

-boris
diff mbox

Patch

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 01a8430..d8b887c 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1133,6 +1133,9 @@  void vlapic_adjust_i8259_target(struct domain *d)
 {
     struct vcpu *v;
 
+    if ( !has_vpic(d) )
+       return;
+
     for_each_vcpu ( d, v )
         if ( __vlapic_accept_pic_intr(v) )
             goto found;