QEMU: blacklisting kernel module doesn't prevent it from showing up as available in `lspci` - kernel-module

I'm working in QEMU, and attempting to see if the guest can still use a PCI device without the corresponding kernel module loaded.
To start, lspci -v shows the following:
00:01.3 Bridge: Intel Corporation ########## PIIX4 ACPI (rev 03)
Subsystem: Red Hat, Inc Qemu virtual machine
Flags: medium devsel, IRQ 9
Kernel modules: i2c_piix4
Before attempting to remove i2c_piix4, lsmod confirmed that it was loaded. To remove it, I edited /etc/modprobe.d/blacklist.conf and added the line blacklist i2c_piix4, then called sudo update-initramfs -u and rebooted. Now, the module has disappeared from lsmod, but is still listed under lspci. This is still true after modprobe -r. Have I properly blacklisted it, or is there another step I need to add?

lspci shows the hardware on the pci bus - no matter if a corresponding kernel module is loaded or not.
To remove a device you can do this in the qemu monitor by id or locate it with info qtree and info qom-tree and remove it with device_del.
But removing your specific device is not supported on the ps-i440fx architecture.
(qemu) info qom-tree /machine/unattached/device[24]
/device[24] (PIIX4_PM)
/piix4-pm[0] (qemu:memory-region)
/acpi-cpu-hotplug[0] (qemu:memory-region)
/acpi-evt[0] (qemu:memory-region)
/acpi-tmr[0] (qemu:memory-region)
/apm-io[0] (qemu:memory-region)
/bus master container[0] (qemu:memory-region)
/bus master[0] (qemu:memory-region)
/acpi-pci-hotplug[0] (qemu:memory-region)
/pm-smbus[0] (qemu:memory-region)
/acpi-gpe0[0] (qemu:memory-region)
/i2c (i2c-bus)
/acpi-cnt[0] (qemu:memory-region)
(qemu)
(qemu) device_del /machine/unattached/device[24]
Device 'PIIX4_PM' does not support hotplugging
(qemu)

Related

kdump is not collecting the core file during the system panic

