[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help on a issue (Unable to schedule guest for Xen on Arm)


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Thu, 30 Mar 2023 16:57:40 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=p5HwkUDx95h6sNWQjqad4mtQrWIR3hbH2JzrcpAvgyY=; b=CyFtqE232GC8A61kkojb9fP6xQHYQj4z8hGtWLoGQwI3FEFWE/v+eDZZKlt3A1t9MrbgUkLL4W1fCuLAkK+8CnmcaeNmaBrlSPCUg/ONu3/ZCkWOGcqD38h0G2WKtvwgl+Q38VmOMWmRcAWz2KfbOhRbNE1KD1w7FrNx+CgXdcfLWJhTuSCC5CJTeKw2LWwOBg1Cts0iBfvFFzDk7Qm2D10OdfvazRCw1u6I6gTCPK7yJofcA+6rLdT2O6ODa1Fbsh7HOR31Mo14RFwGMfCapVf/wPsecMwzDO7460XgS1z0oBYW9tLUfnmfemBa4iOCppWoqgaCl9NOcdiHXuYImA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYC1JdqCcME2zvcoXsp9zCXyPc68wndURkltdag9ItUufUplOfzBeTcP3FgFXOLTrZEvbZbnh6I5PuJorf66WB0ToRxomATd6CiVtO5EZrm/p0YZpctwLw9VOZ+uXqJZHVXNvJvMt9QUnW1FHmxZCq1uQHt7IYSQlgmb0SrnQU/K79aaqUCc2dRHke6PFirFsKn+pdgLOk0YkJft+bPHDvd8b/pygkVcKOVRqxLBHu/c0uKpmm4j7DewGwYPWioLPZoYYAtHu/GbaLVpZc3bPjAqy9l8uVnUobhurRdUzfdehLuSboWhkMCNKY4S1NPPSEBRep+UmvFJRlNk6Bl+8g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr_Babchuk@xxxxxxxx" <Volodymyr_Babchuk@xxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, "Garhwal, Vikram" <vikram.garhwal@xxxxxxx>, "Stabellini, Stefano" <stefano.stabellini@xxxxxxx>
  • Delivery-date: Thu, 30 Mar 2023 15:58:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

(Apologies, fixed the formatting issue)

On 30/03/2023 16:50, Ayan Kumar Halder wrote:
Hi Xen experts,

I need some pointers on an issue I am facing.

I am running my downstream port of Xen on Cortex-R52 hardware. The hardware consist of two R52 cores (the second core is in lockstep mode). So, currently the hardware does not support SMP.

The issue is that Xen is unable to schedule a guest. So leave_hypervisor_to_guest() ---> check_for_pcpu_work() and this does not return.

Debugging this, I see  check_for_pcpu_work() --> do_softirq() --> __do_softirq() --> timer_softirq_action().

In timer_softirq_action(), the problem I see is that for all the timers, "((t = heap[1])->expires < now)" is true.

    while ( (heap_metadata(heap)->size != 0) &&
            ((t = heap[1])->expires < now) )
    {
        remove_from_heap(heap, t); <<<<------ So, this gets invoked for all the timers.
        execute_timer(ts, t);
    }

So, further below reprogram_timer() gets invoked with timeout = 0 and it disables the timer. So, timer_interrupt() is never invoked.

Can someone give any pointers on what the underlying issue could be and how to debug further ?

I do not observe this behavior while running on R52 FVP. The difference is that for most of the timers "((t = heap[1])->expires < now)" is false, so reprogram_timer() gets invoked with non zero timeout and subsequently, the timer_interrupt() get invoked.

Also, looking at the following from xen/arch/arm/time.c.

/* Set the timer to wake us up at a particular time.
 * Timeout is a Xen system time (nanoseconds since boot); 0 disables the timer.
 * Returns 1 on success; 0 if the timeout is too soon or is in the past. */
int reprogram_timer(s_time_t timeout)
{
    uint64_t deadline;

    if ( timeout == 0 )
    {
        WRITE_SYSREG(0, CNTHP_CTL_EL2);
        return 1; <<<<<<<<<<<<<<<<<<<<<<-------------- Shouldn't this be 0 as the comment suggets ?
    }

    deadline = ns_to_ticks(timeout) + boot_count;
    WRITE_SYSREG64(deadline, CNTHP_CVAL_EL2);
    WRITE_SYSREG(CNTx_CTL_ENABLE, CNTHP_CTL_EL2);
    isb();

    /* No need to check for timers in the past; the Generic Timer fires
     * on a signed 63-bit comparison. */
    return 1;
}

Kind regards,

Ayan







 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.