[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d2cccad-16ee-abcf-5a34-7e513a050229@redhat.com>
Date: Thu, 21 Sep 2023 14:38:48 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Nikolay Borisov <nik.borisov@...e.com>, Xin Li <xin3.li@...el.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-edac@...r.kernel.org, linux-hyperv@...r.kernel.org,
kvm@...r.kernel.org, xen-devel@...ts.xenproject.org
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
luto@...nel.org, seanjc@...gle.com, peterz@...radead.org,
jgross@...e.com, ravi.v.shankar@...el.com, mhiramat@...nel.org,
andrew.cooper3@...rix.com, jiangshanlai@...il.com
Subject: Re: [PATCH v10 33/38] x86/entry: Add fred_entry_from_kvm() for VMX to
handle IRQ/NMI
On 9/21/23 14:11, Nikolay Borisov wrote:
>>
>> +SYM_FUNC_START(asm_fred_entry_from_kvm)
>> + push %rbp
>> + mov %rsp, %rbp
>
> use FRAME_BEGIN/FRAME_END macros to ommit this code if
> CONFIG_FRAME_POINTER is disabled.
No, the previous stack pointer is used below, so the code might as well
use %rbp for that; but it must do so unconditionally.
Paolo
>> +
>> + UNWIND_HINT_SAVE
>> +
>> + /*
>> + * Don't check the FRED stack level, the call stack leading to this
>> + * helper is effectively constant and shallow (relatively speaking).
>> + *
>> + * Emulate the FRED-defined redzone and stack alignment.
>> + */
>> + sub $(FRED_CONFIG_REDZONE_AMOUNT << 6), %rsp
>> + and $FRED_STACK_FRAME_RSP_MASK, %rsp
>> +
>> + /*
>> + * Start to push a FRED stack frame, which is always 64 bytes:
>> + *
>> + * +--------+-----------------+
>> + * | Bytes | Usage |
>> + * +--------+-----------------+
>> + * | 63:56 | Reserved |
>> + * | 55:48 | Event Data |
>> + * | 47:40 | SS + Event Info |
>> + * | 39:32 | RSP |
>> + * | 31:24 | RFLAGS |
>> + * | 23:16 | CS + Aux Info |
>> + * | 15:8 | RIP |
>> + * | 7:0 | Error Code |
>> + * +--------+-----------------+
>> + */
>> + push $0 /* Reserved, must be 0 */
>> + push $0 /* Event data, 0 for IRQ/NMI */
>> + push %rdi /* fred_ss handed in by the caller */
>> + push %rbp
^^ here
Paolo
>> + pushf
>> + mov $__KERNEL_CS, %rax
>> + push %rax
Powered by blists - more mailing lists