From patchwork Fri Oct 1 05:02:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515019 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp455126jaf; Thu, 30 Sep 2021 22:10:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuT4PjXolvstDb0RH8mFXrHC5gJmIbc86CmBgBtgEX4YubGko/Yf+lUuL2hwYWxdmtY3+F X-Received: by 2002:a17:906:6403:: with SMTP id d3mr3873946ejm.37.1633065038952; Thu, 30 Sep 2021 22:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633065038; cv=none; d=google.com; s=arc-20160816; b=fRTZd5+VC/a6momnrhrnRAYKoqme7sFBzu65wTjrYtHtPK9B3MagzroPA4GXW+/V5a zwMz9bTzFiZN6054kKMBGkAnsTX1vhpw/chaj8HhDFwBcr7K9usHj4aS0TLkyaNG1YsT 8HXU4v1A7Cn8+s6jF/H7P2+rSN8RfP3Z7bU8ywC7E4ggLicl5k92CSmEtn0qcYdoEbaD tNen7BeUpdMU5+klu1OUKb4PpVke/zt8/V4zEipIMOmoITO0ft4ezRUHrIGmAdf2EeVU wij1rbOSXB/O9XIWJCd9jDe+hnM8spSL8Le30sMNKxTah5rb3YymLKEjTC73iQLXHRPG FWUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+HwM0pXE5H//wzI2I7f49WFGakpJIBZDqVibn5c+sFg=; b=TS0LCwNYm1/qRfVyxM1H/Um24ef2mKwFUfN2/LRMy9mtxCiUJS3P+5g2srygeRbPXI VHPDpJcYCDTTyAWjSZ/HiFad/QQbr7B3PkqLHIk9I0KAh9w1ij0kSdUVPLqCs7K+VF7e pmXOFbnsGCF0a6YVTltUfQv3nlnPOvR4TBxYohi7LWaoTuznAzJUd3AuKL3A2479G7pN m4fhBF9Nr1Ll9TgzZA0tWfc5F9kc0JA7KzUXOEM0Itn/gvD/n6qPgF4UJovlvOZe6vsI vl+7VN8q6uoBPeb5PGMg0XKh2OYgbdWBAk8Je+5w0jGL1EPA9P5PsbOk20Ty9ngjoCQt dZ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U0nFU2X0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id p23si6999690edw.135.2021.09.30.22.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:10:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U0nFU2X0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A84E834DA; Fri, 1 Oct 2021 07:06:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="U0nFU2X0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C7BBF83490; Fri, 1 Oct 2021 07:05:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1707E8349C for ; Fri, 1 Oct 2021 07:05:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x1034.google.com with SMTP id d13-20020a17090ad3cd00b0019e746f7bd4so8417504pjw.0 for ; Thu, 30 Sep 2021 22:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+HwM0pXE5H//wzI2I7f49WFGakpJIBZDqVibn5c+sFg=; b=U0nFU2X08zEvt1cBc+kE935yEiGTAy/xCV6egBMujLoQ4zP47venDK28afa+S+DgtF pSIAHm4XAvqsANrV/X5VUIXROMW3Kw23qjJoH6qoRqIKhfPPrFl33YZlf13Fac8uWZLu MeWXk6DzIcy6qWNtuHr7DSdH0vF+stSsR6TMMBUj/P9Rc47BfDP1h6wdVRpVm+Z3cf10 2ZKKRUxQPQiY3WWa11/VWGaxXjhYTbfltqL2M7Hp6XWWcoLBFuA1WWBeiRDLrVfj6N6B dXTVTUHMyBWXMagBcVZAuyr6krG5eJJ/jQiSdBjwtzxLyrRy9LxGfrwAf63DgV4BAr3U xKUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+HwM0pXE5H//wzI2I7f49WFGakpJIBZDqVibn5c+sFg=; b=Fp6R3FAIlaxmfCdOpdCe9lF+P7agl6kAXn57DtdNvfHZIpqBWqOHXPoXEhKeYG+pWc KdfcvBbPSAXVn5Krre8cjm2o/hD68eIbdIfJQREyjbJ7wOMmOwgtAMDAgJQ6nc+k8goi iZ3kFhS0ehZvn6xaoQTrNLN6fqrqgXXxN16H/Ryfv4Ejq6Yi6qGtR2YIPKHSOsS10XBt PJGVFd2zU8VDiTkAfmH5RvvSpRdr8hNMdYzjV6pD2pZSutQhj+1tOL5vV+KvQpUC8nXO w5O5iANyKJ0czXXRZA6e4zSBz0pmBZZ8Pu2epOYNCLm/ekm8k7B1rDuLaiT9r0ED/6bo zTCw== X-Gm-Message-State: AOAM533QwlzeGlnGgY7ojoHmosB0LuDy1cYo7+FRvH58WBiK65YGN9tf n/gYjlcUzyEKv7NKvk9QqdyDqw== X-Received: by 2002:a17:902:b94b:b0:13d:b1af:f9d4 with SMTP id h11-20020a170902b94b00b0013db1aff9d4mr9254499pls.0.1633064714221; Thu, 30 Sep 2021 22:05:14 -0700 (PDT) Received: from localhost.localdomain (122-100-26-52m5.mineo.jp. [122.100.26.52]) by smtp.gmail.com with ESMTPSA id z8sm4615113pgc.53.2021.09.30.22.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:05:13 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [RFC 21/22] efi_selftest: block device: adjust dp for a test disk Date: Fri, 1 Oct 2021 14:02:26 +0900 Message-Id: <20211001050228.55183-43-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001050228.55183-1-takahiro.akashi@linaro.org> References: <20211001050228.55183-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Due to efi_disk-dm integration, the resultant device path for a test disk got slightly changed, with efi_root contained as the first component. Signed-off-by: AKASHI Takahiro --- lib/efi_selftest/efi_selftest_block_device.c | 26 ++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) -- 2.33.0 diff --git a/lib/efi_selftest/efi_selftest_block_device.c b/lib/efi_selftest/efi_selftest_block_device.c index 15f03751ac87..cac76249e6b4 100644 --- a/lib/efi_selftest/efi_selftest_block_device.c +++ b/lib/efi_selftest/efi_selftest_block_device.c @@ -30,6 +30,9 @@ static const efi_guid_t guid_device_path = EFI_DEVICE_PATH_PROTOCOL_GUID; static const efi_guid_t guid_simple_file_system_protocol = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID; static const efi_guid_t guid_file_system_info = EFI_FILE_SYSTEM_INFO_GUID; +static efi_guid_t guid_uboot = + EFI_GUID(0xe61d73b9, 0xa384, 0x4acc, \ + 0xae, 0xab, 0x82, 0xe8, 0x28, 0xf3, 0x62, 0x8b); static efi_guid_t guid_vendor = EFI_GUID(0xdbca4c98, 0x6cb0, 0x694d, 0x08, 0x72, 0x81, 0x9c, 0x65, 0x0c, 0xb7, 0xb8); @@ -206,25 +209,44 @@ static int setup(const efi_handle_t handle, ret = boottime->allocate_pool(EFI_LOADER_DATA, sizeof(struct efi_device_path_vendor) + + sizeof(struct efi_device_path_vendor) + + sizeof(u8) + sizeof(struct efi_device_path), (void **)&dp); if (ret != EFI_SUCCESS) { efi_st_error("Out of memory\n"); return EFI_ST_FAILURE; } + /* first part */ vendor_node.dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE; vendor_node.dp.sub_type = DEVICE_PATH_SUB_TYPE_VENDOR; vendor_node.dp.length = sizeof(struct efi_device_path_vendor); - boottime->copy_mem(&vendor_node.guid, &guid_vendor, + boottime->copy_mem(&vendor_node.guid, &guid_uboot, sizeof(efi_guid_t)); boottime->copy_mem(dp, &vendor_node, sizeof(struct efi_device_path_vendor)); + + /* second part */ + vendor_node.dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE; + vendor_node.dp.sub_type = DEVICE_PATH_SUB_TYPE_VENDOR; + vendor_node.dp.length = sizeof(struct efi_device_path_vendor) + 1; + + boottime->copy_mem(&vendor_node.guid, &guid_vendor, + sizeof(efi_guid_t)); + boottime->copy_mem((char *)dp + sizeof(struct efi_device_path_vendor), + &vendor_node, + sizeof(struct efi_device_path_vendor)); + /* vendor_data[0] */ + *((char *)dp + sizeof(struct efi_device_path_vendor) * 2) = 0; + end_node.type = DEVICE_PATH_TYPE_END; end_node.sub_type = DEVICE_PATH_SUB_TYPE_END; end_node.length = sizeof(struct efi_device_path); - boottime->copy_mem((char *)dp + sizeof(struct efi_device_path_vendor), + boottime->copy_mem((char *)dp + sizeof(struct efi_device_path_vendor) + + sizeof(struct efi_device_path_vendor) + + sizeof(u8), &end_node, sizeof(struct efi_device_path)); ret = boottime->install_protocol_interface(&disk_handle, &guid_device_path,