[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 00/36] Introduce NS8250 UART emulator


  • To: dmukhin@xxxxxxxx
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 27 Nov 2024 08:26:16 +0100
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, David Scott <dave@xxxxxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Wed, 27 Nov 2024 07:26:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.11.2024 00:57, Andrew Cooper wrote:
> On 26/11/2024 11:21 pm, Denis Mukhin via B4 Relay wrote:
>> The patch series introduces initial in-hypervisor emulator for
>> NS8250/NS16x50-compatible UARTs under CONFIG_HAS_VUART_NS8250.
>>
>> In parallel domain creation scenario (hyperlaunch), NS8520 emulator helps
>> early guest OS bringup debugging, because it eliminates dependency on the
>> external emulator being operational by the time domains are created. Also,
>> there's no early console facility similar to vpl011 to support x86 guest OS
>> bring up.
>>
>> The NS8250 emulator is disabled by default.
>>
>> Series
>> ======
>> - patches 1-2: some miscellaneous random fixes, added into the series
>>   because I stepped into those while debugging NS8250 emulator.
>>
>> - patches 3-14: preparation fixes for xen console and NS8250 emulator.
>>
>> - patches 15-29: xen console driver cleanup and preparation for enabling
>>   physical serial console focus assignment to the guest VM w/ virtual NS8250.
>>
>> - patches 30-36: initial NS8250 emulator. That adds the I/O port emulator
>>   for legacy PC COM UARTs, Kconfig option, enabling emulator and libxl
>>   plumbing.
>>
>> Limitations
>> ===========
>> - Only x86;
>> - Only Linux guest tested so far;
>> - Only legacy COM{1,2,3,4} resources, no customization;
>> - Only Xen console as a backend, no inter-domain communication (similar to
>>   vpl011 on Arm);
>> - Only 8-bit characters;
>> - Baud rate is not emulated;
>> - FIFO-less mode is not emulated properly;
>> - RX FIFO interrupt moderation (FCR) is not emulated properly, TL16C750
>>   has special FCR handling;
>> - No integration w/ VM snapshotting (HVM_REGISTER_SAVE_RESTORE() and
>>   friends);
>> - Assumes no ISA-device IRQ sharing;
>> - MMIO-based UART is not supported.
>>
>> Testing
>> =======
>>
>> I tested boot of HVM linux guest w/ OVMF as the virtual firmware.
>>
>> The emulator, if enabled via CONFIG_HAS_VUART_NS8250=y, will use COM1 (0x3f8)
>> resources by default.
>>
>> To test w/ virtual COM1, the guest kernel parameters should contain
>>   earlycon=uart,io,0x3f8,115200n8 console=uart,io,0x3f8,115200n8
>>
>> Xen is able to forward physical console input to the domain w/ virtual 
>> NS8250.
>> To switch the console focus press Ctrl+aaa. If console= is given to the HVM
>> kernel, then the user shall be able to see the login prompt on xen console 
>> once
>> console focus is switched to the HVM guest.
>>
>> Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
> 
> Hello,
> 
> Thankyou for this.  It's an excellent start for first posting to the list.

+1

> Two things stand out at a glance.
> 
> First, xmalloc/free are the expected functions to use,

Small correction - as of their introduction, it's xvmalloc() etc and xvfree()
which are to be used in new code.

One other, more general remark: Please send patches To: the list, with
maintainers Cc-ed. And please compose the Cc: lists per-patch - looking at
patch 2, there should really have been just a single person (Daniel) on Cc.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.