From patchwork Mon Oct 4 03:44:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515150 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1062963imy; Sun, 3 Oct 2021 20:49:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdL4p76iN0CjWNj+rItIjLaJvLi/iLyVNnBagsj/b2AuU9JPVeuUwNxuG9X1qLRoWxRGzJ X-Received: by 2002:a17:907:a411:: with SMTP id sg17mr14744561ejc.412.1633319344471; Sun, 03 Oct 2021 20:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633319344; cv=none; d=google.com; s=arc-20160816; b=tlBqA8sosem9g3bboeCtyqMl/bfObaUqjVtnKj8vTc8HdXV7r+JM+2Izgxtsaidpqu lyT7mHdNlwxTGEK80MJo9R2+5FcCH8OiEqSAPoHFTminefifsGQHG8Q4MtxNFU7xGk2q uPFL9jRFRUSXUxapf3305HXOCTIFxt5XyBG/8FczXCuW5WrUdUEnp6bwasVs+sZFmy6N l9gO4tMmVNNQcfp54LgUNHEpcEbh0YZ3ZlFqSpzRGm/wp41TVUV6sN4k3EnVLNl0WWXa JNnM+ts9sRBQqsskoQZZFioifqXhk6Ia+kmOSVLCBwvjDUgP59ndaUVtXKpAwiqgFCv+ TqKg== 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=HFt3yVcFQeD9B+0Qx1dJduAjC3BvsLABoWiO+jm8xSlDS4JpJQjkZhSb9H/HWVZGQP pF6TwUig6QtbBygTaQdDXVixrXC4FYd76t5v20D2R2NDSG+nXRkRFUAiY6Kgry8qDuRg OlJQoN67Atf6Pg82ojzQ5soSe4QYU7zucqjS6HtDtP4ZOHIeB6xSDnPHKGmUrCWInDIy czI0j9k45Z8glmLJTu6odcZSp59gliIpH0a/wmbdwhWzQAP7RceudVTWxZuFr0+uL3qe /+Fe0kB+fGyUc66ZqjeEVmC+VUCY15062RkSa/w0QPPNqnhlcyFYs5Rv3Jq5y7AXC8U9 gEew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YnfEU8E0; 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 d17si3187696ejt.635.2021.10.03.20.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 20:49:04 -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=YnfEU8E0; 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 DD71C835C5; Mon, 4 Oct 2021 05:47:15 +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="YnfEU8E0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CDF328357E; Mon, 4 Oct 2021 05:46:59 +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-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (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 DE4C68359F for ; Mon, 4 Oct 2021 05:46:48 +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-pf1-x431.google.com with SMTP id q23so13324486pfs.9 for ; Sun, 03 Oct 2021 20:46:48 -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=YnfEU8E0e01Rr2wQL1L9uDkqqbTMkKkDkzRwEBDBnAs6ARnDJmIuBGPEY5kZJ2bhk8 dwogFIMmwFsc/wUEWAuH/byQLJPw4KcLJZfkplfYR92izda1c6oZWr8hECpAP853g0zK D+Fbit6wEeTMel5DhkUX/OgL2HTONh74RgslgDghM0dpF5aaYrjd31xtZ9/wmjMnymWU sA+W8A0dKG7hLeN/3T5uDlAW398Kan7MAFwC4LpgQm/kve5FVpb/ygYOH7iPuQ9H2YkL ZDjw3kr4TH20NOkOu+u0EX8ubMiAs7niV9oIihVaEq3btTO7iQo3dFRS5ipvtKLXRBxa NChQ== 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=gRXgZxXru68AO5MaWiCHinRBFWaNOg9L2QRzZgo1LMy8PgeUygqPZ+TJ5vgSt6sOrI /Sq6Yr1X7eNU+L+Hu+ZLtpDLfAHqLIG2tK6A7e1r/oAjZVXrSyLAlp1IQuyvD3pFXmGS uVejvEGwZk5mJ5/zdS4jY2yr/6Z/P7z5q5oTbiHDafIMkH+FoH3N4cWYOVSPGGHZAT14 Do2cFN1A1LORDJa1bUZkwOgn1rBKjCEkXrKp+ZhdgWFBGCNj9Ab5EQFPTxw6SeEAzYK4 g3Dn8nkcppFhht1O9qG8Kh2X0zZxVFEee/0t5yiPIF9R4xT0PTepN8uRtbOdzoA7cJYs joRw== X-Gm-Message-State: AOAM5334fKpYM9kvaCI1EKMgiHe4ybY4yTWF3fI0TqLAWaOKj+4i8Kbw bTBfiG2KDWwB8lGAbiNJxtayeQ== X-Received: by 2002:a62:1ac4:0:b0:44c:4c4e:1d3c with SMTP id a187-20020a621ac4000000b0044c4c4e1d3cmr7946306pfa.8.1633319207222; Sun, 03 Oct 2021 20:46:47 -0700 (PDT) Received: from localhost.localdomain (61-205-96-147m5.grp4.mineo.jp. [61.205.96.147]) by smtp.gmail.com with ESMTPSA id a11sm11863515pgj.75.2021.10.03.20.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 20:46:46 -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: [resent RFC 22/22] efi_selftest: block device: adjust dp for a test disk Date: Mon, 4 Oct 2021 12:44:30 +0900 Message-Id: <20211004034430.41355-23-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004034430.41355-1-takahiro.akashi@linaro.org> References: <20211004034430.41355-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,