[PATCH v2 4/4] x86/vdso: Rename "required_syms" to "requested_syms"

From: Sean Christopherson
Date: Tue Dec 04 2018 - 16:26:10 EST


The "required" moniker implies that vdso2c will fail if one of the
defined symbols is not found, which is simply not true, e.g.
VDSO32_NOTE_MASK is quite obviously 32-bit only and not required
for the 64-bit image.

Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
---
arch/x86/entry/vdso/vdso2c.c | 4 ++--
arch/x86/entry/vdso/vdso2c.h | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/entry/vdso/vdso2c.c b/arch/x86/entry/vdso/vdso2c.c
index a175cd2016c9..b2acdaffc66d 100644
--- a/arch/x86/entry/vdso/vdso2c.c
+++ b/arch/x86/entry/vdso/vdso2c.c
@@ -85,7 +85,7 @@ const int special_pages[] = {
sym_hvclock_page,
};

-const char *required_syms[] = {
+const char *requested_syms[] = {
[sym_vvar_start] = "vvar_start",
[sym_vvar_page] = "vvar_page",
[sym_hpet_page] = "hpet_page",
@@ -139,7 +139,7 @@ extern void bad_put_le(void);
PLE(x, val, 64, PLE(x, val, 32, PLE(x, val, 16, LAST_PLE(x, val))))


-#define NSYMS ARRAY_SIZE(required_syms)
+#define NSYMS ARRAY_SIZE(requested_syms)

#define BITSFUNC3(name, bits, suffix) name##bits##suffix
#define BITSFUNC2(name, bits, suffix) BITSFUNC3(name, bits, suffix)
diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h
index 14003d311298..6c5a290ce468 100644
--- a/arch/x86/entry/vdso/vdso2c.h
+++ b/arch/x86/entry/vdso/vdso2c.h
@@ -97,10 +97,10 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len,
GET_LE(&sym->st_name);

for (k = 0; k < NSYMS; k++) {
- if (!strcmp(name, required_syms[k])) {
+ if (!strcmp(name, requested_syms[k])) {
if (syms[k]) {
fail("duplicate symbol %s\n",
- required_syms[k]);
+ requested_syms[k]);
}

/*
@@ -123,12 +123,12 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len,

if (symval % 4096)
fail("%s must be a multiple of 4096\n",
- required_syms[i]);
+ requested_syms[i]);
if (symval + 4096 < syms[sym_vvar_start])
- fail("%s underruns vvar_start\n", required_syms[i]);
+ fail("%s underruns vvar_start\n", requested_syms[i]);
if (symval + 4096 > 0)
fail("%s is on the wrong side of the vdso text\n",
- required_syms[i]);
+ requested_syms[i]);
}
if (syms[sym_vvar_start] % 4096)
fail("vvar_begin must be a multiple of 4096\n");
@@ -168,7 +168,7 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len,
for (i = 0; i < NSYMS; i++) {
if (syms[i])
fprintf(outfile, "\t.sym_%s = %" PRIi64 ",\n",
- required_syms[i], (int64_t)syms[i]);
+ requested_syms[i], (int64_t)syms[i]);
}
fprintf(outfile, "};\n");
}
--
2.19.2