From patchwork Fri Feb 21 07:42:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11395729 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A869C924 for ; Fri, 21 Feb 2020 07:49:31 +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 7D6CC222C4 for ; Fri, 21 Feb 2020 07:49:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="cDT+g8Tz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D6CC222C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j533y-0003YW-Mv for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Feb 2020 02:49:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60588) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j531S-0000wF-PL for qemu-devel@nongnu.org; Fri, 21 Feb 2020 02:46:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j531P-0001Aj-U9 for qemu-devel@nongnu.org; Fri, 21 Feb 2020 02:46:53 -0500 Received: from mail-dm6nam11on2070.outbound.protection.outlook.com ([40.107.223.70]:6081 helo=NAM11-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j531P-00015a-O7; Fri, 21 Feb 2020 02:46:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IDHNcGFRqGWbxPg+oafuvdAJa0uwS5n5rjJFbHZzXu43k6O+a/xMWPVkwupRxZyfABxl9ZBbVyLBxm81TP1g+Y97v915PcKrgAyaBedHQvTJJ8C4OA9S+sr8WChOOpWFGAPRpXokKCIi7J/S8yWGFmUFbrUZsf21tUPShzBTO3id8bbzCWRP9/R2TbyfburP6wdrW/Mdx1EgeZjaKOsQDEEuVJd8LG2CcNPe02Z73BuVqrzK44Peqbs74XqTPTNUoOLXzSoS/zBqI9ZWXS805B1QAOauWy/ovDYN55AcF0qlno4JX4t5Z70mLcIY2olUFOnMWPKMaQNX6ze6TuKYlA== 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-SenderADCheck; bh=IYlNz8YaPKiBm+UMfGlKLwarvPCaLrRSOCOOTXu7C9w=; b=MtXzcTMzK46AE2Q12q8CIM5oMFZ+emsZFLQ6VzpecAEjxVCoPkR+P3L55tPG1pob4v0mUybl9h3GlR0p5h8oaP8f1zwyQz5vPWOAmWG8+ii0D9ZxGf8KmeAcKuvmCW8usPBzrT8E5Yzdbkf1PwlCz8t7rdXqeSchDPtY0A4PobvjXTPDqw3RCMvdqJbNItWKZFjIsPMMm3OvJbr3aBu5cyoNthjeBLYILdf68TlyXsgd93Hvq7ma3c3I+OzaOM49cfqpNlgpoG6z58Pfkst5pp3hgqNGafARA2kHictlwRUG0k3Y+giJZz+JApprIcYanpGAasyaa6J2wii7cYcxig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=suse.de smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IYlNz8YaPKiBm+UMfGlKLwarvPCaLrRSOCOOTXu7C9w=; b=cDT+g8TzNAeorpg/oR/KR+AMZoxESY/mILk3qc+PRrajRELdKRwRXQJy21ttSK67x/47CYGbKGhqpIawlKfoiCtja1qsbjy8nn1a3hZSEy5ydO3WNk2CO4iEH8dDwVtnM0el8wwbmTe3xStO9w61ndRrGD4pYTG/e6qRl9RFp6s= Received: from BN6PR02CA0040.namprd02.prod.outlook.com (2603:10b6:404:5f::26) by CY4PR02MB2278.namprd02.prod.outlook.com (2603:10b6:903:15::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Fri, 21 Feb 2020 07:46:47 +0000 Received: from SN1NAM02FT044.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::208) by BN6PR02CA0040.outlook.office365.com (2603:10b6:404:5f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18 via Frontend Transport; Fri, 21 Feb 2020 07:46:46 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT044.mail.protection.outlook.com (10.152.72.173) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2750.18 via Frontend Transport; Fri, 21 Feb 2020 07:46:46 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1j531J-0002CJ-VC; Thu, 20 Feb 2020 23:46:45 -0800 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j531E-0006CZ-SI; Thu, 20 Feb 2020 23:46:40 -0800 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 01L7keGm018620; Thu, 20 Feb 2020 23:46:40 -0800 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j531D-0006CP-TG; Thu, 20 Feb 2020 23:46:40 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 9A58F13C0374; Fri, 21 Feb 2020 13:12:15 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E . Iglesias" , Alistair Francis , Peter Maydell , Anthony Liguori , afaerber@suse.de Subject: [PATCH v2 1/3] arm_gic: Mask the un-supported priority bits Date: Fri, 21 Feb 2020 13:12:05 +0530 Message-Id: <1582270927-2568-2-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582270927-2568-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1582270927-2568-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(39850400004)(396003)(136003)(346002)(199004)(189003)(8936002)(426003)(70206006)(336012)(70586007)(42186006)(316002)(6266002)(2616005)(110136005)(2906002)(5660300002)(356004)(6666004)(186003)(4326008)(478600001)(26005)(81156014)(8676002)(81166006)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB2278; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ebfaa9b-1b2d-4b3f-4c37-08d7b6a233bf X-MS-TrafficTypeDiagnostic: CY4PR02MB2278: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:626; X-Forefront-PRVS: 0320B28BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7XRKzyXILk4oN+5NbGc4zRp8AzepNC9swEz6X+3tnuzmBZRUkfvsKerOf7ZJ/8vCaY5pvOFW8rqY9broeOEbSziEe+Z9NdjdGVdZSzDQctytuSDyqCDOg6Gw+3e19DMo/Q8CKLhJKPSiuZX8dRdFOOqFeEC5LXKIF3Zv6VPKj64xst/+0ziidWrMRQncXgNZ4PU3R+NqooaGflvijHhch0ZursioOz3NpM6it2/L/344cS5bOK+SI/7JNjunMOEI8wUcC4aUp843MOWoPurKRLOyliAKhMcpqAQzNk4uM39mx4Y6LnOgqHZM7Y/WMPIuomCZlHDdQmSbB60KWk10mi3w2SEikkmOyI7v/RFVlOpUyt4dy4pZpk7zYW2Sd/swqKXadg5gd5owKFT+9ESm54foc+3uIvFiyrncIwlWc820GL/coCljnJWunNMYXsFT X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2020 07:46:46.3875 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ebfaa9b-1b2d-4b3f-4c37-08d7b6a233bf X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB2278 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.223.70 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Priority bits implemented in arm-gic can be 8 to 4, un-implemented bits are read as zeros(RAZ). Signed-off-by: Sai Pavan Boddu --- hw/intc/arm_gic.c | 26 ++++++++++++++++++++++++-- hw/intc/arm_gic_common.c | 1 + include/hw/intc/arm_gic_common.h | 1 + 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 1d7da7b..dec8767 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -641,6 +641,23 @@ uint32_t gic_acknowledge_irq(GICState *s, int cpu, MemTxAttrs attrs) return ret; } +static uint32_t gic_fullprio_mask(GICState *s, int cpu) +{ + /* + * Return a mask word which clears the unimplemented priority + * bits from a priority value for an interrupt. (Not to be + * confused with the group priority, whose mask depends on BPR.) + */ + int unimpBits; + + if (gic_is_vcpu(cpu)) { + unimpBits = GIC_VIRT_MAX_GROUP_PRIO_BITS; + } else { + unimpBits = 8 - s->n_prio_bits; + } + return ~0U << unimpBits; +} + void gic_dist_set_priority(GICState *s, int cpu, int irq, uint8_t val, MemTxAttrs attrs) { @@ -669,7 +686,7 @@ static uint32_t gic_dist_get_priority(GICState *s, int cpu, int irq, } prio = (prio << 1) & 0xff; /* Non-secure view */ } - return prio; + return prio & gic_fullprio_mask(s, cpu); } static void gic_set_priority_mask(GICState *s, int cpu, uint8_t pmask, @@ -684,7 +701,7 @@ static void gic_set_priority_mask(GICState *s, int cpu, uint8_t pmask, return; } } - s->priority_mask[cpu] = pmask; + s->priority_mask[cpu] = pmask & gic_fullprio_mask(s, cpu); } static uint32_t gic_get_priority_mask(GICState *s, int cpu, MemTxAttrs attrs) @@ -2055,6 +2072,11 @@ static void arm_gic_realize(DeviceState *dev, Error **errp) return; } + if (s->n_prio_bits > 8) { + error_setg(errp, "num-priority-bits cannot be greater than 8"); + return; + } + /* This creates distributor, main CPU interface (s->cpuiomem[0]) and if * enabled, virtualization extensions related interfaces (main virtual * interface (s->vifaceiomem[0]) and virtual CPU interface). diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c index e6c4fe7..7b44d56 100644 --- a/hw/intc/arm_gic_common.c +++ b/hw/intc/arm_gic_common.c @@ -357,6 +357,7 @@ static Property arm_gic_common_properties[] = { DEFINE_PROP_BOOL("has-security-extensions", GICState, security_extn, 0), /* True if the GIC should implement the virtualization extensions */ DEFINE_PROP_BOOL("has-virtualization-extensions", GICState, virt_extn, 0), + DEFINE_PROP_UINT32("num-priority-bits", GICState, n_prio_bits, 8), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/intc/arm_gic_common.h b/include/hw/intc/arm_gic_common.h index b5585fe..6e0d6b8 100644 --- a/include/hw/intc/arm_gic_common.h +++ b/include/hw/intc/arm_gic_common.h @@ -96,6 +96,7 @@ typedef struct GICState { uint16_t priority_mask[GIC_NCPU_VCPU]; uint16_t running_priority[GIC_NCPU_VCPU]; uint16_t current_pending[GIC_NCPU_VCPU]; + uint32_t n_prio_bits; /* If we present the GICv2 without security extensions to a guest, * the guest can configure the GICC_CTLR to configure group 1 binary point From patchwork Fri Feb 21 07:42:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11395723 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FA491580 for ; Fri, 21 Feb 2020 07:47:59 +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 05951222C4 for ; Fri, 21 Feb 2020 07:47:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="mWlKCGvM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05951222C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j532U-000263-7t for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Feb 2020 02:47:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60548) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j531R-0000w8-Cx for qemu-devel@nongnu.org; Fri, 21 Feb 2020 02:46:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j531P-0001AD-NX for qemu-devel@nongnu.org; Fri, 21 Feb 2020 02:46:52 -0500 Received: from mail-dm6nam12on2047.outbound.protection.outlook.com ([40.107.243.47]:30816 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j531P-00014N-EN; Fri, 21 Feb 2020 02:46:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qc5Abza1yDsWY3ZqtAoPxE6z8P5Y7ijTmVKHK2ZPV7XZjR2s5M52ySJBDMslrb8AcJwDXYokqbBepkjbFq28ujCPGBdALsK26Q5OcQhhVGyl9Xgi1RZqnIP3ffechzqSo65eWFL8EiyDRvUNZWJQA/ttpNrmczU2j/b4HNJ4WppZg1t7Hz9KbqVDMv6nrGvy1q7+VtyUUZSFTxuuvbO2eyreS6B4JGg6lKhZuNQdpQcIQnLvqkkD/X8bbdG85fRCjNrCeK7QiKYEF0wjbJyiBpLwnTuXpGLv0yGSyKUcXfHxCWCYx58IGWLIdgo+hLyjMiXAgEciQF/1F4njq+ysIg== 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-SenderADCheck; bh=Ctg6ylU4WJvlXSjMYkgx6eFanXH84h/3L2dU/wS1b6U=; b=J5iIFXXJ3gd/iigCL5OwTuAl4NtS6trGAeyVa4jBha4F6W9tQr2PsYbiB0P3t9SPzSUzY/uxywIiWK0Cj4BkAYZJ4PBk8xGRQZXhWL0fT8LWZCwFgmjnNbiyGb4gptUItBvJJdv4xAK4IvCBbWxwknwwEFOW5hdZ9seqE+VAlQl6MtdDUglkMCOtJuE0k20cqGZwqF+bYYU3FhjBs1BwRfIWy+zfo3go1jk/WLnKMv14YO+2WKZw17GIlchS3DRH2SaNp13raqTFO7AtS/6/M1v+4aXSBKsobsYPOrCXL0yF3a7HP3XkJXV2pMlpBLzxlNhsvHu6ak42vdbc7W0k5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=suse.de smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ctg6ylU4WJvlXSjMYkgx6eFanXH84h/3L2dU/wS1b6U=; b=mWlKCGvMH61L572etutKMqU8hwk13FqyyfyI0YenmpebvI2Y3uDlpCSZLWL63z4SnjE8rWcVdQUNX1pi2Di4KX3WhdGTkEDf8bEW1Exj4RSAdHfgQVOh4YGcy49TNFekz9Ue7xW+gTnvq/HXrSffYMF7nGkxTvjTXYEX/H2LGz0= Received: from BL0PR02CA0051.namprd02.prod.outlook.com (2603:10b6:207:3d::28) by CH2PR02MB7045.namprd02.prod.outlook.com (2603:10b6:610:8b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Fri, 21 Feb 2020 07:46:48 +0000 Received: from CY1NAM02FT044.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by BL0PR02CA0051.outlook.office365.com (2603:10b6:207:3d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18 via Frontend Transport; Fri, 21 Feb 2020 07:46:47 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT044.mail.protection.outlook.com (10.152.75.137) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2750.18 via Frontend Transport; Fri, 21 Feb 2020 07:46:47 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1j531K-0002CK-V9; Thu, 20 Feb 2020 23:46:46 -0800 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j531F-0006Cg-S7; Thu, 20 Feb 2020 23:46:41 -0800 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 01L7kfvl017851; Thu, 20 Feb 2020 23:46:41 -0800 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j531E-0006CW-QP; Thu, 20 Feb 2020 23:46:41 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 801DE13C0FD3; Fri, 21 Feb 2020 13:12:16 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E . Iglesias" , Alistair Francis , Peter Maydell , Anthony Liguori , afaerber@suse.de Subject: [PATCH v2 2/3] cpu/a9mpcore: Set number of GIC priority bits to 5 Date: Fri, 21 Feb 2020 13:12:06 +0530 Message-Id: <1582270927-2568-3-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582270927-2568-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1582270927-2568-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(39850400004)(396003)(136003)(189003)(199004)(2616005)(4744005)(336012)(186003)(110136005)(81156014)(26005)(4326008)(5660300002)(2906002)(81166006)(42186006)(316002)(8676002)(8936002)(426003)(70206006)(70586007)(6266002)(6666004)(356004)(36756003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:CH2PR02MB7045; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4fb82471-59c8-478b-c97d-08d7b6a23450 X-MS-TrafficTypeDiagnostic: CH2PR02MB7045: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:161; X-Forefront-PRVS: 0320B28BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AjkcSiGdRB6vtKdoXfMH5k9nV1su3D6M/JzaqWGe/Z44e8xgkySyohMjqBrss0RFWmzJ298k+9W2PYnzAbzUruJTB++QXbuRB8S/3OcK4ZKOtSvjzhoB6qguISyztYjz/thN8omlV9wzA2uMbFhB4fACYGIZGHI4YeBbcJqd/NqKV3GdDp8zv8aqF2g6V78LQi7qEqUWy4Zp9O20i4QZu5WaWq8pMmRAfNKL+asBxdJ2cYjwDDlWxmv3viz4Gxg5UPnwenhSzuUdXQnsGHeI1y/SLMpqHs81NZKHYXdNjS2ELY+3XJ7mM25wLMkKeybvX317xjbQ16dl8uCILEOdoB5K3BJ0SGRqBg4Bjrqxhh9r1Rwg+jIIzdleBG9gm4OR4gF8328c3DFX0pTyz12Vwz3mQkSVJCciqLHLOOIbp/2vU7M0X7vK1vWjNvfIgZO4 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2020 07:46:47.3589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4fb82471-59c8-478b-c97d-08d7b6a23450 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB7045 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.243.47 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" All A9 CPUs have a GIC with 5 bits of priority. Signed-off-by: Sai Pavan Boddu Suggested-by: Peter Maydell Reviewed-by: Peter Maydell --- hw/cpu/a9mpcore.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c index 1f8bc8a..b4f6a7e 100644 --- a/hw/cpu/a9mpcore.c +++ b/hw/cpu/a9mpcore.c @@ -16,6 +16,8 @@ #include "hw/qdev-properties.h" #include "hw/core/cpu.h" +#define A9_GIC_NUM_PRIORITY_BITS 5 + static void a9mp_priv_set_irq(void *opaque, int irq, int level) { A9MPPrivState *s = (A9MPPrivState *)opaque; @@ -68,6 +70,8 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp) gicdev = DEVICE(&s->gic); qdev_prop_set_uint32(gicdev, "num-cpu", s->num_cpu); qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq); + qdev_prop_set_uint32(gicdev, "num-priority-bits", + A9_GIC_NUM_PRIORITY_BITS); /* Make the GIC's TZ support match the CPUs. We assume that * either all the CPUs have TZ, or none do. From patchwork Fri Feb 21 07:42:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11395721 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 032F6924 for ; Fri, 21 Feb 2020 07:47:59 +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 CD234207FD for ; Fri, 21 Feb 2020 07:47:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="AuT2HACd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD234207FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j532U-00025a-1g for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Feb 2020 02:47:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60593) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j531T-0000wG-4R for qemu-devel@nongnu.org; Fri, 21 Feb 2020 02:46:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j531Q-0001BQ-4X for qemu-devel@nongnu.org; Fri, 21 Feb 2020 02:46:53 -0500 Received: from mail-mw2nam10on2043.outbound.protection.outlook.com ([40.107.94.43]:6028 helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j531P-000160-TW; Fri, 21 Feb 2020 02:46:52 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X1aB/CUt5GAqJqJMJ4AMCvncQiJJYKIeQiyF/iwyDVf6NtsjCTEQUdVQDKWit+Esx3q8B7q7UPYr6T/UiRt0ykTMNrfWIWeIMvmvjkPP8Zl4bg5tX3YyQUyG+lkzBncMi0MIji6jIRQb3D4eKxL1QbvCF66z5YjArheEFnuYenQ+Z+EzkP/Hltq2SSZXIGXUT7kOdWEINkcHH7snB3SqsYcepyr9/Mv016V086AbRUWGNys543+uvXMvFfa4PywfWKekpKIN1Q5GCcWgDWzhWv+sZk1yHu7OEGED4M/L4KF/VO2VRt296PIC4gqpfLTlLkYlnmb2ZrSd8SwP3uBtjw== 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-SenderADCheck; bh=93ZmqlyPxWPJk4CKMBWKy7wmcow9SiFeY4euBrW33Ts=; b=ZsKkSr3CM0+nEn4HHefDmCnHvj+Bo+QSzhi52z6eVvtElVT/6FevygEHaho9PY4UWgVr9B/jMB7CwYFJ/qazhGeGvsv2oqZ0Xs0rGUxafoQD+daHkyVJ/l/HkryfFTOKMxu7tyXd5XYTERO/ESfsR0/dz2SSSR7o6CoSbb2JltXxgogBr46DD1CqWunxMld4FlhvjPZMRb653LMI3Z8OY4m/1iBiP10yVovrRwVBj20jUI/xqWeaMe7qlRnBqqIPTLpaPayLvJOEE911lsj1l+Qt0pxjFPWIOMaeOwpA72g2dEISFl1e19a82CUHDqHZEFQbeFPK0u10Xx3fH4tS+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=suse.de smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=93ZmqlyPxWPJk4CKMBWKy7wmcow9SiFeY4euBrW33Ts=; b=AuT2HACdvQU/w2VcuQTGKEHaPl+Kuxj3Waq1QuoCvlJL/TzWj2BjAxgQRY62VDDeoU9i9qaPAfXHtb3AOK09AFIhzln3SJnaOH+LEnxvX9hYlnkwbidU6fCoNoobKXl4/RQSdpr1GOrCWKgNlGB6B/xekdIKxOwDN7WgPbaOpL4= Received: from MN2PR02CA0029.namprd02.prod.outlook.com (2603:10b6:208:fc::42) by SN6PR02MB4334.namprd02.prod.outlook.com (2603:10b6:805:ac::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22; Fri, 21 Feb 2020 07:46:48 +0000 Received: from CY1NAM02FT041.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by MN2PR02CA0029.outlook.office365.com (2603:10b6:208:fc::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25 via Frontend Transport; Fri, 21 Feb 2020 07:46:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT041.mail.protection.outlook.com (10.152.74.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2750.18 via Frontend Transport; Fri, 21 Feb 2020 07:46:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1j531L-0002CM-OZ; Thu, 20 Feb 2020 23:46:47 -0800 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j531G-0006Cp-Lc; Thu, 20 Feb 2020 23:46:42 -0800 Received: from xsj-pvapsmtp01 (smtp-fallback.xilinx.com [149.199.38.66] (may be forged)) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 01L7kfep018626; Thu, 20 Feb 2020 23:46:42 -0800 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j531F-0006Cf-Kr; Thu, 20 Feb 2020 23:46:41 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 58DAB13C0374; Fri, 21 Feb 2020 13:12:17 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E . Iglesias" , Alistair Francis , Peter Maydell , Anthony Liguori , afaerber@suse.de Subject: [PATCH v2 3/3] cpu/arm11mpcore: Set number of GIC priority bits to 4 Date: Fri, 21 Feb 2020 13:12:07 +0530 Message-Id: <1582270927-2568-4-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582270927-2568-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1582270927-2568-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(39860400002)(136003)(376002)(199004)(189003)(42186006)(426003)(316002)(70586007)(81156014)(81166006)(8676002)(70206006)(8936002)(336012)(110136005)(2616005)(6266002)(4744005)(186003)(26005)(4326008)(356004)(5660300002)(6666004)(2906002)(478600001)(36756003)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB4334; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32e7c70a-940d-47eb-c5e6-08d7b6a234cf X-MS-TrafficTypeDiagnostic: SN6PR02MB4334: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:78; X-Forefront-PRVS: 0320B28BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p89TLr+GNGTBsUx4T9zj74xaxKi4vRZEM2+dBD7imJhziBbkho0WZd+Je0hUWAHjYT3UcGrGXUCXa7Uq5c6nw8IIIfT8b5a8venGTxay59CG0iXIPMhvk/3jlFsOwnMBogJO//EpqeQM4UC2v5SCMATV/Mgb28WAtb6LCzWMtdGeUfXnKaCdI+JbPoZUkNLSc9Oce7+xSa81nzVfvHO5wqVwbHM5jgbKsjZTT/CMmbj9ZaFDgs2QKj325yMczzUt7I07wsXMHfl0kG6p/XlXoZIXRFkmJsxNVHW9PoJ8HYbfIWIaz1xVjNb9nh6eCTZ9MRkLSidH7/BrjPeQNtNPKXUlxk5/rg1y+Fvw308eOvJGCZTsLPcGW9oD3rcszskm9Uv/bRheN4UpetwuExgHLdKP1xSXkGes0tfH/4SrG8/4chHuEtUbwpBZHm9hdat4vLJBcE2OLNTpssTelPn1M8bqnLRMEwFpSkoRF39mIq+K87/0qozIdU2d4+JV4xbV X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2020 07:46:48.1912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32e7c70a-940d-47eb-c5e6-08d7b6a234cf X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4334 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.94.43 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" ARM11MPCore GIC is implemented with 4 priority bits. Signed-off-by: Sai Pavan Boddu Suggested-by: Peter Maydell Reviewed-by: Peter Maydell --- hw/cpu/arm11mpcore.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c index 2e3e87c..ab9fadb 100644 --- a/hw/cpu/arm11mpcore.c +++ b/hw/cpu/arm11mpcore.c @@ -15,6 +15,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" +#define ARM11MPCORE_NUM_GIC_PRIORITY_BITS 4 static void mpcore_priv_set_irq(void *opaque, int irq, int level) { @@ -86,6 +87,10 @@ static void mpcore_priv_realize(DeviceState *dev, Error **errp) qdev_prop_set_uint32(gicdev, "num-cpu", s->num_cpu); qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq); + qdev_prop_set_uint32(gicdev, "num-priority-bits", + ARM11MPCORE_NUM_GIC_PRIORITY_BITS); + + object_property_set_bool(OBJECT(&s->gic), true, "realized", &err); if (err != NULL) { error_propagate(errp, err);