From patchwork Tue Sep 29 14:49:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 54228 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 6161122B1E for ; Tue, 29 Sep 2015 14:54:36 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf7132602wic.3 for ; Tue, 29 Sep 2015 07:54:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=tFJXe4BtmnfFSAOuQQYPGM7w+9xLjnB2X9FjfQFLEDg=; b=etCJosGOiFe8oJUiDRrjBxO3WUzxsB55YRNaZ++uUk2/E8YzTzxDV4I+IQf+22SSqh 6smat4Sd3loxScQdWdBcf0+uLC7q17oW3q7j8nCnlpGxgx2Uk9fPuaUwZaNeYyFRuaIp 4+cF8eROMSdBT+aXEU6xApVrKzsgNSEQ+HlWCCmuxmNldcdbrpeemMa38a8QnjZOboVC be8kiIh+xES3VF85PMM4tfcSl1Hg7Fl7e9AL3FExxd/LWeZrlrAdaNkLk4Ed9WXzxNSk yAeFxXv8R0Fa3JnPi+kiYYyvCvk7+2zeDuni1bGCOhDhLwDmigoKcgqD0XlRdE5RUxoL KNtQ== X-Gm-Message-State: ALoCoQmt64lh6uo7G4IDc76btErTRTBadCXeqt77WVLtnF/6dCyLJvxLO73CxSJbreSpbAsV3Q1x X-Received: by 10.180.210.71 with SMTP id ms7mr3962146wic.4.1443538475618; Tue, 29 Sep 2015 07:54:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.166.82 with SMTP id p79ls427548lfe.99.gmail; Tue, 29 Sep 2015 07:54:35 -0700 (PDT) X-Received: by 10.112.125.102 with SMTP id mp6mr7479320lbb.46.1443538475463; Tue, 29 Sep 2015 07:54:35 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id dy8si11058145lbb.55.2015.09.29.07.54.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 07:54:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by laer8 with SMTP id r8so11806983lae.2 for ; Tue, 29 Sep 2015 07:54:35 -0700 (PDT) X-Received: by 10.25.205.198 with SMTP id d189mr4738280lfg.72.1443538475297; Tue, 29 Sep 2015 07:54:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2192258lbq; Tue, 29 Sep 2015 07:54:34 -0700 (PDT) X-Received: by 10.50.131.194 with SMTP id oo2mr2825916igb.33.1443538472653; Tue, 29 Sep 2015 07:54:32 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id o9si16999835igy.67.2015.09.29.07.54.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 07:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZgwHW-0008Hh-C9; Tue, 29 Sep 2015 14:53:26 +0000 Received: from mail-la0-f44.google.com ([209.85.215.44]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZgwDk-0005Ba-G8 for linux-arm-kernel@lists.infradead.org; Tue, 29 Sep 2015 14:49:33 +0000 Received: by labzv5 with SMTP id zv5so11736716lab.1 for ; Tue, 29 Sep 2015 07:49:11 -0700 (PDT) X-Received: by 10.152.21.9 with SMTP id r9mr7236367lae.1.1443538150906; Tue, 29 Sep 2015 07:49:10 -0700 (PDT) Received: from localhost.localdomain (0187900153.0.fullrate.dk. [2.110.55.193]) by smtp.gmail.com with ESMTPSA id zx7sm2749559lbb.15.2015.09.29.07.49.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Sep 2015 07:49:10 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Subject: [PATCH v3 4/8] arm/arm64: KVM: Implement GICD_ICFGR as RO for PPIs Date: Tue, 29 Sep 2015 16:49:01 +0200 Message-Id: <1443538145-11990-5-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1443538145-11990-1-git-send-email-christoffer.dall@linaro.org> References: <1443538145-11990-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150929_074932_730726_214F6341 X-CRM114-Status: GOOD ( 14.71 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.44 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.44 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: Marc Zyngier , Andre Przywara , Christoffer Dall , Eric Auger MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The GICD_ICFGR allows the bits for the SGIs and PPIs to be read only. We currently simulate this behavior by writing a hardcoded value to the register for the SGIs and PPIs on every write of these bits to the register (ignoring what the guest actually wrote), and by writing the same value as the reset value to the register. This is a bit counter-intuitive, as the register is RO for these bits, and we can just implement it that way, allowing us to control the value of the bits purely in the reset code. Reviewed-by: Marc Zyngier Signed-off-by: Christoffer Dall Reviewed-by: Andre Przywara --- 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 fe0e5db..e606f78 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -655,7 +655,7 @@ bool vgic_handle_cfg_reg(u32 *reg, struct kvm_exit_mmio *mmio, ACCESS_READ_VALUE | ACCESS_WRITE_VALUE); if (mmio->is_write) { if (offset < 8) { - *reg = ~0U; /* Force PPIs/SGIs to 1 */ + /* Ignore writes to read-only SGI and PPI bits */ return false; }