Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp502303ybf; Sat, 29 Feb 2020 08:29:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwpI17M7PdRjReK6DLyo2rTijoFbKJ23vy33gPjskMWyXnML2fh5VM85YXDJjdy8wI8sw3s X-Received: by 2002:a05:6808:a8a:: with SMTP id q10mr6484454oij.66.1582993771281; Sat, 29 Feb 2020 08:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582993771; cv=none; d=google.com; s=arc-20160816; b=1HvP5WaLRYnSsXAGofu/N/zaARcorHezYI6zHuGqcjaE4SqEAvTZqp1HZmn7OQCvOU SK6idN7ov/EwDqmILJLNB/YS3DO6/th4Q1zkNx0j/xVYcKtwhbSdSeZGfl0E1t7cnNIY Vvd8GJpM9AD1f51W5sMSGHOCJeV1Ni8KbIWmp95CAWZ8VYWbcLEhqD4hm4xvLhZ+utQ1 50Uv1SaRsK1zhdQXCCvaUyVlOv25V179GopVd/tsnQ1hoo0DG3+rIk62BDIxI8K7pPms MIlzczXF5w8IYUFLEB6iW4KIevPdWm/eY+GBLwdVHqus2M+Zt2Qr1X+Y5MfNiN5TJAbj bQRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-version:dlp-reaction:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:to:from; bh=9semepKfPI0L6fyFAv3b7tE9mDevW60JicSmDhGxEEo=; b=i1bdDjtZdKm6wAigXz4afBK7noMFSECKDOwJfpyoOGFfisnWm+945bCa6+2vGEUI4+ tWhx2gnuyUf0AsbV9B1XDwPHrXOy+a1r9uHfJ8VlAh5yXdjsh17F64Tq++ZYhEEefMGD FGQ+/kUiFYpRGNundfpOUJENHC3bj+LouelRBcnGaSbIPDG9cd15HforpP0p1dDDy1fm QYe37Cz9t/4/GcFAsJHRBd6A1d8CGJYqBVC+F9wzhSRCoPISGJczwvB1dbkd6fFjEWf6 ymDo0Jv/htj1nrl3A16x1UNIv+joyrzJ9j27CHQ600R1TSF+mJicfhWJ5Q7klERYS8j1 0PUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j33si3505668ota.21.2020.02.29.08.29.19; Sat, 29 Feb 2020 08:29:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727228AbgB2Q2Q convert rfc822-to-8bit (ORCPT + 99 others); Sat, 29 Feb 2020 11:28:16 -0500 Received: from mga02.intel.com ([134.134.136.20]:31496 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727119AbgB2Q2Q (ORCPT ); Sat, 29 Feb 2020 11:28:16 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Feb 2020 08:28:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,500,1574150400"; d="scan'208";a="437751103" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 29 Feb 2020 08:28:13 -0800 Received: from hasmsx603.ger.corp.intel.com (10.184.107.143) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 29 Feb 2020 08:28:13 -0800 Received: from hasmsx602.ger.corp.intel.com (10.184.107.142) by HASMSX603.ger.corp.intel.com (10.184.107.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 29 Feb 2020 18:28:11 +0200 Received: from hasmsx602.ger.corp.intel.com ([10.184.107.142]) by HASMSX602.ger.corp.intel.com ([10.184.107.142]) with mapi id 15.01.1713.004; Sat, 29 Feb 2020 18:28:11 +0200 From: "Winkler, Tomas" To: Andy Shevchenko , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v1] mei: Don't encourage to use kernel internal types in user code Thread-Topic: [PATCH v1] mei: Don't encourage to use kernel internal types in user code Thread-Index: AQHV7kmoHRGWq8a92EO3ikJkF4xQsagyWSTQ Date: Sat, 29 Feb 2020 16:28:11 +0000 Message-ID: <3bb5abe91919458aa6166eb60d9451ff@intel.com> References: <20200228151328.45062-1-andriy.shevchenko@linux.intel.com> In-Reply-To: <20200228151328.45062-1-andriy.shevchenko@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-originating-ip: [10.184.70.1] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > uuid_le is internal kernel type which shall not be exposed to the user in the first > place. Why, these types are exported via include/uapi/linux/uuid.h In order to mitigate the (wrong) distribution of the use of that type, > switch MEI AMT sample to plain unsigned char array. There was a change to guid_t from uuild_le, anyhow there is much more code except this sample that uses those types. Nack so far. Tomas > > Note, there is no ABI change involved. > > Signed-off-by: Andy Shevchenko > --- > samples/mei/mei-amt-version.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/samples/mei/mei-amt-version.c b/samples/mei/mei-amt-version.c > index 32234481ad7d..458cb6db57c6 100644 > --- a/samples/mei/mei-amt-version.c > +++ b/samples/mei/mei-amt-version.c > @@ -90,7 +90,7 @@ > } while (0) > > struct mei { > - uuid_le guid; > + unsigned char guid[16]; > bool initialized; > bool verbose; > unsigned int buf_size; > @@ -108,7 +108,7 @@ static void mei_deinit(struct mei *cl) > cl->initialized = false; > } > > -static bool mei_init(struct mei *me, const uuid_le *guid, > +static bool mei_init(struct mei *me, const unsigned char *guid, > unsigned char req_protocol_version, bool verbose) { > int result; > @@ -126,7 +126,7 @@ static bool mei_init(struct mei *me, const uuid_le > *guid, > memset(&data, 0, sizeof(data)); > me->initialized = true; > > - memcpy(&data.in_client_uuid, &me->guid, sizeof(me->guid)); > + memcpy(&data.in_client_uuid, me->guid, sizeof(me->guid)); > result = ioctl(me->fd, IOCTL_MEI_CONNECT_CLIENT, &data); > if (result) { > mei_err(me, "IOCTL_MEI_CONNECT_CLIENT receive message. > err=%d\n", result); @@ -270,8 +270,11 @@ struct amt_host_if_resp_header { > unsigned char data[0]; > } __attribute__((packed)); > > -const uuid_le MEI_IAMTHIF = UUID_LE(0x12f80028, 0xb4b7, 0x4b2d, \ > - 0xac, 0xa8, 0x46, 0xe0, 0xff, 0x65, 0x81, > 0x4c); > +/* MEI AMT Interface GUID: 12f80028-b4b7-4b2d-aca8-46e0ff65814c */ > +const unsigned char mei_iamthif[16] = { > + 0x28, 0x00, 0xf8, 0x12, 0xb7, 0xb4, 0x2d, 0x4b, > + 0xac, 0xa8, 0x46, 0xe0, 0xff, 0x65, 0x81, 0x4c, }; > > #define AMT_HOST_IF_CODE_VERSIONS_REQUEST 0x0400001A #define > AMT_HOST_IF_CODE_VERSIONS_RESPONSE 0x0480001A @@ -295,7 +298,7 > @@ static bool amt_host_if_init(struct amt_host_if *acmd, > unsigned long send_timeout, bool verbose) { > acmd->send_timeout = (send_timeout) ? send_timeout : 20000; > - acmd->initialized = mei_init(&acmd->mei_cl, &MEI_IAMTHIF, 0, > verbose); > + acmd->initialized = mei_init(&acmd->mei_cl, mei_iamthif, 0, verbose); > return acmd->initialized; > } > > -- > 2.25.0