From patchwork Wed Sep 19 03:34:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10605235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D90B5A4 for ; Wed, 19 Sep 2018 03:36:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED9362B38D for ; Wed, 19 Sep 2018 03:36:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0A582B4CB; Wed, 19 Sep 2018 03:36:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 898FE2B38D for ; Wed, 19 Sep 2018 03:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=RBmicq5OhWi0VfALj+Vrr0ofUqw3AHAtnJe9yyq/ou8=; b=nKM C80xhgpX/KD/qiJakJ6HoX5556VFylr4RLsQmHFMeWR8kICgje/+fJEfnQFmPaeav3/tSRy3AYJAN 3kkf+TqFPVgLhXf50AAMDLquJZExX1sfCQAbhFSRdhQQqb3YT2pOOyoqOClA5hbqZUv0+3iahgyav p2iUtYYCSl9QF5S+WUwryqZCT4N4LsJZPy7Xi/7XPj4z58rhW8KgNGpBLZbm7zE7TYKNMFRN+gF1J 0coSSHE9Lgfah3qKe6/avXT8ZJhmuWVxYlVd3Pf77kNHCELhzZWEtIR2u9G1n3+CXpS+/wUGlNgCk ZxJgp6OGC2ExJZqBw/dcrkeVvmFqesA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2THV-0007Eu-FA; Wed, 19 Sep 2018 03:36:01 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2TG5-0005Ni-U6 for linux-arm-kernel@lists.infradead.org; Wed, 19 Sep 2018 03:34:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9B55480D; Tue, 18 Sep 2018 20:34:16 -0700 (PDT) Received: from p8cg001049571a15.arm.com (unknown [10.163.1.174]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E8A443F5C0; Tue, 18 Sep 2018 20:34:14 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/3] Emulate MRS instructions by parsing ESR_ELx.ISS Date: Wed, 19 Sep 2018 09:04:07 +0530 Message-Id: <1537328050-29176-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180918_203434_017493_AA1B6A04 X-CRM114-Status: UNSURE ( 8.73 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, catalin.marinas@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Armv8.4-A extension enables MRS instruction encodings inside ESR_ELx.ISS during exception class ESR_ELx_EC_SYS64 (0x18). This encoding can be used to emulate MRS instructions which can avoid fetch/decode from user space thus improving performance. The patch series here enables this new method of emulating MRS instruction. For this purpose we factorizes the existing emulate_mrs() function and while here, add new macro ESR_ELx_SYS64_ISS_RT. Anshuman Khandual (3): arm64/cpufeatures: Introduce ESR_ELx_SYS64_ISS_RT() arm64/cpufeatures: Factorize emulate_mrs() arm64/cpufeatures: Emulate MRS instructions by parsing ESR_ELx.ISS arch/arm64/include/asm/cpufeature.h | 1 + arch/arm64/include/asm/esr.h | 14 ++++++++++++++ arch/arm64/include/asm/kvm_emulate.h | 2 +- arch/arm64/kernel/cpufeature.c | 23 ++++++++++++++--------- arch/arm64/kernel/traps.c | 25 +++++++++++++++++++++---- 5 files changed, 51 insertions(+), 14 deletions(-)