qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

hw/nvram/fw_cfg: Add fw_cfg_arch_key_name()

Add fw_cfg_arch_key_name() which returns the name of
an architecture-specific key.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190422195020.1494-3-philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

+38 -1
+1
MAINTAINERS
··· 1696 1696 S: Supported 1697 1697 F: docs/specs/fw_cfg.txt 1698 1698 F: hw/nvram/fw_cfg.c 1699 + F: stubs/fw_cfg.c 1699 1700 F: include/hw/nvram/fw_cfg.h 1700 1701 F: include/standard-headers/linux/qemu_fw_cfg.h 1701 1702 F: tests/libqos/fw_cfg.c
+1 -1
hw/nvram/fw_cfg.c
··· 100 100 }; 101 101 102 102 if (key & FW_CFG_ARCH_LOCAL) { 103 - return NULL; 103 + return fw_cfg_arch_key_name(key); 104 104 } 105 105 if (key < FW_CFG_FILE_FIRST) { 106 106 return fw_cfg_wellknown_keys[key];
+14
include/hw/nvram/fw_cfg.h
··· 226 226 FWCfgState *fw_cfg_find(void); 227 227 bool fw_cfg_dma_enabled(void *opaque); 228 228 229 + /** 230 + * fw_cfg_arch_key_name: 231 + * 232 + * @key: The uint16 selector key. 233 + * 234 + * The key is architecture-specific (the FW_CFG_ARCH_LOCAL mask is expected 235 + * to be set in the key). 236 + * 237 + * Returns: The stringified architecture-specific name if the selector 238 + * refers to a well-known numerically defined item, or NULL on 239 + * key lookup failure. 240 + */ 241 + const char *fw_cfg_arch_key_name(uint16_t key); 242 + 229 243 #endif
+1
stubs/Makefile.objs
··· 39 39 stub-obj-y += pci-host-piix.o 40 40 stub-obj-y += ram-block.o 41 41 stub-obj-y += ramfb.o 42 + stub-obj-y += fw_cfg.o
+21
stubs/fw_cfg.c
··· 1 + /* 2 + * fw_cfg stubs 3 + * 4 + * Copyright (c) 2019 Red Hat, Inc. 5 + * 6 + * Author: 7 + * Philippe Mathieu-Daudé <philmd@redhat.com> 8 + * 9 + * SPDX-License-Identifier: GPL-2.0-or-later 10 + * 11 + * This work is licensed under the terms of the GNU GPL, version 2 or later. 12 + * See the COPYING file in the top-level directory. 13 + */ 14 + 15 + #include "qemu/osdep.h" 16 + #include "hw/nvram/fw_cfg.h" 17 + 18 + const char *fw_cfg_arch_key_name(uint16_t key) 19 + { 20 + return NULL; 21 + }