From patchwork Tue Jan 26 14:11:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12046747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D31CC433E0 for ; Tue, 26 Jan 2021 14:14:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3451922D04 for ; Tue, 26 Jan 2021 14:14:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3451922D04 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=gqujP+OzUAV079U5/A4BvH6ZjbufmU0MNdVqL2NoLHk=; b=sQxBOZ4nHR+m/mvW/fk53cSte4 VsnahZLdT9T234lypvfnFOMLLbUq6GTpHFaANEox9didO8XmucwciGbOgpihMy43Bod5UUcNBc/M/ bhixxYF1wXZv25Wbd09oRE2gufepihWW3OfRncz1op5RxPLGKZ6zRvSZ/C7Eb7heyC1W89KABOk6M NjBll5MJeM3Xquw0drV8mHr5v5rlPbyXOhR9+2sC3Tm8xO/sCJwW1UOrM34O18s1U60m6rm9EVQFb EhJOQbGuhhPJY74yvgvwaRYbFm3EGA0i/rz5bsRg7BPvblksYUK58P/c4QvFAL7Z54mZ9ybCGcvai 6If5H8xg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4P4l-0000NA-2x; Tue, 26 Jan 2021 14:12:11 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4P4f-0000LP-QJ for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2021 14:12:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E9628113E; Tue, 26 Jan 2021 06:12:02 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F22393F68F; Tue, 26 Jan 2021 06:12:01 -0800 (PST) From: Alexandru Elisei To: maz@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH 0/2] KVM: arm64: vgic-v3: Misc fixes Date: Tue, 26 Jan 2021 14:11:54 +0000 Message-Id: <20210126141156.39317-1-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210126_091205_961687_3A95C3E8 X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Two minor patches for stuff I found while reviewing Eric's VGIC fixes [1]. First patch should be straightforward documentation update. I thought of the second patch when I was hacking kvmtool to read GICR_TYPER from userspace. I was passing the raw MPIDR_EL1 value (the result of KVM_GET_ONE_REG(MPIDR_EL1)) to KVM_DEV_ARM_VGIC_GRP_REDIST_REGS, which obviously returned an error code. I started investigating and I thought that the problem was caused by VGIC_TO_MPIDR not setting the RES1 bit (bit 31) from MPIDR_EL1. I actually wrote a patch to change that when I realized that the macro wasn't supposed to create a valid MPIDR_EL1 value at all, because the result of the macro is then compared to kvm_vcpu_get_mpidr_aff(). I wrote patch #2 hoping that the change in the macro name will prevent someone else from making the same mistake. On the other hand, using mpidr to refer to the GICR_TYPER.Affinity_Value fields looks to be well established in the kernel and in the documentation, so I'm not sure that changing the macro name is really necessary. [1] https://lore.kernel.org/kvmarm/20201212185010.26579-1-eric.auger@redhat.com/ Alexandru Elisei (2): Documentation: kvm: vgic-v3: Update return code for KVM_DEV_ARM_VGIC_GRP_CTRL KVM: arm64: vgic-v3: Rename VGIC_TO_MPIDR() to VGIC_TO_MPIDR_AFF() Documentation/virt/kvm/devices/arm-vgic-v3.rst | 4 +++- arch/arm64/kvm/vgic/vgic-kvm-device.c | 12 ++++++------ arch/arm64/kvm/vgic/vgic.h | 10 +++++----- 3 files changed, 14 insertions(+), 12 deletions(-)