From f8c7969d655c894800aaa2cf3520c398f34d4202 Mon Sep 17 00:00:00 2001 From: mio Date: Sat, 10 Jun 2023 23:29:56 +0200 Subject: [PATCH] Revert "Add uc_ctl_get/set_tcg_buffer_size" This reverts commit 3145e3c4267ef287a780643d3ca0de70a173aa8c because not properly co-authoer-ed. --- include/uc_priv.h | 1 - include/unicorn/unicorn.h | 13 ++----------- qemu/accel/tcg/translate-all.c | 1 - qemu/softmmu/vl.c | 2 +- uc.c | 14 -------------- 5 files changed, 3 insertions(+), 28 deletions(-) diff --git a/include/uc_priv.h b/include/uc_priv.h index 62115278..968ab22f 100644 --- a/include/uc_priv.h +++ b/include/uc_priv.h @@ -400,7 +400,6 @@ struct uc_struct { FlatView *empty_view; // Static function variable moved from flatviews_init - uint64_t tcg_buffer_size; // The buffer size we are going to use #ifdef WIN32 PVOID seh_handle; void* seh_closure; diff --git a/include/unicorn/unicorn.h b/include/unicorn/unicorn.h index 74193a6e..feae9eea 100644 --- a/include/unicorn/unicorn.h +++ b/include/unicorn/unicorn.h @@ -571,12 +571,8 @@ typedef enum uc_control_type { // Change the tlb implementation // see uc_tlb_type for current implemented types // Write: @args = (int) - UC_CTL_TLB_TYPE, - // Change the tcg translation buffer size, note that - // unicorn may adjust this value. - // Write: @args = (uint64_t) - // Read: @args = (uint64_t*) - UC_CTL_TCG_BUFFER_SIZE, + UC_CTL_TLB_TYPE + } uc_control_type; /* @@ -653,11 +649,6 @@ See sample_ctl.c for a detailed example. #define uc_ctl_flush_tb(uc) uc_ctl(uc, UC_CTL_WRITE(UC_CTL_TB_FLUSH, 0)) #define uc_ctl_flush_tlb(uc) uc_ctl(uc, UC_CTL_WRITE(UC_CTL_TLB_FLUSH, 0)) #define uc_ctl_tlb_mode(uc, mode) uc_ctl(uc, UC_CTL_WRITE(UC_CTL_TLB_TYPE, 1), (mode)) -#define uc_ctl_get_tcg_buffer_size(uc, size) \ - uc_ctl(uc, UC_CTL_READ(UC_CTL_TCG_BUFFER_SIZE, 1), (size)) -#define uc_ctl_set_tcg_buffer_size(uc, size) \ - uc_ctl(uc, UC_CTL_WRITE(UC_CTL_TCG_BUFFER_SIZE, 1), (size)) - // Opaque storage for CPU context, used with uc_context_*() struct uc_context; typedef struct uc_context uc_context; diff --git a/qemu/accel/tcg/translate-all.c b/qemu/accel/tcg/translate-all.c index 9d728523..835c054f 100644 --- a/qemu/accel/tcg/translate-all.c +++ b/qemu/accel/tcg/translate-all.c @@ -1085,7 +1085,6 @@ static inline void code_gen_alloc(struct uc_struct *uc, size_t tb_size) tcg_ctx->code_gen_buffer = alloc_code_gen_buffer(uc); tcg_ctx->initial_buffer = tcg_ctx->code_gen_buffer; tcg_ctx->initial_buffer_size = tcg_ctx->code_gen_buffer_size; - uc->tcg_buffer_size = tcg_ctx->initial_buffer_size; if (tcg_ctx->code_gen_buffer == NULL) { fprintf(stderr, "Could not allocate dynamic translator buffer\n"); exit(1); diff --git a/qemu/softmmu/vl.c b/qemu/softmmu/vl.c index 7802a2d5..6860afd9 100644 --- a/qemu/softmmu/vl.c +++ b/qemu/softmmu/vl.c @@ -50,7 +50,7 @@ int machine_initialize(struct uc_struct *uc) uc->target_page(uc); /* Init tcg. use DEFAULT_CODE_GEN_BUFFER_SIZE. */ - uc->tcg_exec_init(uc, uc->tcg_buffer_size); + uc->tcg_exec_init(uc, 0); /* Init cpu. use default cpu_model. */ return uc->cpus_init(uc, NULL); diff --git a/uc.c b/uc.c index 2c4cb8de..0b464a4d 100644 --- a/uc.c +++ b/uc.c @@ -2374,20 +2374,6 @@ uc_err uc_ctl(uc_engine *uc, uc_control_type control, ...) break; } - case UC_CTL_TCG_BUFFER_SIZE: { - if (rw == UC_CTL_IO_WRITE) { - uint64_t size = va_arg(args, uint64_t); - uc->tcg_buffer_size = size; - } else { - - UC_INIT(uc); - - uint64_t *size = va_arg(args, uint64_t *); - *size = uc->tcg_buffer_size; - } - break; - } - default: err = UC_ERR_ARG; break;