Skip to content

Commit cef71bb

Browse files
committed
renaming and cleanup
1 parent 8152eb7 commit cef71bb

9 files changed

Lines changed: 73 additions & 31 deletions

File tree

so3/arch/arm64/domain.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ void __setup_dom_pgtable(struct domain *d, addr_t paddr_start, unsigned long map
136136
d->grant_pfn[i].free = true;
137137
}
138138

139+
/* Set IPA framebuffer starting address after the grant pfn area */
139140
d->fbdev_start_pfn = phys_to_pfn(memslot[slotID].ipa_addr + map_size + 2 * PAGE_SIZE) + NR_GRANT_PFN;
140-
fbdev_set_pgtable(d, slotID);
141+
fbdev_ipamap_domain(d, slotID);
141142
#endif /* CONFIG_SOO */
142143
}
143144

so3/arch/arm64/include/asm/processor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ typedef struct __attribute__((packed, aligned(8))) cpu_regs {
11291129
u64 tls_usr;
11301130

11311131
#ifdef CONFIG_AVZ
1132+
/* Used to keep track of EL1 exception registers in case they haven't been saved by the domain yet */
11321133
u64 elr_el1;
11331134
u64 spsr_el1;
11341135
#endif

so3/avz/include/avz/domain.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#ifndef DOMAIN_H
2020
#define DOMAIN_H
2121

22-
#include <generated/autoconf.h>
23-
2422
#ifndef __ASSEMBLY__
2523
#ifdef CONFIG_SOO
2624
#include <soo/uapi/soo.h>
@@ -120,7 +118,7 @@ struct domain {
120118
/* IPA reserved page frame numbers for mapping granted pages belonging to other domains */
121119
grant_pfn_t grant_pfn[NR_GRANT_PFN];
122120

123-
/* IPA reserved information for long mapping granted pages belonging to other domains */
121+
/* IPA reserved starting address for framebuffer mapping */
124122
addr_t fbdev_start_pfn;
125123
#endif /* CONFIG_SOO */
126124

so3/avz/include/avz/fbdev_gnt.h

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,53 @@
1+
/*
2+
* Copyright (C) 2026 Clément Dieperink <clement.dieperink@heig-vd.ch>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License version 2 as
6+
* published by the Free Software Foundation.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program; if not, write to the Free Software
15+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16+
*
17+
*/
18+
119
#ifndef FBDEV_GNT_H
220
#define FBDEV_GNT_H
321

422
#include <soo/uapi/soo.h>
523

6-
void fbdev_set_pgtable(struct domain *d, int slotID);
7-
void fbdev_set_info(fbdev_info_t *fbdev);
24+
/**
25+
* IPA map for the framebuffer for the given domain, either on actual buffer
26+
* or the fake one depending on currently shown slot.
27+
*
28+
* @param d pointer to the domain to map
29+
* @param slotID Slot ID of the domain
30+
*/
31+
void fbdev_ipamap_domain(struct domain *d, int slotID);
32+
33+
/**
34+
* Set the actual framebuffer physical pages ranges for
35+
* futur mapping.
36+
*
37+
* @param fbdev Framebuffer pfns informations.
38+
*/
39+
void fbdev_set_pfns(fbdev_pfns_t *fbdev);
40+
41+
/**
42+
* Change the currently shown slot ID by remapping corresponding ipa.
43+
*
44+
* @param new_slotID to be shown.
45+
*/
846
void fbdev_change_focus(int new_slotID);
9-
addr_t fbdev_get_addr(void);
47+
48+
/**
49+
* Get the frambuffer starting ipa for the current domain.
50+
*/
51+
addr_t fbdev_get_domain_ipa(void);
1052

1153
#endif /* FBDEV_GNT_H */

so3/avz/kernel/fbdev_gnt.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
#include <avz/sched.h>
66

77
typedef struct {
8-
fbdev_info_t fbdev;
8+
fbdev_pfns_t fbdev;
99
void *fake_fbdev;
1010
int current_slotID;
1111
} fbdev_priv_t;
1212

1313
static fbdev_priv_t priv = {};
1414

15-
static void __map_fbdev(struct domain *d, const fbdev_info_t *pfn_info)
15+
static void __map_fbdev(struct domain *d, const fbdev_pfns_t *pfn_info)
1616
{
1717
size_t i;
1818
addr_t phys_addr;
@@ -21,7 +21,7 @@ static void __map_fbdev(struct domain *d, const fbdev_info_t *pfn_info)
2121
void *pgtable;
2222

2323
pgtable = (void *)d->pagetable_vaddr;
24-
ipa_addr = d->fbdev_start_pfn << PAGE_SHIFT;
24+
ipa_addr = pfn_to_phys(d->fbdev_start_pfn);
2525

2626
/* Map all distincts ranges of the framebuffer to the capsule */
2727
for (i = 0; i < pfn_info->pfn_count; i++) {
@@ -34,7 +34,7 @@ static void __map_fbdev(struct domain *d, const fbdev_info_t *pfn_info)
3434
}
3535
}
3636

37-
static void __map_fake_fbdev(struct domain *d, const fbdev_info_t *real_fb)
37+
static void __map_fake_fbdev(struct domain *d, const fbdev_pfns_t *real_fb)
3838
{
3939
size_t i, j;
4040
addr_t phys_addr;
@@ -62,7 +62,7 @@ static void __map_fake_fbdev(struct domain *d, const fbdev_info_t *real_fb)
6262
}
6363
}
6464

65-
void fbdev_set_pgtable(struct domain *d, int slotID)
65+
void fbdev_ipamap_domain(struct domain *d, int slotID)
6666
{
6767
/* Only capsules have virtual framebuffer */
6868
if ((slotID < MEMSLOT_BASE) && !memslot[slotID].busy)
@@ -74,7 +74,7 @@ void fbdev_set_pgtable(struct domain *d, int slotID)
7474
__map_fake_fbdev(d, &priv.fbdev);
7575
}
7676

77-
void fbdev_set_info(fbdev_info_t *fbdev)
77+
void fbdev_set_pfns(fbdev_pfns_t *fbdev)
7878
{
7979
int slotID;
8080

@@ -83,7 +83,7 @@ void fbdev_set_info(fbdev_info_t *fbdev)
8383
/* Map framebuffer to all capsules. */
8484
for (slotID = MEMSLOT_BASE; slotID < MEMSLOT_NR; slotID++)
8585
if (memslot[slotID].busy)
86-
fbdev_set_pgtable(domains[slotID], slotID);
86+
fbdev_ipamap_domain(domains[slotID], slotID);
8787
}
8888

8989
void fbdev_change_focus(int new_slotID)
@@ -99,7 +99,7 @@ void fbdev_change_focus(int new_slotID)
9999
priv.current_slotID = new_slotID;
100100
}
101101

