From mboxrd@z Thu Jan 1 00:00:00 1970 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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4562CC433F5 for ; Mon, 9 May 2022 09:55:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 84FC14B2DC; Mon, 9 May 2022 05:55:08 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kQs12---ThE2; Mon, 9 May 2022 05:55:07 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 4B0004B2E0; Mon, 9 May 2022 05:55:07 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 397F04B2A1 for ; Mon, 9 May 2022 05:55:05 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d19lQ8jMfllL for ; Mon, 9 May 2022 05:55:03 -0400 (EDT) Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id B6D084B25F for ; Mon, 9 May 2022 05:55:03 -0400 (EDT) Received: by mail-wm1-f74.google.com with SMTP id v124-20020a1cac82000000b003948b870a8dso1826173wme.2 for ; Mon, 09 May 2022 02:55:03 -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=YW1pGc97VG7+w25sCvimR02dEMnUe2KZ+odKI2ArMeU=; b=RkytZLUFgKmmRLNPqBXtTKaZMdMmNAKYw3+HM0MXx/1yex7gDSCKzNlK0bLsECObX0 N6MpbeP362kVaUSM3R2gLoNKvaXzDUNXtA+AiPd5DcqpgEaTAwJU4cYcc12TBL/vBMBx R7goFNwtZ3cX69jm3LGXlujTcN7YBXY63VjEanK3UYZh49X2ef0k4sYpoHYGAzL9J7fw fTKTBBP1tKlY5SBOBaf0buWK6T2vwyuEQ3cOVC7UvXFhZIdoKaIyKJ+9VaKDAC+naOkB v3JlMDcNxef9+VITS9UHAnTXGpvLjGR4G1sm8uq4TIGL71evdYLXGnijIiUvhTRzV+ja QH9Q== 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=YW1pGc97VG7+w25sCvimR02dEMnUe2KZ+odKI2ArMeU=; b=p7czt0HemkZ4z/dHKLU090LlmIDhAkPCFuQ5bj+iKw/tgEUJGWuo14GfdFqGg7bUx0 +dVY2N9Bo7JYKT4MQ5oJsudsgSgBax3higl4lJOJza4wD1z30TckoNBGQcsoviKi24rb jWa5OO0eFyQ7lrvh1OL4Hki66DScR1JuCuYF8CjZNPPBtQSHH2uCdsQ1jAPQ3kLbFRP9 1rYBkAR+RJVWsmG5bIwbjLwAhNIGMzfQHRA0/dYhcb5Ib3KiN3rHv4XLdi6Hn2GPs7m/ /uzjOYhYi4E4XDtG4Nt5yKE6uFCVVhoNnTQst9Wd5UpUm1QOKHetWY1l1aougKyznlB5 2hQg== X-Gm-Message-State: AOAM530Ftp9nW2duUUOf1fRAgpbvGEdtVyLy4vbzgw6HiqEpE4gy8Dyc qpW2+usd4kJBcJNT823CxG7eHaeTKcDuKoPvIiJYKw4AiRPY96f4N5pJZ6mh0+BNw3L0PMc0Kcu jMt3wFupO930L50253xFZuCqCUgFhxZIFifUFIy6WuiZ9x18zeOb1kQ06xRNsZrhvhOA= X-Google-Smtp-Source: ABdhPJzKAAF6fMy6pXPyySPxGmJhKM8F1rEGVwnvmJoNzqi2QbLfO7t4POKVPmJL/duVvF/fdfPVfZku/A== X-Received: from fuad.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1613]) (user=tabba job=sendgmr) by 2002:a05:600c:2f0f:b0:393:fbd1:cc94 with SMTP id r15-20020a05600c2f0f00b00393fbd1cc94mr15465248wmn.162.1652090102410; Mon, 09 May 2022 02:55:02 -0700 (PDT) Date: Mon, 9 May 2022 09:54:56 +0000 Message-Id: <20220509095500.2408785-1-tabba@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.512.ge40c2bad7a-goog Subject: [PATCH v2 0/4] KVM: arm64: Do not communicate host pmu event changes by accessing hyp data From: Fuad Tabba To: kvmarm@lists.cs.columbia.edu Cc: kernel-team@android.com, maz@kernel.org, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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 provides more isolation between the host and the hypervisor, and allows us to use pmu in protected mode. This series is based on kvmarm/next (8c22fd2d4cfa). Changes since V1 [*]: - Repack struct kvm_pmu to remove all (two) holes - Updating the guest's view of the pmu events before every vcpu run rather than vcpu load to avoid missing updates Thanks, /fuad * https://lore.kernel.org/linux-arm-kernel/20220408084052.3310931-1-tabba@google.com/ Fuad Tabba (4): KVM: arm64: Wrapper for getting pmu_events KVM: arm64: Repack struct kvm_pmu to reduce size 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/hyp/nvhe/switch.c | 20 +++++----------- arch/arm64/kvm/pmu-emul.c | 6 +++-- arch/arm64/kvm/pmu.c | 40 ++++++++++++++++++------------- include/kvm/arm_pmu.h | 10 ++++++-- 5 files changed, 43 insertions(+), 41 deletions(-) base-commit: 8c22fd2d4cfaab2ae3c5859496c894df58ab014b -- 2.36.0.512.ge40c2bad7a-goog _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 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 42331C433F5 for ; Mon, 9 May 2022 09:56:34 +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=nv/P3nrXbqW83PfodWoVr91kGcwxH1TT30Rx8aMjG74=; b=NgU wkIKtEkUDQ9KET9lH3SBpAzd6OYDoPjdZHIp93GEUJzxPXkC1YxGdyZLDwAqQNDcVeQExPDxcB9yJ tHAn/eE4QOjEN5mlqirumU8d96RyofQpdqtHrDl+R5hXa4C8bxVHl+xpwHO+BOnNyqcoOXrS0V4C8 PShovqPlkTWO3z+ntkCYxmJSQGSFZzAOZyxqcA3MWigqy1vkChE+AO/W70/7zu3ahIaHrIXCY9KrN dU2/P6nSZtueFzWRnmCkm0ZnVwMQkb+0xDRkR6+BBUDZQkWo/h5+6/MiPgilDhp7k6P7VG+JjKWMh qrDvQJFwAQ8qRJ9Ulva1kQm84sLYJkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1no06h-00DbLw-5o; Mon, 09 May 2022 09:55:11 +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 1no06c-00DbHx-JR for linux-arm-kernel@lists.infradead.org; Mon, 09 May 2022 09:55:08 +0000 Received: by mail-wm1-x34a.google.com with SMTP id 205-20020a1c02d6000000b003928cd3853aso6723012wmc.9 for ; Mon, 09 May 2022 02:55:03 -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=YW1pGc97VG7+w25sCvimR02dEMnUe2KZ+odKI2ArMeU=; b=RkytZLUFgKmmRLNPqBXtTKaZMdMmNAKYw3+HM0MXx/1yex7gDSCKzNlK0bLsECObX0 N6MpbeP362kVaUSM3R2gLoNKvaXzDUNXtA+AiPd5DcqpgEaTAwJU4cYcc12TBL/vBMBx R7goFNwtZ3cX69jm3LGXlujTcN7YBXY63VjEanK3UYZh49X2ef0k4sYpoHYGAzL9J7fw fTKTBBP1tKlY5SBOBaf0buWK6T2vwyuEQ3cOVC7UvXFhZIdoKaIyKJ+9VaKDAC+naOkB v3JlMDcNxef9+VITS9UHAnTXGpvLjGR4G1sm8uq4TIGL71evdYLXGnijIiUvhTRzV+ja QH9Q== 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=YW1pGc97VG7+w25sCvimR02dEMnUe2KZ+odKI2ArMeU=; b=ArhfafPfuey6/ie/9pPhMD6ixPhW46x8yjRvZpsa7WOCvEiE+xZmtuOKNs1IHMzh62 YGlb9JnXMzW/x3msA+2dmiwvmLP2QqWNoUr5MmOYWNCwaA0LL96V5Ww1oEm/qWwlpGhy ABd/2FTD7/2pRGZBWyvtmhIigzyQemqMhkn72xnBtq7UabLMQxqybwE/D+/G7WpA7tzP W9/XjPx0Q17/6wtCBILp0K1Gr6PRspDFR5pcGAaPECV5B3rvbIdVuf0SuKfIUjurrjBy oKwRFtDyeBUpWOX9WF75hKDD8LyozAKal/epRMFNrefscGEFeAsK7pDLEkVJU4Kk+9wB 0fRQ== X-Gm-Message-State: AOAM532akaPPCi4DrYKyOfs9zBANlJMPcUOMDCxd3zsDI1wSmW4WryPS BEJnfAeefwaD+qdEofwKMMAxNczcSQ== X-Google-Smtp-Source: ABdhPJzKAAF6fMy6pXPyySPxGmJhKM8F1rEGVwnvmJoNzqi2QbLfO7t4POKVPmJL/duVvF/fdfPVfZku/A== X-Received: from fuad.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1613]) (user=tabba job=sendgmr) by 2002:a05:600c:2f0f:b0:393:fbd1:cc94 with SMTP id r15-20020a05600c2f0f00b00393fbd1cc94mr15465248wmn.162.1652090102410; Mon, 09 May 2022 02:55:02 -0700 (PDT) Date: Mon, 9 May 2022 09:54:56 +0000 Message-Id: <20220509095500.2408785-1-tabba@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.512.ge40c2bad7a-goog Subject: [PATCH v2 0/4] 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-20220509_025506_702733_D36AA385 X-CRM114-Status: GOOD ( 10.99 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 provides more isolation between the host and the hypervisor, and allows us to use pmu in protected mode. This series is based on kvmarm/next (8c22fd2d4cfa). Changes since V1 [*]: - Repack struct kvm_pmu to remove all (two) holes - Updating the guest's view of the pmu events before every vcpu run rather than vcpu load to avoid missing updates Thanks, /fuad * https://lore.kernel.org/linux-arm-kernel/20220408084052.3310931-1-tabba@google.com/ Fuad Tabba (4): KVM: arm64: Wrapper for getting pmu_events KVM: arm64: Repack struct kvm_pmu to reduce size 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/hyp/nvhe/switch.c | 20 +++++----------- arch/arm64/kvm/pmu-emul.c | 6 +++-- arch/arm64/kvm/pmu.c | 40 ++++++++++++++++++------------- include/kvm/arm_pmu.h | 10 ++++++-- 5 files changed, 43 insertions(+), 41 deletions(-) base-commit: 8c22fd2d4cfaab2ae3c5859496c894df58ab014b -- 2.36.0.512.ge40c2bad7a-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel