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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CF91C433EF for ; Mon, 28 Mar 2022 14:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242083AbiC1O6a (ORCPT ); Mon, 28 Mar 2022 10:58:30 -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-Google-Smtp-Source: ABdhPJwg199yKqqkaDayt2zOIHK98balymLx+ERu/H6cHCxDivkxD8bu0j9ZObYzOA7rAGFhQrJE3w== 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 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