102-
addr_t fbdev_get_addr(void)
102+
addr_t fbdev_get_domain_ipa(void)
103103
{
104104
return pfn_to_phys(current_domain->fbdev_start_pfn);
105105
}

so3/avz/kernel/gnttab.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ gnttab_t *pick_granted_entry(grant_ref_t ref, domid_t origin_domid)
8181

8282
/**
8383
* @brief Create a new grant table entry in the gnttab of a domain
84-
*
84+
*
8585
* @param d The domain containing the grant table
8686
* @param target_domid The domain concerned by this grant
8787
* @param pfn The real frame number of the page to be granted
@@ -186,7 +186,7 @@ addr_t map_vbstore_pfn(int target_domid, int pfn)
186186

187187
/**
188188
* @brief Hypercall entry for grant table related operations.
189-
*
189+
*
190190
* @param args gnttab detail structure
191191
*/
192192
void do_gnttab(gnttab_op_t *args)

so3/avz/kernel/hypercalls.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,16 @@ void do_avz_hypercall(void *__args)
202202
break;
203203
}
204204

205-
case AVZ_FBDEV_SET_INFO:
206-
fbdev_set_info(&args->u.avz_fbdev_info_args.fbdev);
205+
case AVZ_FBDEV_SET_PFNS:
206+
fbdev_set_pfns(&args->u.avz_fbdev_pfns_args.fbdev);
207207
break;
208208

