Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752191AbdIKQj1 (ORCPT ); Mon, 11 Sep 2017 12:39:27 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:46870 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752055AbdIKQjZ (ORCPT ); Mon, 11 Sep 2017 12:39:25 -0400 X-Google-Smtp-Source: AOwi7QBOFopsbtUrC66dtVWF8gX/FKUHc73O89sAshag9wYYubPWmmX1FqvsarHeIT8qdFbSMbWQqMV9Cltaecgqp8k= MIME-Version: 1.0 In-Reply-To: <0184EA26B2509940AA629AE1405DD7F2015FE17F@DGGEMA503-MBX.china.huawei.com> References: <0184EA26B2509940AA629AE1405DD7F2015FE17F@DGGEMA503-MBX.china.huawei.com> From: Peter Maydell Date: Mon, 11 Sep 2017 17:39:03 +0100 Message-ID: Subject: Re: [PATCH v11 6/6] target-arm: kvm64: Handle SError interrupt for the guest OS To: gengdongjiu Cc: "Michael S. Tsirkin" , Igor Mammedov , Zhaoshenglong , Paolo Bonzini , QEMU Developers , qemu-arm , kvm-devel , "edk2-devel@lists.01.org" , Christoffer Dall , Marc Zyngier , Will Deacon , James Morse , Tyler Baicar , Ard Biesheuvel , Ingo Molnar , "bp@suse.de" , Shiju Jose , "zjzhang@codeaurora.org" , arm-mail-list , "kvmarm@lists.cs.columbia.edu" , lkml - Kernel Mailing List , "linux-acpi@vger.kernel.org" , "devel@acpica.org" , John Garry , Jonathan Cameron , Shameerali Kolothum Thodi , huangdaode , "Wangzhou (B)" , Huangshaoyu , Wuquanming , Linuxarm , "Zhengqiang (turing)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1462 Lines: 35 On 11 September 2017 at 16:17, gengdongjiu wrote: >> On 18 August 2017 at 15:23, Dongjiu Geng wrote: >> > +static int kvm_inject_arm_sei(CPUState *cs) { >> > + ARMCPU *cpu = ARM_CPU(cs); >> > + CPUARMState *env = &cpu->env; >> > + >> > + unsigned long syndrome = env->exception.vaddress; >> > + /* set virtual SError syndrome */ >> > + if (arm_feature(env, ARM_FEATURE_RAS_EXTENSION)) { >> > + syndrome = syndrome & ARM_EL_ISS_MASK; >> > + } else { >> > + syndrome = 0; >> > + } >> > + >> > + return kvm_vcpu_ioctl(CPU(cpu), KVM_ARM_SEI, &syndrome); >> >> This looks odd. If we don't have the RAS extension why do we need to do anything at all here ? > > This is because Qemu may need to support non-RAS extension as discussed with ARM James before. > That is to say host hardware CPU does not support RAS, but guest supports. > That is under discussion. > When host hardware supports RAS, specify the syndrome to a valid value, otherwise, set it to 0. If the guest CPU doesn't support the RAS extension then we have no mechanism for delivering it a notification about the memory problem at all, so setting the syndrome to anything doesn't make sense. I'm not sure what you should do in the case of "host supports telling us about a memory problem and has done so, but guest does not support being told about it", but I'm pretty sure it shouldn't be this. thanks -- PMM