Use virtio-console for the serial devices

A VM is now provided with two
serial devices. One is the uart device which is used as the output
device for the cases where virtio-console device driver is not
available. In the case of Microdroid, it's used by bootloader (u-boot)
and by the kernel as earlycon. The other is the virtio-serial device. It
is used as the console for the kernel.

This CL has two X86 specific hacks though.

1. The PCI addresses of the boot devices were adjusted. This is because
we have added one more PCI device (the virtio-serial device) and crosvm
for x86_64 puts serial devices prior to the block devices and they all
share the same bus ID. As a result, the block device addresses are all
shifted by 1.

2. The kernel command line embedded in boot.img now has `console=none`.
This is to prevent u-boot from automatically adding `console=ttyS0`. If
we let u-boot do that, then we will have console=ttyS0 together with
console=hvc0. Then each kernel message is printed twice; once to ttyS0
and once again to hvc0.

Bug: 200914564
Test: run a VM
Change-Id: I4349c4d70ac76c1b4ddc77bbff6c9b697b2f1f4e
diff --git a/microdroid/Android.bp b/microdroid/Android.bp
index d0f3b66..3665687 100644
--- a/microdroid/Android.bp
+++ b/microdroid/Android.bp
@@ -232,7 +232,15 @@
         },
         x86_64: {
             kernel_prebuilt: ":kernel_prebuilts-5.10-x86_64",
-            cmdline: microdroid_boot_cmdline + ["acpi=noirq"],
+            cmdline: microdroid_boot_cmdline + [
+                // console=none is to work around the x86 specific u-boot behavior which when
+                // console= option is not found in the kernel commandline console=ttyS0 is
+                // automatically added. By adding console=none, we can prevent u-boot from doing
+                // that. Note that console is set to hvc0 by bootconfig if the VM is configured as
+                // debuggable.
+                "console=none",
+                "acpi=noirq",
+            ],
         },
     },
 
diff --git a/microdroid/bootconfig.full_debuggable b/microdroid/bootconfig.full_debuggable
index f6afdcf..0d0457c 100644
--- a/microdroid/bootconfig.full_debuggable
+++ b/microdroid/bootconfig.full_debuggable
@@ -3,6 +3,7 @@
 
 # Kernel message is exported.
 kernel.printk.devkmsg=on
+kernel.console=hvc0
 
 # ADB is supported and rooting is possible. Note that
 # ro.adb.secure is still 0 (see build.prop) which means that adbd is started
diff --git a/microdroid/bootconfig.x86_64 b/microdroid/bootconfig.x86_64
index 75e4a80..20d64f7 100644
--- a/microdroid/bootconfig.x86_64
+++ b/microdroid/bootconfig.x86_64
@@ -1 +1 @@
-androidboot.boot_devices = pci0000:00/0000:00:01.0,pci0000:00/0000:00:02.0,pci0000:00/0000:00:03.0
+androidboot.boot_devices = pci0000:00/0000:00:02.0,pci0000:00/0000:00:03.0,pci0000:00/0000:00:04.0