Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5214457pxb; Mon, 28 Mar 2022 09:29:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUBuTsERsEP0ZLk3nz9a2glz6RG9V/Fp5jUhts8mC+wwMNgr3N+Q/9229wrVmQk3wRdRZA X-Received: by 2002:a17:90b:3003:b0:1c9:9751:cf9c with SMTP id hg3-20020a17090b300300b001c99751cf9cmr7150pjb.20.1648484940092; Mon, 28 Mar 2022 09:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648484940; cv=none; d=google.com; s=arc-20160816; b=Cw4ThoyRPuSElGW5wgH9I2UzM82kxAUGl+Ei/1J0+3Pl1Xy68LZDRTjwCtgXMfaHTa l1V5JzdiXY6HjvpckfNJJEDowh94aEe0M+VZzvRLejk7MO41UamGD+NXuG3fxtlopZzk bwwi/x4vDMHdHnkhic+UJKaoqCabPSLtJiKBWUPlqG/R+CUlAa/Cz0X+wp0jH2cXnj06 7ZjXQO4GjMestWYeh5EZsgVLUZodaOyViUhCroa2J3MqM9ZNef2Aeb5MMAPVWzPuQt30 fz+3mZVjsFD8usngN5KHgBTU3IuXhyXx/WDY92qxQCUbsLQLLH9YdmbtZOUaf7RS3n1m a67w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=xn5CPRiyBEC8Phc5T9mHlpINr2001VRnlOFT234SvvE=; b=WlMeYyy6OUAoYhOv9Oi2SuLibvA+0gYiyoRP2HvJ2C9AOReaZ1n22bZL4xyu40LhSM ppTtQHhbLwkua7zjNMfVKMNntuofesRJwpqI3GEQthryCjGyR/RViOyQy45jvm5LkcdL 9PzfGO55y/01F8fGYNIlMT6y5/ft0C2lLeDVxWjKFbftM+udL1A0bRbVnQUSLRhqNA9g Su1egHDCj0bN0eUDCrF+pBIXCU2mUtpqdzCztgq+ijYi+nSDS+D8YmoaIM/xjtDK61qS PvqxwBorMZIF2cJgasP++t8KP+ZU+4NgndmJMxRUtGH51kZNMcaeLdmR0b6ThJspJP7L j+IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=DE21WS3U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a656bd3000000b00398604b5c6dsi2603522pgw.828.2022.03.28.09.28.43; Mon, 28 Mar 2022 09:29:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=DE21WS3U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237706AbiC1O62 (ORCPT + 99 others); Mon, 28 Mar 2022 10:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244279AbiC1O6R (ORCPT ); Mon, 28 Mar 2022 10:58:17 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B5E25045F for ; Mon, 28 Mar 2022 07:56:37 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id z6so17399537iot.0 for ; Mon, 28 Mar 2022 07:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xn5CPRiyBEC8Phc5T9mHlpINr2001VRnlOFT234SvvE=; b=DE21WS3Uri002Pr1QReulf3aDz87uH4itFX6ffaeqajeUuiWnbfdGAuv4BH71NOY7k Qz6wU/bEaQkTJNrnAzEEceBGiG+bJ6uT1crz6OQWk3G5vzz8dmH+h3+Zbi2hObLAyEWo y7iaQO1td8tPeaU+flW9Y1u+/HFn7d8lj/1tE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xn5CPRiyBEC8Phc5T9mHlpINr2001VRnlOFT234SvvE=; b=lGUq9KwDh49MGuq072nu7BLgzsHFd3RcfkRsKhYbL0boKSu98VW2I/5Emwy/YRwg02 N1+LMH8/RIT2XuiXDXUswAksiricLshpr5uOsNWn8yRpaTEMVV1LMzytK2HbpqBhFLPD I34qW08eO59EFqep9dOiYHNkbdzA91eRQHIjXzNVrYc/mII0fRFlTCUz0wxnT4u+eMZi Crf4gxawJLIbv9wyFmTdvLBBT209oujWyH0v5riax4jsUB8Xvs1u4ga707pfmdMGGXeL 3XgCyuBAQa5QZA0UVXdWHu4ZvPQqnYtgYFyqp6rmXtFP/zvwW1zpcZQMW0icpv/qglTz t8FA== X-Gm-Message-State: AOAM53398v5kLrKylc+rpwQPGw5R6iChirw6M2I5Y820qrUPyjD6ZJJQ OqXpdO6kNugqxUNZS761VQyyXg== X-Received: by 2002:a6b:5d19:0:b0:645:c7ca:7ca with SMTP id r25-20020a6b5d19000000b00645c7ca07camr6619071iob.104.1648479396566; Mon, 28 Mar 2022 07:56:36 -0700 (PDT) Received: from [192.168.1.128] ([71.205.29.0]) by smtp.gmail.com with ESMTPSA id z17-20020a92da11000000b002c83987c2ffsm7138242ilm.76.2022.03.28.07.56.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Mar 2022 07:56:36 -0700 (PDT) Subject: Re: [PATCH 2/3] cpupower: Introduce a new unit test module for AMD P-State driver To: "Meng, Li (Jassmine)" , "Rafael J . Wysocki" , "Huang, Ray" , "linux-pm@vger.kernel.org" Cc: "Fontenot, Nathan" , "Sharma, Deepak" , "Deucher, Alexander" , "Limonciello, Mario" , "Su, Jinzhou (Joe)" , "Yuan, Perry" , "Du, Xiaojian" , Viresh Kumar , Borislav Petkov , "linux-kernel@vger.kernel.org" , Shuah Khan References: <20220323071502.2674156-1-li.meng@amd.com> <20220323071502.2674156-3-li.meng@amd.com> <4c13d97e-1471-5642-39dd-d381fa441753@linuxfoundation.org> From: Shuah Khan Message-ID: <6f52c49f-10c8-0097-9d0f-0ee99925ad9a@linuxfoundation.org> Date: Mon, 28 Mar 2022 08:56:35 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/28/22 7:57 AM, Meng, Li (Jassmine) wrote: > [AMD Official Use Only] > > Hi Shuah: > > Thank you very much for your valuable suggestions. > We will adapt it to test our AMD P-State driver. But we haven't decided which one to adapt, kunit or kselftest. > > Requirements for our unit test module: > - It can access kernel internal structures and functions which aren't exposed to user space. > - It is implemented through the script trigger CPU benchmark app in conjunction with the kernel module. > > Therefore, next, we will study which method can meet the above requirements. > Can you give us some suggestions? > No top posting please. If you need to access kernel internal structures and functions KUNit is a better choice for you as long as all of the testing can be done in the kernel driver. If kernel internal structures and functions need to be tested from user-space, then a kernel driver test module and a user-space kselftest shell or C program is the approach to take. > -----Original Message----- > From: Shuah Khan > Sent: Wednesday, March 23, 2022 10:15 PM > To: Meng, Li (Jassmine) ; Rafael J . Wysocki ; Huang, Ray ; linux-pm@vger.kernel.org > Cc: Fontenot, Nathan ; Sharma, Deepak ; Deucher, Alexander ; Limonciello, Mario ; Su, Jinzhou (Joe) ; Yuan, Perry ; Du, Xiaojian ; Viresh Kumar ; Borislav Petkov ; linux-kernel@vger.kernel.org; Shuah Khan > Subject: Re: [PATCH 2/3] cpupower: Introduce a new unit test module for AMD P-State driver > > [CAUTION: External Email] > > On 3/23/22 1:15 AM, Meng Li wrote: >> amd-pstate-ut is a kernel module for testing the functions of AMD P-State driver. >> >> It can verify the required conditions and basic functions of AMD >> P-State driver before integration test. >> > > Can you elaborate on the need for a kernel module? It would be helpful to know tne value the mdoule adds and why it is necessary. Include details on why it can't be done as part of the user-space program. > > I am not saying it isn't necssary, I would like to know the reasons before I review the patch. > > Also if this is a driver test, why not use other test frameworks such as kunit or kselftest. cpupower is user-space utility and driver debug code would not belong in here. > thanks, -- Shuah