From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by mx.groups.io with SMTP id smtpd.web11.1972.1614135362606068628 for ; Tue, 23 Feb 2021 18:56:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SYp5L+6C; spf=pass (domain: gmail.com, ip: 209.85.166.50, mailfrom: lovemrd@gmail.com) Received: by mail-io1-f50.google.com with SMTP id p16so502439ioj.4 for ; Tue, 23 Feb 2021 18:56:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=m8+fIEBlf3xqfN4lTFw/65MMAXXM4NQ3JCE1RPu0nJQ=; b=SYp5L+6ChToy+e+RmdJxBqIV6w6EdX+yCHCW+nhb5USMJcniytwx+DolncCu3LwIba n8lYzuYykAAjs5dLRllm3wjfRhaeWr8MavrHE/Xn/FwkPDHCAYy0ra/os+u31T67A4cf Mzoq0OKX9zDrUFrRLrlFQcuRwNvuifrTaGtJ+TPdlgkSIIMAe3wTXPWgSLdFvwZzEmf5 v70xXbRPl/MnHNytnZ69NMmJfcnzmvj/5KF10k5NaBFeeINp0z8NN+m0efIrgk5g2cvI UTasr2TqERQ69LLjQXKZ90Thuvbp8uAv2IfD3LBvVMvl5Wlk+zKI35Vd8ZowWLPPtm/e 5eMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=m8+fIEBlf3xqfN4lTFw/65MMAXXM4NQ3JCE1RPu0nJQ=; b=EDYo0NT8hMQjX6Z5mx3/VyJ4epI6UIc6QsPWimKF1XRFEx6yaVpmSwzw93Sn+/Ot8h NgeSKtAaVSPioNDQVGB0Gr2mb79qUQvyo/mqu5ushxwXU9pJyTNsyAnmXHNBFwtQZaj/ TWJHgkFaZX/Yh52F0i+aCUw835g1O6srcuMfceuI7WnfOGAYWIe9fxBSUXYtx0leKPv0 90SdiEZR98IF8I87DpvJCh9+kkUDcYnMzgO1Qr/MUt0y+UVDoMx375TiJlh2RXzr912l voAVBpM2f23aYwdEGKfWTu6sbYD2KeQaU9koJSkGucHYivL9OkJCvsQEBZFAGyTwU8r0 vM5Q== X-Gm-Message-State: AOAM532CMG1hrxycz5rWg0ANIHT/mtyVPCjSwbyPtcIfLTNR3cnlIW74 IAZy7eZKcQxRLl0Rp0UR1oF1NV7i/gDgAkkgdSQ= X-Google-Smtp-Source: ABdhPJz2UCxPx3wW/ncnHESFVBdtdHm7/gn1/1ewyIJTz8XbbLOGkJAtG1+eM5fbIms8fgMTuqrXSjjP2nwHtZrx7JY= X-Received: by 2002:a5d:8552:: with SMTP id b18mr19172692ios.124.1614135361935; Tue, 23 Feb 2021 18:56:01 -0800 (PST) MIME-Version: 1.0 References: <81c4017a-ef40-f729-d304-956105910947@redhat.com> In-Reply-To: <81c4017a-ef40-f729-d304-956105910947@redhat.com> From: Zhu Yijun Date: Wed, 24 Feb 2021 10:55:16 +0800 Message-ID: Subject: Re: implement about virtio-keyboard To: Laszlo Ersek Cc: devel@edk2.groups.io, Ruiyu Ni , Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the update. Now the usb tablet and keyboard are the only two usb devices on aarch64, so I want to eliminate the "qemu-xhci" controller. I even think the situation that something more lightweight VMM instead of QEMU may not support any USB controller, then virtio-input support in UEFI is necessary. So if I want to implement this feature, can you give me some advice? I see there are several keyboards in edk2, VirtualKeyboardDxe/VirtualKeyboard.c looks more simple than usbkbd, can it be used as an example for reference? Laszlo Ersek =E4=BA=8E2021=E5=B9=B42=E6=9C=8823=E6=97= =A5=E5=91=A8=E4=BA=8C =E4=B8=8B=E5=8D=8810:47=E5=86=99=E9=81=93=EF=BC=9A > > On 02/23/21 09:48, Zhu Yijun wrote: > > Hi all, > > I boot vm with the virtio keyboard on aarch64. It looks UEFI lacks > > support for the virtio keyboard, so I can't do any keyboard input > > before the linux kernel driver loads, i.e. edit the grub boot menu. Is > > there any plan to support it? > > Not on my side. > > My team discussed virtio-input's relevance for ArmVirtQemu in September > 2016. > > We decided not to bother about it, because: > > (1) XHCI was virtualization-friendly, both performance-wise and > configuration-wise (unlike EHCI), > > (2) QEMU and libvirt were going to gain (... or had just gained ...) > XHCI support, on aarch64 / "virt". > > > So today, just use a "qemu-xhci" controller in your domain config > please, in combination with a USB keyboard. (If you define a new aarch64 > domain with libvirt, this should happen out of the box for you.) > > ArmVirtQemu includes all the edk2 drivers necessary for driving those > devices, and ArmVirtQemu's PlatformBootManagerLib instance will connect > the USB keyboard automatically. There shouldn't be a problem when typing > in "grub". > > Thanks > Laszlo > > > I find UsbKeyboardDevice attach on UsbIO which implements its > > protocol interface structure(such as UsbGetInterfaceDescriptor, > > UsbAsyncInterruptTransfer) defined by UEFI spec, but virtio not. So is > > there some way to implement similar interfaces? > > > > Best regards, > > Cheng Mao > > >