Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1177039pxf; Fri, 12 Mar 2021 03:55:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwb+rcayAWE14TtfmXlViJWJ2dPBJqsQj3+OicYXL9TdyMzQBQYhAFzmS1HlmdJoGFDUUNb X-Received: by 2002:a17:907:211b:: with SMTP id qn27mr8070187ejb.203.1615550149178; Fri, 12 Mar 2021 03:55:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615550149; cv=none; d=google.com; s=arc-20160816; b=hwdBj1YEqBp/rhA/lDSmoV1j9otG4LGnHrIYNjM61UUZQuq+c0ztqGNUB5Zc9AWejv 9q1yw9Bk+rCVH5jk3Ad0uPSJvQ7Q7sMeM4lanFyEK/HiUnaTxpLsG+1FGPBGq2ESsap0 WgOH+UU9OOrSNu1k3nByxvBS6Tr5/4SFA5E6Egvje9isd5TbfdsUp0KRMUkX/HcExo8g 2JGwoQjVw1BzxLCrdycSPJhm0IvIzeX2UoFzVPHmqUz/t38iMfQFbmjru+f4OvowfNWE kbbMbRgAQmnPgzcm01OVLUmoYeSVH4Fm7reHcoYPSrYPyMaF3LbB1uX8YKejKQQl5iPs te2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WTtzULOcDADt97XqLhkhLSSVvbCZDZRphO+4a+rZO/I=; b=kBk/NxGHOjkeeHexbDR7UL59XWsyaKt4YmSj9AJgX3XdnetDR7xV4xETPy89nuP0ED d0kz5HWKnc0+gZJIzl046wlIAI1DtcHuKLpwR4oEezC/1heBNQ0F8Dluo7jgwsT4my06 fOaeQBvdDpoCV504sXF/6PS3pGxoGOdrYkJBWgTGOL26VvJqBvtfOs3lsI74dmvGK9Bc u5UxVYew2Yi6kDlVPErdhQvaLj4JS/9YFdChIYHYiYuoWnpn0w+/U0SmajPhpASaLyd0 L2DKTskUfzqEabdG+8trdEw7kjN3fIvclp+EYEbX8pA831X2x6K7u8eS4rGy/QDYidD6 xfWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hJg4JUWS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si3735260ejs.195.2021.03.12.03.55.27; Fri, 12 Mar 2021 03:55:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hJg4JUWS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbhCLLxM (ORCPT + 99 others); Fri, 12 Mar 2021 06:53:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35430 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231750AbhCLLws (ORCPT ); Fri, 12 Mar 2021 06:52:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615549968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WTtzULOcDADt97XqLhkhLSSVvbCZDZRphO+4a+rZO/I=; b=hJg4JUWS9sAuHwWQKI1vMk7eM9yvg3uEi7EaPMmhpXLyXANbXQpn+BtUQpPQJHWHmaA/F5 irCha5GPOesj6FE+TxSTdu2xf+ITNcRX7fSBfcJNil4BrZt4nUJB3xIiZBh9GJhRZlTkeq 9bw1GoqCq60X20r5HXnw0RPActW81Mc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-9juX39EFMvqmolD1dAZi9A-1; Fri, 12 Mar 2021 06:52:46 -0500 X-MC-Unique: 9juX39EFMvqmolD1dAZi9A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6D4F10866A3; Fri, 12 Mar 2021 11:52:44 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0AECA60657; Fri, 12 Mar 2021 11:52:36 +0000 (UTC) Date: Fri, 12 Mar 2021 12:52:28 +0100 From: Andrew Jones To: Yanan Wang Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Ben Gardon , Sean Christopherson , Vitaly Kuznetsov , Peter Xu , Marc Zyngier , Ingo Molnar , Adrian Hunter , Jiri Olsa , Arnaldo Carvalho de Melo , Arnd Bergmann , Michael Kerrisk , Thomas Gleixner , wanghaibin.wang@huawei.com, yezengruan@huawei.com, yuzenghui@huawei.com Subject: Re: [RFC PATCH v4 8/9] KVM: selftests: Adapt vm_userspace_mem_region_add to new helpers Message-ID: <20210312115228.p5l26ukkn2xfwevz@kamzik.brq.redhat.com> References: <20210302125751.19080-1-wangyanan55@huawei.com> <20210302125751.19080-9-wangyanan55@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210302125751.19080-9-wangyanan55@huawei.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 02, 2021 at 08:57:50PM +0800, Yanan Wang wrote: > With VM_MEM_SRC_ANONYMOUS_THP specified in vm_userspace_mem_region_add(), > we have to get the transparent hugepage size for HVA alignment. With the > new helpers, we can use get_backing_src_pagesz() to check whether THP is > configured and then get the exact configured hugepage size. > > As different architectures may have different THP page sizes configured, > this can get the accurate THP page sizes on any platform. > > Signed-off-by: Yanan Wang > Reviewed-by: Ben Gardon > --- > tools/testing/selftests/kvm/lib/kvm_util.c | 28 +++++++--------------- > 1 file changed, 9 insertions(+), 19 deletions(-) > Reviewed-by: Andrew Jones