|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 5/7] xen/riscv: implement data and instruction cache operations
On 17.12.2024 11:37, Oleksii Kurochko wrote:
>
> On 12/17/24 9:32 AM, Jan Beulich wrote:
>> On 16.12.2024 18:40, Oleksii Kurochko wrote:
>>> On 12/16/24 3:23 PM, Jan Beulich wrote:
>>>> On 11.12.2024 18:27, Oleksii Kurochko wrote:
>>>>> --- a/xen/arch/riscv/include/asm/page.h
>>>>> +++ b/xen/arch/riscv/include/asm/page.h
>>>>> @@ -7,6 +7,7 @@
>>>>>
>>>>> #include <xen/bug.h>
>>>>> #include <xen/const.h>
>>>>> +#include <xen/errno.h>
>>>>> #include <xen/types.h>
>>>>>
>>>>> #include <asm/atomic.h>
>>>>> @@ -148,9 +149,27 @@ static inline bool pte_is_mapping(pte_t p)
>>>>> return (p.pte & PTE_VALID) && (p.pte & PTE_ACCESS_MASK);
>>>>> }
>>>>>
>>>>> +static inline int clean_and_invalidate_dcache_va_range(const void *p,
>>>>> unsigned long size)
>>>>> +{
>>>>> +#ifdef CONFIG_QEMU
>>>>> + return 0;
>>>>> +#else
>>>>> + return -EOPNOTSUPP;
>>>>> +#endif
>>>>> +}
>>>>> +
>>>>> +static inline int clean_dcache_va_range(const void *p, unsigned long
>>>>> size)
>>>>> +{
>>>>> +#ifdef CONFIG_QEMU
>>>>> + return 0;
>>>>> +#else
>>>>> + return -EOPNOTSUPP;
>>>>> +#endif
>>>>> +}
>>>> So testing on real hardware will then effectively become impossible, until
>>>> someone goes and implements these?
>>> Yes...
>>>
>>> I am not sure what better we can do. It seems like it will be the best one
>>> to check if CMO
>>> extensions is supported and use instructions for this extensions to
>>> implement these functions as they
>>> are in the specification and not expected to be changed.
>> Yes, using CMO when available is certainly the route to go. The main
>> question there is what the behavior ought to be when CMO is unavailable.
>
> If CMO ( or SoC specific extension for cache operation ) isn't available then
> IMO it means that memory is
> coherent and nothing specific should be done in the mentioned above functions
> what means returning 0 should
> be fine.
Hmm, imo that would be a pretty bold assumption.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |