public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Vitaly Cheptsov" <vit9696@protonmail.com>
To: Vitaly Cheptsov <cheptsov@ispras.ru>,devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Fix CPU stack guard support by aligning GDT buffer
Date: Mon, 20 Sep 2021 09:15:12 -0700	[thread overview]
Message-ID: <4886.1632154512621436417@groups.io> (raw)
In-Reply-To: <20210920141347.25161-1-cheptsov@ispras.ru>

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

Just to make it clear, this is an immediate solution that is good enough to fix the bug. However, a more proper solution would be to introduce the _Alignas ( https://en.cppreference.com/w/c/language/_Alignas ) concept to EDK II. I would suggest the following macro in Base.h:

/**
Enforce custom alignment for a variable definition.
Similar to C11 alignas macro from stdalign.h, except it must be functional to support MSVC.

@param  Alignment  Numeric alignment to require.
**/
#ifdef _MSC_EXTENSIONS
#define ALIGNAS(Alignment) __declspec(align(Alignment))
#else
#define ALIGNAS(Alignment) _Alignas(Alignment)
#endif

If there is no disagreement on this, I can imagine submitting an update after this patch is merged.

[-- Attachment #2: Type: text/html, Size: 969 bytes --]

  reply	other threads:[~2021-09-20 16:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 14:13 [PATCH] UefiCpuPkg: Fix CPU stack guard support by aligning GDT buffer Vitaly Cheptsov
2021-09-20 16:15 ` Vitaly Cheptsov [this message]
2021-10-24 10:59   ` [edk2-devel] " Vitaly Cheptsov
2021-11-05 19:28 ` Leif Lindholm
2021-11-05 19:37   ` Vitaly Cheptsov
2021-11-08 14:04     ` Leif Lindholm
2021-11-05 19:42   ` Michael D Kinney
2021-11-05 20:36     ` Vitaly Cheptsov
2021-11-05 21:39       ` Michael D Kinney
2021-11-06  4:42         ` Vitaly Cheptsov

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-list 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=4886.1632154512621436417@groups.io \
    --to=devel@edk2.groups.io \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox