diff mbox series

[V1,04/16] xen/ioreq: Provide alias for the handle_mmio()

Message ID 1599769330-17656-5-git-send-email-olekstysh@gmail.com (mailing list archive)
State Superseded
Headers show
Series IOREQ feature (+ virtio-mmio) on Arm | expand

Commit Message

Oleksandr Tyshchenko Sept. 10, 2020, 8:21 p.m. UTC
From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

The IOREQ is a common feature now and Arm will have its own
implementation.

But the name of the function is pretty generic and can be confusing
on Arm (we already have a try_handle_mmio()).

In order not to rename the function (which is used for a varying
set of purposes on x86) globally and get non-confusing variant on Arm
provide an alias ioreq_handle_complete_mmio() to be used on common and
Arm code.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

---
Please note, this is a split/cleanup/hardening of Julien's PoC:
"Add support for Guest IO forwarding to a device emulator"

Changes RFC -> V1:
   - new patch
---
---
 xen/common/ioreq.c              | 2 +-
 xen/include/asm-x86/hvm/ioreq.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Jan Beulich Sept. 14, 2020, 3:10 p.m. UTC | #1
On 10.09.2020 22:21, Oleksandr Tyshchenko wrote:
> --- a/xen/common/ioreq.c
> +++ b/xen/common/ioreq.c
> @@ -189,7 +189,7 @@ bool handle_hvm_io_completion(struct vcpu *v)
>          break;
>  
>      case HVMIO_mmio_completion:
> -        return handle_mmio();
> +        return ioreq_handle_complete_mmio();

Again the question: Any particular reason to have "handle" in here?
With the abstraction simply named ioreq_complete_mmio() feel free
to add
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
Oleksandr Tyshchenko Sept. 22, 2020, 4:20 p.m. UTC | #2
On 14.09.20 18:10, Jan Beulich wrote:

Hi Jan

> On 10.09.2020 22:21, Oleksandr Tyshchenko wrote:
>> --- a/xen/common/ioreq.c
>> +++ b/xen/common/ioreq.c
>> @@ -189,7 +189,7 @@ bool handle_hvm_io_completion(struct vcpu *v)
>>           break;
>>   
>>       case HVMIO_mmio_completion:
>> -        return handle_mmio();
>> +        return ioreq_handle_complete_mmio();
> Again the question: Any particular reason to have "handle" in here?

"Handle" has been already discussed in previous patches). Will remove.


> With the abstraction simply named ioreq_complete_mmio() feel free
> to add
> Acked-by: Jan Beulich <jbeulich@suse.com>


Thank you.
Julien Grall Sept. 23, 2020, 5:28 p.m. UTC | #3
Hi Oleksandr,

On 10/09/2020 21:21, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> The IOREQ is a common feature now and Arm will have its own
> implementation.
> 
> But the name of the function is pretty generic and can be confusing
> on Arm (we already have a try_handle_mmio()).
> 
> In order not to rename the function (which is used for a varying
> set of purposes on x86) globally and get non-confusing variant on Arm
> provide an alias ioreq_handle_complete_mmio() to be used on common and
> Arm code.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

This doesn't  look like a code I wrote... Can you make sure I am only 
credited on what I wrote?

> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Cheers,
Oleksandr Tyshchenko Sept. 23, 2020, 6:17 p.m. UTC | #4
On 23.09.20 20:28, Julien Grall wrote:
> Hi Oleksandr,

Hi Julien


>
> On 10/09/2020 21:21, Oleksandr Tyshchenko wrote:
>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>
>> The IOREQ is a common feature now and Arm will have its own
>> implementation.
>>
>> But the name of the function is pretty generic and can be confusing
>> on Arm (we already have a try_handle_mmio()).
>>
>> In order not to rename the function (which is used for a varying
>> set of purposes on x86) globally and get non-confusing variant on Arm
>> provide an alias ioreq_handle_complete_mmio() to be used on common and
>> Arm code.
>>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>
> This doesn't  look like a code I wrote... Can you make sure I am only 
> credited on what I wrote?

I am sorry, for the next series I will re-check all patches.
diff mbox series

Patch

diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
index 5017617..ce12751 100644
--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -189,7 +189,7 @@  bool handle_hvm_io_completion(struct vcpu *v)
         break;
 
     case HVMIO_mmio_completion:
-        return handle_mmio();
+        return ioreq_handle_complete_mmio();
 
     case HVMIO_pio_completion:
         return handle_pio(vio->io_req.addr, vio->io_req.size,
diff --git a/xen/include/asm-x86/hvm/ioreq.h b/xen/include/asm-x86/hvm/ioreq.h
index dec1e71..43afdee 100644
--- a/xen/include/asm-x86/hvm/ioreq.h
+++ b/xen/include/asm-x86/hvm/ioreq.h
@@ -42,6 +42,8 @@  void arch_hvm_ioreq_destroy(struct domain *d);
 #define IOREQ_IO_UNHANDLED   X86EMUL_UNHANDLEABLE
 #define IOREQ_IO_RETRY       X86EMUL_RETRY
 
+#define ioreq_handle_complete_mmio   handle_mmio
+
 #endif /* __ASM_X86_HVM_IOREQ_H__ */
 
 /*