|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH V1 02/16] xen/ioreq: Make x86's IOREQ feature common
On 22.09.20 18:52, Jan Beulich wrote: Hi Jan I think it has in some degree, there is a handling of HVMOP_set_param/HVMOP_get_param andOn 22.09.2020 17:05, Oleksandr wrote:2. *arch.hvm.params*: Two functions that use it (hvm_alloc_legacy_ioreq_gfn/hvm_free_legacy_ioreq_gfn) either go into arch code completely or specific macro is used in common code: #define ioreq_get_params(d, i) ((d)->arch.hvm.params[i])If Arm has the concept of params, then perhaps. But I didn't think Arm does ... also there is a code to setup HVM_PARAM_CALLBACK_IRQ. I would prefer macro than moving functions to arch code (which are equal and should remain in sync).Yes, if the rest of the code is identical, I agree it's better to merely abstract away small pieces like this one. ok 3. *arch.hvm.hvm_io*: We could also use the following: #define ioreq_get_io_completion(v) ((v)->arch.hvm.hvm_io.io_completion) #define ioreq_get_io_req(v) ((v)->arch.hvm.hvm_io.io_req) This way struct hvm_vcpu_io won't be used in common code as well.But if Arm needs similar field, why keep them in arch.hvm.hvm_io? Yes, Arm needs the "some" fields, but not "all of them" as x86 has.For example Arm needs only the following (at least in the context of this series):
+struct hvm_vcpu_io {
+ /* I/O request in flight to device model. */
+ enum hvm_io_completion io_completion;
+ ioreq_t io_req;
+
+ /*
+ * HVM emulation:
+ * Linear address @mmio_gla maps to MMIO physical frame @mmio_gpfn.
+ * The latter is known to be an MMIO frame (not RAM).
+ * This translation is only valid for accesses as per @mmio_access.
+ */
+ struct npfec mmio_access;
+ unsigned long mmio_gla;
+ unsigned long mmio_gpfn;
+};
But for x86 the number of fields is quite bigger. If they were in same
way applicable for both archs (as what we have with ioreq_server struct)
I would move it to the common domain. I didn't think of a better idea
than just abstracting accesses to these (used in common ioreq.c) two
fields by macro.
Oh, thank you for pointing this, I should have used ioreq_t *io_req = &ioreq_get_io_req(v); I don't like ioreq_get_io_req much), probably ioreq_req would sound a little bit better? msix_write_completion(v); vcpu_end_shutdown_deferral(v); - io_completion = vio->io_completion; - vio->io_completion = HVMIO_no_completion; + io_completion = ioreq_get_io_completion(v); + ioreq_get_io_completion(v) = HVMIO_no_completion;I think it's at least odd to have an lvalue with this kind of a name. Perhaps want to drop "get" if it's really meant to be used like this. ok I dropped HVMOP plumbing on Arm as it was requested. Only acquire interface should be used. This code is not supposed to be called on Arm, but it is a part of common code and we need to find a way how to abstract away *arch.hvm.params* Am I correct? -- Regards, Oleksandr Tyshchenko
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |