Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5578280imu; Tue, 13 Nov 2018 08:36:30 -0800 (PST) X-Google-Smtp-Source: AJdET5cU/soiKiK5wWWU0SRcXNtKYKEIu1BecBrDTDDPufbN8CFtF4QsesRmucvrTdJNi/SiG9nE X-Received: by 2002:a62:888c:: with SMTP id l134-v6mr5848250pfd.198.1542126990434; Tue, 13 Nov 2018 08:36:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542126990; cv=none; d=google.com; s=arc-20160816; b=yScy7aMETHRMlW/aw0MCkNYNzF5Tg/Iy0lH+zYYxkfhPKOS/hpY9bMB8UqO/mqG4A3 1nQtGhP/UIOJU/lxfBq/m3vSS8z3KC1+l8EypHKrqneJDE1r/yoBdExYqWt5D4J3JwH5 qOKA7gGJhvfYXO+QWWRhB05Kbhc13/yy2A3JNgbMfVYgdQ6EKaRPXWFW28K28nnPAxj9 JBGmsoBrIH6oQqkG3O7igWpG/rDaCKnfbjHgChG16rCfYqTIpWT7Stga00nlRbFZYahp SRuDNP4ZCzycRxb2N+uOx7FAqImSj3UfCI0bzOlJ2PdbVyciy8JuCwjSfAscBeSQXIjl G3Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=f/xS9NznE4DZ6LqftdVXJxv5Wh4zhxT56rhkeeUHRmc=; b=tmeOYxIL1fu1+Rn+rq/F4mpDDDPxs1fHzYfYjQdMZO5esNtnNCI9SvxBxNLkO0+ty+ 73JZxLmTNBhEZ9pBh6bJfjVqfN5tLYqTBWV2+3j0/dk/XT9ct0P718VoC35tfceQ4hb5 eFrKjEgaQFM1tL7ji2EpP4Gxh0Tad+TY9EOQeUXVe5CtIJ6YptdWw3DIhvlgZYEZ7fCi P/NElCE4QviYksv7WIKK+G8cWMpg4dXAkHHotv+RI7tGP9kUcGgkI6viLbGZ5jYO1Fdg YqBK4WCP1NmvPghKNUdGNlf6vpKP3J2qdejTHm5oTQ9tWPTQ7/NTLaP4rZGrd6Rsv9rd woVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si21206901pgr.500.2018.11.13.08.35.56; Tue, 13 Nov 2018 08:36:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731326AbeKNCdD (ORCPT + 99 others); Tue, 13 Nov 2018 21:33:03 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:53610 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727475AbeKNCdD (ORCPT ); Tue, 13 Nov 2018 21:33:03 -0500 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23993048AbeKMQdmj6ry9 (ORCPT + 1 other); Tue, 13 Nov 2018 17:33:42 +0100 Date: Tue, 13 Nov 2018 16:33:42 +0000 (GMT) From: "Maciej W. Rozycki" To: Yasha Cherikovsky cc: Ralf Baechle , Paul Burton , James Hogan , Thomas Gleixner , Jason Cooper , Marc Zyngier , Daniel Lezcano , Rob Herring , Mark Rutland , linux-mips@linux-mips.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v2 1/7] MIPS: Add support for the Lexra LX5280 CPU In-Reply-To: <20181001102952.7913-2-yasha.che3@gmail.com> Message-ID: References: <20181001102952.7913-1-yasha.che3@gmail.com> <20181001102952.7913-2-yasha.che3@gmail.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 1 Oct 2018, Yasha Cherikovsky wrote: > The Lexra LX5280 CPU [1][2] implements the MIPS-I ISA, > without unaligned load/store instructions (lwl, lwr, swl, swr). I think you actually need to emulate these missing instructions for user programs, so that the 32-bit MIPS psABI is supported and standard software can run unmodified. There'll be a performance hit and software will best be recompiled for the limited instruction set provided by actual hardware, however rebuilding is not always possible or feasible (also handcoded assembly may require actual reimplementation here and there). > - RDHWR instruction emulation from the page fault handler > (more details in a code comment) The details are lacking I am afraid and I think it would be good to have them provided for long-term support to be feasible. First, the MIPS architecture does not have a single "page fault" exception. There are three MMU exception codes defined: Mod, TLBL and TLBS, and also two vectors, either the TLB Refill or the General Exception. So please be specific which of those are taken by the LX5280 with the RDHWR instruction. Second, please explain why this MMU exception happens, i.e. does the CPU decode the SPECIAL3 major opcode as an I-Type memory access instruction, and then faults on `GPR[0] + offset' pointing to an unmapped page? If documentation is publicly available this information can be inferred from, then please provide a reference; otherwise please just describe the observed behaviour as you know it. Maciej