[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 12/21] i386/xen: set shared_info page
From: |
David Woodhouse |
Subject: |
Re: [RFC PATCH 12/21] i386/xen: set shared_info page |
Date: |
Tue, 06 Dec 2022 02:20:08 +0000 |
User-agent: |
Evolution 3.36.5-0ubuntu1 |
On Mon, 2022-12-05 at 23:17 +0100, Philippe Mathieu-Daudé wrote:
> On 5/12/22 18:31, David Woodhouse wrote:
> > From: Joao Martins <joao.m.martins@oracle.com>
> >
> > This is done by implementing HYPERVISOR_memory_op specifically
> > XENMEM_add_to_physmap with space XENMAPSPACE_shared_info. While
> > Xen removes the page with its own, we instead use the gfn passed
> > by the guest.
> >
> > Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
> > Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> > ---
> > accel/kvm/kvm-all.c | 6 ++++
> > include/hw/core/cpu.h | 2 ++
> > include/sysemu/kvm.h | 2 ++
> > include/sysemu/kvm_int.h | 3 ++
> > target/i386/cpu.h | 8 ++++++
> > target/i386/trace-events | 1 +
> > target/i386/xen-proto.h | 19 +++++++++++++
> > target/i386/xen.c | 61 ++++++++++++++++++++++++++++++++++++++++
> > 8 files changed, 102 insertions(+)
> > create mode 100644 target/i386/xen-proto.h
>
>
> > diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> > index 8830546121..e57b693528 100644
> > --- a/include/hw/core/cpu.h
> > +++ b/include/hw/core/cpu.h
> > @@ -443,6 +443,8 @@ struct CPUState {
> >
> > /* track IOMMUs whose translations we've cached in the TCG TLB */
> > GArray *iommu_notifiers;
> > +
> > + struct XenState *xen_state;
>
> Since you define a type definition below, use it.
Ack.
More importantly though, some of that state needs to be persisted
across live migration / live update.
There is per-vCPU state (the GPAs for vcpu_info etc., upcall vector,
timer info). I think I see how I could add that to the vmstate_x86_cpu
defined in target/i386/machine.c.
For the machine-wide state, where do I add that? Should I just
instantiate a dummy device (a bit like TYPE_KVM_CLOCK, AFAICT) to hang
that state off?
smime.p7s
Description: S/MIME cryptographic signature
- [RFC PATCH 09/21] pc_piix: allow xenfv machine with XEN_EMULATE, (continued)
- [RFC PATCH 09/21] pc_piix: allow xenfv machine with XEN_EMULATE, David Woodhouse, 2022/12/05
- [RFC PATCH 18/21] kvm/ioapic: mark gsi-2 used in ioapic routing init, David Woodhouse, 2022/12/05
- [RFC PATCH 07/21] xen-platform-pci: register xen-mmio as RAM for XEN_EMULATE, David Woodhouse, 2022/12/05
- [RFC PATCH 15/21] i386/xen: handle register_vcpu_info, David Woodhouse, 2022/12/05
- [RFC PATCH 12/21] i386/xen: set shared_info page, David Woodhouse, 2022/12/05
[RFC PATCH 21/21] i386/xen: implement HYPERVISOR_sched_op, David Woodhouse, 2022/12/05
[RFC PATCH 10/21] i386/xen: handle guest hypercalls, David Woodhouse, 2022/12/05