Mailing List Archive

[PATCH V1 04/16] xen/ioreq: Provide alias for the handle_mmio()
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(-)

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__ */

/*
--
2.7.4
Re: [PATCH V1 04/16] xen/ioreq: Provide alias for the handle_mmio() [ In reply to ]
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
Re: [PATCH V1 04/16] xen/ioreq: Provide alias for the handle_mmio() [ In reply to ]
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.

--
Regards,

Oleksandr Tyshchenko
Re: [PATCH V1 04/16] xen/ioreq: Provide alias for the handle_mmio() [ In reply to ]
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,

--
Julien Grall
Re: [PATCH V1 04/16] xen/ioreq: Provide alias for the handle_mmio() [ In reply to ]
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.


--
Regards,

Oleksandr Tyshchenko