Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4681618rwb; Mon, 8 Aug 2022 05:31:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR7LcAs9/pAOq9poE0MmpmjBwtfeFq8WRhrSAwfhQ6PgPqj0aC7wqC+kJJAKz3gSd1pjZCUx X-Received: by 2002:a17:907:7396:b0:72d:a080:86a9 with SMTP id er22-20020a170907739600b0072da08086a9mr13439159ejc.49.1659961890570; Mon, 08 Aug 2022 05:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659961890; cv=none; d=google.com; s=arc-20160816; b=LcM7D+eOlTI0RBswoQd4oOKSuUidRNYUSVV29oqth48GoCTybLE7Lf9ZRGjsxM5O2R 1qDGmlwxMuqWai2qW+GQ/2ypsuE6CIvViLOObNLc6mdsRo4y1Ev/0P/5Oc/nGyrzB5od ypJSL7c0pQKfhf/rMk7bANzo55Opu66WfpjVWlWtLP5ZUdVt7D+sBwXw2hLlV9EgKDiV hG2AYR7h2DIbXULlSKQbQ8crcAP1DkQDcKT3/YnlFpzRXLZeTDAi27pZii5Dt78r3vvI wSie7urCtQjPsZN2z4bgi1hWRYlnJR/rMqXJDd1D3FxIO11WOZ+PNCb4KX555S2L2ScT EOIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fu+EGKvg0tvo2gbBuEatwKbSy6SV8sz3wHepu6Tfd8E=; b=EQ8CbUhfvSXcTH8tIEf0ZTalapB9GFQBRRhMTjJWOpSz9ox+kw3RHoWGGUHzvsJVQM vzNA3TMw5jYMPbxLDJxRTJ+Iz/SRxExgYaBmmigiVTGF6Ll3h9OfvyW21XRis60m0SFI L4IunMJrs5lQTE4+1B/dX9qyW1N7cqIHYzJ3qV/Fryb8wRyb6LI41xc8Q/tjEx15CHDS I3I3up2UZQ8ABjFla2JHpJM1YVlfKUFJPbYHSUHTQF9+7gFFwa+9d12JtsYvt1Gbvdsk CnLGvwIt07x4dJl0fzhqaKr08mf7yXUmTcsIuQPqOsd5VkwED4vmOwFa1d45ZF1+olh1 G+2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MCqipCFA; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb14-20020a0564020d0e00b004359f471717si7874833edb.0.2022.08.08.05.31.04; Mon, 08 Aug 2022 05:31:30 -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=@redhat.com header.s=mimecast20190719 header.b=MCqipCFA; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242742AbiHHMFu (ORCPT + 99 others); Mon, 8 Aug 2022 08:05:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242527AbiHHMFi (ORCPT ); Mon, 8 Aug 2022 08:05:38 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B4DB2263D for ; Mon, 8 Aug 2022 05:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659960331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fu+EGKvg0tvo2gbBuEatwKbSy6SV8sz3wHepu6Tfd8E=; b=MCqipCFAMClbMsgkMFT/oCOhBxx3D7GvbqSv17mVRFPSpgjMYPopekUxa1hfHtia+Zgun6 jjJy+2kqLD7rOLCJi3caHVsy2e8fF78Oh9DF8l+7LxXqZT53w9HAxUNUhM/Li0jHuCPt+A maYLeHorPD6KyKTo5kj59tX2DH/F/C0= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-427-8Li_jNhjPEO5bh_ibEG71g-1; Mon, 08 Aug 2022 08:05:30 -0400 X-MC-Unique: 8Li_jNhjPEO5bh_ibEG71g-1 Received: by mail-ed1-f70.google.com with SMTP id n8-20020a05640205c800b00434fb0c150cso5495249edx.19 for ; Mon, 08 Aug 2022 05:05:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fu+EGKvg0tvo2gbBuEatwKbSy6SV8sz3wHepu6Tfd8E=; b=Qwx/av0NSR0SxubIEL6ZXcThpF1nEyBgNOwHb6OqmmcjOCB/WCPQ51kfBkZNrhmGWD DaqqlmH7qXUFOv7NcqKDV1rtk/4rlzoePDuPvAOjnGqKHuqBDignJHcgWzOMMbjyzpi9 12Lrz789oCSLa4Q8LewqTWpI3rYiJ4pbJG49WjF4VoB4MpjegsPToHDqeXbE2BgjLqMl Y0g5ze5yL/9/dRjtZDtAI1FoXl5O0wmj8vB8k7PsGika6wy/E5anJHozyNZzh3vCWCXM tkTBnp8shFI0wYquPvM1A8b5wN9YY69aHg5Z9k0TqVM8wugiwCzcwxodsrx0mb/q4W5Y 0eig== X-Gm-Message-State: ACgBeo1QDaX76AbT7GCx3WK+Z6ywgfspBmtlChP+13UVqHHtcUd8A7Pa gyzgL9JVWiaKdhmuB1EiOGFt4D4FxlP67gKOx/MEp8MusCAKRpwsYdSPTx8/Gh7tVMA/0NdX5QJ hPoayN1fSANbMryY+Y1/0qL1q4BIzI4Viq+wWoa7u X-Received: by 2002:a17:907:2d94:b0:730:cad8:fe80 with SMTP id gt20-20020a1709072d9400b00730cad8fe80mr13670216ejc.232.1659960329671; Mon, 08 Aug 2022 05:05:29 -0700 (PDT) X-Received: by 2002:a17:907:2d94:b0:730:cad8:fe80 with SMTP id gt20-20020a1709072d9400b00730cad8fe80mr13670194ejc.232.1659960329404; Mon, 08 Aug 2022 05:05:29 -0700 (PDT) MIME-Version: 1.0 References: <20220804003323.1441376-1-sathyanarayanan.kuppuswamy@linux.intel.com> <3075adc7-e02e-fcd4-44ef-c4228293f460@linux.intel.com> In-Reply-To: <3075adc7-e02e-fcd4-44ef-c4228293f460@linux.intel.com> From: Wander Lairson Costa Date: Mon, 8 Aug 2022 09:05:18 -0300 Message-ID: Subject: Re: [PATCH v10 1/2] x86/tdx: Add TDX Guest attestation interface driver To: Sathyanarayanan Kuppuswamy Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , "Kirill A . Shutemov" , Tony Luck , Andi Kleen , Kai Huang , Isaku Yamahata , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,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 Fri, Aug 5, 2022 at 6:35 PM Sathyanarayanan Kuppuswamy wrote: > > > > On 8/5/22 12:47 PM, Wander Lairson Costa wrote: > > On Wed, Aug 03, 2022 at 05:33:22PM -0700, Kuppuswamy Sathyanarayanan wrote: > >> +/** > >> + * struct tdx_report_req: Get TDREPORT using REPORTDATA as input. > >> + * > >> + * @subtype : Subtype of TDREPORT (fixed as 0 by TDX Module > >> + * specification, but added a parameter to handle > >> + * future extension). > >> + * @reportdata : User-defined REPORTDATA to be included into > >> + * TDREPORT. Typically it can be some nonce > >> + * provided by attestation service, so the > >> + * generated TDREPORT can be uniquely verified. > >> + * @rpd_len : Length of the REPORTDATA (fixed as 64 bytes by > >> + * the TDX Module specification, but parameter is > >> + * added to handle future extension). > >> + * @tdreport : TDREPORT output from TDCALL[TDG.MR.REPORT]. > >> + * @tdr_len : Length of the TDREPORT (fixed as 1024 bytes by > >> + * the TDX Module specification, but a parameter > >> + * is added to accommodate future extension). > >> + * > >> + * Used in TDX_CMD_GET_REPORT IOCTL request. > >> + */ > >> +struct tdx_report_req { > >> + __u8 subtype; > >> + __u64 reportdata; > >> + __u32 rpd_len; > >> + __u64 tdreport; > >> + __u32 tdr_len; > >> +}; > > > > Any reason why reportdata and tdreport aren't "void *"? > > It is the recommended way to pass the pointers. > > https://docs.kernel.org/driver-api/ioctl.html > Ah, right. In this case, we should use the u64_to_user_ptr() function for pointer conversion as recommended.