All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Borislav Petkov <bp@alien8.de>, Li Zetao <lizetao1@huawei.com>
Cc: tglx@linutronix.de, mingo@redhat.com,
	dave.hansen@linux.intel.com, x86@kernel.org,
	brijesh.singh@amd.com, michael.roth@amd.com,
	venu.busireddy@oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] x86/sev: Remove unused variable "err" in enforce_vmpl0()
Date: Mon, 26 Sep 2022 10:52:08 -0700	[thread overview]
Message-ID: <BA9F2C10-DC7F-49F9-B1AE-D58D690A5291@zytor.com> (raw)
In-Reply-To: <YzG72ynMieCUaHVM@zn.tnic>

On September 26, 2022 7:48:59 AM PDT, Borislav Petkov <bp@alien8.de> wrote:
>On Sat, Sep 24, 2022 at 06:18:19PM +0800, Li Zetao wrote:
>> My Compiler version is 11.2.0. I used the default .config and compiled with
>> flags "-Wall -Werror", just as follows:
>> 
>>     make allmodconfig
>> 
>>     make EXTRA_CFLAGS="-Wall -Werror"
>
>Ah, compressed/Makefile doesn't have -Wall. That's the old problem of
>x86 not sharing makefiles. I need to dust off my patches which do that.
>
>Now, if you do:
>
>diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
>index 35ce1a64068b..10abb7c45d04 100644
>--- a/arch/x86/boot/compressed/Makefile
>+++ b/arch/x86/boot/compressed/Makefile
>@@ -34,7 +34,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
> # be valid.
> KBUILD_CFLAGS := -m$(BITS) -O2 $(CLANG_FLAGS)
> KBUILD_CFLAGS += -fno-strict-aliasing -fPIE
>-KBUILD_CFLAGS += -Wundef
>+KBUILD_CFLAGS += -Wundef -Wall
> KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
> cflags-$(CONFIG_X86_32) := -march=i386
> cflags-$(CONFIG_X86_64) := -mcmodel=small -mno-red-zone
>
>then allmodconfig triggers a bunch:
>
>arch/x86/boot/compressed/efi.c: In function ‘efi_get_system_table’:
>arch/x86/boot/compressed/efi.c:62:23: warning: unused variable ‘et’ [-Wunused-variable]
>   62 |         enum efi_type et;
>      |                       ^~
>arch/x86/boot/compressed/efi.c: In function ‘efi_get_conf_table’:
>arch/x86/boot/compressed/efi.c:134:13: warning: unused variable ‘ret’ [-Wunused-variable]
>  134 |         int ret;
>      |             ^~~
>arch/x86/boot/compressed/acpi.c: In function ‘__efi_get_rsdp_addr’:
>arch/x86/boot/compressed/acpi.c:27:13: warning: unused variable ‘ret’ [-Wunused-variable]
>   27 |         int ret;
>      |             ^~~
>arch/x86/boot/compressed/acpi.c: In function ‘efi_get_rsdp_addr’:
>arch/x86/boot/compressed/acpi.c:55:22: warning: unused variable ‘nr_tables’ [-Wunused-variable]
>   55 |         unsigned int nr_tables;
>      |                      ^~~~~~~~~
>arch/x86/boot/compressed/sev.c: In function ‘enforce_vmpl0’:
>arch/x86/boot/compressed/sev.c:256:13: warning: unused variable ‘err’ [-Wunused-variable]
>  256 |         int err;
>      |             ^~~
>
>
>Would you like to do the above instead and fix them all in one go?
>
>Thx.
>

The boot code really needs to be refactored, especially that the real-mode BIOS code is built in the root of that tree.

  reply	other threads:[~2022-09-26 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 11:32 [PATCH -next] x86/sev: Remove unused variable "err" in enforce_vmpl0() Li Zetao
2022-09-23 12:19 ` Borislav Petkov
2022-09-24 10:18   ` Li Zetao
2022-09-26 14:48     ` Borislav Petkov
2022-09-26 17:52       ` H. Peter Anvin [this message]
2022-09-26 17:59         ` Borislav Petkov

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=BA9F2C10-DC7F-49F9-B1AE-D58D690A5291@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizetao1@huawei.com \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=venu.busireddy@oracle.com \
    --cc=x86@kernel.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.