Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B378AC433B4 for ; Tue, 11 May 2021 06:37:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5DE4D61430 for ; Tue, 11 May 2021 06:37:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DE4D61430 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.125624.236447 (Exim 4.92) (envelope-from ) id 1lgM1L-0000wu-PQ; Tue, 11 May 2021 06:37:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 125624.236447; Tue, 11 May 2021 06:37:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lgM1L-0000wn-M0; Tue, 11 May 2021 06:37:31 +0000 Received: by outflank-mailman (input) for mailman id 125624; Tue, 11 May 2021 06:37:30 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lgM1K-0000wb-CA for xen-devel@lists.xenproject.org; Tue, 11 May 2021 06:37:30 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 90517df5-5487-40cc-981c-df11108319f4; Tue, 11 May 2021 06:37:28 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2CFC9168F; Mon, 10 May 2021 23:37:28 -0700 (PDT) Received: from [10.57.3.172] (unknown [10.57.3.172]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BDCF63F718; Mon, 10 May 2021 23:37:25 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 90517df5-5487-40cc-981c-df11108319f4 Subject: Re: [PATCH v3 10/10] arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t To: Jan Beulich Cc: Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Ian Jackson , Wei Liu , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , bertrand.marquis@arm.com, wei.chen@arm.com, xen-devel@lists.xenproject.org References: <20210505074308.11016-1-michal.orzel@arm.com> <20210505074308.11016-11-michal.orzel@arm.com> From: Michal Orzel Message-ID: <1ff4f9fb-0eca-189a-2b47-b910dc6b3639@arm.com> Date: Tue, 11 May 2021 08:37:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Jan, On 05.05.2021 10:00, Jan Beulich wrote: > On 05.05.2021 09:43, Michal Orzel wrote: >> --- a/xen/include/public/arch-arm.h >> +++ b/xen/include/public/arch-arm.h >> @@ -267,10 +267,10 @@ struct vcpu_guest_core_regs >> >> /* Return address and mode */ >> __DECL_REG(pc64, pc32); /* ELR_EL2 */ >> - uint32_t cpsr; /* SPSR_EL2 */ >> + uint64_t cpsr; /* SPSR_EL2 */ >> >> union { >> - uint32_t spsr_el1; /* AArch64 */ >> + uint64_t spsr_el1; /* AArch64 */ >> uint32_t spsr_svc; /* AArch32 */ >> }; > > This change affects, besides domctl, also default_initialise_vcpu(), > which Arm's arch_initialise_vcpu() calls. I realize do_arm_vcpu_op() > only allows two unrelated VCPUOP_* to pass, but then I don't > understand why arch_initialise_vcpu() doesn't simply return e.g. > -EOPNOTSUPP. Hence I suspect I'm missing something. > I agree that do_arm_vcpu_op only allows two VCPUOP* to pass and arch_initialise_vcpu being called in case of VCPUOP_initialise has no sense as VCPUOP_initialise is not supported on arm. It makes sense that it should return -EOPNOTSUPP. However do_arm_vcpu_op will not accept VCPUOP_initialise and will return -EINVAL. So arch_initialise_vcpu for arm will not be called. Do you think that changing this behaviour so that arch_initialise_vcpu returns -EOPNOTSUPP should be part of this patch? >> --- a/xen/include/public/domctl.h >> +++ b/xen/include/public/domctl.h >> @@ -38,7 +38,7 @@ >> #include "hvm/save.h" >> #include "memory.h" >> >> -#define XEN_DOMCTL_INTERFACE_VERSION 0x00000013 >> +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000014 > > So this is to cover for the struct vcpu_guest_core_regs change. > >> --- a/xen/include/public/vm_event.h >> +++ b/xen/include/public/vm_event.h >> @@ -266,8 +266,7 @@ struct vm_event_regs_arm { >> uint64_t ttbr1; >> uint64_t ttbcr; >> uint64_t pc; >> - uint32_t cpsr; >> - uint32_t _pad; >> + uint64_t cpsr; >> }; > > Then I wonder why this isn't accompanied by a similar bump of > VM_EVENT_INTERFACE_VERSION. I don't see you drop any checking / > filling of the _pad field, so existing callers may pass garbage > there, and new callers need to be prevented from looking at the > upper half when running on an older hypervisor. > > Jan > Cheers, Michal