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=-7.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 824BAC49EA2 for ; Mon, 21 Jun 2021 16:48:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 708DC60FDC for ; Mon, 21 Jun 2021 16:48:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232484AbhFUQu5 (ORCPT ); Mon, 21 Jun 2021 12:50:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30649 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232235AbhFUQtF (ORCPT ); Mon, 21 Jun 2021 12:49:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624294010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L4VUJXelLg7ZDO7Fl2bwXBKFHPY2LaqxWaruX+3FsXM=; b=f2uaw0H11sSKRzF71e+2BnzTpOuZ3vpFQDGYuIHatLjr9ZpjLbrIeiEnMw54CJAivEpBLt 7j99jhflwXwpdbfgVagAW9n/kb6IWhHcaCLktzsiVLoYZ5EWPvRy/ysNNtyx8KJhIMlMD2 zvLvBCSJ80AfmvsXLyBqeInBP7Syy4M= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-564-bQjcNyTANtOpR_TnIk9PYg-1; Mon, 21 Jun 2021 12:46:49 -0400 X-MC-Unique: bQjcNyTANtOpR_TnIk9PYg-1 Received: by mail-wm1-f70.google.com with SMTP id j18-20020a05600c1c12b02901dce930b374so221967wms.2 for ; Mon, 21 Jun 2021 09:46:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=L4VUJXelLg7ZDO7Fl2bwXBKFHPY2LaqxWaruX+3FsXM=; b=cEzoeg9p/Q7W8RL5a2t514IprtUL2hsswN7HLLi8Fi9unWeteuecdwmIhFDvYB3BrJ 0w5+VfZmBPL/oq9+Bw9rD8saw/R0KZC6gXOQeUIPi+U4gAa2fRK87f3EQwzA8cqFkZM1 AvYAENWHvqPeC4n/O7NUPTUyCuhTg93YJ7hxclFgfspc72o2bulxPHQplih/J1ek4N2U wYFA/QUxwbmZRsY1zxcj2zR1JHhunpybL0aYaa67QVJmfPaWp45QxLou2dyjZYuraPA5 9OCnfPgbxxArel6r1hk7jSnnD/u8lDoFcE/N0alYewpZ+b11nOAY/CEa7eB+UrWd+gb9 xveQ== X-Gm-Message-State: AOAM532KXXyLd49iYk0KJJOqscJJvV+LeYR8XSzZtxgpMJ6pE3eqTtJQ Y2Ub2QTJgrQ3WJuj43uSuSZ6YM9fJNkkgn70J1OOMmgRmWHaypXASOji7DD5rXhHJGW+Emx1R5D ua+EBJWHHngivsQtvgjvEYw== X-Received: by 2002:a1c:9a4b:: with SMTP id c72mr28275160wme.103.1624294008272; Mon, 21 Jun 2021 09:46:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFHH5+7/D7vjINDjeXsFlLSfp/qFoecAKuxzghrdq/ZeJStCXx4u1i/d7WztJFV77gL5prbw== X-Received: by 2002:a1c:9a4b:: with SMTP id c72mr28275119wme.103.1624294008036; Mon, 21 Jun 2021 09:46:48 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id a24sm16809099wmj.30.2021.06.21.09.46.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Jun 2021 09:46:47 -0700 (PDT) Subject: Re: [PATCH v12 4/7] KVM: stats: Support binary stats retrieval for a VCPU To: Jing Zhang , KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Linuxkselftest , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Will Deacon , Huacai Chen , Aleksandar Markovic , Thomas Bogendoerfer , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Peter Shier , Oliver Upton , David Rientjes , Emanuele Giuseppe Esposito , David Matlack , Ricardo Koller , Krish Sadhukhan , Fuad Tabba , Greg KH References: <20210618222709.1858088-1-jingzhangos@google.com> <20210618222709.1858088-5-jingzhangos@google.com> From: Paolo Bonzini Message-ID: Date: Mon, 21 Jun 2021 18:46:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210618222709.1858088-5-jingzhangos@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On 19/06/21 00:27, Jing Zhang wrote: > + struct kvm_vcpu_stat stat; > struct kvm_dirty_ring dirty_ring; > + char stats_id[KVM_STATS_NAME_SIZE]; I think stats_id needs to be part of the usercopy region too. You can also use offsetofend(struct kvm_vcpu, stats_id) - offsetof(struct kvm_vcpu, arch) to compute the size. Paolo 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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 3AB24C48BC2 for ; Mon, 21 Jun 2021 16:46:55 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id B26A96113E for ; Mon, 21 Jun 2021 16:46:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B26A96113E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 2FD774019D; Mon, 21 Jun 2021 12:46:54 -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=@redhat.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 yldZPR4Tl+a5; Mon, 21 Jun 2021 12:46:52 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id EB07B40623; Mon, 21 Jun 2021 12:46:52 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F1423405EE for ; Mon, 21 Jun 2021 12:46:51 -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 AcZ+lkUiepHL for ; Mon, 21 Jun 2021 12:46:50 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id ED4A44019D for ; Mon, 21 Jun 2021 12:46:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624294010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L4VUJXelLg7ZDO7Fl2bwXBKFHPY2LaqxWaruX+3FsXM=; b=f2uaw0H11sSKRzF71e+2BnzTpOuZ3vpFQDGYuIHatLjr9ZpjLbrIeiEnMw54CJAivEpBLt 7j99jhflwXwpdbfgVagAW9n/kb6IWhHcaCLktzsiVLoYZ5EWPvRy/ysNNtyx8KJhIMlMD2 zvLvBCSJ80AfmvsXLyBqeInBP7Syy4M= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-DMIrobYvPxalMHUOjStThA-1; Mon, 21 Jun 2021 12:46:49 -0400 X-MC-Unique: DMIrobYvPxalMHUOjStThA-1 Received: by mail-wm1-f71.google.com with SMTP id u17-20020a05600c19d1b02901af4c4deac5so213401wmq.7 for ; Mon, 21 Jun 2021 09:46:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=L4VUJXelLg7ZDO7Fl2bwXBKFHPY2LaqxWaruX+3FsXM=; b=pR4PK/58ymLfbalrBmGeiAm6F748MXcviQl4i87EbnauD5Lj5TfDsPtUmTlG89/zHq w88EKdbSaXJy/sETbA1iwluAulj+KbqZ5TtGCquxbL2jeeTfREpigaM9onJlzrX0qW7K kkIalrnlER+TJkiil9++nxPughScRItIXJ3Vg7O08R2JRnA4tg8ylAHF73y8uzgVVecL OQ4Ohu6FleB9ip4DSzTL+eoIJlfYd1/vbIH4u+jnvxB5zyTaQsdNYGnaTH/sIYIG4uMl fiyXsA9dwt/3i0xaodD66e3Wj2dIrhDreLytxhiMu805/gQaGJ9IAjzvvhFeV/xDxfES nBOQ== X-Gm-Message-State: AOAM532mdFxQyvno8LAMUKl5sBsFik5naHNiPkOoLHkgDW6eLQQHOQU0 0trWBDtH5RtPhYd8WybrTou2DnCuH+WFKnDMIcBP6z4nW134Wxo2Ma5US3S1E0w7e3uyPTxdT3U ExtmVA6pMKpHOmU63pIco0qlS X-Received: by 2002:a1c:9a4b:: with SMTP id c72mr28275175wme.103.1624294008280; Mon, 21 Jun 2021 09:46:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFHH5+7/D7vjINDjeXsFlLSfp/qFoecAKuxzghrdq/ZeJStCXx4u1i/d7WztJFV77gL5prbw== X-Received: by 2002:a1c:9a4b:: with SMTP id c72mr28275119wme.103.1624294008036; Mon, 21 Jun 2021 09:46:48 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id a24sm16809099wmj.30.2021.06.21.09.46.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Jun 2021 09:46:47 -0700 (PDT) Subject: Re: [PATCH v12 4/7] KVM: stats: Support binary stats retrieval for a VCPU To: Jing Zhang , KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Linuxkselftest , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Will Deacon , Huacai Chen , Aleksandar Markovic , Thomas Bogendoerfer , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Peter Shier , Oliver Upton , David Rientjes , Emanuele Giuseppe Esposito , David Matlack , Ricardo Koller , Krish Sadhukhan , Fuad Tabba , Greg KH References: <20210618222709.1858088-1-jingzhangos@google.com> <20210618222709.1858088-5-jingzhangos@google.com> From: Paolo Bonzini Message-ID: Date: Mon, 21 Jun 2021 18:46:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210618222709.1858088-5-jingzhangos@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On 19/06/21 00:27, Jing Zhang wrote: > + struct kvm_vcpu_stat stat; > struct kvm_dirty_ring dirty_ring; > + char stats_id[KVM_STATS_NAME_SIZE]; I think stats_id needs to be part of the usercopy region too. You can also use offsetofend(struct kvm_vcpu, stats_id) - offsetof(struct kvm_vcpu, arch) to compute the size. Paolo _______________________________________________ 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 From: Paolo Bonzini Date: Mon, 21 Jun 2021 16:46:45 +0000 Subject: Re: [PATCH v12 4/7] KVM: stats: Support binary stats retrieval for a VCPU Message-Id: List-Id: References: <20210618222709.1858088-1-jingzhangos@google.com> <20210618222709.1858088-5-jingzhangos@google.com> In-Reply-To: <20210618222709.1858088-5-jingzhangos@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jing Zhang , KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Linuxkselftest , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Will Deacon , Huacai Chen , Aleksandar Markovic , Thomas Bogendoerfer , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Peter Shier , Oliver Upton , David Rientjes , Emanuele Giuseppe Esposito , David Matlack , Ricardo Koller , Krish Sadhukhan , Fuad Tabba , Greg KH On 19/06/21 00:27, Jing Zhang wrote: > + struct kvm_vcpu_stat stat; > struct kvm_dirty_ring dirty_ring; > + char stats_id[KVM_STATS_NAME_SIZE]; I think stats_id needs to be part of the usercopy region too. You can also use offsetofend(struct kvm_vcpu, stats_id) - offsetof(struct kvm_vcpu, arch) to compute the size. Paolo