[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v7] x86/emulate: Send vm_event from emulate
- To: Jan Beulich <JBeulich@xxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
- From: Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>
- Date: Mon, 15 Jul 2019 08:52:31 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=bitdefender.com;dmarc=pass action=none header.from=bitdefender.com;dkim=pass header.d=bitdefender.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-SenderADCheck; bh=aUOfx48OOW+cJQkhRTSCk8RvylAvCFOTuZKA+tDh/fg=; b=O2HQ3nL7kxZpAJ05b0YHGb+612PBDQmZZ8U4HgaMSx3eIKlXcw8+FLScByWurMkgf7TCMBfeFf4EuGO8ZTNzGReWnBPfRz+e5smokfAcg+dZPeLh8mfy2s1qZ8Z1DuwafZ1lRowx/OOa6u5roamQi/5gOIxx8FMGE+WgjxnqIfwtfJ+znLxMRQjgxVC+T+I5MqOjZFYLVoj1W5Be7MB3sB5UJAftFaJFRtQe99GYyN3WqDRgka/oPQozAwYWQGlTBDXDoiPekKmPbsN5LXwvKQCNVkQy5x1sWxleMml+/dB/hL/d9IXqUz1EL0AfdZ0RgbzZ8lq7e1WePfj0A0Wamg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hXJkduPzaF+qTSIhfL9V2vsiEOB6N3RDn94K7wd3YiVyx3URtueq+pdkXa//ILNFxePjC3JUUy0WqHB9BnmGbWPhrDnmnrD/QD7JItFJHLxtQSsc8qwXwSsKahMQkxgpidR9tU3n+fN47V/Psy0bg6M0rdUYmVfdSy4dQ4yewk30y9CaK0sVM1WmeoLOcEQnTE/S0o4ETL6ojJ1aN7E6shIAG6NS2pxyZ1KweL/DaDnG/ANQ4GRDnWlAkeet3x8s9DZUAZM0TIL8t9pFRSoE8AJ73E4/DWRqcEGzvtzzztZweWrl0SX4DV+j6APfEyCkzGi7/R07SZjF8DbyKra6IQ==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@xxxxxxxxxxxxxxx;
- Cc: Petre Ovidiu PIRCALABU <ppircalabu@xxxxxxxxxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>, "rcojocaru@xxxxxxxxxxxxxxx" <rcojocaru@xxxxxxxxxxxxxxx>, "george.dunlap@xxxxxxxxxxxxx" <george.dunlap@xxxxxxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "paul.durrant@xxxxxxxxxx" <paul.durrant@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>
- Delivery-date: Mon, 15 Jul 2019 08:52:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVMY4Gmux1Y/IiSU2ZKtKyOfOCuKbFtNiAgACKMgCABTMcAA==
- Thread-topic: [PATCH v7] x86/emulate: Send vm_event from emulate
On 12.07.2019 04:28, Jan Beulich wrote:
> On 11.07.2019 19:13, Tamas K Lengyel wrote:
>>> @@ -629,6 +697,14 @@ static void *hvmemul_map_linear_addr(
>>>
>>> ASSERT(p2mt == p2m_ram_logdirty || !p2m_is_readonly(p2mt));
>>> }
>>> +
>>> + if ( curr->arch.vm_event &&
>>> + curr->arch.vm_event->send_event &&
>>
>> Why not fold these checks into hvm_emulate_send_vm_event since..
>
> I had asked for at least the first of the checks to be pulled
> out of the function, for the common case to be affected as
> little as possible.
>
>>> --- a/xen/arch/x86/hvm/hvm.c
>>> +++ b/xen/arch/x86/hvm/hvm.c
>>> @@ -3224,6 +3224,14 @@ static enum hvm_translation_result __hvm_copy(
>>> return HVMTRANS_bad_gfn_to_mfn;
>>> }
>>>
>>> + if ( unlikely(v->arch.vm_event) &&
>>> + v->arch.vm_event->send_event &&
>>
>> .. you seem to just repeat them here again?
>
> I agree that the duplication makes no sense.
>
The first check is on the hvmemul_map_linear_addr() path and the second
is on hvmemul_insn_fetch() path. There are 2 distinct ways to reach that
if and therefore the check is not duplicated.
Thanks,
Alex
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|