From patchwork Thu Jul 29 19:56:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 12409561 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 33773C4338F for ; Thu, 29 Jul 2021 19:58:52 +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 F1EFD60720 for ; Thu, 29 Jul 2021 19:58:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F1EFD60720 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=kiqq/ab1bZIKcUtdKbjHEAPnahNjrAaZAd4H5aHXR60=; b=b34 kwIRGtYfyxoTcdYryp39mHTTMKpk727lsx7Xl4q3bDnGTPJP7BFZM6XwcDDmiHjuKEvBRglep2I1C YpaTuWFl8PSbwRMblHMe+08YUNKzwRXewkKrXxy4i2o/Hv1VhLS1pNe78ksvF9Uza+9anqReVNHo7 sFbUQaVASsF9VTN6X6Vt88ubqTNdZL5VVyvDZmTO0aS3FNQ+4eShvZp2JNztERLgu5Qij3BU8vUiC HVuGW6y0bpCn/FESlKiCX6/8qCEUle+4bsGORnebBNdkVNMum5pnHK+dSflsVsEHzreN3S8XZK9Jd c62ZQCFtGtgR1H0S1Gag4d2Ndo91vcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9C9C-005iBJ-4I; Thu, 29 Jul 2021 19:56:50 +0000 Received: from mail-qt1-x84a.google.com ([2607:f8b0:4864:20::84a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9C97-005i8p-54 for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 19:56:46 +0000 Received: by mail-qt1-x84a.google.com with SMTP id m2-20020ac807c20000b0290269bd8044e1so3235391qth.10 for ; Thu, 29 Jul 2021 12:56:43 -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=AybauKNFPo3SsUjhjkW3rvaT9nCugcHZc2DTga5rD+Y=; b=pDjWXDMBoqce2Uo3OFtJqZEiF7+0tG6fbwCkYp/QACm55I5LeZi6KGbTuMrSoe1cpk cKB3vxAThRuWvsRaBsGqDa70j0yjXUL+jIyrVksRTaHkqWIM7fjB12MJIG2DFRppBsET OS+SgpYNdabohr+fskGck9XrjK1I9TB5SGCPbSFDRFCvXaVN/wK3x+926RV2yAWtXm92 2RLXmBhRr2WiNQi5NX86D6YFvwO+mh5X+GudOeiT1cU81ScCAw9pXLpWtAYUlsvlEwny 7LTUROpCB9f6RyfBw38ElnczcBXFnU+VcCD28lRKwo+UoPXYplSCMMbxGekOT21/omPJ aMQw== 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=AybauKNFPo3SsUjhjkW3rvaT9nCugcHZc2DTga5rD+Y=; b=lhC4Ehs+Pk21akd9v56Y55rL+QZ72xtJ5ZE/kG77qKeV5zfRuwksQ7rgBF9+1Pk4Pu PjyYybnvLW9eCBG3/9ozMIfa5EsOFZKIiNmoQ8tMAva+UudWgZAQlMuG7jd4APr72DYK Bd/ZoTaPrdRs68YnP/hFAnLokQtlrb6OsHIApe8I41EDjR0eN79cb6LWjE2t02A581ZD uI3zTXwBs6fa2jQoRUQ8u3c+aHdgiB5F4ttZuEyABbda8CnDl0smLTCa+D7KlLin12zK c5krNPjjETBXreKOSxF5iPyMto+0hWWA8epvBAdBPvJKuyuJS4VfsMFlPdbEKTX3X0Ai 4qWw== X-Gm-Message-State: AOAM530QPF8BSoEJEQ58U8F0ctIJWg4nePlsSILdAeQC8D06RHpPY+iV 9MMAtvTGB8FSzL7IrbPYoCr+2xz6RsY= X-Google-Smtp-Source: ABdhPJwU8WQNmo1zhH1aQzP5f0AXaA7UbdvB2nIHEOEw8XVOvuCKD7pK9ur3hioyHd+oC0Rya2glIwWuYlI= X-Received: from oupton.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:404]) (user=oupton job=sendgmr) by 2002:ad4:5c49:: with SMTP id a9mr6517273qva.27.1627588602907; Thu, 29 Jul 2021 12:56:42 -0700 (PDT) Date: Thu, 29 Jul 2021 19:56:29 +0000 Message-Id: <20210729195632.489978-1-oupton@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [PATCH 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_125645_252945_4B072F0E X-CRM114-Status: GOOD ( 11.53 ) 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") 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 | 3 ++- include/linux/entry-kvm.h | 6 +++++- 5 files changed, 23 insertions(+), 14 deletions(-)