错误日志:

ACPI Error: Table [PPTT] is not invalidated during early boot stage (20180810/tbxface-165)

linux版本:4.19(注意:以下所有代码虽然是linux-4.19,但是与主线版本不同,只能作为参考)

首先查询到此日志在linux代码中的位置,位于“drivers/acpi/acpica/tbxface.c”文件的164行,相关代码块如下:

 /** Ensure OS early boot logic, which is required by some hosts. If the* table state is reported to be wrong, developers should fix the* issue by invoking acpi_put_table() for the reported table during the* early stage.*/for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) {table_desc = &acpi_gbl_root_table_list.tables[i];if (table_desc->pointer) {ACPI_ERROR((AE_INFO,"Table [%4.4s] is not invalidated during early boot stage",table_desc->signature.ascii));}}

在此处有一段注释,大意是如果ACPI表状态出错,要检查“acpi_put_table()”函数。那么这个函数是什么呢?
此函数也位于“drivers/acpi/acpica/tbxface.c”文件,在359行。函数的注释如下:

/********************************************************************************* FUNCTION:    acpi_put_table** PARAMETERS:  table               - The pointer to the table** RETURN:      None** DESCRIPTION: Release a table returned by acpi_get_table() and its clones.*              Note that it is not safe if this function was invoked after an*              uninstallation happened to the original table descriptor.*              Currently there is no OSPMs' requirement to handle such*              situations.*******************************************************************************/
void acpi_put_table(struct acpi_table_header *table)

"acpi_put_table()"用来释放由“acpi_get_table()”获取的表。那就看看"acpi_get_table()"函数,位于“drivers/acpi/acpica/tbxface.c”文件297行:

/********************************************************************************* FUNCTION:    acpi_get_table** PARAMETERS:  signature           - ACPI signature of needed table*              instance            - Which instance (for SSDTs)*              out_table           - Where the pointer to the table is returned** RETURN:      Status and pointer to the requested table** DESCRIPTION: Finds and verifies an ACPI table. Table must be in the*              RSDT/XSDT.*              Note that an early stage acpi_get_table() call must be paired*              with an early stage acpi_put_table() call. otherwise the table*              pointer mapped by the early stage mapping implementation may be*              erroneously unmapped by the late stage unmapping implementation*              in an acpi_put_table() invoked during the late stage.*******************************************************************************/
acpi_status
acpi_get_table(char *signature,u32 instance, struct acpi_table_header ** out_table)

很明显,这里的注释告诉我们,“acpi_get_table()”和“acpi_put_table()”要配对使用。再来看一个“acpi_put_table()”调用的函数“acpi_tb_put_table()”:

void acpi_tb_put_table(struct acpi_table_desc *table_desc)
{ACPI_FUNCTION_TRACE(acpi_tb_put_table);if (table_desc->validation_count < ACPI_MAX_TABLE_VALIDATIONS) {table_desc->validation_count--;/** Detect validation_count underflows to ensure that the warning* message will only be printed once.*/if (table_desc->validation_count >= ACPI_MAX_TABLE_VALIDATIONS) {ACPI_WARNING((AE_INFO,"Table %p, Validation count underflows\n",table_desc));return_VOID;}}if (table_desc->validation_count == 0) {/* Table need to be "INVALIDATED" */acpi_tb_invalidate_table(table_desc);}return_VOID;
}

最后面的注释说“Table need to be “INVALIDATED””,和错误“ACPI Error: Table [PPTT] is not invalidated during early boot stage (20180810/tbxface-165)”中的信息对上了,因此大概率就可以猜测是很有可能是某处代码没有将“Table”释放,造成这个错误。接下来就查找调用了“acpi_get_table()”的函数,看看存不存在直接返回没有释放“Table”或者干脆就没调用“acpi_put_table()”的情况。
很幸运,很快就找到了,位于“drivers/acpi/pptt.c”的"find_acpi_cpu_id()"函数,以下为此函数的代码:

/** find_acpi_cpu_id() - Determine a unique cpu signature* Return 0 if found a matched cpu.*/
int find_acpi_cpu_id(bool (*match_f)(struct acpi_pptt_id *))
{struct acpi_table_header *table_hdr;struct acpi_subtable_header *entry;struct acpi_pptt_id *cpu_id;u32 id_sz;unsigned long table_end;acpi_status status;status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_hdr);if (ACPI_FAILURE(status)) {pr_warn_once("No PPTT table found, can't find cpu id through acpi\n");return -ENOENT;}table_end = (unsigned long)table_hdr + table_hdr->length;entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,sizeof(struct acpi_table_pptt));id_sz = sizeof(struct acpi_pptt_id *);/* iterate the tables until find an expected cpu signature */while ((unsigned long)entry + id_sz < table_end) {cpu_id = (struct acpi_pptt_id *)entry;if (entry->length == 0) {pr_warn("Invalid zero length subtable\n");return -EINVAL;}if (entry->type == ACPI_PPTT_TYPE_ID && match_f(cpu_id))return 0;entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry,entry->length);}return -1;
}

可以看到没有使用“acpi_put_table()”,修改结果如下,这是使用"git diff"生成的文件,可以看到修改前后对比:

diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index f6d640acff5f..036bf8ed13e9 100644
--- a/drivers/acpi/pptt.c
+++ b/drivers/acpi/pptt.c
@@ -909,6 +909,7 @@ int find_acpi_cpu_id(bool (*match_f)(struct acpi_pptt_id *))u32 id_sz;unsigned long table_end;acpi_status status;
+       int ret = -1;status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_hdr);if (ACPI_FAILURE(status)) {@@ -927,15 +928,19 @@ int find_acpi_cpu_id(bool (*match_f)(struct acpi_pptt_id *))if (entry->length == 0) {pr_warn("Invalid zero length subtable\n");
-                       return -EINVAL;
+                       ret = -EINVAL;
+                       break;}-               if (entry->type == ACPI_PPTT_TYPE_ID && match_f(cpu_id))
-                       return 0;
+               if (entry->type == ACPI_PPTT_TYPE_ID && match_f(cpu_id)){+                       ret = 0;
+                       break;
+               }entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry,entry->length);}-       return -1;
+       acpi_put_table(table_hdr);
+       return ret;}

linux运行中的一个错误解决相关推荐

  1. linux中oracle静默安装失败,oracle 11 Linux 静默安装 步骤及错误解决(更新中)

    oracle 11 Linux 静默安装 步骤及错误解决(更新中) oracle 11 Linux 静默安装 步骤及错误解决(更新中) [待更新] oracle成功安装完成后 显示的页面如下 : 此时 ...

  2. 因为返回有true ajax提示进入错误,jquery ajax中error返回错误解决办法

    转自:https://www.jb51.net/article/72198.htm 进入百度搜索此问题,发现有人这么说了一句 Jquery中的Ajax的async默认是true(异步请求),如果想一个 ...

  3. RDP 协议组件 X.224 在协议流中发现一个错误并且中断了客户端连

    今天在访问远程桌面的时候提示RDP 的 "DATA ENCRYPTION" 协议组件在协议流中检测到一个错误并且中断了客户机,于是参考了下面的文章设置了一下,一般是由于访问量过大或 ...

  4. 云应用程序服务器错误怎么办,“/”应用程序中的服务器错误解决方法

    "/"应用程序中的服务器错误解决方法,是与WebConfig配置文件中mode属性相关,修改属性值便可查看具体错误原因. 电脑重装了下系统,重新打开项目运行报错:"/&q ...

  5. RDP 协议组件 X.224 在协议流中发现一个错误并且中断了客户端连接

    今天在用terminal远程连接服务器时,总是连接不上,后来直接到服务器上查看,在事件里查看到错误日志:RDP 协议组件 X.224 在协议流中发现一个错误并且中断了客户端连接. RDP,即远程桌面协 ...

  6. ASP导入Excel数据提示:外部数据库驱动程序(1)中的意外错误 解决办法

     ASP导入Excel数据提示:外部数据库驱动程序(1)中的意外错误 解决办法 最近拿起很久以前写的ASP导入excel数据程序测试时,发现好好的程序出现运行问题,之前都是好好的.真是怪事. 怎么 ...

  7. linux libvpx编译安装,linux编译安装时常见错误解决办法

    **configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution** 复 ...

  8. Linux mysql 登录 2002,Linux 下 Mysql error 2002 错误解决

    Linux 下 Mysql error 2002 错误解决 先查看 /etc/rc.d/init.d/mysqld status 查看mysql是否已经启动. 如果启动的的话,先将数据库停止   ki ...

  9. C#界面设计--5--Bitmap.save保存图片时: GDI+ 中发生一般性错误 解决办法

    Bitmap.save保存图片时: GDI+ 中发生一般性错误 解决办法 源程序: var date = DateTime.Now.ToString("yyyy-MM-dd");/ ...

最新文章

  1. Java_注解 反射 字节码 类加载机制
  2. 7天拿到阿里Android岗位offer,都是精髓!
  3. android 聊天背景图片,Android 实现从本地读取图片更改聊天背景
  4. -bash: lsof: 未找到命令
  5. 【华为云技术分享】物体检测yolo3算法 学习笔记2
  6. Google、Baidu
  7. 旧板与IO板之间的连接
  8. 城市大脑一网统管数据中台建设方案
  9. Linux编译安装PHP7.4.24及启动
  10. 架构经验:微商城生态解决方案
  11. 计算机管理打印机服务,Windows下打印服务器的管理(一)
  12. Ionic之自定义icon大小
  13. 7种网络摄像机的设计方案,包含软硬件设计
  14. 云计算数据中心运维管理的五大重点
  15. NOJ-1148-石子合并
  16. office钓鱼学习
  17. 几种查询局域网内在线弱电设备IP地址的方法,总有一款你会用的到
  18. 基于Matlab使用地面雷达探测和跟踪LEO卫星星座仿真(附源码)
  19. 微软工程院 硕士_微软工程院招聘NLP算法研究员实习生|NLP算法工程师实习生_北京实习招聘...
  20. 天下足球--背景音乐

热门文章

  1. 保研之路——复旦计算机学院预推免
  2. axurerp出现错误报告_Windows 应用程序无法安装 事件查看器报错
  3. lpk劫持方式粘滞键后门后门T00ls Lpk Sethc v3.0 正式版下载
  4. 拼多多无货源店群模式现在还能赚钱吗?(小珏)
  5. 国培计算机音乐教学设计作业,2017国培计划教学设计
  6. ASCII码与16进制的互相转换(表)
  7. python输入一个三位数输出百位十位个位_python输入一个水仙花数(三位数) 输出百位十位个位实例...
  8. 转:接班人都是“剩出来”的,选接班人9条必用原则
  9. STM32F103C8T6引脚笔记
  10. 链改价值节点,构建区块链命运共同体