Received: by 10.223.164.202 with SMTP id h10csp131350wrb; Fri, 10 Nov 2017 03:53:09 -0800 (PST) X-Google-Smtp-Source: AGs4zMYnrgcVmbTdQrGozrbhPzBycoE5xFhcBlkIH2dfUiRAcugx6xjVGjJG4T+1XkhqeKReYcke X-Received: by 10.84.134.34 with SMTP id 31mr106232plg.154.1510314789305; Fri, 10 Nov 2017 03:53:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510314789; cv=none; d=google.com; s=arc-20160816; b=tQjfm3tAtHLu3Y5qiZaLHZwPq1quIhW0J9ZK+l/hdGRdS2ru0ujqyCGYc2rcran9fq KanAjXARMORJ9wpmeTUsKsRZI6fLlzecRATWv03ik2FJoSGQC8Mj2lceP2hV0edBG8Wh pAwmiMWco/s1wO2k4lHNH8+IIjsCFnRdcH469ySnqxuYM93g0moggvi7+egFM8C/Avxk iWOAjPqseAz3k1QnL9ClGzDt6opUHQnWEj24sBpNnWMDwoEKnypyQVJl+/D8F+ob4Mgi 5O7MxtthROWNMMG3u8v1ue6c+iJA7NfQktqhqRtGhF65dTRipwhdBlRklIY/ur7YQ31W rjlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from:arc-authentication-results; bh=oAgwB/+C7BzfVHnZTHCjSl/2mAF/EnainvWEdxsSWag=; b=vGL807KRpo7xZr/sBdKdU6+rYT03xJuXWEPFnNk6pWEd4U5udjjQjMfqVJO2FCRBqD KQ8tDBjzckadB6qWzQXYChWUF1/mAUo3MkH72zOBMfGZckHlwqO0EgM6AkhSjxqdFXEr I5ZBVAOt+Jn1ADXRkBKv+Rcq1JS1a+5cPcXW5lrQym+5fgkak8wjoq5zcGFjTrzVbcXs HpdZ3ldgef2xo0o8r9IgecK3xX0knucWvbp7Q+zYAVKrgF8/aI75+BuNJZzZP2I3qfWB pSq1tkggEI0UEv9GGu/FbNq7ediOaAtLOxAfbXV3/exmGxc9V1oxRmE1PM0v0KEf0kPg r32g== 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 f34si8493387ple.9.2017.11.10.03.52.57; Fri, 10 Nov 2017 03:53:09 -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 S1753499AbdKJLvL (ORCPT + 82 others); Fri, 10 Nov 2017 06:51:11 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:10449 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753114AbdKJLta (ORCPT ); Fri, 10 Nov 2017 06:49:30 -0500 Received: from 172.30.72.58 (EHLO DGGEMS401-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKO50286; Fri, 10 Nov 2017 19:49:25 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.361.1; Fri, 10 Nov 2017 19:48:17 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v8 0/7] Support RAS virtualization in KVM Date: Sat, 11 Nov 2017 03:54:03 +0800 Message-ID: <1510343650-23659-1-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5A059245.00DB,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b545d6edbd58453999876b4c98c35d34 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series patches mainly do below things: 1. Trap RAS ERR* registers Accesses to EL2 from Non-secure EL1, KVM will will do a minimum simulation, there registers are simulated to RAZ/WI in KVM. 2. Route synchronous External Abort exceptions from Non-secure EL0 and EL1 to EL2. When exception EL3 routing is enabled by firmware, system will trap to EL3 firmware instead of EL2 KVM, then firmware judges whether El2 routing is enabled, if enabled, jump to EL2 KVM, otherwise jump to EL1 host kernel. 3. Enable APEI ARv8 SEI notification to parse the CPER records for SError in the ACPI GHES driver, KVM will call handle_guest_sei() to let ACPI driver to parse the CPER record for SError which happened in the guest 4. Although we can use APEI driver to handle the guest SError, but not all system support SEI notification, such as kernel-first. So here KVM will also classify the Error through Exception Syndrome Register and do different approaches according to Asynchronous Error Type 5. If the guest SError error is not propagated and not consumed, then KVM return recoverable error status to user-space, user-space will specify the guest ESR and inject a virtual SError. For other Asynchronous Error Type, KVM directly injects virtual SError with IMPLEMENTATION DEFINED ESR or KVM is panic if the error is fatal. In the RAS extension, guest virtual ESR must be set, because all-zero means 'RAS error: Uncategorized' instead of 'no valid ISS', so set this ESR to IMPLEMENTATION DEFINED by default if user space does not specify it. Dongjiu Geng (5): acpi: apei: Add SEI notification type support for ARMv8 KVM: arm64: Trap RAS error registers and set HCR_EL2's TERR & TEA arm64: kvm: Introduce KVM_ARM_SET_SERROR_ESR ioctl arm64: kvm: Set Virtual SError Exception Syndrome for guest arm64: kvm: handle SError Interrupt by categorization James Morse (1): KVM: arm64: Save ESR_EL2 on guest SError Xie XiuQi (1): arm64: cpufeature: Detect CPU RAS Extentions Documentation/virtual/kvm/api.txt | 11 ++++++ arch/arm/include/asm/kvm_host.h | 1 + arch/arm/kvm/guest.c | 9 +++++ arch/arm64/Kconfig | 16 +++++++++ arch/arm64/include/asm/barrier.h | 1 + arch/arm64/include/asm/cpucaps.h | 3 +- arch/arm64/include/asm/esr.h | 15 ++++++++ arch/arm64/include/asm/kvm_arm.h | 2 ++ arch/arm64/include/asm/kvm_asm.h | 3 ++ arch/arm64/include/asm/kvm_emulate.h | 17 +++++++++ arch/arm64/include/asm/kvm_host.h | 2 ++ arch/arm64/include/asm/sysreg.h | 15 ++++++++ arch/arm64/include/asm/system_misc.h | 1 + arch/arm64/kernel/cpufeature.c | 13 +++++++ arch/arm64/kernel/process.c | 3 ++ arch/arm64/kvm/guest.c | 14 ++++++++ arch/arm64/kvm/handle_exit.c | 67 +++++++++++++++++++++++++++++++++--- arch/arm64/kvm/hyp/switch.c | 31 +++++++++++++++-- arch/arm64/kvm/inject_fault.c | 13 ++++++- arch/arm64/kvm/reset.c | 3 ++ arch/arm64/kvm/sys_regs.c | 10 ++++++ arch/arm64/mm/fault.c | 16 +++++++++ drivers/acpi/apei/Kconfig | 15 ++++++++ drivers/acpi/apei/ghes.c | 53 ++++++++++++++++++++++++++++ include/acpi/ghes.h | 1 + include/uapi/linux/kvm.h | 3 ++ virt/kvm/arm/arm.c | 7 ++++ 27 files changed, 336 insertions(+), 9 deletions(-) -- 1.9.1 From 1584146271802488952@xxx Wed Nov 15 15:26:52 +0000 2017 X-GM-THRID: 1584146271802488952 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread