Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5508288imm; Tue, 12 Jun 2018 08:52:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIYxm5OvCdvXF/BAHR+MBD2PpfoCOooeWalqN2jtBf16hz0juQ6KzF3lGKjg3uG7oeuBqcU X-Received: by 2002:a17:902:8210:: with SMTP id x16-v6mr975209pln.307.1528818732260; Tue, 12 Jun 2018 08:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528818732; cv=none; d=google.com; s=arc-20160816; b=ClL9etr3z2rvlLqZN3NYdpB2nNkVswuNaAD9t9JrXW1pWfIki9qN8HcMPGGnBnEPBI St8Rp8tRlviTApHshWqSNEf3RWdUhmAP1J/N+i1BaPAYRnXnx8UtAL3D01KoDFuMLNBY O9oinBYIc8Acw9y3YEwkF6KIyqo3Bsy07oAKf3SPGzbx4ZlrJ3SLEsjMK/JEzgpRh9I7 m5Q+wCUZUZR79GHkcV0kg/oKXkN9jCMj7nRfr859XKcs40wYu3Dc1w3qgEZwBo5BScu6 6oIEh7256bCBfTs76F05yzoRHDFdLEH7MBmLkuFHFuJU54MJTB2HAfqWPLwPRWO72yRT YzTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=/JTH9+g8cLs9lCT0CmTHdGPlFuBiifR6lEPgihtaF5k=; b=aH6EoFrXiJK5mhmhXo3F1ZpsdXajNgV0AQTogFhX5OkRzMEnsE0C+V/1IgTKKJs2l0 NW2K8odE4ZBc7uZsoAULImw90FUsZKGCqgiGxxroF9MTfA0Yd1RGuQSgwGXj6GM7Wy9p AiYCZiTVkl5GNYlkcinBqOrYOguolVYz1kja/k83Eb6tAJ0lI7Pt7ASbNYE6/2ApnJeW inoJm7Y9lOmdt1VeOFU2EZvvZgsq2uT1ySavGWn3OUYB96CeNZ2h+KVoc1mYZXy/9aC9 h6gb2KFRy+juDs678nIPk+Ub4phoNq0HSXlu4aYj7q0Yx7IDivx5lo9DHaPr2+06Y7B9 4/8A== 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 c81-v6si419110pfj.138.2018.06.12.08.51.57; Tue, 12 Jun 2018 08:52:12 -0700 (PDT) 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 S1754379AbeFLPvN (ORCPT + 99 others); Tue, 12 Jun 2018 11:51:13 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8667 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933469AbeFLPvL (ORCPT ); Tue, 12 Jun 2018 11:51:11 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EB434B7472FE4; Tue, 12 Jun 2018 23:50:54 +0800 (CST) Received: from [127.0.0.1] (10.142.68.147) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.382.0; Tue, 12 Jun 2018 23:50:54 +0800 Subject: Re: [PATCH RESEND v4 2/2] arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS To: James Morse CC: , , , , , , , , , , , References: <1528487320-2873-1-git-send-email-gengdongjiu@huawei.com> <1528487320-2873-3-git-send-email-gengdongjiu@huawei.com> <45e94aae-ed9f-1fb7-f10e-d95c2f969ddd@arm.com> <6887237f-d252-5b9e-02cb-5a44fef27080@arm.com> From: gengdongjiu Message-ID: <2455dc33-ae8d-79e6-e915-4181050e1e65@huawei.com> Date: Tue, 12 Jun 2018 23:48:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <6887237f-d252-5b9e-02cb-5a44fef27080@arm.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.68.147] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/6/12 23:29, James Morse wrote: > Hi gengdongjiu, > > On 12/06/18 15:50, gengdongjiu wrote: >> On 2018/6/11 21:36, James Morse wrote: >>> On 08/06/18 20:48, Dongjiu Geng wrote: >>>> For the migrating VMs, user space may need to know the exception >>>> state. For example, in the machine A, KVM make an SError pending, >>>> when migrate to B, KVM also needs to pend an SError. >>>> >>>> This new IOCTL exports user-invisible states related to SError. >>>> Together with appropriate user space changes, user space can get/set >>>> the SError exception state to do migrate/snapshot/suspend. > > >>>> diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h >>>> index caae484..c3e6975 100644 >>>> --- a/arch/arm/include/uapi/asm/kvm.h >>>> +++ b/arch/arm/include/uapi/asm/kvm.h >>>> @@ -124,6 +124,18 @@ struct kvm_sync_regs { >>>> struct kvm_arch_memory_slot { >>>> }; >>>> >>>> +/* for KVM_GET/SET_VCPU_EVENTS */ >>>> +struct kvm_vcpu_events { >>>> + struct { >>>> + __u8 serror_pending; >>>> + __u8 serror_has_esr; >>>> + /* Align it to 8 bytes */ >>>> + __u8 pad[6]; >>>> + __u64 serror_esr; >>>> + } exception; >>>> + __u32 reserved[12]; >>>> +}; >>>> + >>> >>> You haven't defined __KVM_HAVE_VCPU_EVENTS for 32bit, so presumably this struct >>> will never be used. Why is it here? > >> if not add it for 32 bits. the 32 arm platform will build Fail, whether you have good >> idea to avoid this Failure if not add this struct for the 32 bit? > > How does this 32bit code build without this patch? > If do you provide the struct, how will that code build with older headers? > > As far as I can see, this is what the __KVM_HAVE_VCPU_EVENTS define is for. > > This should be both, or neither. Having just the struct is useless. It because the caller of kvm_arm_vcpu_get/set_events() is in "virt/kvm/arm/arm.c". the virt/kvm/arm/arm.c will used by both arm64 and arm. so It needs to add kvm_arm_vcpu_get/set_events() for the 32 bits, however, kvm_arm_vcpu_get/set_events() will directly return, I attached the build erros below: https://lkml.org/lkml/2018/6/4/918 https://lkml.org/lkml/2018/6/4/873 [..] I will continue check below comments, thanks