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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 6CDA9C433DB for ; Tue, 12 Jan 2021 00:37:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0C46322D5B for ; Tue, 12 Jan 2021 00:37:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C46322D5B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kz7gb-00070Z-1S for qemu-devel@archiver.kernel.org; Mon, 11 Jan 2021 19:37:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz7em-0005nm-3Z for qemu-devel@nongnu.org; Mon, 11 Jan 2021 19:35:33 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:50989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz7ek-0007s0-4c for qemu-devel@nongnu.org; Mon, 11 Jan 2021 19:35:31 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 5F7AA58066E; Mon, 11 Jan 2021 19:35:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 11 Jan 2021 19:35:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=8 ECw2ui1DSz9RsQPvyjBTRfZymZzp4AdIegc3WoQ6B4=; b=KqdP4HoWz/2//yxe6 7Q21+DI2k7i75Ohdku40/x5GZJImUI1cdRXRI1m+TYA5SpSOWkinwiEVrVjna84J q2DL33GJ1Ww7Oyam3FafA++EIS6y3lRmpJlnyHcLyrdKxdcdQnqwfr1plTx7Yk3s FLOAVYuChxBdD+JNex9j6w3IiSkP4BUJT4Jp3ij38Zza69dZkobjTCEzJrqliKVc Rje1j6THELA5RjeHJ9ijBF+TB6VDuojfOsyVFHfGgZUmtlK8HgKrEQ+N+rPpL1Cm vg2h+WrWVdzx2ENuz0n3JGP0dMQzMBRLp6zp5zFTLVhHWPLybnsA5/7rPvNKX17K +5/Dw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=8ECw2ui1DSz9RsQPvyjBTRfZymZzp4AdIegc3WoQ6 B4=; b=cw8UPmoIs+d/Bb13NAULUH7QSvl77x2v4IFJDThVcwpo4mz8TSgbgLck0 VATGXCugxiW8TviBuq8xZFH7cd//XoZroYSgNezATvEpHpZBM1HdfIzmEicxY6wc +Qcx9H8XBHSMMivyr2ICS26+ifqzSIz7CFHG9Ykm+ADvz2VQ3FFzV3xjKFzoMiNo FssXolcxgQfgJSjzbhDgrfszcWelVTmkRnzM6wqQsGo2tipxIrIbF6L/MflJUvB6 rMZ7xQ/XHnyQnGZvPuUWlPJHcY4dtF+ppE6/5JgI7yrScI/J+ZAVJyH2FL4E2ml1 ifkm6868NPVGT23M5GGl97KjjjVaA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdehvddgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheplfhirgig uhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenuc ggtffrrghtthgvrhhnpeeihffghfeikedugeejvefgffevgeevgeehfffhudeiieffffev ffeugeevfefgfeenucfkphepgeehrdeffedrhedtrddvheegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhl hihgohgrthdrtghomh X-ME-Proxy: Received: from [0.0.0.0] (li1000-254.members.linode.com [45.33.50.254]) by mail.messagingengine.com (Postfix) with ESMTPA id F33C8240057; Mon, 11 Jan 2021 19:35:25 -0500 (EST) Subject: Re: [PULL 23/35] hw/intc: Rework Loongson LIOINTC To: Peter Maydell , BALATON Zoltan References: <20210103205021.2837760-1-f4bug@amsat.org> <20210103205021.2837760-24-f4bug@amsat.org> <3aece87-60ff-b195-8bd-c696bf461cb6@eik.bme.hu> <3f383a52-6583-4c60-8f24-a24e6b95c068@www.fastmail.com> <29acb49a-4d1-ae6b-328d-6e3081e2ab2f@eik.bme.hu> From: Jiaxun Yang Message-ID: <9ccb0e6a-4b80-eea2-b9f5-4eec6f8e1fad@flygoat.com> Date: Tue, 12 Jan 2021 08:35:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: permerror client-ip=66.111.4.230; envelope-from=jiaxun.yang@flygoat.com; helo=new4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Huacai Chen , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Aurelien Jarno , BALATON Zoltan via Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 在 2021/1/11 下午6:35, Peter Maydell 写道: > On Mon, 11 Jan 2021 at 10:20, BALATON Zoltan wrote: >> On Mon, 11 Jan 2021, Jiaxun Yang wrote: >>> On Mon, Jan 11, 2021, at 8:36 AM, Huacai Chen wrote: >>>> I think R_END should be 0x60, Jiaxun, what do you think? >>> U r right. >>> The manual is misleading. >> The R_END constant is also used in loongson_liointc_init() for the length >> of the memory region so you might want to revise that. If this is a 32 bit >> register then you should decide what R_END means? Is it the end of the >> memory region in which case the reg starts at R_END - 4 or is it the >> address of the last reg in which case the memory region ends at R_END + 4. >> From the above I think it's the address of the last reg so you'll probably >> need to add 4 in loongson_liointc_init() when creating the memory region. > Mmm, or check > (addr >= R_START && addr < (R_START + R_ISR_SIZE * NUM_CORES)) > > Side note: R_ISR_SIZE is 8, but the code makes both the > 32-bit addresses you can read/write in that 8-byte range > behave the same way. Is that really what the hardware does ? > Or does it actually have 1 32-bit register per core, spaced > 8 bytes apart ? Yes, the hardware was designed like that. It have 1 32-bit register per core but spaced 8 bytes apart. I assume they were planing to add more ISRs in the future but as the product line have been ceased I'm not going to handle that. I'll send a patch for fix. Thanks. - Jiaxun > > thanks > -- PMM