[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] x86/spec-ctrl: Drop SPEC_CTRL_{ENTRY_FROM,EXIT_TO}_HVM


  • To: Andrew Cooper <amc96@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Jan 2022 12:57:46 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AQ/zTNOMe0OArpgikcOSniJL63ljcgoh7uNa/JxE8R8=; b=kE+OBcm6GCIIsrBEYBo8VnNx9tvhBr7fkSUVPnTLg/L6l5pD7jEP+1rZBAVWIn09Y8IrowVmufzn7UhjJYz84M2MzIcgNDF7n1aGrjHsEXzUq2DCNy0TUOPFKjIGlouZO5URvoPjJRP1nIFlUez0LRy1k/II1tKmBjA4A02ajpJLV9ofs5orR/g3Li2TzC5hats++h/4K/FGl3dwz+kQHauavazx/l0EauEEI0PN31u2D4PWybRH9LPe0TQ367SAgJvTBsPdkUl2XWsSSRYG7yn+Wk7TewJYg1kxnM+biIL6HgQYPgABsr4pN5tF9UIHYItuBbUtvdq+EzNwgyQ1uw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HmSOE+NMaJzofeOn+KNVmGE8N5V14LcdJAaZvw+FEU8n3Z+WO7l65ObDcUUXXE/EnCVT96z8NgqmHIptVvqiWLPchqJrfS7+2gcH01IcBxq5QLLPMkTW48Ho94sMUneFUcuax1Us5PW5YGAy7oHsl16TIX1KHeSoXi5M3Y9sj4tFA88b5aC6bJYWYiD+d4ITwsZ/3a1nxnHaSNPkOwK4OlzneLoeJQrQmViqzxd1ffqoolG5CBqlSpeCvw/4YNrMNelwTmBUL3+YK1NnnbIVwxIDDpDVlCDeisRWYI4Cefohwkb7Egt1ncOquJYe6i7NboJyVAPcPSBPwWYErbe8/A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 17 Jan 2022 11:57:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.01.2022 12:41, Andrew Cooper wrote:
> On 17/01/2022 11:22, Jan Beulich wrote:
>> On 13.01.2022 17:38, Andrew Cooper wrote:
>>> --- a/xen/arch/x86/hvm/svm/entry.S
>>> +++ b/xen/arch/x86/hvm/svm/entry.S
>>> @@ -59,7 +59,7 @@ __UNLIKELY_END(nsvm_hap)
>>>          mov VCPUMSR_spec_ctrl_raw(%rax), %eax
>>>  
>>>          /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
>>> -        SPEC_CTRL_EXIT_TO_HVM   /* Req: a=spec_ctrl %rsp=regs/cpuinfo, 
>>> Clob: cd */
>>> +        /* SPEC_CTRL_EXIT_TO_SVM   (nothing currently) */
>>>  
>>>          pop  %r15
>>>          pop  %r14
>>> @@ -86,7 +86,8 @@ __UNLIKELY_END(nsvm_hap)
>>>  
>>>          GET_CURRENT(bx)
>>>  
>>> -        SPEC_CTRL_ENTRY_FROM_HVM    /* Req: b=curr %rsp=regs/cpuinfo, 
>>> Clob: acd */
>>> +        /* SPEC_CTRL_ENTRY_FROM_SVM    Req: b=curr %rsp=regs/cpuinfo, 
>>> Clob: ac  */
>>> +        ALTERNATIVE "", DO_OVERWRITE_RSB, X86_FEATURE_SC_RSB_HVM
>> Just for my own understanding: The comments you add aren't commented
>> out macro invocations (as I did read it first), but comments naming
>> would-be-macros which are then expanded "manually"? That is partly
>> because initially I read the description saying "Expand and drop the
>> macros" as meaning that the macros grow in what they contain, which
>> looked contradictory to them getting dropped at the same time.
>> Perhaps me not sufficiently understanding the difference between all
>> possible meanings of "expand" vs "extend" ...
> 
> They're grep fodder to be able to easily locate where we're doing
> entry/exit speculation logic.

And I don't suppose I could talk you into replacing the use of "expand"
in the description, even if it was just me who was mislead? Perhaps by
"Open-code and drop the macros"?

>  These paths will continue to diverge over
> time, and cannot have a common implementation.

That's understood.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.