From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
linux-s390@vger.kernel.org, hca@linux.ibm.com,
svens@linux.ibm.com, gor@linux.ibm.com, nrb@linux.ibm.com,
nsg@linux.ibm.com, seiden@linux.ibm.com, frankja@linux.ibm.com,
borntraeger@de.ibm.com, gerald.schaefer@linux.ibm.com,
david@redhat.com
Subject: Re: [PATCH v1 2/2] s390/kvm: Move bitfields for dat tables
Date: Thu, 11 Jul 2024 18:23:48 +0200 [thread overview]
Message-ID: <20240711182348.21ca02b2@p-imbrenda> (raw)
In-Reply-To: <Zo/3RzpS2WNssMIi@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
On Thu, 11 Jul 2024 17:16:23 +0200
Alexander Gordeev <agordeev@linux.ibm.com> wrote:
> On Wed, Jul 03, 2024 at 05:59:00PM +0200, Claudio Imbrenda wrote:
>
> Hi Claudio,
>
> > Once in a separate header, the structs become available everywhere. One
> > possible usecase is to merge them in the s390
> > definitions, which is left as an exercise for the reader.
>
> Is my understanding correct that you potentially see page_table_entry::val /
> region?_table_entry.*::val / segment_table_entry.* merged with pte_t::pte /
> p?d_t::p?d?
>
> Thanks!
that depends on how you want to do the merge
you could do:
typedef union {
unsigned long pte;
union page_table_entry hw;
union page_table_entry_softbits sw;
} pte_t;
then you would have pte_t::pte and pte_t::hw::val; unfortunately it's
not possible to anonymously merge a named type..
this would be great but can't be done*:
typedef union {
unsigned long pte;
union page_table_entry;
} pte_t;
[*] gcc actually supports it with an additional feature switch, but
it's not standard C and I seriously doubt we should even think about
doing it
another possibility is a plain
typedef union page_table_entry pte_t;
and then fix pte_val() and similar, but then you won't have the
softbits.
in the end, it's up to you how you want to merge them. I will
have my own unions that I will use only inside KVM, that's enough for
me.
next prev parent reply other threads:[~2024-07-11 16:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 15:58 [PATCH v1 0/2] s390: Two small fixes and improvements Claudio Imbrenda
2024-07-03 15:58 ` [PATCH v1 1/2] s390/entry: Pass the asce as parameter to sie64a() Claudio Imbrenda
2024-07-09 12:15 ` Nico Boehr
2024-07-09 14:52 ` Alexander Gordeev
2024-07-03 15:59 ` [PATCH v1 2/2] s390/kvm: Move bitfields for dat tables Claudio Imbrenda
2024-07-09 8:45 ` Nico Boehr
2024-07-11 15:16 ` Alexander Gordeev
2024-07-11 16:23 ` Claudio Imbrenda [this message]
2024-07-12 9:56 ` Heiko Carstens
2024-07-09 12:25 ` [PATCH v1 0/2] s390: Two small fixes and improvements Heiko Carstens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240711182348.21ca02b2@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=seiden@linux.ibm.com \
--cc=svens@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox