Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp249002imp; Thu, 21 Feb 2019 00:18:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IYsV17wbjPdgZYEplvhB2b0rQF9dVlLuGFEWThARPhSFM9rb5nCAEdHUViDAQXSB14b+a7M X-Received: by 2002:a63:f753:: with SMTP id f19mr32107518pgk.437.1550737081387; Thu, 21 Feb 2019 00:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550737081; cv=none; d=google.com; s=arc-20160816; b=yq03H6AZc/YFKoFLAgVSoal/6l8wgdxoAbSl4y6BQ7XN5kSkibPSlyXZxgztAFP7If ogzm0Zc33Zobgu2FUlB1ArfZdvSMxiHoXAKnJWAY64jxV140osG5ZmO2Ep8rdqpzKhDt 0m1HGYU2+ccNKvtuox2DYpwZrEpsRofdZ+dZwSPeMQzRa1+fs6Asx/QEmQUaGgT9rPn9 MFJFhvcJizVpvGi9fEf3yj+q6SCn8Fj9WG5m0oPdNYFZju71n4MsMIAg3wqO6FsDvYQu 1pouFJVqhiBTdtzX10FjbjeOwft1AOZusK70XLatHXK30hzKVXrqMWfsqmqu4KFcy0IU KQnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=ddbZ3acoCw50UhAJ8lX6BysEWcujnb8tRmtHkexhOtc=; b=vN0ydegkebpEj/CltMFBrpSVYTp9HoKYsjHW/dGWUCnr21/10oSDpnYIHQsoNUg8f+ i3mhsNcaSqACdDxlOFEWO8B7RCtsKes4KjcghTVIC+XNW3MGVMDQwO89f+jF5bp4Hv8c VtcMRQm5j0eY74+t50RMibqdpjX7XQWPrkt2SMsbwuwdP7jrWNa5V7jAmj1IUKv3fbJW +RZXLnDyIJUEzwPZanNzkuc/tSl+sqoNIx5Iqxvg6t6Rqx5TAxNEjZ8uffCYl9Bx4xY9 qmVG0p+2wnPKW2LK1tL8td29pocBvg++l+8pzFbc6mDtTas4rhnmCwfP8aguR9iC5zZR BJeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si10015321pgt.131.2019.02.21.00.17.43; Thu, 21 Feb 2019 00:18:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727055AbfBUIRO (ORCPT + 99 others); Thu, 21 Feb 2019 03:17:14 -0500 Received: from mx2.suse.de ([195.135.220.15]:40102 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726339AbfBUIRO (ORCPT ); Thu, 21 Feb 2019 03:17:14 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 95CCDAD95; Thu, 21 Feb 2019 08:17:12 +0000 (UTC) Subject: Re: xen/evtchn and forced threaded irq To: Julien Grall , Boris Ostrovsky , Stefano Stabellini Cc: xen-devel , "linux-kernel@vger.kernel.org" , Dave P Martin References: <5e256d9a-572c-e01e-7706-407f99245b00@arm.com> From: Juergen Gross Openpgp: preference=signencrypt Autocrypt: addr=jgross@suse.com; prefer-encrypt=mutual; keydata= xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB ycWxw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, 21 Feb 2019 09:17:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <5e256d9a-572c-e01e-7706-407f99245b00@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/02/2019 18:31, Julien Grall wrote: > Hi all, > > I have been looking at using Linux RT in Dom0. Once the guest is started, > the console is ending to have a lot of warning (see trace below). > > After some investigation, this is because the irq handler will now be threaded. > I can reproduce the same error with the vanilla Linux when passing the option > 'threadirqs' on the command line (the trace below is from 5.0.0-rc7 that has > not RT support). > > FWIW, the interrupt for port 6 is used to for the guest to communicate with > xenstore. > > From my understanding, this is happening because the interrupt handler is now > run in a thread. So we can have the following happening. > > Interrupt context | Interrupt thread > | > receive interrupt port 6 | > clear the evtchn port | > set IRQF_RUNTHREAD | > kick interrupt thread | > | clear IRQF_RUNTHREAD > | call evtchn_interrupt > receive interrupt port 6 | > clear the evtchn port | > set IRQF_RUNTHREAD | > kick interrupt thread | > | disable interrupt port 6 > | evtchn->enabled = false > | [....] > | > | *** Handling the second interrupt *** > | clear IRQF_RUNTHREAD > | call evtchn_interrupt > | WARN(...) > > I am not entirely sure how to fix this. I have two solutions in mind: > > 1) Prevent the interrupt handler to be threaded. We would also need to > switch from spin_lock to raw_spin_lock as the former may sleep on RT-Linux. > > 2) Remove the warning 3) Split the handler (RT-only?) to a non-threaded part containing everything until the "evtchn->enabled = false" and only then kick the thread doing the rest, including the spin_lock(). Juergen