From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D433C388F7 for ; Sat, 31 Oct 2020 09:55:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BFFF20791 for ; Sat, 31 Oct 2020 09:55:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604138130; bh=gAEow2TTsi/uUIDdTLhZ9+KVGhJj3RxdcBzWaHN1ddM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=yv8RmJLnD1K4K2s94L/GrwM3wamk9isr14CUUFQRkOy8YJwFg5gPC8+yjK5yJeHpq HHtfwOOuUB+pE+P4go5gfCvL3o2OgW6bcl2wn52WJt0KeHoxZH1Pl3MXsntSOpCPKG 0zG80+OGVbIR9GdDAu99VOGy5CAn182FXcDBpYfY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbgJaJz3 (ORCPT ); Sat, 31 Oct 2020 05:55:29 -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.