209209
case AVZ_FBDEV_CHANGE_FOCUS:
210210
fbdev_change_focus(args->u.avz_fbdev_focus_args.new_slotID);
211211
break;
212212

213-
case AVZ_FBDEV_GET_ADDR:
214-
args->u.avz_fbdev_addr_args.paddr = fbdev_get_addr();
213+
case AVZ_FBDEV_GET_ME_ADDR:
214+
args->u.avz_fbdev_addr_args.paddr = fbdev_get_domain_ipa();
215215
break;
216216

217217
#endif /* CONFIG_SOO */

so3/soo/drivers/vfbdevfront/vfbdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static void retrieve_data(vfbdev_priv_t *priv)
243243

244244
vdevfront_processing_end(vfbdev_dev);
245245

246-
hyp_args.cmd = AVZ_FBDEV_GET_ADDR;
246+
hyp_args.cmd = AVZ_FBDEV_GET_ME_ADDR;
247247
avz_hypercall(&hyp_args);
248248
priv->fb_paddr = hyp_args.u.avz_fbdev_addr_args.paddr;
249249
}

so3/soo/include/soo/uapi/soo.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ void do_gnttab(gnttab_op_t *args);
7979
*/
8080

8181
#define MAX_FBDEV_PFN 8
82-
typedef struct fbdev_info {
82+
typedef struct fbdev_pfns {
8383
size_t pfn_count;
8484
addr_t pfn[MAX_FBDEV_PFN];
8585
size_t page_count[MAX_FBDEV_PFN];
86-
} fbdev_info_t;
86+
} fbdev_pfns_t;
8787

8888
#define AVZ_SCHEDULER_FLIP 0
8989

@@ -314,9 +314,9 @@ typedef struct agency_ioctl_args {
314314
#define AVZ_SET_ME_STATE 11
315315
#define AVZ_GET_DOM_DESC 12
316316
#define AVZ_GRANT_TABLE_OP 13
317-
#define AVZ_FBDEV_SET_INFO 14
317+
#define AVZ_FBDEV_SET_PFNS 14
318318
#define AVZ_FBDEV_CHANGE_FOCUS 15
319-
#define AVZ_FBDEV_GET_ADDR 16
319+
#define AVZ_FBDEV_GET_ME_ADDR 16
320320

321321
/* AVZ_INJECT_CAPSULE */
322322
typedef struct {
@@ -379,17 +379,17 @@ typedef struct {
379379
gnttab_op_t gnttab_op;
380380
} avz_gnttab_t;
381381

382-
/* AVZ_FBDEV_SET_INFO */
382+
/* AVZ_FBDEV_SET_PFNS */
383383
typedef struct {
384-
fbdev_info_t fbdev;
385-
} avz_fbdev_info_t;
384+
fbdev_pfns_t fbdev;
385+
} avz_fbdev_pfns_t;
386386

387387
/* AVZ_FBDEV_CHANGE_FOCUS */
388388
typedef struct {
389389
int new_slotID;
390390
} avz_fbdev_focus_t;
391391

392-
/* AVZ_FBDEV_GET_ADDR */
392+
/* AVZ_FBDEV_GET_ME_ADDR */
393393
typedef struct {
394394
addr_t paddr;
395395
} avz_fbdev_addr_t;
@@ -413,7 +413,7 @@ typedef struct {
413413
avz_console_io_t avz_console_io_args;
414414
avz_domctl_t avz_domctl_args;
415415
avz_gnttab_t avz_gnttab_args;
416-
avz_fbdev_info_t avz_fbdev_info_args;
416+
avz_fbdev_pfns_t avz_fbdev_pfns_args;
417417
avz_fbdev_focus_t avz_fbdev_focus_args;
418418
avz_fbdev_addr_t avz_fbdev_addr_args;
419419
} u;

0 commit comments

Comments
 (0)