qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 2/3] arm/kvm: add support for MTE


From: Cornelia Huck
Subject: Re: [PATCH v5 2/3] arm/kvm: add support for MTE
Date: Mon, 27 Feb 2023 16:12:22 +0100
User-agent: Notmuch/0.37 (https://notmuchmail.org)

On Mon, Feb 06 2023, Cornelia Huck <cohuck@redhat.com> wrote:

> On Mon, Feb 06 2023, Eric Auger <eauger@redhat.com> wrote:
>
>> Hi,
>>
>> On 2/3/23 21:40, Richard Henderson wrote:
>>> On 2/3/23 03:44, Cornelia Huck wrote:
>>>> +static void aarch64_cpu_get_mte(Object *obj, Visitor *v, const char
>>>> *name,
>>>> +                                void *opaque, Error **errp)
>>>> +{
>>>> +    ARMCPU *cpu = ARM_CPU(obj);
>>>> +    OnOffAuto mte = cpu->prop_mte;
>>>> +
>>>> +    visit_type_OnOffAuto(v, name, &mte, errp);
>>>> +}
>>> 
>>> You don't need to copy to a local variable here.
>>> 
>>>> +
>>>> +static void aarch64_cpu_set_mte(Object *obj, Visitor *v, const char
>>>> *name,
>>>> +                                void *opaque, Error **errp)
>>>> +{
>>>> +    ARMCPU *cpu = ARM_CPU(obj);
>>>> +
>>>> +    visit_type_OnOffAuto(v, name, &cpu->prop_mte, errp);
>>>> +}
>>> 
>>> ... which makes get and set functions identical.
>>> No need for both.
>> This looks like a common pattern though. virt_get_acpi/set_acpi in
>> virt.c or pc_machine_get_vmport/set_vmport in i386/pc.c and many other
>> places (microvm ...). Do those other callers also need some simplifications?
>
> Indeed, I'm pretty sure that I copied + adapted it from somewhere :)
>
> Should we clean up all instances in one go instead? (Probably on top of
> this series, in order to minimize conflicts with other changes.)

Any objections to going with the code above and just doing a general
cleanup on top?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]