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 X-Spam-Level: X-Spam-Status: No, score=-21.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL 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 99986C48BDF for ; Mon, 14 Jun 2021 02:53:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E74E6134F for ; Mon, 14 Jun 2021 02:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232302AbhFNC4A (ORCPT ); Sun, 13 Jun 2021 22:56:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232295AbhFNC4A (ORCPT ); Sun, 13 Jun 2021 22:56:00 -0400 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D000C061766 for ; Sun, 13 Jun 2021 19:53:58 -0700 (PDT) Received: by mail-pf1-x44a.google.com with SMTP id 197-20020a6218ce0000b02902e9c6393facso7451942pfy.18 for ; Sun, 13 Jun 2021 19:53:58 -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=KV1G/R1zSZnSBOo/d7pZSYrqkdhyWDQYDOJ/O2SNH4I=; b=kDQEan3QS0HPXWg18LBV2T73SvgN3datzG2XhzaYhgiNgGasOyWf+QJstJsHVasjiW IHzlsrAC3QKbwWnobFjsw5ahQCrYI/z+Eo/XT8EEnOSRC18yfBYktADbFbSlLHQ8S6Iw FC1ltJ7DqfFoJxfTz4aD7EnlxksQ3aTdcI+rmyvgj4Idgh7lZb28q+rwNp514TO/722o f1nR3FVWQj/6t9gKh5sJslnMeKt8oNOfdNRsCkZ7xtm1Vvrk1lrdi+9qJSxpgju6r2Gl QRdTdil4be1AJmPnHhHxQ1VFA3c7XtQ0+pzairSTsOJ16N0IKcg1ppAD/RbQQIrPznYI RjGg== 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=KV1G/R1zSZnSBOo/d7pZSYrqkdhyWDQYDOJ/O2SNH4I=; b=Ho9X5vs2YYPF9TJB6O1GsQvba5Mfzomm4Clqp9vvrDvsR2/Sfd0wor9RTEUSK9Occx v/avQFwMvNBANXQAPOQInwoOPmZndLCuV2E1OcubPLEhQQNN3XcJbakUU8AOxytEN0Qv Uj7TdgOCaTWjmS1m64doqIfNvktL0ZENrqJwORrVhancVOFPXlRPS1lK0YGFryQw/kvL O7Smer9khnpg3PwEjcXuX4lgBdHSAZeehpnNhp+3GylzbgE11/Lcni2wUyPqGNgW/y64 304kudF6376MeSJyYw64dvNxMUbmv1o0kCjC0RuV1wuLzeEX2ZlmLBcNIWl1uq7xfajf SJrQ== X-Gm-Message-State: AOAM530si2hPQ0tENERV7zxIdzDd/mESTxrFJ//NcNh/dztBhLclAgO3 FYdrB+gP7MZrQBpz1GJFa3K3Y2wO1h5MY4hWjg== X-Google-Smtp-Source: ABdhPJwRWAstHgo7BVtHEtkFzdNcfslZh+/1MjQ4teaqitIxKeI6I2u0l+pkFtjTmd38Dt65Uu2PIUcSDoZnRDqISg== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:10:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a17:902:9008:b029:119:25dd:8646 with SMTP id a8-20020a1709029008b029011925dd8646mr10986859plp.41.1623639235855; Sun, 13 Jun 2021 19:53:55 -0700 (PDT) Date: Mon, 14 Jun 2021 02:53:47 +0000 Message-Id: <20210614025351.365284-1-jingzhangos@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.272.g935e593368-goog Subject: [PATCH 0/4] Remove duplicated stats definitions for debugfs From: Jing Zhang To: KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Paolo Bonzini , Fuad Tabba Cc: Jing Zhang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org This is a follow-up patchset to binary stats interface patchset as below: https://lore.kernel.org/kvm/20210611124624.1404010-1-jingzhangos@google.com This patchset contains a commit to fix some missing stats and add static check to make sure we have the right number of stats descriptors and add an 'offset' field in stats descriptor to make sure the or order of stats descriptors is not relevant to the order of stats in vm/vcpu stats structure. This will totally avoid the possibility of missing stats and mismatched stats definitions. The binary stats interface defines stats in another array of descriptors, while the original stats debugfs interface uses array of kvm_stats_debugfs item. To remove the duplicated stats definition, this patchset would utilize only the stats descriptors to provide stats information to debugfs interface. This patchset adds a 'mode' flag to support the read/write mode of stats, which can be used to indicate the file permission of debugfs stats files. It removes the usage of kvm_stats_debugfs_item and all the debugfs_entries defined in all archs. The patch also fixes an issue that read only stats could be cleared in global level, though not permitted in VM level in the original debugfs code. --- Jing Zhang (4): KVM: stats: Make sure no missing or mismatched binary stats definition KVM: stats: Use binary stats descriptors for debugfs interface KVM: stats: Update documentation supporting stats mode and offset KVM: selftests: Update binary stats test for stats mode Documentation/virt/kvm/api.rst | 33 +- arch/arm64/kvm/guest.c | 32 +- arch/mips/kvm/mips.c | 99 ++---- arch/powerpc/kvm/book3s.c | 101 ++---- arch/powerpc/kvm/booke.c | 79 ++--- arch/s390/kvm/kvm-s390.c | 307 ++++++------------ arch/x86/kvm/x86.c | 120 +++---- include/linux/kvm_host.h | 186 ++++++----- include/uapi/linux/kvm.h | 11 +- .../selftests/kvm/kvm_binary_stats_test.c | 13 +- virt/kvm/kvm_main.c | 105 ++++-- 11 files changed, 477 insertions(+), 609 deletions(-) base-commit: 39be2e28180a2e87af5fbb8d83643812e1a3b371 -- 2.32.0.272.g935e593368-goog 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 X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 5F49CC49360 for ; Mon, 14 Jun 2021 02:54:04 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id BD68F6134F for ; Mon, 14 Jun 2021 02:54:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD68F6134F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 333D5406E0; Sun, 13 Jun 2021 22:54:03 -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 NpNopxlrXxVB; Sun, 13 Jun 2021 22:54:02 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 261AC49E57; Sun, 13 Jun 2021 22:54:02 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D6287406AD for ; Sun, 13 Jun 2021 22:54:00 -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 W84h+OiB1e2I for ; Sun, 13 Jun 2021 22:53:57 -0400 (EDT) Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id E855340630 for ; Sun, 13 Jun 2021 22:53:56 -0400 (EDT) Received: by mail-pf1-f202.google.com with SMTP id i13-20020aa78b4d0000b02902ea019ef670so7461794pfd.0 for ; Sun, 13 Jun 2021 19:53:56 -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=KV1G/R1zSZnSBOo/d7pZSYrqkdhyWDQYDOJ/O2SNH4I=; b=kDQEan3QS0HPXWg18LBV2T73SvgN3datzG2XhzaYhgiNgGasOyWf+QJstJsHVasjiW IHzlsrAC3QKbwWnobFjsw5ahQCrYI/z+Eo/XT8EEnOSRC18yfBYktADbFbSlLHQ8S6Iw FC1ltJ7DqfFoJxfTz4aD7EnlxksQ3aTdcI+rmyvgj4Idgh7lZb28q+rwNp514TO/722o f1nR3FVWQj/6t9gKh5sJslnMeKt8oNOfdNRsCkZ7xtm1Vvrk1lrdi+9qJSxpgju6r2Gl QRdTdil4be1AJmPnHhHxQ1VFA3c7XtQ0+pzairSTsOJ16N0IKcg1ppAD/RbQQIrPznYI RjGg== 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=KV1G/R1zSZnSBOo/d7pZSYrqkdhyWDQYDOJ/O2SNH4I=; b=SRzbFdPTRx6IA4wXA/c8DfFd9OzDyGWG2WI+IG8ZjBVaH/9Q7Vlyc8AXZ8WB5Emo6p 7vJnBrqRdWeGHyjlni3v13IEktQE95Iz7mWgusLRNosX8Izd7uQ5SF8BeRPC1/hK0Ha/ DpKUl12kAl8YXDm2PM9xH+rSIo6b9gLAzoBRxIEzN8wH95Vb9ykHe2gUZt/DpyJ2uSPO ZG7TokBJ1iTWxJoQBAD1KiyDDCSX50XZ3aFJw5qGemnwpfbpnDN86Ua0V1SUb0kuJaCh yHuxxskFB5kA+XI+zBRnNiLrmYYUqSg+0l7DJO9Q8pFhkzbfYs/37ACw5F3J53iQBxhZ LTHg== X-Gm-Message-State: AOAM530paS7iAExmcgdJR8YxJ0QKtyzhLgqBbJKAut24Whaxih+3ohbs DDgQ9fMzHYlFzYCR6R5v+pN0IgJVYHA84dOtXA== X-Google-Smtp-Source: ABdhPJwRWAstHgo7BVtHEtkFzdNcfslZh+/1MjQ4teaqitIxKeI6I2u0l+pkFtjTmd38Dt65Uu2PIUcSDoZnRDqISg== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:10:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a17:902:9008:b029:119:25dd:8646 with SMTP id a8-20020a1709029008b029011925dd8646mr10986859plp.41.1623639235855; Sun, 13 Jun 2021 19:53:55 -0700 (PDT) Date: Mon, 14 Jun 2021 02:53:47 +0000 Message-Id: <20210614025351.365284-1-jingzhangos@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.272.g935e593368-goog Subject: [PATCH 0/4] Remove duplicated stats definitions for debugfs From: Jing Zhang To: KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Paolo Bonzini , Fuad Tabba 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 This is a follow-up patchset to binary stats interface patchset as below: https://lore.kernel.org/kvm/20210611124624.1404010-1-jingzhangos@google.com This patchset contains a commit to fix some missing stats and add static check to make sure we have the right number of stats descriptors and add an 'offset' field in stats descriptor to make sure the or order of stats descriptors is not relevant to the order of stats in vm/vcpu stats structure. This will totally avoid the possibility of missing stats and mismatched stats definitions. The binary stats interface defines stats in another array of descriptors, while the original stats debugfs interface uses array of kvm_stats_debugfs item. To remove the duplicated stats definition, this patchset would utilize only the stats descriptors to provide stats information to debugfs interface. This patchset adds a 'mode' flag to support the read/write mode of stats, which can be used to indicate the file permission of debugfs stats files. It removes the usage of kvm_stats_debugfs_item and all the debugfs_entries defined in all archs. The patch also fixes an issue that read only stats could be cleared in global level, though not permitted in VM level in the original debugfs code. --- Jing Zhang (4): KVM: stats: Make sure no missing or mismatched binary stats definition KVM: stats: Use binary stats descriptors for debugfs interface KVM: stats: Update documentation supporting stats mode and offset KVM: selftests: Update binary stats test for stats mode Documentation/virt/kvm/api.rst | 33 +- arch/arm64/kvm/guest.c | 32 +- arch/mips/kvm/mips.c | 99 ++---- arch/powerpc/kvm/book3s.c | 101 ++---- arch/powerpc/kvm/booke.c | 79 ++--- arch/s390/kvm/kvm-s390.c | 307 ++++++------------ arch/x86/kvm/x86.c | 120 +++---- include/linux/kvm_host.h | 186 ++++++----- include/uapi/linux/kvm.h | 11 +- .../selftests/kvm/kvm_binary_stats_test.c | 13 +- virt/kvm/kvm_main.c | 105 ++++-- 11 files changed, 477 insertions(+), 609 deletions(-) base-commit: 39be2e28180a2e87af5fbb8d83643812e1a3b371 -- 2.32.0.272.g935e593368-goog _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm