Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1927273pxx; Sat, 31 Oct 2020 02:57:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHNamiZyrP+kjjNnH1fHCeqTCpmwTyWTWrVyBaQm/iRQ3gfx4Dn5KWeQ0sLrmIdJ/YSEep X-Received: by 2002:a17:907:9e3:: with SMTP id ce3mr6604457ejc.4.1604138230041; Sat, 31 Oct 2020 02:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604138230; cv=none; d=google.com; s=arc-20160816; b=zxwm55p2d//IjJAn9KYde8to5EXteRfD7W/w2G60dDlj8JFQxB0VH4cdKdBZNIckor +Z9hOuxYMv/ktSn8XJ813i3kKZRRlE5Q7Hj91GOLsIsGMKOIczCGb4j5PRX37mMgL+lc 92/Q/yRIh2QjOLUSFcAOl8/ICDCtMGOj7D+Ypd7WOS6e3hDpN5CJGskAPBROFD/+1l9O gQqMEtrRJ0IzADh0EoO4Bfp7p5TeDXiUaOGIQBCpy5d6qyH4R8PVBmh3pZ/a+umAkTxB 2JCpRkX8eCKVM4G2sp0iZK8rdtBIl/xQuWwzEuj1U3YhRfLr7kGEbMbxRC3fpOPtGmFe 2Lrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=fg+R0feMXjmtl84yfH3TGJ+oqJf8dTnRDBxms4m9xnU=; b=FwOGxWqk3fmd0do+Okra2ApFJyuOnKkQJp2LVZVMytzPsIB9PpaNiV3qMlYYtT/arx zvN0VkaM4HkPb7aFMlDOILG37G4WgahVmXKTgn5WSJ6FmNDnfBt0z8pN56QBmxjRYLtv Nd4NLsVroMnsDrRLInBKH8ptN2fy0jw1XldlAjefTXkW9U3JG+XO8ibiPxo9rRW8/dg8 W3pJ/CTI6CQJ2fgfGql3uvvZWmUCup70H9LWT0p9wdItpIs/i6mfraKwFFOZePtb8IdM 7beBi1otwQN662Uq3NM/TMSppjpO5Ly7l0WBBl9kL4b+q26lyUdNyNeafBV2H8+eg4vg uw2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h4d5ePT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si8622890edn.39.2020.10.31.02.56.48; Sat, 31 Oct 2020 02:57:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h4d5ePT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbgJaJz2 (ORCPT + 99 others); Sat, 31 Oct 2020 05:55:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:48362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbgJaJz2 (ORCPT ); Sat, 31 Oct 2020 05:55:28 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87C8C2076D; Sat, 31 Oct 2020 09:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604138127; bh=gAEow2TTsi/uUIDdTLhZ9+KVGhJj3RxdcBzWaHN1ddM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=h4d5ePT1lyEzSkCcVtcj+Q0+T2lMy+3bT9IXtlO/QfwZ3aO84GSuJqQjcMO4yvFh6 Aokb28gsdlHN/+2bZVD6swjJCrD+kgtkRCUmcKf95yIArm18wg0C8ToRquqhxwh6S4 Fv7x0SbE+Iy875jls9z05xFrPjp8TN73xBcABmgM= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kYnbZ-0061eH-Fz; Sat, 31 Oct 2020 09:55:25 +0000 Date: Sat, 31 Oct 2020 09:55:25 +0000 Message-ID: <87eeleen3m.wl-maz@kernel.org> From: Marc Zyngier To: Dongjiu Geng Cc: Jason Cooper , Thomas Gleixner , Subject: Re: Using fixed LPI number for some Device ID In-Reply-To: <04e31996-6eb8-3bb9-e333-bc46eebe3d7a@huawei.com> References: <0baed5b0-6cbe-6492-b4af-fe758f461602@huawei.com> <04e31996-6eb8-3bb9-e333-bc46eebe3d7a@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: gengdongjiu@huawei.com, jason@lakedaemon.net, tglx@linutronix.de, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dongjiu, On Sat, 31 Oct 2020 02:19:19 +0000, Dongjiu Geng wrote: > > Hi Marc, > Sorry to disturb you, Currently the LPI number is not fixed for the > device. The LPI number is dynamically allocated start from 8092. > For two OS which shares the ITS, One OS needs to configure the > device interrupt required by another OS, and the other OS uses a > fixed interrupt ID to respond the interrupt. Therefore, the LPI IRQ > number of the device needed be fixed. I want to upstream this > feature that allocate fixed LPI number for the device that is > specified through the DTS. What is your meaning? Thanks I think you are starting from the wrong premises. You can't "share" an ITS directly between two operating systems. The ITS can only be controlled by a single operating system, because its function goes way beyond allocating an LPI. How would you deal with simple things such as masking an interrupt, which requires: - Access to memory (configuration table) - Access to the command queue (to insert an invalidation command) - Access to MMIO registers (to kick the command queue into action) all of which needs to be exclusive of concurrent modifications. How do you propose this is implemented in a safe manner by two operating systems which, by nature, distrust each other? Allocating LPIs is the least of your problems, really. If you need two concurrent OSs taking interrupts, use virtualisation. That is its purpose. On your HW, you'll even get direct injection. Thanks, M. -- Without deviation from the norm, progress is not possible.