From: Yan-Jie Wang <ubzeme@gmail.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Roman Bolshakov <r.bolshakov@yadro.com>,
Alexander Graf <agraf@csgraf.de>,
Cameron Esfahani <dirty@apple.com>,
Yan-Jie Wang <ubzeme@gmail.com>
Subject: [PATCH v3 4/9] hvf: rename struct hvf_slot to HVFSlot
Date: Wed, 2 Mar 2022 21:04:12 +0800 [thread overview]
Message-ID: <20220302130417.18551-5-ubzeme@gmail.com> (raw)
In-Reply-To: <20220302130417.18551-1-ubzeme@gmail.com>
Follow the QEMU coding style. Structured type names are in CamelCase.
Signed-off-by: Yan-Jie Wang <ubzeme@gmail.com>
---
accel/hvf/hvf-mem.c | 14 +++++++-------
include/sysemu/hvf_int.h | 8 ++++----
target/i386/hvf/hvf.c | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/accel/hvf/hvf-mem.c b/accel/hvf/hvf-mem.c
index 6b82be3220..b8e9f30e4c 100644
--- a/accel/hvf/hvf-mem.c
+++ b/accel/hvf/hvf-mem.c
@@ -30,11 +30,11 @@
#define HVF_NUM_SLOTS 32
-static hvf_slot memslots[HVF_NUM_SLOTS];
+static HVFSlot memslots[HVF_NUM_SLOTS];
-hvf_slot *hvf_find_overlap_slot(hwaddr start, hwaddr size)
+HVFSlot *hvf_find_overlap_slot(hwaddr start, hwaddr size)
{
- hvf_slot *slot;
+ HVFSlot *slot;
int x;
for (x = 0; x < HVF_NUM_SLOTS; ++x) {
slot = &memslots[x];
@@ -46,9 +46,9 @@ hvf_slot *hvf_find_overlap_slot(hwaddr start, hwaddr size)
return NULL;
}
-static hvf_slot *hvf_find_free_slot(void)
+static HVFSlot *hvf_find_free_slot(void)
{
- hvf_slot *slot;
+ HVFSlot *slot;
int x;
for (x = 0; x < HVF_NUM_SLOTS; x++) {
slot = &memslots[x];
@@ -91,7 +91,7 @@ static hwaddr hvf_align_section(MemoryRegionSection *section,
static void hvf_set_phys_mem(MemoryRegionSection *section, bool add)
{
- hvf_slot *slot;
+ HVFSlot *slot;
hwaddr start, size, offset, delta;
uint8_t *host_addr;
MemoryRegion *area = section->mr;
@@ -172,7 +172,7 @@ static void hvf_set_phys_mem(MemoryRegionSection *section, bool add)
static void hvf_set_dirty_tracking(MemoryRegionSection *section, bool on)
{
- hvf_slot *slot;
+ HVFSlot *slot;
slot = hvf_find_overlap_slot(
section->offset_within_address_space,
diff --git a/include/sysemu/hvf_int.h b/include/sysemu/hvf_int.h
index 2c4a97debe..0aafbc9357 100644
--- a/include/sysemu/hvf_int.h
+++ b/include/sysemu/hvf_int.h
@@ -17,17 +17,17 @@
#include <Hypervisor/hv.h>
#endif
-/* hvf_slot flags */
+/* HVFSlot flags */
#define HVF_SLOT_LOG (1 << 0)
#define HVF_SLOT_READONLY (1 << 1)
-typedef struct hvf_slot {
+typedef struct HVFSlot {
hwaddr start;
hwaddr size; /* 0 if the slot is free */
hwaddr offset; /* offset within memory region */
uint32_t flags;
MemoryRegion *region;
-} hvf_slot;
+} HVFSlot;
typedef struct hvf_vcpu_caps {
uint64_t vmx_cap_pinbased;
@@ -58,7 +58,7 @@ int hvf_arch_init(void);
int hvf_arch_init_vcpu(CPUState *cpu);
void hvf_arch_vcpu_destroy(CPUState *cpu);
int hvf_vcpu_exec(CPUState *);
-hvf_slot *hvf_find_overlap_slot(hwaddr, hwaddr);
+HVFSlot *hvf_find_overlap_slot(hwaddr, hwaddr);
int hvf_put_registers(CPUState *);
int hvf_get_registers(CPUState *);
void hvf_kick_vcpu_thread(CPUState *cpu);
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 4ba6e82fab..2ddb4fc825 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -113,7 +113,7 @@ void hvf_handle_io(CPUArchState *env, uint16_t port, void *buffer,
}
}
-static bool ept_emulation_fault(hvf_slot *slot, uint64_t gpa, uint64_t ept_qual)
+static bool ept_emulation_fault(HVFSlot *slot, uint64_t gpa, uint64_t ept_qual)
{
int read, write;
@@ -469,7 +469,7 @@ int hvf_vcpu_exec(CPUState *cpu)
/* Need to check if MMIO or unmapped fault */
case EXIT_REASON_EPT_FAULT:
{
- hvf_slot *slot;
+ HVFSlot *slot;
uint64_t gpa = rvmcs(cpu->hvf->fd, VMCS_GUEST_PHYSICAL_ADDRESS);
if (((idtvec_info & VMCS_IDT_VEC_VALID) == 0) &&
--
2.32.0 (Apple Git-132)
next prev parent reply other threads:[~2022-03-02 13:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 13:04 [PATCH v3 0/9] Many improvements to HVF memory-related codes Yan-Jie Wang
2022-03-02 13:04 ` [PATCH v3 1/9] hvf: move memory related functions from hvf-accel-ops.c to hvf-mem.c Yan-Jie Wang
2022-03-18 11:46 ` Peter Maydell
2022-03-02 13:04 ` [PATCH v3 2/9] hvf: simplify data structures and codes of memory related functions Yan-Jie Wang
2022-03-18 12:09 ` Peter Maydell
2022-03-02 13:04 ` [PATCH v3 3/9] hvf: use correct data types for addresses in " Yan-Jie Wang
2022-03-18 12:10 ` Peter Maydell
2022-03-02 13:04 ` Yan-Jie Wang [this message]
2022-03-18 12:11 ` [PATCH v3 4/9] hvf: rename struct hvf_slot to HVFSlot Peter Maydell
2022-03-02 13:04 ` [PATCH v3 5/9] hvf: fix memory dirty-tracking Yan-Jie Wang
2022-03-18 13:09 ` Peter Maydell
2022-03-02 13:04 ` [PATCH v3 6/9] hvf: add a lock for memory related functions Yan-Jie Wang
2022-03-18 12:11 ` Peter Maydell
2022-03-02 13:04 ` [PATCH v3 7/9] hvf: use GTree to store memory slots instead of fixed-size array Yan-Jie Wang
2022-03-18 12:58 ` Peter Maydell
2022-03-02 13:04 ` [PATCH v3 8/9] hvf: only consider directly writeable memory regions for dirty-tracking Yan-Jie Wang
2022-03-02 13:04 ` [PATCH v3 9/9] hvf: remove the need to lookup memory slots when clearing dirty-bits Yan-Jie Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220302130417.18551-5-ubzeme@gmail.com \
--to=ubzeme@gmail.com \
--cc=agraf@csgraf.de \
--cc=dirty@apple.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=r.bolshakov@yadro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).