From patchwork Thu Jul 29 22:09:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 12409951 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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,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 5C24BC4338F for ; Thu, 29 Jul 2021 22:11:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 21BE8604DB for ; Thu, 29 Jul 2021 22:11:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 21BE8604DB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=Biizbk3xI3u7+oQJ6CHlvJkK1PK6rSIy+0aWbRHO/2k=; b=XYx c/hDiRVxQ7uOvHZygRAWvWcZ6IdVUHTQuAdXO5Z58R9JDJ+zMpzk9wFoYRWjhXXDmzjjiBbQICIw4 cRjd+UvEs1SDdgYwCz9nJ+NCwO9TPyLAQ7o4iqciYlcw/e8dO/VLOwtZx9x+9laHuSWboTUgSgdXR 7p68mSrPAfUn1p3iSs3nwDq3cReqYd1CqoajAnrJlfe6VHTr5LKTeEjivwCl5iyu5QgEhQmR6EcNV JB8yusWFzDpd+9c8CbkdbcrbBI9YOmR5y5BljJsnSnRml7apsWnILY8wXoyz7/kVLXSatF7Q8rM/B Rk3L3jW9T9/bFv66eU65pbeZ21fL/oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9EEA-006BQf-3L; Thu, 29 Jul 2021 22:10:06 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9EDa-006BKk-1h for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 22:09:32 +0000 Received: by mail-yb1-xb49.google.com with SMTP id p71-20020a25424a0000b029056092741626so8099257yba.19 for ; Thu, 29 Jul 2021 15:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=Y1FozKgR1OGtch4GBgu/T53ekVcZG3++UIur3cT4k1g=; b=KCVCCjvfgPmT2bb35uWb5YZDXm5qgf3gJxeSBmXlrVF1vncKlfaP8Wzzg1bfZi5Nkr T8v+aNTulTf6jbCZMm835Z7w86SM4E2eEqKDSBtbNqNvwJqd1ScPCOp0Ppmlru9mdffm 2PjMw4XxdccM8Am6I5NOcHkW9SIi6d5kd/NOAMDmNU4AT0AtBagT7M03wnlA7CmKb395 D5Bhao5isUgygnfi8Jw5PgpS4XM74rDfLMjm2dFm0CYi7EcZcLhU7AzADCylciD28fEy aVUkLMiMdzIfZcktnJjBcPjav6cUYulnE9PWO19nsbfIJ9H+tszoSYfrdd5VQDoykvdb fBBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Y1FozKgR1OGtch4GBgu/T53ekVcZG3++UIur3cT4k1g=; b=Lh8RDCMvL+mf+ipeCgmXNF+nKqHctbhapwC8MFL+eWtfITc+2jF7mWHw7MwM4zZuSJ CAU8A08QBEa3gVnPfm5zWXU1dRBEKDOY2CXUPFFrC92TKq3grT8Y2WxqjjONT8RMrlTA RapULYq9vAVlkNfbC8zkR9Kq85d+9Aloflv8Ly+8R5JycJb+tdwEJ3PUO2TIPcaQ0B6i OU4GKTVdfZMNJzCsh16cuizi0eEgQQixAMlO6itZMaHhJc0ho3qduZv6KLMR/l0FVebo JsdXgu0Hs58Giype4PiGoOCiIy4hQIlLGzWD0uUsQA/Wye0dl9bhwGBi635f3Kuad/kr r5Qg== X-Gm-Message-State: AOAM531pYVqOm6P81NTbKPSmp1RH7zAWQ4js0YmAgG9bsmJ1qIhEJd5H AggW5SjEeb5g87GWk8ZMfBWX5PwjdnE= X-Google-Smtp-Source: ABdhPJweYbkW6ntZKyVJeSlR2LDQ77+i9PG1QNakarKHqxX2ZyAz6vYGDXkzuixuoiNM0eHVpr8gTAurhys= X-Received: from oupton.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:404]) (user=oupton job=sendgmr) by 2002:a25:3503:: with SMTP id c3mr7258148yba.316.1627596565260; Thu, 29 Jul 2021 15:09:25 -0700 (PDT) Date: Thu, 29 Jul 2021 22:09:13 +0000 Message-Id: <20210729220916.1672875-1-oupton@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [PATCH v2 0/3] KVM: arm64: Use generic guest entry infrastructure From: Oliver Upton To: kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Thomas Gleixner , Peter Zijlstra , Andy Lutomirski , linux-arm-kernel@lists.infradead.org, Peter Shier , Shakeel Butt , Guangyu Shi , Oliver Upton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_150930_136796_E1A7B835 X-CRM114-Status: GOOD ( 11.52 ) 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 The arm64 kernel doesn't yet support the full generic entry infrastructure. That being said, KVM/arm64 doesn't properly handle TIF_NOTIFY_RESUME and could pick this up by switching to the generic guest entry infrasturture. Patch 1 adds a missing vCPU stat to ARM64 to record the number of signal exits to userspace. Patch 2 unhitches entry-kvm from entry-generic, as ARM64 doesn't currently support the generic infrastructure. Patch 3 replaces the open-coded entry handling with the generic xfer function. This series was tested on an Ampere Mt. Jade reference system. The series cleanly applies to kvm/queue (note that this is deliberate as the generic kvm stats patches have not yet propagated to kvm-arm/queue) at the following commit: 8ad5e63649ff ("KVM: Don't take mmu_lock for range invalidation unless necessary") v1 -> v2: - Address Jing's comment - Carry Jing's r-b tag v1: http://lore.kernel.org/r/20210729195632.489978-1-oupton@google.com Oliver Upton (3): KVM: arm64: Record number of signal exits as a vCPU stat entry: KVM: Allow use of generic KVM entry w/o full generic support KVM: arm64: Use generic KVM xfer to guest work function arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/Kconfig | 1 + arch/arm64/kvm/arm.c | 26 ++++++++++++++------------ arch/arm64/kvm/guest.c | 1 + include/linux/entry-kvm.h | 6 +++++- 5 files changed, 22 insertions(+), 13 deletions(-)