From patchwork Mon Oct 16 15:18:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 13423564 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D2CAC41513 for ; Mon, 16 Oct 2023 15:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233788AbjJPPTx (ORCPT ); Mon, 16 Oct 2023 11:19:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233628AbjJPPTr (ORCPT ); Mon, 16 Oct 2023 11:19:47 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B566FB for ; Mon, 16 Oct 2023 08:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=F3UjuhE2FBKcmgLerw1NnKKsKaQ1Vv0F+THBpoMNMME=; b=RUe0h4t2PDLQe/PbrYmnoJGzBv XpnXvqi6OUXrxehffQ1Zf3iom+dmkFdob8j4mg/Fas49lSB23CT9QoY4sPBHT4gD/sj7ySvs5Vrf1 YlBGiPXcApj99d7zg4CiWufTxxd6zJETNOAbQpUZHP7JI/G6hkT4XxZ/Vg0SWIAYmhNl6AkpgMA63 e2cWIx2oNICYJZFTgnao0HZdGFu0FriQCdSWlVoDiXrgJFb4ucufo8yvmCSkO1VpYxIYLfrsie/tz 29KhaPmM8aD222XRsxlZECZiMS8rBg9NJydMRO9W4S4Ltm38AFPXw/MPQ+HkcdEr5AesYJTRLYIP9 SYkllKNQ==; Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qsPNC-006lqX-62; Mon, 16 Oct 2023 15:19:14 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qsPNB-0005n5-1t; Mon, 16 Oct 2023 16:19:13 +0100 From: David Woodhouse To: qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , Stefano Stabellini , Anthony Perard , Paul Durrant , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , "Michael S. Tsirkin" , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , David Woodhouse , Marcelo Tosatti , qemu-block@nongnu.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org Subject: [PATCH 0/12] Get Xen PV shim running in qemu Date: Mon, 16 Oct 2023 16:18:57 +0100 Message-Id: <20231016151909.22133-1-dwmw2@infradead.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org I hadn't got round to getting the PV shim running yet; I thought it would need work on the multiboot loader. Turns out it doesn't. I *did* need to fix a couple of brown-paper-bag bugs in the per-vCPU upcall vector support, and implement Xen console support though. Now I can test PV guests: $ qemu-system-x86_64 --accel kvm,xen-version=0x40011,kernel-irqchip=split \ -chardev stdio,mux=on,id=char0 -device xen-console,chardev=char0 \ -drive file=${GUEST_IMAGE},if=xen -display none -m 1G \ -kernel ~/git/xen/xen/xen -initrd ~/git/linux/arch/x86/boot/bzImage \ -append "loglvl=all -- console=hvc0 root=/dev/xvda1" blockdev.c | 15 +++- hw/block/xen-block.c | 26 +++++- hw/char/trace-events | 8 ++ hw/char/xen_console.c | 522 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------- hw/i386/kvm/meson.build | 1 + hw/i386/kvm/trace-events | 2 + hw/i386/kvm/xen-stubs.c | 5 ++ hw/i386/kvm/xen_evtchn.c | 6 ++ hw/i386/kvm/xen_gnttab.c | 32 ++++++- hw/i386/kvm/xen_primary_console.c | 167 ++++++++++++++++++++++++++++++++++ hw/i386/kvm/xen_primary_console.h | 22 +++++ hw/i386/kvm/xen_xenstore.c | 21 ++++- hw/xen/xen-backend.c | 81 +++++++++++++---- hw/xen/xen-bus.c | 21 ++++- hw/xen/xen-legacy-backend.c | 1 - include/hw/xen/interface/arch-arm.h | 37 ++++---- include/hw/xen/interface/arch-x86/cpuid.h | 31 +++---- include/hw/xen/interface/arch-x86/xen-x86_32.h | 19 +--- include/hw/xen/interface/arch-x86/xen-x86_64.h | 19 +--- include/hw/xen/interface/arch-x86/xen.h | 26 +----- include/hw/xen/interface/event_channel.h | 19 +--- include/hw/xen/interface/features.h | 19 +--- include/hw/xen/interface/grant_table.h | 19 +--- include/hw/xen/interface/hvm/hvm_op.h | 19 +--- include/hw/xen/interface/hvm/params.h | 19 +--- include/hw/xen/interface/io/blkif.h | 27 ++---- include/hw/xen/interface/io/console.h | 19 +--- include/hw/xen/interface/io/fbif.h | 19 +--- include/hw/xen/interface/io/kbdif.h | 19 +--- include/hw/xen/interface/io/netif.h | 25 ++---- include/hw/xen/interface/io/protocols.h | 19 +--- include/hw/xen/interface/io/ring.h | 49 +++++----- include/hw/xen/interface/io/usbif.h | 19 +--- include/hw/xen/interface/io/xenbus.h | 19 +--- include/hw/xen/interface/io/xs_wire.h | 36 ++++---- include/hw/xen/interface/memory.h | 30 +++---- include/hw/xen/interface/physdev.h | 23 +---- include/hw/xen/interface/sched.h | 19 +--- include/hw/xen/interface/trace.h | 19 +--- include/hw/xen/interface/vcpu.h | 19 +--- include/hw/xen/interface/version.h | 19 +--- include/hw/xen/interface/xen-compat.h | 19 +--- include/hw/xen/interface/xen.h | 19 +--- include/hw/xen/xen-backend.h | 4 + include/hw/xen/xen-bus.h | 2 + include/sysemu/kvm_xen.h | 1 + target/i386/kvm/kvm.c | 4 + target/i386/kvm/xen-emu.c | 35 ++++++-- 48 files changed, 941 insertions(+), 680 deletions(-)