From patchwork Tue Jun 16 01:16:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 484757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3A9C81401EF for ; Tue, 16 Jun 2015 11:19:00 +1000 (AEST) Received: from localhost ([::1]:37081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4fWk-0003Hk-2I for incoming@patchwork.ozlabs.org; Mon, 15 Jun 2015 21:18:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4fUl-0007jm-8V for qemu-devel@nongnu.org; Mon, 15 Jun 2015 21:16:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4fUh-0002wW-4T for qemu-devel@nongnu.org; Mon, 15 Jun 2015 21:16:55 -0400 Received: from mail-bl2on0082.outbound.protection.outlook.com ([65.55.169.82]:17994 helo=na01-bl2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4fUh-0002wN-0O for qemu-devel@nongnu.org; Mon, 15 Jun 2015 21:16:51 -0400 Received: from BN1BFFO11FD008.protection.gbl (10.58.144.33) by BN1BFFO11HUB054.protection.gbl (10.58.144.201) with Microsoft SMTP Server (TLS) id 15.1.190.9; Tue, 16 Jun 2015 01:16:49 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by BN1BFFO11FD008.mail.protection.outlook.com (10.58.144.71) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Tue, 16 Jun 2015 01:16:49 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:43050 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1Z4fUe-0001YV-24 for qemu-devel@nongnu.org; Mon, 15 Jun 2015 18:16:48 -0700 Received: from [127.0.0.1] (port=48671 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1Z4fUd-0007ys-Qn; Mon, 15 Jun 2015 18:16:47 -0700 Received: from xsj-tvapsmtp02 (xsj-tvapsmtp02.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id t5G1CQXN029453; Mon, 15 Jun 2015 18:12:26 -0700 Received: from [172.19.5.153] (port=45533 helo=xsjrdevl46.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1Z4fUc-0007yp-KS; Mon, 15 Jun 2015 18:16:46 -0700 From: Alistair Francis To: , Date: Mon, 15 Jun 2015 18:16:46 -0700 Message-ID: <96221ccd1ec7e10b7ece0b092df178072d66487a.1434412857.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-21614.005 X-TM-AS-Result: No--5.523-7.0-31-10 X-imss-scan-details: No--5.523-7.0-31-10 X-TMASE-MatchedRID: ZGrszQeQPYUBOHW58ozCWhcanaCAqviGTJDl9FKHbrkKogmGusPLb1YW wxB9tw0TJRIIM4T6ZBb2y4dNCExKircH4/RZ7lQnngIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPIfiA qrjYtFiQpjF2nk1yUMr1ZTANT8QrKpgBQtVKdjEEs/HzB2UgH5H7cGd19dSFd X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD008; 1:Q6loq93dIrKvJn4/d11wn7qMhckovzVs4uWI3aAMdFLxgDZW7678VexI7kGn1YmA4JhCAIHlnLhL76liWUilQp5NTRtuN7ib79cvcIfmJO4KnqTyiOq5LQ7HfI7ippP5xmzxlwAWqOpU3fF9KoB0nZrZU2gEnO1BWWMBA2VwWe53h1TLAD2BXbXnwAmNeWtg7iWcnJ/cidf338/HBnDZMe9771nYTfXa20unW5rOVgDZEfSY6Q6Tz1OufoAlt6XaJWTAeqBNWloEGcLDmeVW6ddsjgRvVCqZZq/XK/1P9gM= X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(339900001)(199003)(189002)(229853001)(5001960100002)(50466002)(107886002)(33646002)(85426001)(77096005)(92566002)(6806004)(19580405001)(189998001)(106466001)(19580395003)(87936001)(2950100001)(36756003)(64026002)(50986999)(76176999)(48376002)(71366001)(50226001)(105606002)(5001770100001)(5003600100002)(46102003)(118296001)(47776003)(450100001)(86362001)(77156002)(62966003)(107986001)(4001450100001)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1BFFO11HUB054; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11HUB054; 2:DbVJTWfY8IYWxMGIZCezHpPL6bVFhEt2OYZCkNFyrjKgwEW3VN4O3R+18SYSciWg; 2:LZjWJgxUZGiZ2/T4MlaEWTfW1rzvZloo1IPzjjHuafHvW9Fgox7Gc8o27f7mkhg9Fqpnt5DvswwNZiRn7/38I1FO7Fqg+R5WQsAZOqZoOiWecbF9y2AvpLVGS36WGhQiiQlHlf4oC26kmmKh1sW1FNDAzVfNZT2+h7HriFh4d08FqyEdCPvFYqSzkxE5/OXe/g5quxZaJvMrZLTMJu4FasU5NxEjShoZw4mtQ4wqc1Y=; 6:md9huleJatR3IkWgtEpXWIT4Oz94d3lTr6h/Ix2qSKY+KS3WrJXk3dmLip5ZfGxDBPU5/zMYE9IgXDrzEVjhYSDfsOIhOgAgWicQFaDFf+yleLtGo81W/NPtJG8M5+cLOdO+wCO2HLkJroTWUJ0xuccQLNVkaqhO4Tgh3YY+B2jjmEvtWyswRtOGQVkop1JeOO0WnLcCraOwPhU9tNtov1013fIOdx7Qc2LquO0KSbIj7Fv1PXwSOlPcTAklSUWyWkcJcK2tHb9d9eqOTzuZxugf+OkXI3SPb8K2e5fG+2iSUE1SbLPgKBcVSiNLZb4C9zKnSJNH5ljpvxcXwmBrpj9MmKEEApZ1+WTsBPZTiF12CqFNLkz9+ldht/zAqNRzt1GHTJXhJ2DhJQaIfRH9XU7JmTWf6yc5+xxiQSAv/SPY5oV/8dEw/5bA4MNZWyZFBb8DT793nbIfKk3INWWYeUB3mrL4RKUTy1GuSShHADVzHRNXR37EBraj3kp1NVrr X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1BFFO11HUB054; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520003)(3002001); SRVR:BN1BFFO11HUB054; BCL:0; PCL:0; RULEID:; SRVR:BN1BFFO11HUB054; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11HUB054; 3:m+HAf0x78h4MI0oqyj9Bdr17QRomYeACvT+D5OYpnaeMlskgctKe7E7RRnvhAOTn+PTE0oXj7FWx1nWB8iUAMbOlKxQDXod+hX+C6hTL4lDTwLCXux7OGS7vr4iEzuGvJN8uPuHd5Rw3PTagESIwaeZuaEJ09PQN5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jU1jxNL1Bfzlln?= =?us-ascii?Q?5MqGrkwtcsx2lzwvzm8RXjMLUiiYbMcKHL8/PvUQ1GBNgIIUVwTU2j9Gpz3L?= =?us-ascii?Q?dzt3Ukm5a2xrcNNSTfBVH7/9Yg1BsR4ICglE72RzxFwp+ig4MOXVN5SEk1q6?= =?us-ascii?Q?iDwy6H0k4ZKXFDHxcT1lZrIOadlmjxth5fgwkow5/dcznRM9nCGzgGmYfEAg?= =?us-ascii?Q?OC16LtuYOINO0e25cqcqISpkkaVMmh2n56ZkL/ZB1GPMCr0b7OTMIeYG0qTu?= =?us-ascii?Q?y59mtfpUUjeHNSrmuIkh5ScRzgD42b0ihomtuIAhSu416UsCqBb4oDfDpysX?= =?us-ascii?Q?7LaINMXukT4vCmPO2In9MPCgBcgWuz5d9qysBCwby5WThnbMe65GP2w4IHWq?= =?us-ascii?Q?JREwuIc=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11HUB054; 3:Qj6u1qIw7KFls/WUxSxHCAPlHWU8Lmo25TQGpGAs0iwnV8Z8yk4PQ5KAlTuObrrU+SLQg0cyzbD2KVctwcYPf+4ppr4G3svaIe56Gp0/FIHiCT5hepZVBi7b1qQU7FSNPeqGzEkI0FYv+LLsLlQ5sQ==; 10:Si9KlLJzuOpDBm3Vy/qCPgBahLvDIbBxfF8LwGX9rc3B5rIoRAKTVMa3DZY1qkhFbjuDeUxpjAFtBxbtKQRhkDD1cnLbizTFfD0IJ7SF6hg= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2015 01:16:49.5194 (UTC) 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.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1BFFO11HUB054 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (barebone) [generic] [fuzzy] X-Received-From: 65.55.169.82 Cc: peter.crosthwaite@xilinx.com, alistair.francis@xilinx.com Subject: [Qemu-devel] [PATCH v3 6/9] target-microblaze: Convert pvr-full to a CPU property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Originally the pvr-full PVR bits were manually set for each machine. This is a hassle and difficult to read, instead set them based on the CPU properties. Signed-off-by: Alistair Francis Reviewed-by: Peter Crosthwaite --- V3: - Convert PVR to an 8-bit uint instead of a bool V2: - Rename DTS mapping target-microblaze/cpu-qom.h | 1 + target-microblaze/cpu.c | 7 ++++--- target-microblaze/helper.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target-microblaze/cpu-qom.h b/target-microblaze/cpu-qom.h index 7da25fa..34f6273 100644 --- a/target-microblaze/cpu-qom.h +++ b/target-microblaze/cpu-qom.h @@ -68,6 +68,7 @@ typedef struct MicroBlazeCPU { bool dcache_writeback; bool endi; char *version; + uint8_t pvr; } cfg; CPUMBState env; diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c index df3dd89..b1ffa8e 100644 --- a/target-microblaze/cpu.c +++ b/target-microblaze/cpu.c @@ -130,8 +130,7 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) qemu_init_vcpu(cs); - env->pvr.regs[0] = PVR0_PVR_FULL_MASK \ - | PVR0_USE_BARREL_MASK \ + env->pvr.regs[0] = PVR0_USE_BARREL_MASK \ | PVR0_USE_DIV_MASK \ | PVR0_USE_HW_MUL_MASK \ | PVR0_USE_EXC_MASK \ @@ -166,7 +165,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) (cpu->cfg.use_fpu ? PVR0_USE_FPU_MASK : 0) | (cpu->cfg.use_mmu ? PVR0_USE_MMU_MASK : 0) | (cpu->cfg.endi ? PVR0_ENDI_MASK : 0) | - (version_code << 16); + (version_code << 16) | + (cpu->cfg.pvr == 2 ? PVR0_PVR_FULL_MASK : 0); env->pvr.regs[2] |= (cpu->cfg.use_fpu ? PVR2_USE_FPU_MASK : 0) | (cpu->cfg.use_fpu > 1 ? PVR2_USE_FPU2_MASK : 0); @@ -228,6 +228,7 @@ static Property mb_properties[] = { false), DEFINE_PROP_BOOL("endianness", MicroBlazeCPU, cfg.endi, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), + DEFINE_PROP_UINT8("pvr", MicroBlazeCPU, cfg.pvr, 2), DEFINE_PROP_END_OF_LIST(), }; diff --git a/target-microblaze/helper.c b/target-microblaze/helper.c index 5156c12..fa783ff 100644 --- a/target-microblaze/helper.c +++ b/target-microblaze/helper.c @@ -58,8 +58,8 @@ int mb_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw, mmu_available = 0; if (cpu->cfg.use_mmu) { mmu_available = 1; - if ((env->pvr.regs[0] & PVR0_PVR_FULL_MASK) - && (env->pvr.regs[11] & PVR11_USE_MMU) != PVR11_USE_MMU) { + if ((cpu->cfg.pvr == 2) && + (env->pvr.regs[11] & PVR11_USE_MMU) != PVR11_USE_MMU) { mmu_available = 0; } }