I was going through the doc https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-kdump-configuration-cli.html on configuring the coredump collector.
I have made the following to changes and have restarted the kdump with the command "service kdump restart".
On /etc/kdump.conf => I have enabled the path and the core-collector as below,
path /var/crash
core_collector makedumpfile -c
#default halt
And on /boot/grub/grub.conf
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-318.6.1.el5.20)
root (hd0,0)
kernel /vmlinuz-2.6.18-318.6.1.el5.20 ro root=/dev/Raid_vg/Root_lv crashkernel=256M#16M
initrd /initrd-2.6.18-318.6.1.el5.20.img
title Red Hat Enterprise Linux Server (2.6.18-110.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-110.el5 ro root=/dev/Raid_vg/Root_lv crashkernel=256M#16M
initrd /initrd-2.6.18-110.el5.img
I did the above to trigger the crash dump "cho c > /proc/sysrq-trigger". But after the reboot the core files are not present in the /var/crash.
Please help to identify why the core dump was not generated.
I see the config file of the kernel with the following enabled,
CONFIG_CRASH_DUMP=y but CONFIG_RELOCATABLE is not present in the config. Is it becoz of that the core dump didnt get generated.

What does Bad EIP value error means?

I've been writing some kernel module recently. For some modules everytime i insert them or remove them a huge kernel trace is shown on screen. The errors are somewhat like
ERROR: Bad EIP value.
or
ModuleName is tainted.
What does this imply. Any help is appreciated.
The Extended Instruction Pointer exists in x86 processors, but is somehow related to a missing WiFi driver, it seems:
Yesterday I could not reach this site and read your reactions, so I
experimented with several Linux versions: Xubuntu, Slacko-Puppy 5,4
Firefox ,Puppy Akita Beta and LinuxMintMaya. And with all the same
result, i.e. no result,
But in the last install - LinuxMintMaya - I discovered the problem,
which is be found here: http://www.linuxmint.com/rel_maya.php It
tells:
Boot hangs on systems using b43 wireless cards
So after entering this command
Code: sudo apt-get install firmware-b43-installer
LinuxMintMaya works.
To boot, the Mint page says:
An upstream issue in the kernel prevents Linux Mint 13 from booting on
computers with b43 wireless cards. If you're in this situation, try
the following:
To boot the live DVD, choose the "Compatibility mode" or add the
following kernel argument to the boot options: b43.blacklist=yes
Install Linux Mint on the hard drive If not present already, in Grub,
modify the boot options to add: b43.blacklist=yes Install the b43
firmware on the system

Porting eCos to i386

I am trying to port eCos on an i386 PC.
I have downloaded prebuilt redboot.bin from
http://ecos.sourceware.org/ecos/boards/redbootbins/x86pc/
I boot it onto usb disk, using
dd conv=sync if/redboot.bin of=/dev/sdb1
After booting target from usb, I get "IA2!" string on the target monitor always, and on serial port on 38400 8n1 configurations, I receive nothing.
I tried using i386-elf-gdb, but it is not able to connect to the target and starts printing "Ignoring error packet, Continuing..."
I also tried to build redboot using configtool for i386, but it is only able to build library, when I try Tests, It gives ERROR: multiple definition of cyg_start()
I am very new to eCos, and I don't know what I am doing wrong!!.
Ok, I figured out how to boot Redboot on a target i386 pc with RealteK RTL8139 ehternet card.
install grub on usb stick,
mkdir /mnt/USB && mount /dev/sdx1 /mnt/USB
grub-install --force --no-floppy --boot-directory=/mnt/USB/boot /dev/sdx
Build Redboot using ecosconfig, make sure the number of pci bus are less than 8 or more, if more, then need to increase the pci bus range from from 8 inside pci.h, I had my realtek ethernet card on bus 10 dev 10, I had to increase the bus to 11, so that redboot finds realtek card on bootup.
ecosconfig new pc redboot
configtool ecos.ecc
add common ethernet support
Build Library
copy redboot.elf on usb.
on grub startup menu,
insmod multiboot
multiboot /redboot.elf
boot
Thats it, redboot will use BOOTP and provide IP Address, then I can test redboot commands like ip_address, reset, ping, version etc.

dfu-util: unable to read DFU status

DFU does not seem to work on a development board (Hitex LPC1850 or Keil MCB1800), but the manual states that it should work.
I could not find the same problem on the internet, so I posted my problem here.
(I manually compiled dfu-util 0.7, but the lpcXpresso bundled binary gives similar result)
tijs#debian:~/u-boot$ sudo ../dfu-util/src/dfu-util -R -D u-boot-dfu.bin boot/u-boot/u-boot-dfu.bin dfu-util 0.7
Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2012 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to dfu-util#lists.gnumonks.org
Opening DFU capable USB device...
ID 1fc9:000c Run-time device DFU version 0100
Claiming USB DFU Runtime Interface...
Determining device status: state = dfuIDLE, status = 0
dfu-util: WARNING: Runtime device already in DFU state ?!?
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0100
Device returned transfer size 2048
Copying data from PC to DFU device
Download [=========================] 100%
90640 bytes Download done.
dfu-util: unable to read DFU status
The problem is, that I am not sure if u-boot has been executed.
Reset (-R) should do that, but it tells me that it is 'unable to read dfu status'.
Am I missing something here?
Does anyone know what might be the problem here?
I already used dfu-util and this message has always been displayed but it doesn't affect the Reset. Once you execute
dfu-util -R -D u-boot-dfu.bin
you should get U-Boot console through serial port (ttyS0... or ttyUSB0 if you are using a Serial to USB dongle...) using minicom or a similar tool.
I ported U-Boot on the Hitex board in SPI Flash and using USB to get the console during a internship, so maybe I can help you further.
Thanks for helping.
It seems that the message "dfu-util: unable to read DFU status" is normal.
The problem was that my bootloader was not working because it was for a similar board with more internal SRAM. I just had to port my bootloader first, console is now working.

module for usb pen drive

I am making a module to do some basic stuff in my pen drive following the example here . its stating that the usb storage(in my case pen drive) device uses usb-storage driver . I saw in hardware info that its usb_storage(which is same as usb-storage as when i do rmmod usb -storage it states that ERROR: Module usb_storage does not exist in /proc/modules) . I have done even lsmod with and without device its not showing any module name usb-storage.
My doubt is simple how to know which module controles which device and i know it could be unloaded by rmmod (module name).
Assuming that your kernel actually has usb-storage support this means the module is built in to the kernel and cannot be removed.
Try rebuilding your kernel after changing the usb-storage support to be built as a module, rather than directly into the kernel.
There should be no problem removing the module if you are the Super user. Otherwise, change to super user then try to remove it. It can be done by sudo su command.
And for the list of modules being used, you can view the device log by dmesg and check out.

Resources