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

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:50: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=36UGZNAd6m+VrexqEHUbCI4Q7pyBZp5b4OX2S6to97c=; b=BNdwpTPvpMpvC2nbZFT1ZZlJPfRIHdopUYqAcmMYLePjcH5QeTl9+kKzqbwJtEkSiO8jw8+pFLcbqWsR4GsZ0nXZr6c1yf7oQU7bJlSlFxMujw3ARDHIe3OzgJFFOCYvWQAmRVZxvJZdI+WMpEUHFNOJ0otfOMCqwjfvIf6cd3WgvqT8HwIerpQVcRSH+vdzvTNhqwiSwI034T/i+yg2CtiIGT6NfuC+J353z/+iHhUkEgsJ6Ea6PWc6J8CNz1HK2CQQiWSJXOsRIyzyKCXoAdXQGt8OwwH1p6fITR2naVZHzmjV1RZzchaB5Saa8dO+VwLvcO1doRqGQ3iq3DqXXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iEiRtmcVoBLZWBtC41eXQsAeA8WMG7WAjtvgtGmZWxxGF7+m8pBy5x4zdaYGxi+Fnlc1MAPcsC2RtdPe3jxYX3XWlVqCAxmufURbr6+NZvM5Ma2M9IIF7Pn5mxDTR4Gbq/g0Cp0TooYDXmBlNWBUqkAJg7wpCZrD2AhsYuTNS/puFdqMkDYjnC2NoFbNkcSNrJq3EIP7W1w3pJh6KI3MGxQjuwwHm76l9BTM5ocl5YIm00lIs5xsNwDgZvrBgBuMvfu+LRsvwyL93+p5/J8ClE9hXQ9zL+uXoqgs8h2gSi7Z3Aki4NJf2RPqYTHAfT06K0A6S78vgGt5E3n6hLAgPQ==
  • 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:51:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l211

208 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l208> /* Set the timer to wake us up at a particular time. 209 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l209>  * Timeout is a Xen system time (nanoseconds since boot); 0 disables the timer. 210 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l210>  * Returns 1 on success; 0 if the timeout is too soon or is in the past. */ 211 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l211> int reprogram_timer(s_time_t timeout) 212 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l212> { 213 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l213>     uint64_t deadline; 214 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l214> 215 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l215>     if ( timeout == 0 ) 216 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l216>     { 217 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l217>         WRITE_SYSREG(0, CNTHP_CTL_EL2); 218 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l218>         return 1; <<<<<<<<<<<<<<<<<<<<<<-------------- Shouldn't this be 0 as the comment suggets ? 219 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l219>     } 220 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l220> 221 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l221>     deadline = ns_to_ticks(timeout) + boot_count; 222 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l222>     WRITE_SYSREG64(deadline, CNTHP_CVAL_EL2); 223 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l223>     WRITE_SYSREG(CNTx_CTL_ENABLE, CNTHP_CTL_EL2); 224 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l224>     isb(); 225 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l225> 226 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l226>     /* No need to check for timers in the past; the Generic Timer fires 227 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l227>      * on a signed 63-bit comparison. */ 228 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l228>     return 1; 229 <https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/time.c;h=0b482d7db30c89fc70b191722a89dea8a675c2b6;hb=refs/heads/staging#l229> }

Kind regards,

Ayan






 


Rackspace

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