From nobody Sun Jul 06 20:02:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bZyw53dkYz61gHh; Sun, 06 Jul 2025 20:02:45 +0000 (UTC) (envelope-from ahmadkhalifa570@gmail.com) Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bZyw50bTsz3RKJ; Sun, 06 Jul 2025 20:02:45 +0000 (UTC) (envelope-from ahmadkhalifa570@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-70a57a8ffc3so18633147b3.0; Sun, 06 Jul 2025 13:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751832163; x=1752436963; darn=freebsd.org; h=cc:to:subject:message-id:date:in-reply-to:references:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tG8QfF37L1IUR4RCFeMXEh+qgrLMtmXi7BV1vdJ3W4o=; b=SHxJ6S/YGJl+fSyIKBsq0sOlbptfELoaopFptbDTbTjLC6ysPmDZHXY1kJJznztXog Px0XkIqf1N+cPSuNl9Tl825z9jRXCLmL2qSm91JPNhk3LGAzzPC48cEUhS+oTeQF6zpQ aTBW02XprAqkoUtIeuw8poK7BXfRsKTP4Wzh9DMbiQNn+XiJHSy7rtDAMfMSEkvdqeJa hWBSiZEjtQ/sUrfJpUUmcHP8MEy0qBYzFLGW3jAfO/SfIdlq3gjMl670ryCk3sZ7p8hY 59HjabtgNqqvUxNm+CERd2q5rKMLe0DkhrLcRo2QSqWACSamdDaP8ODouSd3wrP0qN7G GSZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751832163; x=1752436963; h=cc:to:subject:message-id:date:in-reply-to:references:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tG8QfF37L1IUR4RCFeMXEh+qgrLMtmXi7BV1vdJ3W4o=; b=LaPlX6n5KT5Y51u29pdXJ5/z1oROWj1BZD8tKjaRi3XTuX5YLHacdqtmTu1KcdJod8 4f6jt3aEOcvnaYl/7AUSG+W0IXHpJAfLfoFroTPtkbdqZ+muel6vTJNSbXs+K/UZSA+h OUo//a9M0/KdhHTEb/oNoM8qVD8agiARGfov7GSMQ3uRrbBg3JQDIx7gTl9dOWFTJwuU 4/qrX1gbBh/7b1WrknnQvb9p0d4SyDg8o/RWcU6W+9MCZnyVeKsYFwXBh/kD7QBB8sM0 d6ZSytNxikzsbt8iKA07cKwNGLG60aLn1+M9rbE8cOcQA0QjB/K+rLsbJiQz7fDFYLI3 cZag== X-Forwarded-Encrypted: i=1; AJvYcCWlirHwPVEpEcL3503XJpVu+BfZJikVvppiZSHSGkTWvvUFDFGhepmV9wwXJisZcq0675NCihSVOj1+Bgpu6p4F6eN0@freebsd.org, AJvYcCXgDmxCIk9gIfYxaNh2SqOUMzYw52rNZ98Aed1J2Mvtirq8QQnY7C5OTTezaZYeO4ffedRJ9jRu0z1WreiWCrQr7b4sX50=@freebsd.org X-Gm-Message-State: AOJu0YwOhcWxcY9rwQ0gINaMgKYOIArgcbtngirtDMVc9sO1zvkcSMmD LGtK6jhFIoSk1cOTffWP8sBCfPFIHrqpe3XEjs/sVluBZN2C5mBk2N8Cvhb5GCYCS/vcnGaUivJ SC5NkfHbTxJSO6KFa3/L7fmLuJSUkHHs= X-Gm-Gg: ASbGnculrsXc8vKcVzse6SiFoQmDM2pTkMS7qUkzaXNkyIrct7tXr7/MtE5PmH2LJIg mHU/nB2WIrH2CmJeNiJublIvadVAKVXbzr0R3VZB1dJIB6Bm+PBb+st8PQD7b0HJ2mdQzk0nVKT yL5coM9RrTVq5iPZL0Y8CbTisKesKOwFfch8QswwquQCEQfA== X-Google-Smtp-Source: AGHT+IH+mitYo3NpvOfIBWZWO5VC0FXLSruKPArt2AUshevuFsLa4NOHEOaXYPc18CgtYvoJ4C73f4LjrcEJLEzvi3E= X-Received: by 2002:a05:690c:3705:b0:70e:a1e:d9c7 with SMTP id 00721157ae682-7176ca03f3fmr84470337b3.10.1751832162929; Sun, 06 Jul 2025 13:02:42 -0700 (PDT) Received: from 490177373942 named unknown by gmailapi.google.com with HTTPREST; Sun, 6 Jul 2025 13:02:42 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 From: Ahmad Khalifa X-Mailer: aerc 0.20.1 References: <202507061928.566JSLh9096963@gitrepo.freebsd.org> In-Reply-To: Date: Sun, 6 Jul 2025 13:02:42 -0700 X-Gm-Features: Ac12FXxmp0JKFwNEU5PY0g4iyJc-8AxQ7u7v3rY_GXXXKrPt3j_3AzzNlVzShDI Message-ID: Subject: Re: git: 85dcdb7aad85 - main - amd64: allow the mapping of other regions for efirt To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4bZyw50bTsz3RKJ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sun Jul 6, 2025 at 10:43 PM +0300, Konstantin Belousov wrote: > On Sun, Jul 06, 2025 at 07:28:21PM +0000, Ahmad Khalifa wrote: >> The branch main has been updated by vexeduxr: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=85dcdb7aad85498b3f497b8752e69b8612b27cb7 >> >> commit 85dcdb7aad85498b3f497b8752e69b8612b27cb7 >> Author: Ahmad Khalifa >> AuthorDate: 2025-07-06 19:10:25 +0000 >> Commit: Ahmad Khalifa >> CommitDate: 2025-07-06 19:26:07 +0000 >> >> amd64: allow the mapping of other regions for efirt >> >> Some BIOSes access data outside of regions marked as "runtime" in their >> runtime EFI functions. Allow the mapping and preservation of other >> regions through a tunable. >> >> The tunable is a bitmap specifying the regions to map. e.g bit 3 would >> be set to map BootServicesCode. >> >> Currently allowed regions are: >> BootServicesCode >> BootServicesData >> RuntimeServicesCode >> RuntimeServicesData >> ACPIMemoryNVS >> >> PR: 287422 >> Reviewed by: kib >> Approved by: imp (mentor) >> Differential Revision: https://reviews.freebsd.org/D51146 >> --- >> sys/amd64/amd64/efirt_machdep.c | 18 +++++++++++++++++- >> sys/amd64/amd64/machdep.c | 8 ++++++-- >> sys/amd64/include/efi.h | 4 ++++ >> 3 files changed, 27 insertions(+), 3 deletions(-) >> >> diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c >> index 81a28ebe97ee..75c357f6e3df 100644 >> --- a/sys/amd64/amd64/efirt_machdep.c >> +++ b/sys/amd64/amd64/efirt_machdep.c >> @@ -56,6 +56,15 @@ >> #include >> #include >> >> +/* The EFI regions we're allowed to map. */ >> +#define EFI_ALLOWED_TYPES_MASK ( \ >> + 1u << EFI_MD_TYPE_BS_CODE | 1u << EFI_MD_TYPE_BS_DATA | \ >> + 1u << EFI_MD_TYPE_RT_CODE | 1u << EFI_MD_TYPE_RT_DATA | \ >> + 1u << EFI_MD_TYPE_FIRMWARE \ >> +) >> + >> +uint32_t efi_map_regs; >> + > > Apparently efi_map_regs must be defined in amd64/machdep.c and not in > efirt_machdep.c. If efirt is compiled as module, efo_map_regs gets > undefined in the kernel. Ah, nice catch. Review opened.