From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mx.groups.io with SMTP id smtpd.web08.5820.1615363482058297654 for ; Wed, 10 Mar 2021 00:04:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@solid-run-com.20150623.gappssmtp.com header.s=20150623 header.b=M4qt0YJn; spf=pass (domain: solid-run.com, ip: 209.85.208.43, mailfrom: jon@solid-run.com) Received: by mail-ed1-f43.google.com with SMTP id m9so26558116edd.5 for ; Wed, 10 Mar 2021 00:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solid-run-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=UrNaTMYB5Tm1pcf687hcu0l4ZLaQsrNmg6aiT/6CmoU=; b=M4qt0YJnl2pUZ9vn5ztF2PPBzZX0kz7v/SLKtwPPlJw61Uot5mVj0noWIRRACibG5w 0MmxgcJpO85G/RqsoDKAIYKg5fJQ0XNXbxfgcQ2+jFRupk72Y/Tgtp57HgXz4DWJmZI5 3KmuOIWfDi1I/Gm/tKdV6qqG2TMoU9dozOsPYnpfqM624GQb0b+4yPxBhd6e+bjnwV3P znYrSkMyH3muyAyClqn00sCy7NWLgc2/vpMTSzZbe2G6eidOo8IZMH4cF5HXAdOgukeo 367XY9lxeH/1/Ty9JnSrposFKcqf8FP2xKbYZG9FeJptrbmrHeLchijqyM2bZcFt4mTl dZMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=UrNaTMYB5Tm1pcf687hcu0l4ZLaQsrNmg6aiT/6CmoU=; b=WhaFyRLD0PSXDLqZznmrJo00VpF1szJexV4P82Y5qq9s//dnbeqeO3A8LTzG42egxT ucs7+SKJxetiHqwaBDisJP2NvOi1faeYPFh5MmFYfqnRjra1MehuwbbDCJ+4vUQLCyHD Faa8cvl+UwJygsUMn5G/uMjmS+DJkl3iN0SYoODRyU+4qhSqCCcOAYkcuAepCBeuiC6u kpWxBqkPhWZvpR4pYnsUkRQewh+GbYQnoy29Os9a5+UZAlJGghIczSH6E2AzjqB2Cc/+ ps85xhFAX3EUF3lf4+xAE4M5Z04dur8yY8MBI+3ohoAcB+Ngp8mkNN4Yqr1nWKfau+zr AbqA== X-Gm-Message-State: AOAM531D7NvG8E2LwLfLugN7ZdyqX/OcT6av15aa2BH1pzIFivqT22o6 OU/q6SYbH3mA7yJ/TIEf0Xheh81MhSyWXNF/nLztoWM8FhSuTZv+ X-Google-Smtp-Source: ABdhPJzfJ5TTE2Z34pENDlTRb9Tenag7a4wdfQ0qOutPzBTUB48WY9uixNdCkowttre1GFc5iMwjTpILBWnkjLhjt7Q= X-Received: by 2002:a05:6402:27d3:: with SMTP id c19mr1909492ede.129.1615363480202; Wed, 10 Mar 2021 00:04:40 -0800 (PST) MIME-Version: 1.0 From: "Jon Nettleton" Date: Wed, 10 Mar 2021 09:04:03 +0100 Message-ID: Subject: Conflicting virtual addresses causing Runtime Services issues To: devel@edk2.groups.io Content-Type: text/plain; charset="UTF-8" I am debugging a failure that I am seeing while using the HoneyComb's spi-nor flash for runtime variable storage. I am hoping someone on the list can give me some insight as what may be the problem. The problem showed up when we switched the MMIO region for the fspi flash device to be marked as non executable. reading variables is fine, however writes began throwing an error. [ 556.709828] Unable to handle kernel execute from non-executable memory at virtual address 00000000206a3968 I have patched the kernel and removed the X86 requirement and enabled the sysfs runtime mappings kernel config so I can get an easy view of the mappings the kernel carries for runtime services. I then track that virtual address to the MMIO region of nor flash, which makes sense that region is marked as non executable. The question is why is code being executed from this address range attribute :::::::::::::: 0x8000000000000001 :::::::::::::: num_pages :::::::::::::: 0x40 :::::::::::::: phys_addr :::::::::::::: 0x20500000 :::::::::::::: type :::::::::::::: 0xb :::::::::::::: virt_addr :::::::::::::: 0x20680000 So then I patched the PL011 serial driver to be able to log to the console in runtime and I track down the access to Status = Fvb->GetPhysicalAddress(Fvb, &FvVolHdr); in UpdateVariableStore(). What I don't understand is why EfiConvertPointer is mapping that pointer into the Virtual address space occupied by the runtime mmio of the flash. The pointer is being properly remapped. Here are the pointer addresses in EFI and Kernel Runtime EFI: UpdateVariableStore:156 ECE33968 FvbGetPhysicalAddress(BaseAddress=0x20000000) KERNEL: UpdateVariableStore:156 206A3968 [ 556.709828] Unable to handle kernel execute from non-executable memory at virtual address 00000000206a3968 Any insight that anyone could provide would be much appreciated. Thanks, Jon