Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp4085219pxb; Tue, 7 Sep 2021 14:31:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe9yiJdjGdt7izrNU7qQL4uegQP+wsczrU+TZwgCpS+CRcZ23y9z6322JUgL/A7wSW4FxF X-Received: by 2002:a17:906:504:: with SMTP id j4mr378467eja.245.1631050312130; Tue, 07 Sep 2021 14:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631050312; cv=none; d=google.com; s=arc-20160816; b=qsrqdcQohs8FGvnNXjidqiUid3lnWbq7BI3mkqWbQHwTch6zlq7FhJWZbquiPJQ9/O 3VaTqo+hUZ8WtNI8BEY5IAshfKQPbV0/MCYudsqOs+8f1U2z8Jpjsgc0vVOTHl2tPNxG HnExlG5+sdRdGC2ljTpSkq0drfcY70zPYqVfNEyGIPpZy4uDEpcrwNxh6isSZqNovh4Q HMk6hqA/9tO74VJ/TUaRnmmhAblubyGAynmecQ6xeEb2B8ND0X6I/Zb79dJFQhH4LEGl 2Lgxl5o3eT0BeeSMJjVtkIMkdF2+MRsMfhL7ECG3l7gj2LZlW3tP4NTmQp9L2KvjlaG7 xVRQ== 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=uQ1QKlOMUxMJjspXpCNHZjX329YTQj9Uc23PyYscxxE=; b=zK5g2ceZLElUUPKnbTf/HmkMAYALDK2qHaKAJsIdeunYpijLkqfLvCGT2UdhZao/xA v0/PPwEuCH0lxWNMuPgpxP/mi+d/2n8xaOeBN9kcIKs73ZGPOc2aSBMREByGCtjEvxPj +0ueZhgKv2OmuCtRadpINb25q1j/gZxwg62Ne10o6JjOQZ0ylyXMTc9ePpyY5PxWG1sQ 26t7wYGSeTrambENbu25opMHfz9rIMrNGVr7O52IgVh7F5kwyD7qUP1kIzkPcMcF2eRW 5pt/iCSm5SZOWjLiBNj8PNH5Zqi64cMtSr2kAPNdTnpYG2xvR7f18a76xrQvnpP5CfqI 4p8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=FbO+pDJX; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si213580edd.40.2021.09.07.14.31.28; Tue, 07 Sep 2021 14:31:52 -0700 (PDT) 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=@linuxfoundation.org header.s=google header.b=FbO+pDJX; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347155AbhIGVbC (ORCPT + 99 others); Tue, 7 Sep 2021 17:31:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348681AbhIGVaF (ORCPT ); Tue, 7 Sep 2021 17:30:05 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4725C06175F for ; Tue, 7 Sep 2021 14:28:54 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id g9so362727ioq.11 for ; Tue, 07 Sep 2021 14:28:54 -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=uQ1QKlOMUxMJjspXpCNHZjX329YTQj9Uc23PyYscxxE=; b=FbO+pDJXDBkBjC1rlKAdQfQgfh08Xa3kp6kg4kr7w0Y5RfqJlJsZJaWhpbBQz8nQqc keSp3KjF48yyjtGYzivaNDwdC5pmNPDMlXgcahzEhY/BtqEdJRNRPSFOYLUsZ498FeFY NucFj/hNQX432SYJKtlG1bl88o+Q4HvaC23zc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=uQ1QKlOMUxMJjspXpCNHZjX329YTQj9Uc23PyYscxxE=; b=dU0n9w2UiKccplJdMAX0p8kq+9VO7RAGct70tb3xqRlvtn1uXaysYq0qbx1W4M3gJU qLpQkYiBdBIbVekJFYilk+S5j5lz6GLugbGroVaXxxZ3FeW1EBuoGZhBxlGItXOEjeFl sOVYvvRSpKEOH7wBLIcZnhKDiRu2LT+hCYbpVOhCoOd8tu0o8GjTX/yZWx8sal2XZTtm UyojUWbaM5JgCvZnGlbhmh2h1iT3/ISmumZ9YxmWfSSjOOLbKACLQ7mDsqE1LZaQqdP6 QrlOT74kutmQC8gu6IVO7FDhpEAb1hE3mSeOwARyetZVUSNdQX8DoyWKGY+tiEaixV97 DyEg== X-Gm-Message-State: AOAM530Uz9e9BmnDjS5ePEGk3nZ5JCKtbwpZflywp6gGNwjuQRW7lFyo FdJh4qUTUoILnxK71CKwgpCB2wNQW8iWdw== X-Received: by 2002:a05:6638:4104:: with SMTP id ay4mr397781jab.10.1631050134251; Tue, 07 Sep 2021 14:28:54 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id m13sm140087ilh.43.2021.09.07.14.28.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 14:28:53 -0700 (PDT) Subject: Re: [PATCH 5/5][RFC] selftests/pfru: add test for Platform Firmware Runtime Update and Telemetry To: Chen Yu , linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Dan Williams , Andy Shevchenko , Aubrey Li , Ashok Raj , Shuah Khan , linux-kselftest@vger.kernel.org, Dou Shengnan , Shuah Khan References: <1cef405de3484eef108251562fbf461bad4294c7.1631025237.git.yu.c.chen@intel.com> From: Shuah Khan Message-ID: <82889db2-1927-582d-c27f-b1f0927ca903@linuxfoundation.org> Date: Tue, 7 Sep 2021 15:28:52 -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: <1cef405de3484eef108251562fbf461bad4294c7.1631025237.git.yu.c.chen@intel.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-kernel@vger.kernel.org On 9/7/21 9:40 AM, Chen Yu wrote: > Introduce a simple test for Platform Firmware Runtime Update and Telemetry > drivers. It is based on ioctl to either update firmware driver or code injection, > and read corresponding PFRU Telemetry log into user space. > A few things to consider and add handling for them in the test. What happens when non-root user runs this test? What happens when the pfru device doesn't exist? [snip] > +} > + > +int main(int argc, char *argv[]) > +{ > + int fd_update, fd_log, fd_capsule; > + struct telem_data_info data_info; > + struct telem_info info; > + struct update_cap_info cap; > + void *addr_map_capsule; > + struct stat st; > + char *log_buf; > + int ret = 0; > + > + parse_options(argc, argv); > + > + fd_log = open("/dev/pfru/telemetry", O_RDWR); > + if (fd_log < 0) { > + perror("Cannot open telemetry device..."); > + return 1; > + } Is this considered an error or unsupported? > + fd_update = open("/dev/pfru/update", O_RDWR); > + if (fd_update < 0) { > + perror("Cannot open code injection device..."); > + return 1; > + } > + Same here. If test is run on platform with pfru test should skip instead of reporting failure/error. thanks, -- Shuah