[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH] Avoid cpu_physical_memory_rw() with a constant is_write argument
- To: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx
- From: Stefan Weil <sw@xxxxxxxxxxx>
- Date: Tue, 18 Feb 2020 18:57:08 +0100
- Autocrypt: addr=sw@xxxxxxxxxxx; keydata= mQINBFXCNBcBEACUbHx9FWsS1ATrhLGAS+Nc6bFQHPR3CpUQ4v++RiMg25bF6Ov1RsYEcovI 0DXGh6Ma+l6dRlvUXV8tMvNwqghDUr5KY7LN6tgcFKjBbXdv9VlKiWiMLKBrARcFKxx1sfLp 1P8RiaUdKsgy2Hq4T1PPy9ENTL1/FBG6P/Rw0rO9zOB+yNHcRJ5diDnERbi3x7qoaPUra2Ig lmQk/uxXKC0aNIhpNLNiQ+YpwTUN9q3eG6B9/3CG8RGtFzH9vDPlLvtUX+01a2gCifTi3iH3 8EEK8ACXIRs2dszlxMneKTvflXfvyCM1O+59wGcICQxltxLLhHSCJjOQyWdR2JUtn//XjVWM mf6bBT7Imx3DhhfFRlA+/Lw9Zah66DJrZgiV0LqoN/2f031TzD3FCBiGQEMC072MvSQ1DdJN OiRE1iWO0teLOxaFSbvJS9ij8CFSQQTnSVZs0YXGBal+1kMeaKo9sO4tkaAR2190IlMNanig CTJfeFqxzZkoki378grSHdGUTGKfwNPflTOA6Pw6xuUcxW55LB3lBsPqb0289P8o9dTR7582 e6XTkpzqe/z/fYmfI9YXIjGY8WBMRbsuQA30JLq1/n/zwxAOr2P9y4nqTMMgFOtQS8w4G46K UMY/5IspZp2VnPwvazUo2zpYiUSLo1hFHx2jrePYNu2KLROXpwARAQABtBxTdGVmYW4gV2Vp bCA8c3dAd2VpbG5ldHouZGU+iQI6BBMBCAAkAhsDBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheA BQJV04LlAhkBAAoJEOCMIdVndFCtP5QP/1U8yWZzHeHufRFxtM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ano Stabellini <sstabellini@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxx>
- Delivery-date: Tue, 18 Feb 2020 17:57:30 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Am 18.02.20 um 14:20 schrieb Philippe Mathieu-Daudé:
> This commit was produced with the included Coccinelle script
> scripts/coccinelle/as-rw-const.patch.
>
> Inspired-by: Peter Maydell <peter.maydell@xxxxxxxxxx>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
> ---
> Based-on: <20200218112457.22712-1-peter.maydell@xxxxxxxxxx>
[...]
> diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c
> index a8b6e5aeb8..f5971ccc74 100644
> --- a/target/i386/hax-all.c
> +++ b/target/i386/hax-all.c
> @@ -376,8 +376,8 @@ static int hax_handle_fastmmio(CPUArchState *env, struct
> hax_fastmmio *hft)
> * hft->direction == 2: gpa ==> gpa2
> */
> uint64_t value;
> - cpu_physical_memory_rw(hft->gpa, (uint8_t *) &value, hft->size, 0);
> - cpu_physical_memory_rw(hft->gpa2, (uint8_t *) &value, hft->size, 1);
> + cpu_physical_memory_read(hft->gpa, (uint8_t *)&value, hft->size);
> + cpu_physical_memory_write(hft->gpa2, (uint8_t *)&value, hft->size);
Maybe those type casts could be removed, too. They are no longer needed
after your modification.
Stefan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|