Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1010481pxa; Wed, 5 Aug 2020 19:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+UoIn77THWhYTisVijsenNHIgvAPBbudtV9oKj7TIBjMnCP/KY9W+/+qmybviFCiVxXYm X-Received: by 2002:aa7:ce98:: with SMTP id y24mr2073227edv.76.1596680821301; Wed, 05 Aug 2020 19:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596680821; cv=none; d=google.com; s=arc-20160816; b=ByJnr/jREBhFlYOn4lBTkwAT+aolykpL9EXEThQ7waUZZboMUG7x6D4IVsDIPC0+zG A4nRi2NbReizxLAQrNWTu7bug9XOeU/2Pu03gr6/edfrfwNBN6p9Wki/1A5XDOeZf25r D4ppzrTFI9PZae6OlvExvxnpk6ttbyqybBNJeKrGPuoh3fyIfSkXdybPpJmpC2CJGem2 oVXorzsYJNJ5kCKbwZEg5U18+5BalvSP3M55+rvA5MZZZZpnkJNo2UKS8ccakUZiMmtf UYUxdaluxUkcQ0aOQj3jwMSKNrafM1Ia//D3U69ZSNCcUUNXrDJ4y+7E3coPwddQ85lh ZCWg== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=jobxu7Ihgzo5p13T/oJooCNiAOp6VN9Fwy/WNnGJlXI=; b=Q7FmaCxb+C40wWvv/Uor7RDZCEy8XderZgwb8zE3B/Thd/vEa21YCAr2u642vDCUTo wumy3R+nnjrfIez0HSnsYFuB0Bk8oP82v7OYsPzKoMKfarbjDqYesqkhu0MMNFT8nV5x yELj+VYWlgJ0S421tlvbxtNt57GbXRrF0W7jI8wcswcc63Y96vj0kHOy9ocIQuQnJQLK FYJpXUKhLOaFtuep/v73iQplRI286E83fAlIxG/klzSmgfdzWWhmTNzhBzYoQyprt9ba lH96YlYAuHf6TOhgjYKZUPc4z/ZjeAexsYcoD0/YaLi0/j1n4MWZrJtaA0YfIP6nfcdk bkWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs1si2611722edb.76.2020.08.05.19.26.39; Wed, 05 Aug 2020 19:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbgHFC03 (ORCPT + 99 others); Wed, 5 Aug 2020 22:26:29 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8771 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725999AbgHFC02 (ORCPT ); Wed, 5 Aug 2020 22:26:28 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6C8951545C524298B78F; Thu, 6 Aug 2020 10:26:26 +0800 (CST) Received: from [127.0.0.1] (10.174.179.106) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Thu, 6 Aug 2020 10:26:24 +0800 Subject: Re: Patch "KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts" has been added to the 4.4-stable tree To: , , , , , , CC: , References: <159230500664142@kroah.com> From: yangerkun Message-ID: <6084bc97-11ea-4b7d-086e-fb98880fca6c@huawei.com> Date: Thu, 6 Aug 2020 10:26:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <159230500664142@kroah.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.106] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Not familiar with kvm. And I have a question about this patch. Maybe backport this patch 3204be4109ad("KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts") without 52f6c4f02164 ("KVM: arm64: Change 32-bit handling of VM system registers") seems not right? Thanks, Kun. 在 2020/6/16 18:56, gregkh@linuxfoundation.org 写道: > > This is a note to let you know that I've just added the patch titled > > KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts > > to the 4.4-stable tree which can be found at: > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary > > The filename of the patch is: > kvm-arm64-make-vcpu_cp1x-work-on-big-endian-hosts.patch > and it can be found in the queue-4.4 subdirectory. > > If you, or anyone else, feels it should not be added to the stable tree, > please let know about it. > > >>From 3204be4109ad681523e3461ce64454c79278450a Mon Sep 17 00:00:00 2001 > From: Marc Zyngier > Date: Tue, 9 Jun 2020 08:40:35 +0100 > Subject: KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts > > From: Marc Zyngier > > commit 3204be4109ad681523e3461ce64454c79278450a upstream. > > AArch32 CP1x registers are overlayed on their AArch64 counterparts > in the vcpu struct. This leads to an interesting problem as they > are stored in their CPU-local format, and thus a CP1x register > doesn't "hit" the lower 32bit portion of the AArch64 register on > a BE host. > > To workaround this unfortunate situation, introduce a bias trick > in the vcpu_cp1x() accessors which picks the correct half of the > 64bit register. > > Cc: stable@vger.kernel.org > Reported-by: James Morse > Tested-by: James Morse > Acked-by: James Morse > Signed-off-by: Marc Zyngier > Signed-off-by: Greg Kroah-Hartman > > --- > arch/arm64/include/asm/kvm_host.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -178,8 +178,10 @@ struct kvm_vcpu_arch { > * CP14 and CP15 live in the same array, as they are backed by the > * same system registers. > */ > -#define vcpu_cp14(v,r) ((v)->arch.ctxt.copro[(r)]) > -#define vcpu_cp15(v,r) ((v)->arch.ctxt.copro[(r)]) > +#define CPx_BIAS IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) > + > +#define vcpu_cp14(v,r) ((v)->arch.ctxt.copro[(r) ^ CPx_BIAS]) > +#define vcpu_cp15(v,r) ((v)->arch.ctxt.copro[(r) ^ CPx_BIAS]) > > #ifdef CONFIG_CPU_BIG_ENDIAN > #define vcpu_cp15_64_high(v,r) vcpu_cp15((v),(r)) > > > Patches currently in stable-queue which might be from maz@kernel.org are > > queue-4.4/kvm-arm64-make-vcpu_cp1x-work-on-big-endian-hosts.patch > > . >