Kernel KVM-PPC virtualization development
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: Thomas Huth <thuth@redhat.com>, kvm-ppc@vger.kernel.org
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Sam Bobroff <sbobroff@redhat.com>
Subject: Re: [RFC kvm-unit-tests PATCH] powerpc: add tests for XICS
Date: Wed, 22 Nov 2017 12:39:29 +0000	[thread overview]
Message-ID: <b050a042-b55b-004c-bfcb-69f192e68eea@redhat.com> (raw)
In-Reply-To: <ecbcb946-48e6-d7c9-45af-65ee62dfdf7f@redhat.com>

On 16/10/2017 14:34, Laurent Vivier wrote:
> On 13/10/2017 11:45, Thomas Huth wrote:
>> On 12.10.2017 10:07, Laurent Vivier wrote:
>>> Check if we can set the xive server and priority, and
>>> check we get values that have been set.
>>> Check we disable/enable interrupts.
>>>
>>> This patch also increases NR_CPUS from 8 to 16
>>> (maximum for KVM on POWER9, POWER8 allows 96)
>>>
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>> ---
>>> Note: I send this as an RFC, because even if this test works well with
>>> TCG and POWER8 KVM hosts, it detects some problems with POWER9 KVM hosts
>>
>> What kind of errors does it detect? Are they expected due to the
>> different interrupt controllers?
>>
> 
> [I cc' Sam as he already did a fix for this part in the kernel]

I finally found some time to debug this.

> I have two kinds of error:
> 
> - "xics: get-xive: irq #4351, expected cpu 15 prio 255, had cpu 0 prio
>    255",
>   Priority 255 is set to disable the IRQs, I don't think it's really a
>   problem at this level, it could be only cosmetic,

In this case, we have set priority to 255 with set-xive, and in the
emulation, 255 is the "MASKED" value and in this case set-xive doesn't
store the interrupt server, so get-xive always returns an invalid server.

> - "xics: int-on: irq #4351, ret = -3",
>   but here it becomes more serious: as the IRQ server has been lost, it
>   seems we are not able to re-enable the interrupt.

int-on explicitly checks the priority value, and if the value is
"MASKED" (255, the value we set previously with set-xive) it returns an
error.

These errors can be fixed by two different ways:

A- don't allow set-xive to set the priority to 255 (the MASKED value)
   and return an error value, and get-xive return an error value if
   priority is the MASKED value

B- store the server in set-xive even it the value is the MASKED one, so
we can get it with get-xive and use it with int-on (with the saved
priority value)

(A) follows the specs:

Linux on Power Architecture Platform Reference,  v1.1
R1–7.3.10.2–5. For the PowerPC External Interrupt option: The
               ibm,set-xive call must return the Status of -3
               (Argument Error) for an unimplemented Interrupt number.

(B) would behave like XICS with P8 and TCG.

Any ideas?

Thanks,
Laurent


  reply	other threads:[~2017-11-22 12:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12  8:07 [RFC PATCH] powerpc: add tests for XICS Laurent Vivier
2017-10-13  9:45 ` [RFC kvm-unit-tests " Thomas Huth
2017-10-16 12:34   ` Laurent Vivier
2017-11-22 12:39     ` Laurent Vivier [this message]
2017-11-23  4:52       ` Benjamin Herrenschmidt
2017-10-16 17:08   ` Laurent Vivier
2017-10-18  8:11     ` Andrew Jones

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=b050a042-b55b-004c-bfcb-69f192e68eea@redhat.com \
    --to=lvivier@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sbobroff@redhat.com \
    --cc=thuth@redhat.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