[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ce63cfc3844a3b071d99d7c847c7188041daaa50.camel@mediatek.com>
Date: Fri, 12 May 2023 07:18:48 +0000
From: Yi-De Wu (吳一德) <Yi-De.Wu@...iatek.com>
To: "maz@...nel.org" <maz@...nel.org>,
"quic_tsoni@...cinc.com" <quic_tsoni@...cinc.com>
CC: "corbet@....net" <corbet@....net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
MY Chuang (莊明躍) <MY.Chuang@...iatek.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Shawn Hsiao (蕭志祥)
<shawn.hsiao@...iatek.com>,
Miles Chen (陳民樺)
<Miles.Chen@...iatek.com>,
PeiLun Suei (隋培倫)
<PeiLun.Suei@...iatek.com>,
Liju-clr Chen (陳麗如)
<Liju-clr.Chen@...iatek.com>,
Jades Shih (施向玨)
<jades.shih@...iatek.com>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"dbrazdil@...gle.com" <dbrazdil@...gle.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Yingshiuan Pan (潘穎軒)
<Yingshiuan.Pan@...iatek.com>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"arnd@...db.de" <arnd@...db.de>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
Ze-yu Wang (王澤宇)
<Ze-yu.Wang@...iatek.com>, "will@...nel.org" <will@...nel.org>,
Ivan Tseng (曾志軒)
<ivan.tseng@...iatek.com>
Subject: Re: [PATCH v2 3/7] virt: geniezone: Introduce GenieZone hypervisor
support
On Fri, 2023-04-28 at 15:48 -0700, Trilok Soni wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> Hi Marc,
>
> >
> > [...]
> >
> > > +/**
> > > + * gzvm_gfn_to_pfn_memslot() - Translate gfn (guest ipa) to pfn
> > > (host
> > > pa),
> > > + * result is in @pfn
> > > + *
> > > + * Leverage KVM's gfn_to_pfn_memslot(). Because
> > > gfn_to_pfn_memslot()
> > > needs
> > > + * kvm_memory_slot as parameter, this function populates
> > > necessary
> > > fileds
> > > + * for calling gfn_to_pfn_memslot().
> > > + *
> > > + * Return:
> > > + * * 0 - Succeed
> > > + * * -EFAULT - Failed to convert
> > > + */
> > > +static int gzvm_gfn_to_pfn_memslot(struct gzvm_memslot *memslot,
> > > u64
> > > gfn, u64 *pfn)
> > > +{
> > > + hfn_t __pfn;
> > > + struct kvm_memory_slot kvm_slot = {0};
> > > +
> > > + kvm_slot.base_gfn = memslot->base_gfn;
> > > + kvm_slot.npages = memslot->npages;
> > > + kvm_slot.dirty_bitmap = NULL;
> > > + kvm_slot.userspace_addr = memslot->userspace_addr;
> > > + kvm_slot.flags = memslot->flags;
> > > + kvm_slot.id = memslot->slot_id;
> > > + kvm_slot.as_id = 0;
> > > +
> > > + __pfn = gfn_to_pfn_memslot(&kvm_slot, gfn);
> >
> > Again, I absolutely oppose this horror. This is internal to KVM,
> > and we want to be able to change this without having to mess
> > with your own code that we cannot test anyway.
> >
> > What if we start using the extra fields that you don't populate
> > as they mean nothing to you? Or add a backpointer to the kvm
> > structure to do fancy accounting?
> >
> > You have your own hypervisor, that's well and good. Since your
> > main argument is that it is supposed to be standalone, make it
> > *really* standalone and don't use KVM as a prop.
>
>
> Agreed, same comments were made earlier too. I would prefer that
> GenieZone have its own identify rather than sharing the
> APIs/data-structures here.
>
> ---Trilok Soni
Same with previous discussion, we'd like to copy or rename the related
part from KVM and keep the maintainance at our own if it's ok.
Powered by blists - more mailing lists