[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC PATCH v2 14/21] ppc/xive: add support for the SET_OS
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-ppc] [RFC PATCH v2 14/21] ppc/xive: add support for the SET_OS_PENDING command |
Date: |
Wed, 20 Sep 2017 11:47:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/19/2017 09:55 AM, David Gibson wrote:
> On Mon, Sep 11, 2017 at 07:12:28PM +0200, Cédric Le Goater wrote:
>> Adjusting the Interrupt Pending Buffer for the O/S would allow a CPU
>> to process event queues of other priorities during one physical
>> interrupt cycle. This is not currently used by the XIVE support for
>> sPAPR in Linux but it is by the hypervisor.
>>
>> Signed-off-by: Cédric Le Goater <address@hidden>
>> ---
>> hw/intc/spapr_xive.c | 9 ++++++++-
>> 1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
>> index ad3ff91b13ea..ad3f03e37401 100644
>> --- a/hw/intc/spapr_xive.c
>> +++ b/hw/intc/spapr_xive.c
>> @@ -162,7 +162,14 @@ static bool spapr_xive_tm_is_readonly(uint8_t index)
>> static void spapr_xive_tm_write_special(ICPState *icp, hwaddr offset,
>> uint64_t value, unsigned size)
>> {
>> - /* TODO: support TM_SPC_SET_OS_PENDING */
>> + if (offset == TM_SPC_SET_OS_PENDING && size == 1) {
>> + icp->tima_os[TM_IPB] |= priority_to_ipb(value & 0xff);
>> + icp->tima_os[TM_PIPR] = ipb_to_pipr(icp->tima_os[TM_IPB]);
>
> This only lets the cpu raise bits in the IPB, never clear them.> Is that
> right?
The clear is done when the OS acks the interrupt.
> I don't see how you'd implement the handling of multiple
> priorities without being able to clear bits here.
I am not sure how this command should be used from the OS.
Currently, I only see KVM handling it in the XICS/XIVE glue.
I need to take a closer look.
C.
>> + spapr_xive_icp_notify(icp);
>> + } else {
>> + qemu_log_mask(LOG_GUEST_ERROR, "XIVE: invalid TIMA write @%"
>> + HWADDR_PRIx" size %d\n", offset, size);
>> + }
>>
>> /* TODO: support TM_SPC_ACK_OS_EL */
>> }
>
- Re: [Qemu-ppc] [RFC PATCH v2 11/21] ppc/xive: push the EQ data in OS event queue, (continued)
[Qemu-ppc] [RFC PATCH v2 12/21] ppc/xive: notify the CPU when interrupt priority is more privileged, Cédric Le Goater, 2017/09/11
[Qemu-ppc] [RFC PATCH v2 13/21] ppc/xive: handle interrupt acknowledgment by the O/S, Cédric Le Goater, 2017/09/11
[Qemu-ppc] [RFC PATCH v2 14/21] ppc/xive: add support for the SET_OS_PENDING command, Cédric Le Goater, 2017/09/11
[Qemu-ppc] [RFC PATCH v2 15/21] spapr: modify spapr_populate_pci_dt() to use a 'nr_irqs' argument, Cédric Le Goater, 2017/09/11
[Qemu-ppc] [RFC PATCH v2 16/21] spapr: add a XIVE object to the sPAPR machine, Cédric Le Goater, 2017/09/11
[Qemu-ppc] [RFC PATCH v2 17/21] ppc/xive: add hcalls support, Cédric Le Goater, 2017/09/11
[Qemu-ppc] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Cédric Le Goater, 2017/09/11