Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3013448pxb; Mon, 1 Nov 2021 06:21:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynNxE9oIF9vSFn/FHz/vIY+GXiVW86TKe1O43vZ2zo4n+kaSiVd/L0t24l+9uZl983mz2q X-Received: by 2002:a17:907:7213:: with SMTP id dr19mr19440069ejc.157.1635772896194; Mon, 01 Nov 2021 06:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635772896; cv=none; d=google.com; s=arc-20160816; b=Vnady8r2KCFunPjS8Viz2IJb5zUgWddzWUHsLc10fk9qgVfM20/ZUfXXGJLMzcH9mA a5K3nSrc80ej7Nqp0nxLzKHW2PDu1PbZvO9hKQhbjSume68A4VIXjEPgNT8s9erMU5zo kthjz7uf1GsfZMPS5b9sSRbnrOoo7Zf1HLblo0C+EpA4+tfNFcFFgn6iPZ1DLG6zFUa2 991FC8N8e2/aKStNNw4AnS7ApbnkguRkPKHAbTE7Kas003pEYTN8M2ajYRfCg/YCtx2G BIp8oC2qMKcudpRm7FXX0ZTUNyPWVz0k86T1Ccc7XgT80KfxDWxG6r14B+OOa619hq8s DI/A== 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=bHFPp8WgKAkDwRI5N8HKn8lJykxg+F3ABKA9/AsxKjI=; b=XEpK/tELSud7TqyWtjESXHQsfTmW9vzNW7+2UBlUqNdm2CGghqKvEhm4Us3UJDpELP ubT0/RhTwqsAJgux9nImZCJafQmHCxPODd1z7ywpLjY2gsByO6wLEOe3FqDlA8Hvi5J1 IiGdX+Bn/0nRfFjcpYpw/bC2vbYksuoJMBP70Uj1Pa1QVTYDa1vQPWFL4eYS1llstff5 I1iJDPakh0hWToW7wbw8llWwY62O58w49yk8VIOUJ0YTv4FpZkMqPj768ZyhgCDVPC9v /RT0KhOKUaiwgWekf5ikU9FmkIigTHLa5h0J7ijLp38BurGppjaqkNkYqsBWkVlsEWjW Wirw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z+DgNYc9; 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 g16si7956511ejf.471.2021.11.01.06.21.10; Mon, 01 Nov 2021 06:21:36 -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=korg header.b=Z+DgNYc9; 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 S232250AbhKANTT (ORCPT + 99 others); Mon, 1 Nov 2021 09:19:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:48138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230177AbhKANTS (ORCPT ); Mon, 1 Nov 2021 09:19:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7113460FE8; Mon, 1 Nov 2021 13:16:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635772605; bh=kOpBDDGaH87nGht/vlIlCbJDUyolK3Z7JgS92RWh5Tw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z+DgNYc9diT2vkpi1Y+yP6P0lu3xCwgGiL0ep5s0DTxWNiUAEFfOx8TbX2/hcBVnB k7zHSr0LC0UcvZ39VjZx6M6nNfXPO+OWi4819oBV9DZWjc5++7Yk9pMGHKq21mVrzl 11vBpz2AZHBgpJ5K8fapgHh4XXe7DlyFahZTGBxQ= Date: Mon, 1 Nov 2021 14:16:41 +0100 From: Greg Kroah-Hartman To: Chen Yu Cc: Andy Shevchenko , linux-acpi@vger.kernel.org, "Rafael J. Wysocki" , Ard Biesheuvel , Len Brown , Ashok Raj , Mike Rapoport , Aubrey Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 2/4] drivers/acpi: Introduce Platform Firmware Runtime Update device driver Message-ID: References: <20211101093320.GA18982@chenyu5-mobl1> <20211101131434.GA32880@chenyu5-mobl1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211101131434.GA32880@chenyu5-mobl1> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 01, 2021 at 09:14:34PM +0800, Chen Yu wrote: > On Mon, Nov 01, 2021 at 01:21:36PM +0200, Andy Shevchenko wrote: > > On Mon, Nov 01, 2021 at 05:33:20PM +0800, Chen Yu wrote: > > > On Wed, Oct 27, 2021 at 01:20:33PM +0300, Andy Shevchenko wrote: > > > > On Wed, Oct 27, 2021 at 03:07:51PM +0800, Chen Yu wrote: > > > > ... > > > > > > > + guid_t *image_type_id = &img_hdr->image_type_id; > > > > > > > > efi_guid_t ? > > > > > > > efi_guid_t is a 32-bit aligned guid_t, which is for the case when > > > efi_guid_t* arguments are 32-bit aligned. And it is for 32-bit ARM. > > > Since this code injection is only for 64-bit, the guid is not required > > > to be strictly 32-bit aligned I suppose? > > > > But the type of that member may not be guid_t. So, I expect not to see guid_t > > at all here or as a internal member with the export/import GUID API in place. > > > > See, for example > > d1c6e08e7503 ("libnvdimm/labels: Add uuid helpers") > > > 8b03aa0e0e5a ("libnvdimm/labels: Add type-guid helpers") I suppose. Do you > mean, since the label is not delcared as uuid type, then need to treat the > data region as a uuid. But it is actually not a formal 'uuid' type, so uuid_t > is not applicable here. And this also applys to the case in this patch? > > ... > > > > > > > + ret = guid_parse(PFRU_UUID, &pfru_dev->uuid); > > > > > > > + ret = guid_parse(PFRU_CODE_INJ_UUID, &pfru_dev->code_uuid); > > > > > > > + ret = guid_parse(PFRU_DRV_UPDATE_UUID, &pfru_dev->drv_uuid); > > > > > > Why do you need to keep zillions of copies of the data which seems > > > > is not going to be changed? Three global variables should be enough, > > > > no? > > > > > > > The guid information is embedded in each pfru_dev and only calculated > > > once during probe. I thought people try to avoid using global variables > > > if possible? > > > > Use your common sense. You might have a lot of data duplication, > > and this data is definitely not something that needs any kind of > > serialization / personification / etc. > > > Ok, I'll switch to global variables in next version. Wait, no, why? Keep them per-device unless you can somehow be guaranteed there will never be more than one of these ACPI devices in a system. It's simpler this way, no need to worry about global state at all. thanks, greg k-h