From patchwork Fri Apr 8 08:40:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12806294 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 C8B0DC433F5 for ; Fri, 8 Apr 2022 08:42:15 +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:Mime-Version: Message-Id: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=imjZaUKDuuGZBf9fI4uwV4kloYGsuTs/d7O0HTsMI8I=; b=jjo c8hbWxoSLBq19+BALOZXD4XRR5/RcLxFworiWShOVx6RjZrjtgdeY+FoQwT31TS2twj3B3OmzpXof gX4jF/xQZAu3dRa3BldaUfyJtKnIot9usnOK7fWVZVWN1/opZXnLQEeSsFs/Vqsaii43ma/7SxydG BU+FWoZ9vGntW1FcathC3+ec4+8PVKy/9MlzqpZnfELtiMVI+75UVoxXPfXJ0JnQ+cgXgByo2SrNE cKQ5uJIGEjZenq50y3pfIbfiDUC9NzJilAEJg45xPyabUL7zbdm/y0QtMYl35QM+MZj8uw9VU8mFn lKm52SzgK+x5VH8vYlTzlF8+L7zRl+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nckAw-00FxYU-B3; Fri, 08 Apr 2022 08:41:02 +0000 Received: from mail-wm1-x34a.google.com ([2a00:1450:4864:20::34a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nckAs-00FxW1-2S for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 08:40:59 +0000 Received: by mail-wm1-x34a.google.com with SMTP id c19-20020a05600c4a1300b0038e6b4a104cso5656871wmp.9 for ; Fri, 08 Apr 2022 01:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=Nppf0IVUcbryIy16xL7a0EyLuMDdlfoY1IOmXXJ7T9g=; b=ClKRdYAX/jJ01QPRYEvw+j1C+Ngfdnh/FySEhtUJUth0UsYl4MAz4K4Xr0OMTyGc3k 0iINv1KnmLz3FlqBSyYCY4Q4lfB6PVeKE4BF+EW1DanrPeJaxsBAC4ImQSgcyxILxnv8 +b/JxzXFDjEIscdb0oDwXCbFzZq7UAojGHNJ2iT9BFqbJ6r58xcuKA79jPf6VK8yJPZb ijC1jrI++c09toxd1XRMToPOC+LW1fhYzR506ItrhJzHr3F03fewK5xZueOUcH5s24UG NrtvXAeJsAIYcEUnCgKY1NDrSEMz2JeL93WRecclM5UwF47qKurB+egvyL9ImA3fsUAd J2YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Nppf0IVUcbryIy16xL7a0EyLuMDdlfoY1IOmXXJ7T9g=; b=MXPcqOL00i90wKFSfN1eSoTV8iuzTYqngzPyZm8Akdo/YbRU9R9Re0G2xDZ/BvYPqd 9TpLJaNChWJARGVGe0jQRauImbIXFePdz8ICJaWjtHdMfw/0+YXiWCGN0sve5ULl9YSV lUdEv3ECU/LlmIp+lQh/55egSrZw8HQq7pCuujMdbrGZzxByqSekSzLejr0F6bfqO0GU 8j/CiKLSi0J5sQIZ7xs911MpGSY+C4D5Dn1Ay217dsaJozF8gzf2zystNUFRdJcHUND6 WU0JeJWABklSU5vuuolAXgy7EJzbhAe4b+2dB29UUltkAGcyabdiG6O3VXdPjQpmAYdZ wZAQ== X-Gm-Message-State: AOAM530eWW+qNaPoodt8He0hcdoQe48b8QMUo/1DaJz29Z7c4zLSPSiJ l6GgTmNz2DObfQkD0/SC6qzJIGpcfQ== X-Google-Smtp-Source: ABdhPJyNZCaPHSyKllqyzN/x+DlMqMHNaN1fxF7n9qRxANWZjGjBn5VEnUWtfciVShfJyNqeBJbN5DEbag== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a05:600c:3d14:b0:38c:9d85:781d with SMTP id bh20-20020a05600c3d1400b0038c9d85781dmr15820986wmb.191.1649407254542; Fri, 08 Apr 2022 01:40:54 -0700 (PDT) Date: Fri, 8 Apr 2022 09:40:49 +0100 Message-Id: <20220408084052.3310931-1-tabba@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog Subject: [PATCH v1 0/3] KVM: arm64: Do not communicate host pmu event changes by accessing hyp data From: Fuad Tabba To: kvmarm@lists.cs.columbia.edu Cc: maz@kernel.org, will@kernel.org, qperret@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, drjones@redhat.com, linux-arm-kernel@lists.infradead.org, tabba@google.com, kernel-team@android.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_014058_167564_FB4CB8F7 X-CRM114-Status: GOOD ( 10.51 ) 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 Hi, This series changes the way KVM communicates host pmu event changes to the hypervisor in nvhe and protected mode. Instead of accessing hyp data directly from the host, the data is passed to hyp via the loaded vcpu. This gives more isolation between the host and the hypervisor, and would allow us to use pmu in protected mode. This series is based on kvmarm/next. Thanks, /fuad Fuad Tabba (3): KVM: arm64: Wrapper for getting pmu_events KVM: arm64: Pass pmu events to hyp via vcpu KVM: arm64: Reenable pmu in Protected Mode arch/arm64/include/asm/kvm_host.h | 8 ++---- arch/arm64/kvm/arm.c | 2 +- arch/arm64/kvm/hyp/nvhe/switch.c | 20 ++++--------- arch/arm64/kvm/pmu-emul.c | 3 +- arch/arm64/kvm/pmu.c | 48 ++++++++++++++++++++----------- include/kvm/arm_pmu.h | 6 ++++ 6 files changed, 47 insertions(+), 40 deletions(-) base-commit: 21ea457842759a236eefed2cfaa8cc7e5dc967a0