From patchwork Mon Sep 7 05:34:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 249195 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3414999ilg; Sun, 6 Sep 2020 22:37:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK0+1JyImH6nEJIwys/b00OEtZrRakfZE6HzsU4AavmsKDvRVuBI+TS1HSK9YZiAW0RcBD X-Received: by 2002:aa7:d585:: with SMTP id r5mr20326209edq.278.1599457074505; Sun, 06 Sep 2020 22:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599457074; cv=none; d=google.com; s=arc-20160816; b=Zvrk49BfZCVD9oZisuHtE0i70SK6rd0aUP+l9Uf150G/CwkAnaF0j0ah48MQONnRaU j9dlzfC7zX5sSaqWMJWmo/eN8wJLauOEUi5jbJTDSYBrT+QYhCIFc+AUTmSs8vXLVHow 3hG43BlUO5CCDq45D/X2frneq7L/KRSNpabBpOBn54pFjG/FR+3JMVr/4x0izh3q8kgz m21RHirEAA4WK3tdllCtDPWJ9DLrOYT2CcBdwcYRQftcj3qgJtvxrrULB9lN1Of5OV7I 9lRrAs/cRp8XbnBuGLwMyibAbmIwk3cFCfwrNg5bzhZY1e2Ob8aQQJp0XPMNu6ZSYvCk gEcA== 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=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=pENgShSqJL8MORLmyzdGQc7poBa9cHYU39Aucd9fsLfbpiFkrDjMcjwGJSxqoiQg0y GgmwEIwY7qIxt/2uaml7W3ZLgARdfRHWcUKH1WMABbbJWnznWcRULmiT+gyghg8TJiPx ffzkLBUSgj35LaYkvUNuIoMWLEQW4dxw9JbC/IyK4ueHe4BeErn8BLvj0vula3ow71oA 657W4Q49kfu9FWl5cCcyqwgudTSDxIUhaDtnNtNm0jdFmLch2hEHQYzxCY5su3O61dVo Lamy7RpDf/YTFJX27IiTrvxEnnHFpToUKxht/nSQ+6ng6crZFRZWqchTOimqKQlbAMFs 06HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RhU+2fAt; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id h9si9516585edv.170.2020.09.06.22.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 22:37:54 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RhU+2fAt; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 BB76C824F0; Mon, 7 Sep 2020 07:36:24 +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="RhU+2fAt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 74B07824D5; Mon, 7 Sep 2020 07:36:13 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) (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 E64F0824D3 for ; Mon, 7 Sep 2020 07:36:06 +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-x1044.google.com with SMTP id u3so2691036pjr.3 for ; Sun, 06 Sep 2020 22:36:06 -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=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=RhU+2fAts9l6/ZpY/+9ZOQRwauiaYn5WA3iPbohlfNB3imGuBNNr451QG3NnFlczmh i1iMJmUtpgvOMwBQAJnid1zuIDuh9xmrJQm1Tfp7csMcz/zJZFxlaSWNfSkVobZpXaOa KmQ/mw0InXnfEFw8uamNCG5BvMEIem1laOn78i+HgnWVuJoCOMB922OADSeoQtQWK8Mo fO+/zanofWOGmJeZUU7mxz8Zz4A/ESs3ZOWdHHhBiP64J/F1Dzf1fhmH/pqSttoUWrFX m6MrFj8Kv7mGhkMfM3gqsLuZUyPAwN5NENI6foF6RBw7Zh389ABjaq6pGsJYHgxsImMZ 5HCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=FgoZR4bbZiglefHUJmTGIzZI2leoBkY62xeV2/qhzO1h+OKEp5T2dXEAgJ9cLflh75 SX4XH42q5Ey41vrAsCioQHmnRJEUlB2m4sRxZ1PjsESTGRiQZ/JGgqSc5Np97IbT3FK9 d+kxjGEKkgre8hUxfgOi44HJEqPhWEVPISLh61pdANwtzbZLTgXEgWyd73s5HwpYNzk6 STKJaJIjMKLC9dbTXEmPAtyMPCIlF/oRAV45sSmgqf1EjSZ29x93G5KQSP0fuCYYyxle RANJxefsbnPcPw4bGy1InX/pX6sYx6//QlS2svfBeV1SJYXJvn4CaiEGPPEtvLMtRPhg PNJQ== X-Gm-Message-State: AOAM530htkaxQFom79V3fDN6VoDfsUyyxPsGxGS2k1CjaND2HdKxEucK nqW2gdnDH1bNjoiZ3zotRcNTvA== X-Received: by 2002:a17:90a:a787:: with SMTP id f7mr18994001pjq.103.1599456965474; Sun, 06 Sep 2020 22:36:05 -0700 (PDT) Received: from localhost.localdomain (p784a66b9.tkyea130.ap.so-net.ne.jp. [120.74.102.185]) by smtp.gmail.com with ESMTPSA id w6sm10783939pgr.82.2020.09.06.22.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 22:36:04 -0700 (PDT) From: AKASHI Takahiro To: lukma@denx.de, trini@konsulko.com, xypron.glpk@gmx.de, agraf@csgraf.de Cc: sughosh.ganu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v6 09/17] efi_loader: capsule: add memory range capsule definitions Date: Mon, 7 Sep 2020 14:34:18 +0900 Message-Id: <20200907053426.1675646-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200907053426.1675646-1-takahiro.akashi@linaro.org> References: <20200907053426.1675646-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.102.3 at phobos.denx.de X-Virus-Status: Clean Memory range capsule gives us a way to notify that some memory regions should be left untouched across the next reset. See UEFI specification, section 8.5.3. Since how we should handle this kind of capsule is totally up to the system, no implementation will be added in this commit. Signed-off-by: AKASHI Takahiro --- include/efi_api.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.28.0 diff --git a/include/efi_api.h b/include/efi_api.h index c128a0a66ce8..7a2a087c60ed 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -221,6 +221,10 @@ enum efi_reset_type { EFI_GUID(0x39b68c46, 0xf7fb, 0x441b, 0xb6, 0xec, \ 0x16, 0xb0, 0xf6, 0x98, 0x21, 0xf3) +#define EFI_MEMORY_RANGE_CAPSULE_GUID \ + EFI_GUID(0xde9f0ec, 0x88b6, 0x428f, 0x97, 0x7a, \ + 0x25, 0x8f, 0x1d, 0xe, 0x5e, 0x72) + struct efi_capsule_header { efi_guid_t capsule_guid; u32 header_size; @@ -236,6 +240,19 @@ struct efi_capsule_result_variable_header { efi_status_t capsule_status; } __packed; +struct efi_memory_range { + efi_physical_addr_t address; + u64 length; +}; + +struct efi_memory_range_capsule { + struct efi_capsule_header *header; + /* EFI_MEMORY_TYPE: 0x80000000-0xFFFFFFFF */ + enum efi_mem_type os_requested_memory_type; + u64 number_of_memory_ranges; + struct efi_memory_range memory_ranges[]; +} __packed; + #define EFI_RT_SUPPORTED_GET_TIME 0x0001 #define EFI_RT_SUPPORTED_SET_TIME 0x0002 #define EFI_RT_SUPPORTED_GET_WAKEUP_TIME 0x0004