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: 10089465 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 71DA1602C8 for ; Sun, 3 Dec 2017 23:05:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DD7928D50 for ; Sun, 3 Dec 2017 23:05:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50E0B28D57; Sun, 3 Dec 2017 23:05:03 +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=-2.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, URIBL_DBL_ABUSE_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC80428D50 for ; Sun, 3 Dec 2017 23:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=nUchfbmwXbnRn7OSqVoah1HuX995COeEbBqFLMVwYxQ=; b=qOt rvdui+zqvFP5Ram8qNvQ/LGK1/SypDf0bz8+gWx9AePd94MqEMGYOfXyI/jBrBI9aK2a6HOq51G1n k8p8e1YWDGaWH8cr+34HpwPk7F4oHQ+1HshLXazXJYjXNwem4voshI2hdmq63uy9ottN+dFQqi38F P0ytUa6p38NjKfvRON7wfzAj8X2e1EsiTQKDkVl4fm/AVgcMNkt1hnnCClmYxDsKfvjPkTKYOhE33 xNkFzbFIfPmNo5emO83pvebMiRjxt6mtvjaEyQhtUoCtiZgzWh8NOo7plUGbHLyZ+EMAWvMcICIAw klvdorB7DKsdpp8zUfglJpHN/D3YtvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLdJk-0008DC-Vg; Sun, 03 Dec 2017 23:05:00 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLdJi-0008CN-0S for linux-arm-kernel@lists.infradead.org; Sun, 03 Dec 2017 23:04:59 +0000 Received: by mail-wm0-x243.google.com with SMTP id g130so12421948wme.0 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=WTswK66acpIID2kAQAx0vJxevoAJSbO+m/U0+G995eUEhCwL2n49+sVTUo4gyd3KZw +rdqWhIGM9EfwYaYwSSHWptImSGzzB5/WmKHrPZZ8VBFVGZuUEUOCGe+v7yZ3a3wgEHO NErP3X1GFBk8jROv3NSFTjqpm31hnGat3Bs5Ub+IB8Tuq0UXtEbbdAOget4UITLAk24r yPHOvYVqB+o7lKsWPC3JJPaGTFb8hUz8m5g9q2AE48qZBKkWdacUt6OZMCN3qbQUlSI5 JNSjlItEF5lV+nSKIwbZ+l0pat1V+KHjgulkHYgYB5EURmqd7ntozs5dXkYKYkGEzWng /EpQ== X-Gm-Message-State: AKGB3mIaqlC01jRokzXo9jj4Izex7gWitCbtb85PJmWHVTP3cBgoPvYp Tk4t+98AN6fP5vYr2B8ygq+8Kg== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171203_150458_203981_49CE1E24 X-CRM114-Status: UNSURE ( 7.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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)