From patchwork Mon Dec 4 14:03:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10090357 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 8B29D60329 for ; Mon, 4 Dec 2017 14:04:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7262E2899A for ; Mon, 4 Dec 2017 14:04:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6739228D48; Mon, 4 Dec 2017 14:04:43 +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 E65C92899A for ; Mon, 4 Dec 2017 14:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754487AbdLDOE1 (ORCPT ); Mon, 4 Dec 2017 09:04:27 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:45798 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754488AbdLDOEO (ORCPT ); Mon, 4 Dec 2017 09:04:14 -0500 Received: by mail-wm0-f67.google.com with SMTP id 9so5994901wme.4 for ; Mon, 04 Dec 2017 06:04:13 -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:in-reply-to:references; bh=VYxmL+PZNurnmoYpZ7X7QGf0B46epS0TWuDGYyV98VI=; b=EhnGxpRq4srcQQwPlbKAYJzdpW53Agv3lZjtjkdhIj7WWqBgPuyCzQD+ui7A7xrQwb ec78BydyisNjd0XchFM+A8IkOOCnmL+bG2s6cS1pbyyB+cVXwqo2XLhMIhcQNQtZNLrE ECxLeydHHOXg6a3KegujrpNOutZMDKGZKDs7kA5O/ggjJIoKceFw5bqS8T12zXqhD+9y chOY+USFn9+N3hJ3WfODv/8rVjG+NWCZ06Ximcc5WiTMDiEaY+sHBBssP41ugR0qX+Vv mlHjfUuvrcuiQ+g5fPYTVNpXJI3na/1RRj1F/20Ny01DolSGXE1MRrV/FtAYuzH3o0Rd jhmA== 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 :in-reply-to:references; bh=VYxmL+PZNurnmoYpZ7X7QGf0B46epS0TWuDGYyV98VI=; b=AnoBPEX81pAiG0T7Bhz6YktOv0RqQ/eTiQXWfbjBAmHPGPtJkwgjxefCXKzlYypqoE o2EnXT2C2+AJIV0u3sOCcoe1TdDaPWbggWvF+UPQ+uQWXVJz3fSoWhhL6KZcBXRo1RFa 3nchYchG1TEoaTNUYqTo2WLQjb6vfAXBvdVhYe/DBDUZi3MwxONNSlTD/Z2h8y2RxLWE qUJQV3I52F4ID7ClIfhRlJTYLoHNI8x3E2ItdThe7Kt8gjWtWktAx/sPmrUIxT08ed53 Kh2Evxw1MO5yHL0wPR6l9dJc7kXsIHnwEZVxT4BABDR7C9cMU+++7ISkNSWEmVoRG2QE pNxw== X-Gm-Message-State: AJaThX6KGs27DOFdwzrt5nIPLvlpv6QB49Wv9t7k/H6R77hw/YJ9mXh/ SthFNmPDnR8uxSIqw/gRhbAQpyLpEJE= X-Google-Smtp-Source: AGs4zMY4joNoGqc4zJZbwcDQ/8GdCDAwlICzB0R8zrneHMFKXYD2UZRzVoquWOi3as+fwhd5A3iTFQ== X-Received: by 10.28.28.5 with SMTP id c5mr7459230wmc.115.1512396253343; Mon, 04 Dec 2017 06:04:13 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id g7sm22794279wra.38.2017.12.04.06.04.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 06:04:12 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Christoffer Dall , stable@vger.kernel.org Subject: [PULL 19/19] KVM: arm/arm64: Fix broken GICH_ELRSR big endian conversion Date: Mon, 4 Dec 2017 15:03:48 +0100 Message-Id: <20171204140348.21965-17-cdall@kernel.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171204135637.21620-1-cdall@kernel.org> References: <20171204135637.21620-1-cdall@kernel.org> 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: Acked-by: Christoffer Dall Signed-off-by: Christoffer Dall --- 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)