All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhiquan Li <zhiquan1.li@intel.com>
To: Dave Hansen <dave.hansen@intel.com>, <linux-sgx@vger.kernel.org>,
	<jarkko@kernel.org>, <dave.hansen@linux.intel.com>,
	<kai.huang@intel.com>
Cc: <seanjc@google.com>, <fan.du@intel.com>, <cathy.zhang@intel.com>,
	<tglx@linutronix.de>, <bp@suse.de>, <tony.luck@intel.com>
Subject: Re: [PATCH v9 2/3] x86/sgx: Introduce union with vepc_vaddr field for virtualization case
Date: Wed, 12 Oct 2022 12:42:10 +0800	[thread overview]
Message-ID: <2dd703b6-66a9-0a35-b02e-6a66e356277f@intel.com> (raw)
In-Reply-To: <277c494c-7e55-2d73-dbf3-7a841836a395@intel.com>


On 2022/10/11 21:57, Dave Hansen wrote:
> That honestly doesn't help me understand what's going on here.
> 
> The changelog and subject are spending far too much time explaining the
> low level details of what is being done (like "add a union") and far too
> little time explaining what it _means_.

Thanks for your comments, Dave.

I added more descriptions for motivation and reduced explanations
for details in changelog as below, could you help me review if it is
easier to understand now?

    When a page triggers a machine check, it only reports the PFN.  But
    in order to inject #MC into VM through hypervisor, the virtual
    address of virtual EPC page is required.  To avoid introduce a new
    dedicated structure to track it, repurpose the 'encl_owner' field as
    it is useless in virtualization case, so that arch_memory_failure()
    can retrieve the virtual address easily and attach it to the extra
    info of SIGBUS which will be sent to hypervisor.

    The union can prevent playing the casting games while using it.  And
    add a new EPC page flag - SGX_EPC_PAGE_KVM_GUEST to interpret the
    meaning of the field.

    The changes take place while allocating an EPC page to a KVM guests.
    After applying it, the reversed relationship from an EPC page to
    virtual EPC doesn't exist, in practice, such relationship is
    useless. Beyond that, other behaviors have not been changed.

Furthermore, may I change the subject as below to highlight the
motivation?

    x86/sgx: track virtual address of virtual EPC page for injecting #MC
    into VM

Best Regards,
Zhiquan

  reply	other threads:[~2022-10-12  4:36 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20  6:39 [PATCH v9 0/3] x86/sgx: fine grained SGX MCA behavior Zhiquan Li
2022-09-20  6:39 ` [PATCH v9 1/3] x86/sgx: Rename the owner field of struct sgx_epc_page as encl_owner Zhiquan Li
2022-09-20  6:39 ` [PATCH v9 2/3] x86/sgx: Introduce union with vepc_vaddr field for virtualization case Zhiquan Li
2022-10-10 23:10   ` Dave Hansen
2022-10-11  5:49     ` Zhiquan Li
2022-10-11 13:57       ` Dave Hansen
2022-10-12  4:42         ` Zhiquan Li [this message]
2022-10-12 11:17           ` Huang, Kai
2022-09-20  6:39 ` [PATCH v9 3/3] x86/sgx: Fine grained SGX MCA behavior for virtualization Zhiquan Li
2022-10-10 23:20   ` Dave Hansen
2022-10-11  4:44     ` Zhiquan Li
2022-10-11 14:04   ` Dave Hansen
2022-10-12  5:09     ` Zhiquan Li
2022-10-12 11:01       ` Huang, Kai
2022-10-12 11:54         ` jarkko
2022-10-12 20:56           ` Huang, Kai
2022-10-13  2:05         ` Zhiquan Li
2022-10-12 14:36       ` Dave Hansen
2022-10-13 14:40         ` Zhiquan Li
2022-10-13 15:39           ` Dave Hansen
2022-10-14  5:42             ` Zhiquan Li
2022-10-14  5:41               ` Dave Hansen
2022-10-13 15:44           ` Dave Hansen
2022-10-13 21:49             ` Huang, Kai
2022-10-13 22:02               ` Dave Hansen
2022-10-13 22:15                 ` Huang, Kai
2022-10-13 22:28                   ` Dave Hansen
2022-10-13 23:40                     ` Huang, Kai
2022-10-13 23:57                       ` Dave Hansen
2022-10-14  0:19                         ` Huang, Kai
2022-10-19 10:59                           ` Huang, Kai
2022-10-23 20:39                             ` jarkko
2022-10-24  1:32                               ` Zhiquan Li
2022-11-01  0:46                                 ` jarkko
2022-11-02  1:38                                   ` Zhiquan Li
2022-11-07 11:36                                     ` jarkko
2022-11-07 12:19                                       ` Zhiquan Li
2022-11-04 10:17                                   ` Huang, Kai
2022-11-04 16:26                                     ` Sean Christopherson
2022-11-04 16:34                                       ` Dave Hansen
2022-11-07  8:55                                         ` Huang, Kai
2022-11-07  8:54                                       ` Huang, Kai
2022-10-24 22:23                               ` Huang, Kai
2022-11-01  0:53                                 ` jarkko
2022-09-29  8:05 ` [PATCH v9 0/3] x86/sgx: fine grained SGX MCA behavior Zhiquan Li
2022-10-08  2:29 ` Zhiquan Li

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=2dd703b6-66a9-0a35-b02e-6a66e356277f@intel.com \
    --to=zhiquan1.li@intel.com \
    --cc=bp@suse.de \
    --cc=cathy.zhang@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=fan.du@intel.com \
    --cc=jarkko@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=linux-sgx@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.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.