From patchwork Fri Aug 23 07:17:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 19433 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B71FE248E6 for ; Fri, 23 Aug 2013 07:17:23 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf224003vbg.10 for ; Fri, 23 Aug 2013 00:17:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=JNUBXCA8eIIu1PfMQt2LPTP0xcqpIB32fK39lOGlNx0=; b=chWfzvfid9nsguFRKABlbcSh1cH+IzLEgY/RpW2WN2N4EYcezaxdLxYDYysXqyb+gq aqcXub+aIlvkXISWmafW9gKYNEXoePuyPJ5RkZC+IF1GbUXmMBPUyBK46pQNrSzVecz4 eSID/8B8fC+w0kLwtYEyxnRXCXWpTuxsK2A/iO9DVZw9qjkZDuUXzL0BZF+D5xlTM6Ta z4v9SzNT/RtdqBZkW1RFMUuD4Gc4Uh1jIHbx4FkAaIudhcqOcILUgrVBeJHB8K632yJs V1KgQZrjMNizVwK34R3u+VtqXVufl+7ohnZAUslzMHHjx0LFtOBzap6gv01rRi5+cBle ZbGw== X-Received: by 10.236.166.35 with SMTP id f23mr967332yhl.22.1377242243414; Fri, 23 Aug 2013 00:17:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.107.71 with SMTP id ha7ls1570428qeb.77.gmail; Fri, 23 Aug 2013 00:17:23 -0700 (PDT) X-Received: by 10.221.27.73 with SMTP id rp9mr18720vcb.29.1377242243328; Fri, 23 Aug 2013 00:17:23 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id bb4si5202055vcb.75.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 00:17:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id db10so202889veb.14 for ; Fri, 23 Aug 2013 00:17:23 -0700 (PDT) X-Gm-Message-State: ALoCoQnuAfDUsST1H2EeDl/C9svojwwKoxYXWKlhUE0YnTMBTY/e2KGubURNt4Klx5QaLx4hqH40 X-Received: by 10.58.215.15 with SMTP id oe15mr19167vec.25.1377242243258; Fri, 23 Aug 2013 00:17:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp77253vcz; Fri, 23 Aug 2013 00:17:22 -0700 (PDT) X-Received: by 10.66.191.5 with SMTP id gu5mr9488043pac.126.1377242242285; Fri, 23 Aug 2013 00:17:22 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id yk3si12381508pac.186.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 00:17:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of christoffer.dall@linaro.org) client-ip=209.85.220.50; Received: by mail-pa0-f50.google.com with SMTP id fb10so337005pad.9 for ; Fri, 23 Aug 2013 00:17:21 -0700 (PDT) X-Received: by 10.67.1.228 with SMTP id bj4mr9464688pad.157.1377242241687; Fri, 23 Aug 2013 00:17:21 -0700 (PDT) Received: from localhost.localdomain (c-67-169-183-77.hsd1.ca.comcast.net. [67.169.183.77]) by mx.google.com with ESMTPSA id y6sm19591485pbl.23.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 00:17:20 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linaro-kernel@lists.linaro.org, patches@linaro.org, Christoffer Dall Subject: [PATCH] ARM: KVM: Bugfix: vgic_bytemap_get_reg per cpu regs Date: Fri, 23 Aug 2013 00:17:17 -0700 Message-Id: <1377242237-29930-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , For bytemaps each IRQ field is 1 byte wide, so we pack 4 irq fields in one word and since there are 32 private (per cpu) irqs, we have 8 private u32 fields on the vgic_bytemap struct. We shift the offset from the base of the register group right by 2, giving us the word index instead of the field index. But then there are 8 private words, not 4, which is also why we subtract 8 words from the offset of the shared words. Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 17c5ac7..96d7aa4 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -149,7 +149,7 @@ static u32 *vgic_bytemap_get_reg(struct vgic_bytemap *x, int cpuid, u32 offset) { offset >>= 2; BUG_ON(offset > (VGIC_NR_IRQS / 4)); - if (offset < 4) + if (offset < 8) return x->percpu[cpuid] + offset; else return x->shared + offset - 8;