From patchwork Thu Mar 30 09:13:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 9653345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 007466034C for ; Thu, 30 Mar 2017 09:16:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAEF528535 for ; Thu, 30 Mar 2017 09:16:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFE5D28574; Thu, 30 Mar 2017 09:16:48 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4440628578 for ; Thu, 30 Mar 2017 09:16:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctW9g-0005Lz-IC; Thu, 30 Mar 2017 09:14:08 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctW9e-0005Lp-Qy for xen-devel@lists.xen.org; Thu, 30 Mar 2017 09:14:07 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 60/94-03430-E5CCCD85; Thu, 30 Mar 2017 09:14:06 +0000 X-Brightmail-T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Ref: server-16.tower-27.messagelabs.com!1490865244!94173418!1 X-Originating-IP: [40.107.1.88] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 62281 invoked from network); 30 Mar 2017 09:14:05 -0000 Received: from mail-eopbgr10088.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.107.1.88) by server-16.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 30 Mar 2017 09:14:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gAIjzKxIFVsBV/1IsXCI75EBSwRqICmZmKCwPIuZzPs=; b=ZKZdmoyC4zYZxZuSuYWGQu3I6Alq9H4PsLNgDCbd3zLcgvGBvaFIOi9y5/h9TlBk0+FVUA6KHjZJ+BfdMN0ocURNtgMLHGztzgJ/9+Wu1i7dnyY6t9YWsFbMinwavXTfhgmK6oqTdNQpFNUJ1D5bBsLNSUXfLVvPxinBJR7MCco= Received: from HE1PR0801CA0037.eurprd08.prod.outlook.com (10.167.184.47) by AM5PR0801MB1668.eurprd08.prod.outlook.com (10.169.246.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Thu, 30 Mar 2017 09:14:03 +0000 Received: from VE1EUR03FT050.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::203) by HE1PR0801CA0037.outlook.office365.com (2603:10a6:3:6::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Thu, 30 Mar 2017 09:14:02 +0000 Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 217.140.96.140 as permitted sender) receiver=protection.outlook.com; client-ip=217.140.96.140; helo=nebula.arm.com; Received: from nebula.arm.com (217.140.96.140) by VE1EUR03FT050.mail.protection.outlook.com (10.152.19.209) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.977.7 via Frontend Transport; Thu, 30 Mar 2017 09:14:02 +0000 Received: from P300.p300.shanghai.arm.com (10.1.2.79) by mail.arm.com (10.1.106.66) with Microsoft SMTP Server id 14.3.294.0; Thu, 30 Mar 2017 10:13:34 +0100 From: Wei Chen To: Date: Thu, 30 Mar 2017 17:13:11 +0800 Message-ID: <1490865209-18283-2-git-send-email-Wei.Chen@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490865209-18283-1-git-send-email-Wei.Chen@arm.com> References: <1490865209-18283-1-git-send-email-Wei.Chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(39450400003)(39840400002)(39400400002)(39850400002)(39410400002)(2980300002)(438002)(189002)(199003)(2950100002)(6916009)(38730400002)(110136004)(8936002)(6666003)(2906002)(50226002)(8676002)(4326008)(189998001)(106466001)(2351001)(356003)(305945005)(5660300001)(47776003)(104016004)(54906002)(77096006)(48376002)(86362001)(5003940100001)(50986999)(76176999)(36756003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1668; H:nebula.arm.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VE1EUR03FT050; 1:0MJbPKpebC5EhuJJsXCIw0iOMAMJpckSuROl3JPRfrgiwDS8Adea4m1Nd67lRwOc5VPmrkWOPjXDhi+7uRWiYPMcN0U2aPrlw2lv2SS87jz84kh9BGsTw6OaWwzgVKQTpEQimx2GrXD+2n3y7O4a3p7bSYnYENmPGSIy3n1ObgvXuXANuF7XLZ159QtaAhZ3YNtZLM39NCxrV9BaL4rDYGhbI+EkwulEe2JhSfiXg+tXmY4vq8bt/5gB/mfcWRDaVGNpcqb5dcuGhuIVWjWkjFkgYIPh4HwASU/A5AMgqXeUdAosPRUrX1c9wO9ZuiDu00/S3NAHiP42SMGdBDZtTNS6qGcFJWlwtwTnQf4hSioND5i4epmHKQM2sZP0k16qkj9QM7BCB7NmXvS2TpCdnYDGSaHIWUR6sRJFTLKxlwLC9gpjJKi4VVxfzmE3j+/apYQPVH4PLjTMlUaXlflSy6e4OWvCh6Iuogiu+X9PWRYMAAIBU6YklgIm2Mssb3LJq0nsQneFFzB7xt73J8j/tnb2VunW5i9C8LbfTQRLP8sAXW1frvaM1VopJXqr/UZT+lkfs+0SLEnTB8FpynAQbGV+W/Be0nrpaHv9leYrjFw= X-MS-Office365-Filtering-Correlation-Id: cd2b8ddf-6264-4a5f-d18b-08d4774d1bc9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:AM5PR0801MB1668; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1668; 3:+ehUufwDIlVqEoNq01i3iIYnEl56LHj8F+u5gGMJaOUO462oJdIzHHYBAH1xsMaq3fn1oifXS3u4Mk0TEGdJnd8vBa1llfFYAIupe+AGNEGZmoIypuyPTufqlY/sDrUhGXSEVtBAvhtutyRjH9SggqyK0eCOQwKlzo/wd0Vrhoshf7C15+MyxQ7QSDIGd+xwiyGPA26VS9bhQjJFyNyl6eZ7gsBLpUo+P+BMNn8o7Y0rRnUye1keBJC51ND76e8USX20GGOl7vFA42FuWci1Yr4qDQfznef3oIrhRlHTHVY3ov8ZWTgTo5MHMROR2ylXQI0WEnp4W+9okipKFyemEFStGa4CsmyRVXeZf2fPR1rSTgscH2N+h6tSXyFG3HhiCDy5XbBHlwUsp9q7BbqLDkCzXHRabyh6aYq2h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HapHyMNC6gkLl+fsj5ZJhiBAECuss89yr0O16Zb66iQH2CjoVzodXp0wvzETcxnBCzMgF/GjS9uSx0/yqjysDpM2f8qb4e9s816qM+0omri2tzgmWFFAq/0G6Zqe4VynIlFgWgemyFmAIgD3Lzv/wkGilrHWH9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13023025)(13020025)(13024025)(8121501046)(5005006)(13013025)(3002001)(93006067)(93004067)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123564025)(6072148); SRVR:AM5PR0801MB1668; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1668; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1668; 4:9y3K/B/Jr21Qk20CDdkbkmCHnV2SupAGbSk7sDiEZCbpH2Uau7Ba96VlBhnHyCHsG2Lj7AZb4c0LdKWwZDBYnPa8B19j9d/nnArZcw5mOjAOJc6e7oVK13WZwaOGNtYmU3nQJMWBvOPtNh29/BV8Jzatx4gFiWl68q7fwJGz5CbsNsFpB+HUZAy5BJQVrQ5V+S23vlZ4Vs/2x35SYVt3IgJO/f1tv5LxljyxSxwL+kXzRhVLgJvcu3FnjIGpdi8cgL8bUY7fb/c8w3G65T1a2xW+Bed0xuTNeR/la2mtFyovVas0xakG/C1kV+XDQ0LbzAyK/A1W0u49ZMCuu8SU/oXRM5EBKxyjIXRG2m6saE/vMOHaPXsFJn8zk1IXqVxJgg/wqdLBgAT4qMIV5wxhU+TqylVAP7x0Z3PvPRBBuK/GzaLEmY03kDZxEPU9vMWsOouSOWutuRyqz3IaSXy7/HZk5ULvqwzeb1cad3e35aTnZGTrVn6B4XG9+SzsFgmSIGCVZo4kWw7sGa4UE6webu7fryHpn3OZMEbJEB2svr61IQOBby/Hk2ijILI67QGymbtwEVDuEVLmvVL5U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Ehz1+vf0UYqImHzJEeG3LmIHDdgtyYfSUf8OqvF9LCg==; 24:2QQnlisoBUyBt/iEpTtLFW025IFukan4p7XVEa6H4ZG/QpxopgGTrABVXNZsvzYHVVq7KOe6mu1ZuMSjLU9I7S8laeJkyvWbzxpQMVEx7wM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1668; 7:RnsfJGARA5MDWvVrU+t8BbUxeX8aFhiK5p8NsM/pq6HYqpNlWwy85lTF+NF/6wxgpNf+Dy4JMTerB7NQVHrsq04rcZVt70Eh8iGPh1A4OOWfHoYa86iKdY3PsZIhO5qJfV/mWH7cwAkoRS574X8ZLvk940K6pDPZzAH2So5G5uEyo1IgCBD7YEr/YQ1dx/ubCWmR45jLPosKcWYhfpqc4QLJzi/K/195iyp/XL9Ine5bOPuiM4MB6tW3KFCd+CfTunQeZGK7b81dS8uFojWMdTNLaVRqTzJ4lueZNaGqlwjgHRMSNZnypIroRMgKKx16/B2saAKchGjEI7c+RphH7w== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2017 09:14:02.5512 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1668 Cc: sstabellini@kernel.org, wei.chen@arm.com, steve.capper@arm.com, Kaly.Xin@arm.com, julien.grall@arm.com, nd@arm.com Subject: [Xen-devel] [PATCH v2 01/19] xen/arm: Save ESR_EL2 to avoid using mismatched value in syndrome check X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Xen will do exception syndrome check while some types of exception take place in EL2. The syndrome check code read the ESR_EL2 register directly, but in some situation this register maybe overridden by nested exception. For example, if we re-enable IRQ before reading ESR_EL2 which means Xen may enter in IRQ exception mode and return the processor with clobbered ESR_EL2 (See ARM ARM DDI 0487A.j D7.2.25) In this case the guest exception syndrome has been overridden, we will check the syndrome for guest sync exception with an incorrect ESR_EL2 value. So we want to save ESR_EL2 to cpu_user_regs as soon as the exception takes place in EL2 to avoid using an incorrect syndrome value. In order to save ESR_EL2, we added a 32-bit member hsr to cpu_user_regs. But while saving registers in trap entry, we use stp to save ELR and CPSR at the same time through 64-bit general registers. If we keep this code, the hsr will be overridden by upper 32-bit of CPSR. So adjust the code to use str to save ELR in a separate instruction and use stp to save CPSR and HSR at the same time through 32-bit general registers. This change affects the registers restore in trap exit, we can't use the ldp to restore ELR and CPSR from stack at the same time. We have to use ldr to restore them separately. Signed-off-by: Wei Chen --- v1->v2: 1. Use more accurate words in the commit message. 2. Remove pointless comment message in cpu_user_regs. 3. Explain the changes of the registers save/restore order in trap entry/exit. --- xen/arch/arm/arm32/asm-offsets.c | 1 + xen/arch/arm/arm32/entry.S | 3 +++ xen/arch/arm/arm64/asm-offsets.c | 1 + xen/arch/arm/arm64/entry.S | 13 +++++++++---- xen/arch/arm/traps.c | 2 +- xen/include/asm-arm/arm32/processor.h | 2 +- xen/include/asm-arm/arm64/processor.h | 3 +-- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/arm32/asm-offsets.c b/xen/arch/arm/arm32/asm-offsets.c index f8e6b53..5b543ab 100644 --- a/xen/arch/arm/arm32/asm-offsets.c +++ b/xen/arch/arm/arm32/asm-offsets.c @@ -26,6 +26,7 @@ void __dummy__(void) OFFSET(UREGS_lr, struct cpu_user_regs, lr); OFFSET(UREGS_pc, struct cpu_user_regs, pc); OFFSET(UREGS_cpsr, struct cpu_user_regs, cpsr); + OFFSET(UREGS_hsr, struct cpu_user_regs, hsr); OFFSET(UREGS_LR_usr, struct cpu_user_regs, lr_usr); OFFSET(UREGS_SP_usr, struct cpu_user_regs, sp_usr); diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S index 2a6f4f0..2187226 100644 --- a/xen/arch/arm/arm32/entry.S +++ b/xen/arch/arm/arm32/entry.S @@ -23,6 +23,9 @@ add r11, sp, #UREGS_kernel_sizeof+4; \ str r11, [sp, #UREGS_sp]; \ \ + mrc CP32(r11, HSR); /* Save exception syndrome */ \ + str r11, [sp, #UREGS_hsr]; \ + \ mrs r11, SPSR_hyp; \ str r11, [sp, #UREGS_cpsr]; \ and r11, #PSR_MODE_MASK; \ diff --git a/xen/arch/arm/arm64/asm-offsets.c b/xen/arch/arm/arm64/asm-offsets.c index 69ea92a..ce24e44 100644 --- a/xen/arch/arm/arm64/asm-offsets.c +++ b/xen/arch/arm/arm64/asm-offsets.c @@ -27,6 +27,7 @@ void __dummy__(void) OFFSET(UREGS_SP, struct cpu_user_regs, sp); OFFSET(UREGS_PC, struct cpu_user_regs, pc); OFFSET(UREGS_CPSR, struct cpu_user_regs, cpsr); + OFFSET(UREGS_ESR_el2, struct cpu_user_regs, hsr); OFFSET(UREGS_SPSR_el1, struct cpu_user_regs, spsr_el1); diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S index c181b5e..02802c0 100644 --- a/xen/arch/arm/arm64/entry.S +++ b/xen/arch/arm/arm64/entry.S @@ -121,9 +121,13 @@ lr .req x30 // link register stp lr, x21, [sp, #UREGS_LR] - mrs x22, elr_el2 - mrs x23, spsr_el2 - stp x22, x23, [sp, #UREGS_PC] + mrs x21, elr_el2 + str x21, [sp, #UREGS_PC] + + add x21, sp, #UREGS_CPSR + mrs x22, spsr_el2 + mrs x23, esr_el2 + stp w22, w23, [x21] .endm @@ -307,7 +311,8 @@ ENTRY(return_to_new_vcpu64) return_from_trap: msr daifset, #2 /* Mask interrupts */ - ldp x21, x22, [sp, #UREGS_PC] // load ELR, SPSR + ldr x21, [sp, #UREGS_PC] // load ELR + ldr w22, [sp, #UREGS_CPSR] // load SPSR pop x0, x1 pop x2, x3 diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 614501f..1da6d24 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2641,7 +2641,7 @@ static void enter_hypervisor_head(struct cpu_user_regs *regs) asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs) { - const union hsr hsr = { .bits = READ_SYSREG32(ESR_EL2) }; + const union hsr hsr = { .bits = regs->hsr }; enter_hypervisor_head(regs); diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h index db3b17b..f6d5df3 100644 --- a/xen/include/asm-arm/arm32/processor.h +++ b/xen/include/asm-arm/arm32/processor.h @@ -37,7 +37,7 @@ struct cpu_user_regs uint32_t pc, pc32; }; uint32_t cpsr; /* Return mode */ - uint32_t pad0; /* Doubleword-align the kernel half of the frame */ + uint32_t hsr; /* Exception Syndrome */ /* Outer guest frame only from here on... */ diff --git a/xen/include/asm-arm/arm64/processor.h b/xen/include/asm-arm/arm64/processor.h index b0726ff..24f836b 100644 --- a/xen/include/asm-arm/arm64/processor.h +++ b/xen/include/asm-arm/arm64/processor.h @@ -66,8 +66,7 @@ struct cpu_user_regs /* Return address and mode */ __DECL_REG(pc, pc32); /* ELR_EL2 */ uint32_t cpsr; /* SPSR_EL2 */ - - uint32_t pad0; /* Align end of kernel frame. */ + uint32_t hsr; /* ESR_EL2 */ /* Outer guest frame only from here on... */