From: Andrew Jones <andrew.jones@linux.dev>
To: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Shaoqin Huang <shahuang@redhat.com>,
kvmarm@lists.linux.dev,
Nikos Nikoleris <nikos.nikoleris@arm.com>,
Eric Auger <eric.auger@redhat.com>,
Laurent Vivier <lvivier@redhat.com>,
Thomas Huth <thuth@redhat.com>, Nico Boehr <nrb@linux.ibm.com>,
David Woodhouse <dwmw@amazon.co.uk>,
Nadav Amit <namit@vmware.com>,
kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [kvm-unit-tests PATCH v1 01/18] Makefile: Define __ASSEMBLY__ for assembly files
Date: Thu, 15 Feb 2024 20:13:30 +0100 [thread overview]
Message-ID: <20240215-8527d5fd0c830d5d8d07f668@orel> (raw)
In-Reply-To: <Zc5G0Uu1QxJ1Qt36@raptor>
On Thu, Feb 15, 2024 at 05:16:01PM +0000, Alexandru Elisei wrote:
> Hi Drew,
>
> On Thu, Feb 15, 2024 at 05:32:22PM +0100, Andrew Jones wrote:
> > On Thu, Feb 15, 2024 at 04:05:56PM +0000, Alexandru Elisei wrote:
> > > Hi Drew,
> > >
> > > On Mon, Jan 15, 2024 at 01:44:17PM +0100, Andrew Jones wrote:
> > > > On Thu, Nov 30, 2023 at 04:07:03AM -0500, Shaoqin Huang wrote:
> > > > > From: Alexandru Elisei <alexandru.elisei@arm.com>
> > > > >
> > > > > There are 25 header files today (found with grep -r "#ifndef __ASSEMBLY__)
> > > > > with functionality relies on the __ASSEMBLY__ prepocessor constant being
> > > > > correctly defined to work correctly. So far, kvm-unit-tests has relied on
> > > > > the assembly files to define the constant before including any header
> > > > > files which depend on it.
> > > > >
> > > > > Let's make sure that nobody gets this wrong and define it as a compiler
> > > > > constant when compiling assembly files. __ASSEMBLY__ is now defined for all
> > > > > .S files, even those that didn't set it explicitely before.
> > > > >
> > > > > Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
> > > > > Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
> > > > > Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> > > > > Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
> > > > > ---
> > > > > Makefile | 5 ++++-
> > > > > arm/cstart.S | 1 -
> > > > > arm/cstart64.S | 1 -
> > > > > powerpc/cstart64.S | 1 -
> > > > > 4 files changed, 4 insertions(+), 4 deletions(-)
> > > > >
> > > > > diff --git a/Makefile b/Makefile
> > > > > index 602910dd..27ed14e6 100644
> > > > > --- a/Makefile
> > > > > +++ b/Makefile
> > > > > @@ -92,6 +92,9 @@ CFLAGS += -Woverride-init -Wmissing-prototypes -Wstrict-prototypes
> > > > >
> > > > > autodepend-flags = -MMD -MP -MF $(dir $*).$(notdir $*).d
> > > > >
> > > > > +AFLAGS = $(CFLAGS)
> > > > > +AFLAGS += -D__ASSEMBLY__
> > > > > +
> > > > > LDFLAGS += -nostdlib $(no_pie) -z noexecstack
> > > > >
> > > > > $(libcflat): $(cflatobjs)
> > > > > @@ -113,7 +116,7 @@ directories:
> > > > > @mkdir -p $(OBJDIRS)
> > > > >
> > > > > %.o: %.S
> > > > > - $(CC) $(CFLAGS) -c -nostdlib -o $@ $<
> > > > > + $(CC) $(AFLAGS) -c -nostdlib -o $@ $<
> > > >
> > > > I think we can drop the two hunks above from this patch and just rely on
> > > > the compiler to add __ASSEMBLY__ for us when compiling assembly files.
> > >
> > > I think the precompiler adds __ASSEMBLER__, not __ASSEMBLY__ [1]. Am I
> > > missing something?
> > >
> > > [1] https://gcc.gnu.org/onlinedocs/cpp/macros/predefined-macros.html#c.__ASSEMBLER__
> >
> > You're right. I'm not opposed to changing all the __ASSEMBLY__ references
> > to __ASSEMBLER__. I'll try to do that at some point unless you beat me to
> > it.
>
> Actually, I quite prefer the Linux style of using __ASSEMBLY__ instead of
> __ASSEMBLER__, because it makes reusing Linux files easier. That, and the
> habit formed by staring at Linux assembly files.
Those are good arguments and also saves the churn. OK, let's keep this
patch and __ASSEMBLY__
Thanks,
drew
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Jones <andrew.jones@linux.dev>
To: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
Thomas Huth <thuth@redhat.com>, Nico Boehr <nrb@linux.ibm.com>,
kvm@vger.kernel.org, Shaoqin Huang <shahuang@redhat.com>,
Nikos Nikoleris <nikos.nikoleris@arm.com>,
Eric Auger <eric.auger@redhat.com>, Nadav Amit <namit@vmware.com>,
kvmarm@lists.linux.dev, linuxppc-dev@lists.ozlabs.org,
David Woodhouse <dwmw@amazon.co.uk>
Subject: Re: [kvm-unit-tests PATCH v1 01/18] Makefile: Define __ASSEMBLY__ for assembly files
Date: Thu, 15 Feb 2024 20:13:30 +0100 [thread overview]
Message-ID: <20240215-8527d5fd0c830d5d8d07f668@orel> (raw)
In-Reply-To: <Zc5G0Uu1QxJ1Qt36@raptor>
On Thu, Feb 15, 2024 at 05:16:01PM +0000, Alexandru Elisei wrote:
> Hi Drew,
>
> On Thu, Feb 15, 2024 at 05:32:22PM +0100, Andrew Jones wrote:
> > On Thu, Feb 15, 2024 at 04:05:56PM +0000, Alexandru Elisei wrote:
> > > Hi Drew,
> > >
> > > On Mon, Jan 15, 2024 at 01:44:17PM +0100, Andrew Jones wrote:
> > > > On Thu, Nov 30, 2023 at 04:07:03AM -0500, Shaoqin Huang wrote:
> > > > > From: Alexandru Elisei <alexandru.elisei@arm.com>
> > > > >
> > > > > There are 25 header files today (found with grep -r "#ifndef __ASSEMBLY__)
> > > > > with functionality relies on the __ASSEMBLY__ prepocessor constant being
> > > > > correctly defined to work correctly. So far, kvm-unit-tests has relied on
> > > > > the assembly files to define the constant before including any header
> > > > > files which depend on it.
> > > > >
> > > > > Let's make sure that nobody gets this wrong and define it as a compiler
> > > > > constant when compiling assembly files. __ASSEMBLY__ is now defined for all
> > > > > .S files, even those that didn't set it explicitely before.
> > > > >
> > > > > Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
> > > > > Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
> > > > > Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> > > > > Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
> > > > > ---
> > > > > Makefile | 5 ++++-
> > > > > arm/cstart.S | 1 -
> > > > > arm/cstart64.S | 1 -
> > > > > powerpc/cstart64.S | 1 -
> > > > > 4 files changed, 4 insertions(+), 4 deletions(-)
> > > > >
> > > > > diff --git a/Makefile b/Makefile
> > > > > index 602910dd..27ed14e6 100644
> > > > > --- a/Makefile
> > > > > +++ b/Makefile
> > > > > @@ -92,6 +92,9 @@ CFLAGS += -Woverride-init -Wmissing-prototypes -Wstrict-prototypes
> > > > >
> > > > > autodepend-flags = -MMD -MP -MF $(dir $*).$(notdir $*).d
> > > > >
> > > > > +AFLAGS = $(CFLAGS)
> > > > > +AFLAGS += -D__ASSEMBLY__
> > > > > +
> > > > > LDFLAGS += -nostdlib $(no_pie) -z noexecstack
> > > > >
> > > > > $(libcflat): $(cflatobjs)
> > > > > @@ -113,7 +116,7 @@ directories:
> > > > > @mkdir -p $(OBJDIRS)
> > > > >
> > > > > %.o: %.S
> > > > > - $(CC) $(CFLAGS) -c -nostdlib -o $@ $<
> > > > > + $(CC) $(AFLAGS) -c -nostdlib -o $@ $<
> > > >
> > > > I think we can drop the two hunks above from this patch and just rely on
> > > > the compiler to add __ASSEMBLY__ for us when compiling assembly files.
> > >
> > > I think the precompiler adds __ASSEMBLER__, not __ASSEMBLY__ [1]. Am I
> > > missing something?
> > >
> > > [1] https://gcc.gnu.org/onlinedocs/cpp/macros/predefined-macros.html#c.__ASSEMBLER__
> >
> > You're right. I'm not opposed to changing all the __ASSEMBLY__ references
> > to __ASSEMBLER__. I'll try to do that at some point unless you beat me to
> > it.
>
> Actually, I quite prefer the Linux style of using __ASSEMBLY__ instead of
> __ASSEMBLER__, because it makes reusing Linux files easier. That, and the
> habit formed by staring at Linux assembly files.
Those are good arguments and also saves the churn. OK, let's keep this
patch and __ASSEMBLY__
Thanks,
drew
next prev parent reply other threads:[~2024-02-15 19:13 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 9:07 [kvm-unit-tests PATCH v1 00/18] arm/arm64: Rework cache maintenance at boot Shaoqin Huang
2023-11-30 9:07 ` Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 01/18] Makefile: Define __ASSEMBLY__ for assembly files Shaoqin Huang
2023-11-30 9:07 ` Shaoqin Huang
2024-01-15 12:44 ` Andrew Jones
2024-01-15 12:44 ` Andrew Jones
2024-02-15 16:05 ` Alexandru Elisei
2024-02-15 16:05 ` Alexandru Elisei
2024-02-15 16:32 ` Andrew Jones
2024-02-15 16:32 ` Andrew Jones
2024-02-15 17:16 ` Alexandru Elisei
2024-02-15 17:16 ` Alexandru Elisei
2024-02-15 19:13 ` Andrew Jones [this message]
2024-02-15 19:13 ` Andrew Jones
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 02/18] powerpc: Replace the physical allocator with the page allocator Shaoqin Huang
2023-11-30 9:07 ` Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 03/18] lib/alloc_phys: Initialize align_min Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 04/18] lib/alloc_phys: Consolidate allocate functions into memalign_early() Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 05/18] lib/alloc_phys: Remove locking Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 06/18] lib/alloc_phys: Remove allocation accounting Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 07/18] lib/alloc_phys: Add callback to perform cache maintenance Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 08/18] lib/alloc_phys: Expand documentation with usage and limitations Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 09/18] arm/arm64: Zero secondary CPUs' stack Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 10/18] arm/arm64: Allocate secondaries' stack using the page allocator Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 11/18] arm/arm64: assembler.h: Replace size with end address for dcache_by_line_op Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 12/18] arm/arm64: Add C functions for doing cache maintenance Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 13/18] arm/arm64: Configure secondaries' stack before enabling the MMU Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 14/18] arm/arm64: Use pgd_alloc() to allocate mmu_idmap Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 15/18] arm/arm64: Enable the MMU early Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 16/18] arm/arm64: Map the UART when creating the translation tables Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 17/18] arm/arm64: Perform dcache maintenance at boot Shaoqin Huang
2023-11-30 9:07 ` [kvm-unit-tests PATCH v1 18/18] arm/arm64: Rework the cache maintenance in asm_mmu_disable Shaoqin Huang
2023-11-30 10:35 ` [kvm-unit-tests PATCH v1 00/18] arm/arm64: Rework cache maintenance at boot Alexandru Elisei
2023-11-30 10:35 ` Alexandru Elisei
2023-12-01 8:40 ` Shaoqin Huang
2023-12-01 8:40 ` Shaoqin Huang
2024-02-16 15:47 ` Alexandru Elisei
2024-02-16 15:47 ` Alexandru Elisei
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=20240215-8527d5fd0c830d5d8d07f668@orel \
--to=andrew.jones@linux.dev \
--cc=alexandru.elisei@arm.com \
--cc=dwmw@amazon.co.uk \
--cc=eric.auger@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lvivier@redhat.com \
--cc=namit@vmware.com \
--cc=nikos.nikoleris@arm.com \
--cc=nrb@linux.ibm.com \
--cc=shahuang@redhat.com \
--cc=thuth@redhat.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 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.