xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Joe Jin <joe.jin@oracle.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Juergen Gross" <jgross@suse.com>,
	"Kevin Tian" <kevin.tian@intel.com>, "Wei Liu" <wl@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] x86/passthrough: fix migration of MSI when using posted interrupts
Date: Thu, 31 Oct 2019 07:52:23 -0700	[thread overview]
Message-ID: <b61f1b50-c050-2482-527e-f7740058b5f9@oracle.com> (raw)
In-Reply-To: <83625673-5e84-20ba-b7bf-e3e527eecbc0@suse.com>

On 10/31/19 1:01 AM, Jan Beulich wrote:
> On 30.10.2019 19:01, Joe Jin wrote:
>> On 10/30/19 10:23 AM, Roger Pau Monné wrote:
>>> On Wed, Oct 30, 2019 at 09:38:16AM -0700, Joe Jin wrote:
>>>> On 10/30/19 1:24 AM, Roger Pau Monné wrote:
>>>>> Can you try to add the following debug patch on top of the existing
>>>>> one and report the output that you get on the Xen console?
>>>>
>>>> Applied debug patch and run the test again, not of any log printed,
>>>> attached Xen log on serial console, seems pi_update_irte() not been
>>>> called for iommu_intpost was false.
>>>
>>> I have to admit I'm lost at this point. Does it mean the original
>>> issue had nothing to do with posted interrupts?
>>
>> Looks when inject irq by vlapic_set_irq(), it checked by
>> hvm_funcs.deliver_posted_intr rather than iommu_intpost:
>>
>>  176     if ( hvm_funcs.deliver_posted_intr )
>>  177         hvm_funcs.deliver_posted_intr(target, vec);
>>
>> And deliver_posted_intr() would be there, when vmx enabled:
>>
>> (XEN) HVM: VMX enabled
>> (XEN) HVM: Hardware Assisted Paging (HAP) detected
>> (XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB
> 
> I can't see the connection. start_vmx() has
> 
>     if ( cpu_has_vmx_posted_intr_processing )
>     {
>         alloc_direct_apic_vector(&posted_intr_vector, pi_notification_interrupt);
>         if ( iommu_intpost )
>             alloc_direct_apic_vector(&pi_wakeup_vector, pi_wakeup_interrupt);
> 
>         vmx_function_table.deliver_posted_intr = vmx_deliver_posted_intr;
>         vmx_function_table.sync_pir_to_irr     = vmx_sync_pir_to_irr;
>         vmx_function_table.test_pir            = vmx_test_pir;
>     }
> 
> i.e. the hook is present only when posted interrupts are
> available in general. I.e. also with just CPU-side posted
> interrupts, yes, which gets confirmed by your "apicv=0"
> test. Yet with just CPU-side posted interrupts I'm
> struggling again to understand your original problem
> description, and the need to fiddle with IOMMU side code.

Yes, on my test env, cpu_has_vmx_posted_intr_processing == true && iommu_intpost == false,
with this, posted interrupts been enabled.

Thanks,
Joe

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-10-31 14:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 12:52 [Xen-devel] [PATCH v2] x86/passthrough: fix migration of MSI when using posted interrupts Roger Pau Monne
2019-10-09 13:35 ` Jan Beulich
2019-10-14 14:36   ` Joe Jin
2019-10-30  0:20 ` Joe Jin
2019-10-30  8:24   ` Roger Pau Monné
2019-10-30 16:38     ` Joe Jin
2019-10-30 17:23       ` Roger Pau Monné
2019-10-30 18:01         ` Joe Jin
2019-10-31  8:01           ` Jan Beulich
2019-10-31 14:52             ` Joe Jin [this message]
2019-10-31 14:56               ` Jan Beulich
2019-10-31 15:11                 ` Joe Jin
2019-10-31 15:23               ` Roger Pau Monné
2019-11-02  7:48                 ` Tian, Kevin
2019-11-04  9:46                   ` Roger Pau Monné
2019-11-08  2:25                     ` Tian, Kevin
2019-11-08 10:20                       ` Roger Pau Monné
2019-11-15  5:18                         ` Tian, Kevin

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=b61f1b50-c050-2482-527e-f7740058b5f9@oracle.com \
    --to=joe.jin@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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;
as well as URLs for NNTP newsgroup(s).