From patchwork Sun Dec 3 23:04:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10089463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4FB1A602C8 for ; Sun, 3 Dec 2017 23:04:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F98728D50 for ; Sun, 3 Dec 2017 23:04:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32DCA28D57; Sun, 3 Dec 2017 23:04:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,URIBL_DBL_ABUSE_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A13C728D50 for ; Sun, 3 Dec 2017 23:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752499AbdLCXEj (ORCPT ); Sun, 3 Dec 2017 18:04:39 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34122 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752074AbdLCXEh (ORCPT ); Sun, 3 Dec 2017 18:04:37 -0500 Received: by mail-wm0-f66.google.com with SMTP id y82so12376319wmg.1 for ; Sun, 03 Dec 2017 15:04:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=christofferdall-dk.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=VAP7JNReHJPIMthSIxhjLfF6oGpWUktwv1jWk5KQUW4=; b=X4Eel3KSDrbTMfNzjU2e8+E39DBFv2rex4NeW2JRffLyEQpC7IrYfvM259ik+AQBIJ rf0B/keH7To6S3MiaPUs4OeSJEe9oEIwrorDh2G4kx/o3H2PtdgFbFgpMtOAZeNH9Q0W xgydzeI2VzsHL3O8Xg1XNBWoZjpaKKq2NDC31VdZZTUBeuYnzV7liFxN/w+bcoBffTE4 ccDXsUPAn5SSzT+3u0/zIEucEE9ZQy/6+cO7ACUlsStYOGwCNS4yweykBBR0uvuKc9AO jAjGPoYGXFYFvXabDav7Zwbp+v3miI6Wy6YFO7HuICssKIevyBdMqe4YqHBWPvMsYEPr Xn2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=VAP7JNReHJPIMthSIxhjLfF6oGpWUktwv1jWk5KQUW4=; b=RRC0kMlyjriEcu0Xre1o5CmZg98ROQk6KNu1JJk17J8sPoX51GUD4E+Dg/cvkNo9gl hDinpTYLV+ID9PuwLlde+OnkcMvW6yRKs62LSu4bO8lS0AMc2kJEfyq8IK5M0HFgqAnZ SSWww0gliz/NnxSQ7x/g8Xev9GTxwgw0MacUKkNKVkTyYfJXLci/6/sMZtEVjwOqvVdR eNw7G/dUOFuEXiYi7f9S3owZc5WXZOSctzY+YWf4wjxXP5FyO6TVIAkbVTHEER0D+A4R quUxiLCwNlNC1efMsUJPdPmPK+41ndf/+Gp29WkSv8cr7AJYfNDCiOd27bfhGahnQFah Q8ig== X-Gm-Message-State: AKGB3mLIPXACq4IYCY2f74kYHFE0V2vo2ogOqzVNWDjkVzFj/DG4bJtO 55SxIXwWm24jjgHhAng7hD+imCMYcq8= X-Google-Smtp-Source: AGs4zMbGqxfNAGd/AATPMJVrPHk+DyhVnMkGTQh/UcC+gqWZt6yUunNZWYbXvY+HmfDlbT/H6QujYA== X-Received: by 10.28.214.145 with SMTP id n139mr1878804wmg.59.1512342276290; Sun, 03 Dec 2017 15:04:36 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id f18sm288950wrg.66.2017.12.03.15.04.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Dec 2017 15:04:34 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , Christoffer Dall , stable@vger.kernel.org Subject: [PATCH] KVM: arm/arm64: Fix broken GICH_ELRSR big endian conversion Date: Mon, 4 Dec 2017 00:04:34 +0100 Message-Id: <20171203230435.22021-1-cdall@kernel.org> X-Mailer: git-send-email 2.14.2 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christoffer Dall We are incorrectly rearranging 32-bit words inside a 64-bit typed value for big endian systems, which would result in never marking a virtual interrupt as inactive on big endian systems (assuming 32 or fewer LRs on the hardware). Fix this by not doing any word order manipulation for the typed values. Cc: Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- virt/kvm/arm/hyp/vgic-v2-sr.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/virt/kvm/arm/hyp/vgic-v2-sr.c b/virt/kvm/arm/hyp/vgic-v2-sr.c index a3f18d362366..d7fd46fe9efb 100644 --- a/virt/kvm/arm/hyp/vgic-v2-sr.c +++ b/virt/kvm/arm/hyp/vgic-v2-sr.c @@ -34,11 +34,7 @@ static void __hyp_text save_elrsr(struct kvm_vcpu *vcpu, void __iomem *base) else elrsr1 = 0; -#ifdef CONFIG_CPU_BIG_ENDIAN - cpu_if->vgic_elrsr = ((u64)elrsr0 << 32) | elrsr1; -#else cpu_if->vgic_elrsr = ((u64)elrsr1 << 32) | elrsr0; -#endif } static void __hyp_text save_lrs(struct kvm_vcpu *vcpu, void __iomem *base)