From patchwork Tue Sep 19 17:50:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13391741 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 792C2CE79A9 for ; Tue, 19 Sep 2023 17:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: Mime-Version:Date: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=RMaEfOalRDN7AZ0bYUp3NCLhWUiE14CWj0AphKVKayU=; b=MlA TXBixlsGqE7mQrw7RPqgKdm6WLq6rMTPKwFgxf88h8H6nIdf1WvORx+K1vlhiOZBTnaxHodKx17Pe DdxwsEgv2bDE4quiTopZPlyF5kOavcSZBMrk5J44oaBjY8Wrao81jRBgUbdx6LzDUkKZOji2XBgJq 36RA/XwCw3Piy5jNhe3FQn07q2OX0v1sgTOre6jxSrVqSo/BThrge2VsY4Zdh8ZJNAUKjmKlF9vfD UQOsqc4nCF1K43i1FIyRimwo/rMX32lrX8UcjwLvq2GSGvAZRhjWtXBaQOAG9V+jwkRspK0Ew5OBA b8lf8kLIlHMOZ+XOZQCMgDPHQHnMGXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qiesf-000zt9-29; Tue, 19 Sep 2023 17:51:25 +0000 Received: from mail-pf1-x44a.google.com ([2607:f8b0:4864:20::44a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qieri-000zEb-07 for linux-arm-kernel@lists.infradead.org; Tue, 19 Sep 2023 17:50:30 +0000 Received: by mail-pf1-x44a.google.com with SMTP id d2e1a72fcca58-690bb524a97so1512112b3a.2 for ; Tue, 19 Sep 2023 10:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695145823; x=1695750623; darn=lists.infradead.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=kWnTlx7Gdnm5Vz0/SIGYkkfnd0U6Pz1ne+euXaONdhM=; b=DRGzED07ZVP0R57WtkTyD/7fOdgCSpa3xFgKPnLFjRsdn/l51aVE2ZDtEZxfVvZ8V+ EA2GoiUkSXVXqGTVdol0TrMd9Pn35b5rSObTIPAkVqVBX8NEe8rkbr/9sSXcSEqdet8m 6bRkctStk2dRKTVnKhJcyJEK46TP8Yd6nyoVxRKgIXQN8+vcz5VvEnz6WL3VykZAnyYB EbIvjn9FU5Z6OXu+byLc5CwV4b3kLTfeFRQfpT8NWqhyB23MxEOchJk3cBce7Kn6U8UM YwXHSqrcDj0mKcW00dI6I0gfvIALl0AzWCMB/1sE3x0c1Wu5W4A9OFc5Zh1R64+FHog+ HZMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695145823; x=1695750623; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kWnTlx7Gdnm5Vz0/SIGYkkfnd0U6Pz1ne+euXaONdhM=; b=Fi8UXLmUzYBHirfhFOTgg0/uS5MGDLFkvfBLRnBd8r5/WyFsQuzGIafAsHWo/MKJGh 8eGNhut3d8hFXUfQFLjI63MVX2BbdXEYOsu5NWc6r0GJQKYPwtU6A39R2ZewFLgC/Vxg wdCKB4omoANh5vbTxrPW70ppMRim5P5orcOM+wieAplEYNoqxVvzqb1jFwJ628Onv2wF gqZHzNkFvz7ehd6GodWlES94L1gPigCeYp2nFNOsUc35eWdmxc29geCnlGqFJ3+xaIjq eGu3H+r1SqbPlgRZWTp4y37Nws1lMfh57G33s7jXr3s836KbrppofzcTMsIOOk5uv/sD IQSw== X-Gm-Message-State: AOJu0Yy8NQXZB5Tsg4I98YXGUjHnww8TuzlV0XxKoCICszdQNlNf6/y2 zFHPXsSDoUnPApJW7lSVUzoCHMU26866+bdNMQ== X-Google-Smtp-Source: AGHT+IEeHiio7e1vKdIgqVCmVLTA7YryY2gvJQIIbbaxBDphMBRHHqcu+bML2gSb43lnX/ewy3LJgGjLyxr0jFKanA== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a05:6a00:2d84:b0:68f:f868:a4fe with SMTP id fb4-20020a056a002d8400b0068ff868a4femr10033pfb.2.1695145823586; Tue, 19 Sep 2023 10:50:23 -0700 (PDT) Date: Tue, 19 Sep 2023 10:50:12 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog Message-ID: <20230919175017.538312-1-jingzhangos@google.com> Subject: [PATCH v1 0/4] Get writable masks for feature ID from userspace From: Jing Zhang To: KVM , KVMARM , ARMLinux , Marc Zyngier , Oliver Upton Cc: Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Suraj Jitindar Singh , Cornelia Huck , Shaoqin Huang , Jing Zhang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230919_105026_138179_001F9416 X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch series were part of [1], but actually are independent from that. In this patch series, a VM ioctl is added to allow userspace to get writable masks for feature ID registers. Another two fixes for ID registers are also included in this series. This is based on v6.6-rc2. [1] https://lore.kernel.org/all/20230821212243.491660-1-jingzhangos@google.com --- Jing Zhang (3): KVM: arm64: Allow userspace to get the writable masks for feature ID registers KVM: arm64: Document KVM_ARM_GET_REG_WRITABLE_MASKS KVM: arm64: Use guest ID register values for the sake of emulation Oliver Upton (1): KVM: arm64: Reject attempts to set invalid debug arch version Documentation/virt/kvm/api.rst | 42 ++++++++++++ arch/arm64/include/asm/kvm_host.h | 2 + arch/arm64/include/uapi/asm/kvm.h | 32 +++++++++ arch/arm64/kvm/arm.c | 10 +++ arch/arm64/kvm/sys_regs.c | 104 ++++++++++++++++++++++++++++-- include/uapi/linux/kvm.h | 2 + 6 files changed, 186 insertions(+), 6 deletions(-) base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70