Received: by 10.223.185.116 with SMTP id b49csp755693wrg; Wed, 14 Feb 2018 06:34:14 -0800 (PST) X-Google-Smtp-Source: AH8x2257xqhzgTtiNC7pMeNJE15fpplhY3BljYEbxLxFulVEWk3YeokKQB9AVqaOVAgQBgxWvRwW X-Received: by 2002:a17:902:7e85:: with SMTP id c5-v6mr4800762plm.110.1518618854083; Wed, 14 Feb 2018 06:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518618854; cv=none; d=google.com; s=arc-20160816; b=XeurgXjTwJrM7KmytbuRLI2yu3prD+mhQhF5SIjTRIg1vCadaMPggvxDuDuo/TowWT 1V599BEmXHsyqwV4jJIaEwiXxBWp7zDkmjlANtRMK67PS8bp5Dkkg8SMptDbP7NOBlQt YqoQJcQ+r3/NbYwYZai5DXd4Fzo6mTH2zW4rHnHgwQfHn3n2SgVCn9pPGONzDrbmyDa7 WOwubzcSHbhS9uNV2y2w7iVfVF5I6VlnKki1jxYWVDVjELARvzTEzvE+YBiJYaJPHQ1f LnMpADSieidsIx9riNQnEbvopW5rUilYWOsA/uaVtUwtl4w1iJhOLBlJyZ91jeGoxe0V 42ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=mhxZ4Q3FQPpH4CvQJgV371Arcj9ZAF7LMV5uBdd6/ac=; b=HfN9HEAf1xvRS7JlkSeqSTsyN/ERScj3HsQQZbZmg+CwkTl4W4EAgXsw25C3rSLirv loVQiwbYETHA1Pwk9UQ6FSrochtp6nqS9vVAX8q/AixekvsPFud/7Y8n6SCpBrZPaC5+ aiTwX4f9MPSY89KqIybmUitQfn2q6LamDKsGehOaAyBiDx2QtiO7jupY3L1+xnFNoZ9S I9N8KTqb/ZWrtZCjfmQ0NpCmiVWGiy7VtALuKRv7p3FgoeBX8fsuqsfpV+Lk5xpoXml+ IaBamhyrEUz9e1KgXkXInqlyVR7Kh/+yImpw6/GDemXqDgEE8tF6YKxPkZEby73gXoMe cPbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=CFw7hwb5; 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 31-v6si2986451plz.201.2018.02.14.06.33.59; Wed, 14 Feb 2018 06:34:14 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=CFw7hwb5; 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 S1030878AbeBNObt (ORCPT + 99 others); Wed, 14 Feb 2018 09:31:49 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:35859 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030381AbeBNObp (ORCPT ); Wed, 14 Feb 2018 09:31:45 -0500 Received: by mail-qt0-f196.google.com with SMTP id q18so7915506qtl.3; Wed, 14 Feb 2018 06:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=mhxZ4Q3FQPpH4CvQJgV371Arcj9ZAF7LMV5uBdd6/ac=; b=CFw7hwb5hAqmVN055GKcE2xi8vlIDfavJQDy4PhmVD+G2hM+waRLjnyiH2yUPSC5Gg SKO8TuYfv5LdnHlxXmAsgCX8K6hdDKwdLMTdfQekPN+p31sOsMmrYvrrRewKI74cuoEZ 5mF+8LSeXALGu17B6c1urMoCnqUUqt4j3+j9GZ0j6GETwPEaMm9xgs/qa1H9RQmdDj02 CIuju8yKOYyuT2Ipu0HbIedOHZfoNhu/1itVhmvseXbRif5UnTKqeUq0kM886/QGpFhY 8v4EFM5QN4YwtoiyQL2wZaONEXzGWehBMBRlGz+hLgwg5SANpGGyXoh4WHdhaEN7EPyb rHOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=mhxZ4Q3FQPpH4CvQJgV371Arcj9ZAF7LMV5uBdd6/ac=; b=DsZuNFKs/QKZKh0yo/W8TAsutfw5TspAq8a78wuBA9+bSTl6unA/db9EJAajhr+B36 6KoYeePWQMiLz4C6ohw9e5f/1EyNtG0ULBNNuvKZgIqmAV2L62STiMBnc9Tfq8xnjBjn CX9cmFS5gLcva1bR67N0oWoIzlZi1rVaD3vBebJkfJcKNxe8tmUT16dhLrUXn9Eaxv78 qEqJW1iw9I9tlWk5NtJZEgYIK8t7JGU/n0F9n58QP55w/5xUHs7XyWZNR2tC5E9vLnf6 MxjHVDZfGKlJhMMX3gU/FLydQNb+DkpxBuL77KUqg+ErbBchgg92hIT6IeMu13PacN1p LSmg== X-Gm-Message-State: APf1xPAn9P94v+YlINOtSeefp4D+rzn983RkIwVGmGJsJuuhqyvnlwmi eQ4Eb0PAwuopH1NvIyo5IxBNCrkq/8uIU54H2KM= X-Received: by 10.200.6.208 with SMTP id j16mr7675604qth.166.1518618704918; Wed, 14 Feb 2018 06:31:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.23.8 with HTTP; Wed, 14 Feb 2018 06:31:44 -0800 (PST) In-Reply-To: <5d7538f6cad0763594f968d58625c7c7a99f3225.1518505384.git.greentime@andestech.com> References: <5d7538f6cad0763594f968d58625c7c7a99f3225.1518505384.git.greentime@andestech.com> From: Arnd Bergmann Date: Wed, 14 Feb 2018 15:31:44 +0100 X-Google-Sender-Auth: m5O1fEBk9Iu9K2f2fl7bb4_SDPU Message-ID: Subject: Re: [PATCH v7 08/37] nds32: Exception handling To: Greentime Hu Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial@vger.kernel.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , Guo Ren , Randy Dunlap , David Miller , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Vincent Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 13, 2018 at 10:09 AM, Greentime Hu wrote: > This patch includes the exception/interrupt entries, pt_reg structure and > related accessors. > > /* Unaligned accessing handling*/ > Andes processors cannot load/store information which is not naturally > aligned on the bus, i.e., loading a 4 byte data whose start address must > be divisible by 4. If unaligned data accessing is happened, data > unaligned exception will be triggered and user will get SIGSEGV or > kernel oops according to the unaligned address. In order to make user be > able to load/store data from an unaligned address, software load/store > emulation is implemented in arch/nds32/mm/alignment.c to address data > unaligned exception. > > Unaligned accessing handling is disabled by default because it is not a > normal case. User can enable this feature by following steps. > > A. Compile time: > 1. Enable kernel config CONFIG_ALIGNMENT_TRAP > B. Run time: > 1. Enter /proc/sys/nds32/unaligned_acess folder > 2. Write 1 to file enable_mode to enable unaligned accessing > handling. User can disable it by writing 0 to this file. > 3. Write 1 to file debug to show which unaligned address is under > processing. User can disable it by writing 0 to this file. > > However, unaligned accessing handler cannot work if this unaligned > address is not accessible such as protection violation. On this > condition, the default behaviors for addressing data unaligned exception > still happen > > Signed-off-by: Vincent Chen > Signed-off-by: Greentime Hu Acked-by: Arnd Bergmann