From: Borislav Petkov <bp@alien8.de>
To: Dave Hansen <dave.hansen@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
x86@kernel.org
Subject: Re: [tip: x86/urgent] x86/tdx: Prepare for using "INFO" call for a second purpose
Date: Sun, 6 Nov 2022 13:45:16 +0100 [thread overview]
Message-ID: <Y2esXPWwulendusf@zn.tnic> (raw)
In-Reply-To: <166734513630.7716.12952231613533508782.tip-bot2@tip-bot2>
On Tue, Nov 01, 2022 at 11:25:36PM -0000, tip-bot2 for Dave Hansen wrote:
> @@ -121,7 +121,7 @@ static u64 get_cc_mask(void)
> * The highest bit of a guest physical address is the "sharing" bit.
> * Set it for shared pages and clear it for private pages.
> */
> - return BIT_ULL(gpa_width - 1);
> + *cc_mask = BIT_ULL(gpa_width - 1);
> }
I'm looking at the next patch too and I still don't see what the point
is of making it a void?
IOW, what's wrong with doing this?
---
diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
index b8998cf0508a..0421cb7f3b86 100644
--- a/arch/x86/coco/tdx/tdx.c
+++ b/arch/x86/coco/tdx/tdx.c
@@ -100,11 +100,11 @@ static inline void tdx_module_call(u64 fn, u64 rcx, u64 rdx, u64 r8, u64 r9,
panic("TDCALL %lld failed (Buggy TDX module!)\n", fn);
}
-static void tdx_parse_tdinfo(u64 *cc_mask)
+static u64 tdx_parse_tdinfo(void)
{
struct tdx_module_output out;
unsigned int gpa_width;
- u64 td_attr;
+ u64 td_attr, ret;
/*
* TDINFO TDX module call is used to get the TD execution environment
@@ -123,7 +123,7 @@ static void tdx_parse_tdinfo(u64 *cc_mask)
* can not meaningfully run without it.
*/
gpa_width = out.rcx & GENMASK(5, 0);
- *cc_mask = BIT_ULL(gpa_width - 1);
+ ret = BIT_ULL(gpa_width - 1);
/*
* The kernel can not handle #VE's when accessing normal kernel
@@ -133,6 +133,8 @@ static void tdx_parse_tdinfo(u64 *cc_mask)
td_attr = out.rdx;
if (!(td_attr & ATTR_SEPT_VE_DISABLE))
panic("TD misconfiguration: SEPT_VE_DISABLE attibute must be set.\n");
+
+ return ret;
}
/*
@@ -769,7 +771,7 @@ void __init tdx_early_init(void)
setup_force_cpu_cap(X86_FEATURE_TDX_GUEST);
cc_set_vendor(CC_VENDOR_INTEL);
- tdx_parse_tdinfo(&cc_mask);
+ cc_mask = tdx_parse_tdinfo();
cc_set_mask(cc_mask);
/*
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2022-11-06 12:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 23:25 [tip: x86/urgent] x86/tdx: Prepare for using "INFO" call for a second purpose tip-bot2 for Dave Hansen
2022-11-06 12:45 ` Borislav Petkov [this message]
2022-11-06 17:02 ` Dave Hansen
2022-11-06 19:50 ` Borislav Petkov
2022-11-07 13:26 ` Dave Hansen
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=Y2esXPWwulendusf@zn.tnic \
--to=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--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.