From patchwork Thu Sep 20 04:06:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10606823 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 D9A1C1390 for ; Thu, 20 Sep 2018 04:06:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEE482B892 for ; Thu, 20 Sep 2018 04:06:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B301D2B8A2; Thu, 20 Sep 2018 04:06:58 +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 2334A2B892 for ; Thu, 20 Sep 2018 04:06:58 +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=Qn4u1C2uQ8Zdc3nkJQUUw9i99x+6wyZDIdC4v4bI5zo=; b=fii xk6QceBnGXy3m11Hh3kAtJE+YUxtH4Dyvg69ePpdIzE3GIGMEn/Vey7zogGH0F85S6HnmRwzbhKKn W5AlDSet6MvlYC/YEqmh0pTjkvYEWXEWhHKG7qNBvA4ORuNsI+OfK17Ld+jbKWuk1WeIry2X4UmEk EUNth1HHP3Ujo1aoXnbbBQiAo1jR0bUAwFyMc40xK8JEikZuQ/yQ0RAu2av4pFOIQch+VWG/A8BZf oa5Lkd7M/vSfLcqFCONqwwVy6WguzAhHG03uKBySfHlR5v5h0XaXHNrZBesHtu1uZjFYy9cdR3XjT Aa5989fmXbc7ma5Gw08bltdtr6Z2Nfg==; 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 1g2qEo-0003iN-N6; Thu, 20 Sep 2018 04:06:46 +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 1g2qEk-0003gm-Iq for linux-arm-kernel@lists.infradead.org; Thu, 20 Sep 2018 04:06:44 +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 D7FB47A9; Wed, 19 Sep 2018 21:06:27 -0700 (PDT) Received: from p8cg001049571a15.blr.arm.com (p8cg001049571a15.blr.arm.com [10.162.0.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D868A3F5C0; Wed, 19 Sep 2018 21:06:25 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 0/3] Emulate MRS instructions by parsing ESR_ELx.ISS Date: Thu, 20 Sep 2018 09:36:18 +0530 Message-Id: <1537416381-13674-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-20180919_210642_641489_3C1DFB8E X-CRM114-Status: UNSURE ( 9.19 ) 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, will.deacon@arm.com, suzuki.poulose@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. Changes in V2: - Replaced the argument 'dst' as 'rt' in second patch per Suzuki - Added review tags from Suzuki 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 | 25 +++++++++++++++---------- arch/arm64/kernel/traps.c | 25 +++++++++++++++++++++---- 5 files changed, 52 insertions(+), 15 deletions(-)