All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Julien Grall <julien@xen.org>
Cc: "George Dunlap" <george.dunlap@citrix.com>,
	"Ian Jackson" <iwj@xenproject.org>, "Wei Liu" <wl@xen.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"M A Young" <m.a.young@durham.ac.uk>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>
Subject: Re: [PATCH 1/3] introduce unaligned.h
Date: Mon, 18 Jan 2021 11:59:32 +0100	[thread overview]
Message-ID: <3aaac5be-b5ef-674f-8671-dbe27aa3fd8c@suse.com> (raw)
In-Reply-To: <70ad73e4-c9d2-ec55-dc40-14567a0838af@xen.org>

On 18.01.2021 11:45, Julien Grall wrote:
> On 18/01/2021 09:33, Jan Beulich wrote:
>> On 15.01.2021 12:27, Jan Beulich wrote:
>>> On 15.01.2021 12:13, Andrew Cooper wrote:
>>>> On 15/01/2021 10:05, Jan Beulich wrote:
>>>>> Rather than open-coding commonly used constructs in yet more places when
>>>>> pulling in zstd decompression support (and its xxhash prereq), pull out
>>>>> the custom bits into a commonly used header (for the hypervisor build;
>>>>> the tool stack and stubdom builds of libxenguest will still remain in
>>>>> need of similarly taking care of). For now this is limited to x86, where
>>>>> custom logic isn't needed (considering this is going to be used in init
>>>>> code only, even using alternatives patching to use MOVBE doesn't seem
>>>>> worthwhile).
>>>>>
>>>>> No change in generated code.
>>>>>
>>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>>> ---
>>>>> Iirc use of include/asm-generic/ was disliked, hence the generic header
>>>>> goes into include/xen/.
>>>>
>>>> Really?  I think its going to be the only sane way of fixing up some of
>>>> our header tangle.
>>>>
>>>> This series probably isn't the right place to fix this argument, so
>>>> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>
>>> Thanks.
>>>
>>>> However, presumably we're going to want an ARM side of this imminently?
>>>
>>> Why? It's only used (and going to be further used) by code not
>>> built for Arm. So while it certainly would be nice for such a
>>> header to also appear there (and the x86-special casing going
>>> away in patch 2), it's not a strict requirement at this point.
>>> Therefore I'd prefer to leave this to the Arm maintainers (and
>>> probably for 4.16).
>>
>> I was wrong here, when it comes to an Arm64 build with ACPI
>> support enabled. xen/arch/arm/efi/efi-dom0.c has
>>
>> #define XZ_EXTERN STATIC
>> #include "../../../common/xz/crc32.c"
>>
>> in order to later do
>>
>>      xz_crc32_init();
>>      efi_sys_tbl->Hdr.CRC32 = xz_crc32((uint8_t *)efi_sys_tbl,
>>                                        efi_sys_tbl->Hdr.HeaderSize, 0);
>>
>> Urgh. Why in the world does xz code get re-used like this?
>> If we need generic crc32 support, such should imo live in
>> xen/lib/.
> 
> I suspect this was in order to make the EFI stub completely independent 
> to Xen (this is the case for Linux Arm). It turns out we now have an 
> hybrid model as we re-use pass some information in the DT and other via 
> variables.
> 
>>
>> So we have two possible courses of action: Eliminate this
>> unsuitable re-use of code, or introduce asm/unaligned.h
>> for Arm (or at least Arm64, in case it makes a difference)
>> right away.
> 
> EFI stub is only supported for Arm64. So it should be sufficient to 
> introduce the asm/unaligned.h on Arm64.
> 
> Note that on Arm32 we forbid unaligned access. So we may need two set of 
> helpers (I haven't looked at what the header does).

IOW it might be possible that Arm64 could re-use the x86 header.
Unless the price of unaligned accesses is much higher there. But
anyway, I'm about to commit the series with the issues addressed
using the 3rd approach, outlined earlier in a separate reply.

Jan


  reply	other threads:[~2021-01-18 10:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 10:03 [PATCH 0/3] x86/Dom0: support zstd compressed kernels Jan Beulich
2021-01-15 10:05 ` [PATCH 1/3] introduce unaligned.h Jan Beulich
2021-01-15 11:13   ` Andrew Cooper
2021-01-15 11:27     ` Jan Beulich
2021-01-18  9:33       ` Jan Beulich
2021-01-18  9:51         ` Jan Beulich
2021-01-18 10:45         ` Julien Grall
2021-01-18 10:59           ` Jan Beulich [this message]
2021-01-15 11:29     ` Jan Beulich
2021-01-18 10:35       ` Julien Grall
2021-01-15 10:06 ` [PATCH 2/3] lib: introduce xxhash Jan Beulich
2021-01-15 11:18   ` Andrew Cooper
2021-01-15 10:06 ` [PATCH 3/3] x86/Dom0: support zstd compressed kernels Jan Beulich
2021-01-15 11:20   ` Andrew Cooper

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=3aaac5be-b5ef-674f-8671-dbe27aa3fd8c@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=julien@xen.org \
    --cc=m.a.young@durham.ac.uk \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.