[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZpqT7raWOhb3xQ12@google.com>
Date: Fri, 19 Jul 2024 16:27:26 +0000
From: Sebastian Ene <sebastianene@...gle.com>
To: Vincent Donnefort <vdonnefort@...gle.com>
Cc: akpm@...ux-foundation.org, alexghiti@...osinc.com, ankita@...dia.com,
ardb@...nel.org, catalin.marinas@....com,
christophe.leroy@...roup.eu, james.morse@....com,
mark.rutland@....com, maz@...nel.org, oliver.upton@...ux.dev,
rananta@...gle.com, ryan.roberts@....com, shahuang@...hat.com,
suzuki.poulose@....com, will@...nel.org, yuzenghui@...wei.com,
kvmarm@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH v7 5/6] KVM: arm64: Initialize the ptdump parser with
stage-2 attributes
On Fri, Jul 19, 2024 at 03:36:04PM +0100, 'Vincent Donnefort' via kernel-team wrote:
> On Fri, Jul 19, 2024 at 02:09:19PM +0000, Sebastian Ene wrote:
> > On Tue, Jul 16, 2024 at 10:59:41AM +0100, Vincent Donnefort wrote:
> > > On Mon, Jul 01, 2024 at 02:18:39PM +0000, Sebastian Ene wrote:
> > > > On Mon, Jul 01, 2024 at 09:42:43AM +0100, Vincent Donnefort wrote:
> > > > > O Fri, Jun 21, 2024 at 12:32:29PM +0000, 'Sebastian Ene' via kernel-team wrote:
> > > > > > Define a set of attributes used by the ptdump parser to display the
> > > > > > properties of a guest memory region covered by a pagetable descriptor.
> > > > > > Build a description of the pagetable levels and initialize the parser
> > > > > > with this configuration.
> > > > > >
> > > > > > Signed-off-by: Sebastian Ene <sebastianene@...gle.com>
> > > > > > ---
> > > > > > arch/arm64/kvm/ptdump.c | 143 ++++++++++++++++++++++++++++++++++++++--
> > > > > > 1 file changed, 137 insertions(+), 6 deletions(-)
> > > > > >
> > > > > > diff --git a/arch/arm64/kvm/ptdump.c b/arch/arm64/kvm/ptdump.c
> > > > > > index 36dc7662729f..cc1d4fdddc6e 100644
> > > > > > --- a/arch/arm64/kvm/ptdump.c
> > > > > > +++ b/arch/arm64/kvm/ptdump.c
> > > > > > @@ -14,6 +14,61 @@
> > > > > > #include <kvm_ptdump.h>
> > > > > >
> > > > > >
> > > > > > +#define MARKERS_LEN (2)
> > > > > > +#define KVM_PGTABLE_MAX_LEVELS (KVM_PGTABLE_LAST_LEVEL + 1)
> > > > > > +
> > > > > > +struct kvm_ptdump_guest_state {
> > > > > > + struct kvm *kvm;
> > > > > > + struct pg_state parser_state;
> > > > > > + struct addr_marker ipa_marker[MARKERS_LEN];
> > > > > > + struct pg_level level[KVM_PGTABLE_MAX_LEVELS];
> > > > > > + struct ptdump_range range[MARKERS_LEN];
> > > > > > +};
> > > > > > +
> > > > > > +static const struct prot_bits stage2_pte_bits[] = {
> > > > > > + {
> > > > > > + .mask = PTE_VALID,
> > > > > > + .val = PTE_VALID,
> > > > > > + .set = " ",
> > > > > > + .clear = "F",
> > > > > > + }, {
> > > > > > + .mask = KVM_PTE_LEAF_ATTR_HI_S2_XN | PTE_VALID,
> > > > > > + .val = KVM_PTE_LEAF_ATTR_HI_S2_XN | PTE_VALID,
> > >
> > > KVM_PTE_LEAF_ATTR_HI_S2_XN is actually a mask covering
> >
> > It is not a mask covering here but in the ACK kernel.
>
> You're right, I should have double-checked upstream.
>
> That said, how about we move this __after__ RW ? and just use "X" on .clear
> so we can have something R W X ?
>
Yes that's a good ideea to improve output format, let me move it.
> >
> > >
> > > KVM_PTE_LEAF_ATTR_HI_S2_XN_XN, KVM_PTE_LEAF_ATTR_HI_S2_XN_PXN and
> > > KVM_PTE_LEAF_ATTR_HI_S2_XN_UXN.
> > >
> > > I believe here what we should do is something like?
> > >
> > > .val = FIELD_PREP_CONST(KVM_PTE_LEAF_ATTR_HI_S2_XN,
> > > KVM_PTE_LEAF_ATTR_HI_S2_XN_XN) | PTE_VALID
> > >
> > > > > > + .set = "XN",
> > > > > > + .clear = " ",
> > > > > > + }, {
> > > > > > + .mask = KVM_PTE_LEAF_ATTR_LO_S2_S2AP_R | PTE_VALID,
> > > > > > + .val = KVM_PTE_LEAF_ATTR_LO_S2_S2AP_R | PTE_VALID,
> > > > > > + .set = "R",
> > > > > > + .clear = " ",
> > > > > > + }, {
> > >
> > > [...]
>
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@...roid.com.
>
Powered by blists - more mailing lists